Java 类org.eclipse.xtext.generator.trace.ITraceURIConverter 实例源码

项目:xtext-extras    文件:TreeAppendable.java   
private static ILocationData createLocationData(ITraceURIConverter converter, ILocationInFileProvider locationProvider, EObject object, ILocationInFileProviderExtension.RegionDescription query, boolean skipEmpty) {
    ITextRegion textRegion = locationProvider instanceof ILocationInFileProviderExtension ? 
            ((ILocationInFileProviderExtension) locationProvider).getTextRegion(object, query) : locationProvider.getFullTextRegion(object);
    if (!(textRegion instanceof ITextRegionWithLineInformation)) {
        if (log.isDebugEnabled())
            log.debug("location provider returned text region without line information.", new Exception());
        if (textRegion != null)
            textRegion = new TextRegionWithLineInformation(textRegion.getOffset(), textRegion.getLength(), 0, 0);
        else
            return null;
    } 
    // usually we want to skip empty regions but if the root region is empty, we want to use it to store the path information along
    // with the empty offset / length pair
    if (skipEmpty && textRegion == ITextRegion.EMPTY_REGION) {
        return null;
    }
    ILocationData newData = createLocationData(converter, object, (ITextRegionWithLineInformation) textRegion);
    return newData;
}
项目:xtext-extras    文件:TreeAppendable.java   
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);
}
项目:xtext-extras    文件:TreeAppendable.java   
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);
}
项目:xtext-extras    文件:TreeAppendable.java   
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();
}
项目:xtext-extras    文件:TreeAppendable.java   
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;
}
项目:xtext-extras    文件:ErrorTreeAppendable.java   
public ErrorTreeAppendable(SharedAppendableState state, 
        ITraceURIConverter converter,
        ILocationInFileProvider locationProvider,
        IJvmModelAssociations jvmModelAssociations,
        Set<ILocationData> sourceLocations, 
        boolean useForDebugging) {
    super(state, converter, locationProvider, jvmModelAssociations, sourceLocations, useForDebugging);
    encoder = getOrCreateURIEncoder();
}
项目:xtext-core    文件:AbstractTrace.java   
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());
}
项目:xtext-extras    文件:TreeAppendable.java   
public ITraceURIConverter getTraceURIConverter() {
    return traceURIConverter;
}
项目:xtext-extras    文件:TreeAppendable.java   
protected static ILocationData createLocationData(ITraceURIConverter converter, ILocationInFileProvider locationProvider, EObject object, ILocationInFileProviderExtension.RegionDescription query) {
    return createLocationData(converter, locationProvider, object, query, true);
}
项目:xtext-extras    文件:TreeAppendable.java   
private static Set<ILocationData> createAllLocationData(ITraceURIConverter converter, ILocationInFileProvider locationProvider, IJvmModelAssociations jvmModelAssociations, EObject object, ILocationInFileProviderExtension.RegionDescription query) {
    return createAllLocationData(converter, locationProvider, jvmModelAssociations, object, query, true);
}
项目:xtext-core    文件:AbstractTraceForURIProvider.java   
protected SourceRelativeURI getGeneratedUriForTrace(IProjectConfig projectConfig, AbsoluteURI absoluteSourceResource, AbsoluteURI generatedFileURI, ITraceURIConverter traceURIConverter) {
    return traceURIConverter.getURIForTrace(projectConfig, generatedFileURI);
}
项目:bts    文件:DefaultUiModule.java   
/**
 * @since 2.4
 */
public Class<? extends ITraceURIConverter> bindITraceURIConverter() {
    return DefaultTraceURIConverter.class;
}
项目:k3    文件:XtendModule.java   
public Class<? extends ITraceURIConverter> bindITraceURIConverter() {
    return TraceURIConverter.class;
}