Java 类org.eclipse.xtext.ui.validation.MarkerTypeProvider 实例源码

项目:n4js    文件:OwnResourceValidatorAwareValidatingEditorCallback.java   
private ValidationJob newValidationJob(final XtextEditor editor) {

        final IXtextDocument document = editor.getDocument();
        final IAnnotationModel annotationModel = editor.getInternalSourceViewer().getAnnotationModel();

        final IssueResolutionProvider issueResolutionProvider = getService(editor, IssueResolutionProvider.class);
        final MarkerTypeProvider markerTypeProvider = getService(editor, MarkerTypeProvider.class);
        final MarkerCreator markerCreator = getService(editor, MarkerCreator.class);

        final IValidationIssueProcessor issueProcessor = new CompositeValidationIssueProcessor(
                new AnnotationIssueProcessor(document, annotationModel, issueResolutionProvider),
                new MarkerIssueProcessor(editor.getResource(), markerCreator, markerTypeProvider));

        return editor.getDocument().modify(resource -> {
            final IResourceServiceProvider serviceProvider = resource.getResourceServiceProvider();
            final IResourceValidator resourceValidator = serviceProvider.getResourceValidator();
            return new ValidationJob(resourceValidator, editor.getDocument(), issueProcessor, ALL);
        });
    }
项目:statecharts    文件:SCTXtextIntegrationModule.java   
@Override
public void configure(Binder binder) {
    binder.bind(IResourceValidator.class).to(SCTResourceValidatorImpl.class);
    binder.bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("sct");
    binder.bind(IEncodingProvider.class).to(IEncodingProvider.Runtime.class);
    binder.bind(IQualifiedNameProvider.class).to(StextNameProvider.class);
    binder.bind(org.eclipse.jface.viewers.ILabelProvider.class)
            .annotatedWith(org.eclipse.xtext.ui.resource.ResourceServiceDescriptionLabelProvider.class)
            .to(DefaultDescriptionLabelProvider.class);
    binder.bind(IDefaultResourceDescriptionStrategy.class).to(SCTResourceDescriptionStrategy.class);

    binder.bind(MarkerCreator.class).to(SCTMarkerCreator.class);
    binder.bind(MarkerTypeProvider.class).to(SCTMarkerTypeProvider.class);
    binder.bind(IDiagnosticConverter.class).to(SCTDiagnosticConverterImpl.class);
    binder.bind(IURIEditorOpener.class).annotatedWith(LanguageSpecific.class).to(SCTFileEditorOpener.class);

    binder.bind(IMarkerContributor.class).to(TaskMarkerContributor.class);
    binder.bind(ITaskFinder.class).to(DomainSpecificTaskFinder.class);
    binder.bind(TaskMarkerCreator.class).to(SCTTaskMarkerCreator.class);
    binder.bind(TaskMarkerTypeProvider.class).to(SCTTaskMarkerTypeProvider.class);
}
项目:n4js    文件:ResourceUIValidatorExtension.java   
private void createMarkers(IFile file, List<Issue> list, MarkerCreator markerCreator,
        MarkerTypeProvider markerTypeProvider) throws CoreException {

    for (Issue issue : list) {
        markerCreator.createMarker(issue, file, markerTypeProvider.getMarkerType(issue));
    }
}
项目:bts    文件:MarkerIssueProcessor.java   
/**
 * @since 2.3
 */
public MarkerIssueProcessor(IResource resource, MarkerCreator markerCreator, MarkerTypeProvider markerTypeProvider) {
    super();
    this.resource = resource;
    this.markerCreator = markerCreator;
    this.markerTypeProvider = markerTypeProvider;
}
项目:bts    文件:AddMarkersOperation.java   
/**
 * @since 2.3
 */
public AddMarkersOperation(IResource resource, List<Issue> issues, Set<String> markerIds,
        boolean deleteMarkers, MarkerCreator markerCreator, MarkerTypeProvider markerTypeProvider) {
    super(ResourcesPlugin.getWorkspace().getRuleFactory().markerRule(resource));
    this.issues = issues;
    this.markerTypeProvider = markerTypeProvider;
    this.markerIds = ImmutableList.copyOf(markerIds);
    this.resource = resource;
    this.deleteMarkers = deleteMarkers;
    this.markerCreator = markerCreator;
}
项目:n4js    文件:ResourceUIValidatorExtension.java   
private MarkerTypeProvider getMarkerTypeProvider(Resource resource) {
    return getService(resource, MarkerTypeProvider.class);
}
项目:bts    文件:DefaultUiModule.java   
/**
 * @since 2.3
 */
public Class<? extends MarkerTypeProvider> bindMarkerTypeProvider() {
    return LanguageAwareMarkerTypeProvider.class;
}
项目:bts    文件:MarkerIssueProcessor.java   
/**
 * @deprecated use {@link MarkerIssueProcessor#MarkerIssueProcessor(IResource, MarkerCreator, MarkerTypeProvider) instead.}
 */
@Deprecated
public MarkerIssueProcessor(IResource resource, MarkerCreator markerCreator) {
    this(resource, markerCreator, new MarkerTypeProvider());
}
项目:bts    文件:AddMarkersOperation.java   
/**
 * @deprecated use {@link AddMarkersOperation#AddMarkersOperation(IResource, List, Set, boolean, MarkerCreator, MarkerTypeProvider)} instead
 */
@Deprecated
public AddMarkersOperation(IResource resource, List<Issue> issues, Set<String> markerIds,
        boolean deleteMarkers, MarkerCreator markerCreator) {
    this(resource, issues, markerIds, deleteMarkers, markerCreator, new MarkerTypeProvider());
}
项目:statecharts    文件:GenericEditorModule.java   
public Class<? extends MarkerTypeProvider> bindMarkerTypeProvider() {
    return SCTMarkerTypeProvider.class;
}