org.eclipse.xtext.generator.trace.ITraceURIConverter Java Examples

The following examples show how to use org.eclipse.xtext.generator.trace.ITraceURIConverter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TreeAppendable.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
public TreeAppendable(ImportManager importManager, ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, EObject source,
		String indentation, String lineSeparator) {
	this(
			new SharedAppendableState(indentation, lineSeparator, importManager, source.eResource()),
			converter,
			locationProvider,
			jvmModelAssociations,
			source);
}
 
Example #2
Source File: TreeAppendable.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
protected TreeAppendable(SharedAppendableState state, ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, EObject source) {
	this(
			state,
			converter,
			locationProvider,
			jvmModelAssociations,
			createAllLocationData(
					converter,
					locationProvider,
					jvmModelAssociations,
					source,
					ILocationInFileProviderExtension.RegionDescription.INCLUDING_COMMENTS,
					false), // don't skip empty root regions
			false);
}
 
Example #3
Source File: TreeAppendable.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
protected TreeAppendable(SharedAppendableState state,
		final ITraceURIConverter converter,
		ILocationInFileProvider locationProvider,
		IJvmModelAssociations jvmModelAssociations,
		Set<ILocationData> sourceLocations, 
		boolean useForDebugging) {
	this.state = state;
	this.traceURIConverter = converter;
	this.locationProvider = locationProvider;
	this.jvmModelAssociations = jvmModelAssociations;
	this.children = Lists.newArrayList();
	this.locationData = sourceLocations;
	this.useForDebugging = useForDebugging;
	this.lightweightTypeReferenceSerializer = createLightweightTypeReferenceSerializer();
}
 
Example #4
Source File: TreeAppendable.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
protected static ILocationData createLocationData(ITraceURIConverter converter, EObject object, ITextRegionWithLineInformation textRegion) {
	Resource resource = object.eResource();
	SourceRelativeURI uriForTrace = null;
	if (converter != null) {
		uriForTrace = converter.getURIForTrace(resource);
	}
	ILocationData newData = new LocationData(textRegion, uriForTrace);
	return newData;
}
 
Example #5
Source File: ErrorTreeAppendable.java    From xtext-extras with Eclipse Public License 2.0 5 votes vote down vote up
public ErrorTreeAppendable(SharedAppendableState state, 
		ITraceURIConverter converter,
		ILocationInFileProvider locationProvider,
		IJvmModelAssociations jvmModelAssociations,
		Set<ILocationData> sourceLocations, 
		boolean useForDebugging) {
	super(state, converter, locationProvider, jvmModelAssociations, sourceLocations, useForDebugging);
	encoder = getOrCreateURIEncoder();
}
 
Example #6
Source File: AbstractTrace.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
protected boolean isAssociatedWith(AbstractTraceRegion region, AbsoluteURI uri, IProjectConfig project) {
	ITraceURIConverter traceURIConverter = getService(uri, ITraceURIConverter.class);
	if (traceURIConverter == null) {
		traceURIConverter = getService(getLocalURI(), ITraceURIConverter.class);
	}
	SourceRelativeURI convertedUri = traceURIConverter.getURIForTrace(project, uri);
	return convertedUri.equals(region.getAssociatedSrcRelativePath());
}
 
Example #7
Source File: TreeAppendable.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
public ITraceURIConverter getTraceURIConverter() {
	return traceURIConverter;
}
 
Example #8
Source File: TreeAppendable.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
protected static ILocationData createLocationData(ITraceURIConverter converter, ILocationInFileProvider locationProvider, EObject object, ILocationInFileProviderExtension.RegionDescription query) {
	return createLocationData(converter, locationProvider, object, query, true);
}
 
Example #9
Source File: TreeAppendable.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
private static Set<ILocationData> createAllLocationData(ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, EObject object, ILocationInFileProviderExtension.RegionDescription query) {
	return createAllLocationData(converter, locationProvider, jvmModelAssociations, object, query, true);
}
 
Example #10
Source File: AbstractTraceForURIProvider.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
protected SourceRelativeURI getGeneratedUriForTrace(IProjectConfig projectConfig, AbsoluteURI absoluteSourceResource, AbsoluteURI generatedFileURI, ITraceURIConverter traceURIConverter) {
	return traceURIConverter.getURIForTrace(projectConfig, generatedFileURI);
}