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

项目: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);
        });
    }
项目:n4js    文件:CompositeValidationIssueProcessor.java   
@Override
public void processIssues(final List<Issue> issues, final IProgressMonitor monitor) {
    for (final IValidationIssueProcessor processor : processors) {
        if (null != processor) {
            processor.processIssues(issues, monitor);
        }
    }
}
项目:bts    文件:EmbeddedEditorFactory.java   
public Builder processIssuesBy(IValidationIssueProcessor issueProcessor) {
    if (this.issueProcessor != null)
        throw new IllegalStateException();
    if (issueProcessor == null)
        throw new IllegalArgumentException();
    this.issueProcessor = issueProcessor;
    return this;
}
项目:statecharts    文件:GenericEditorModule.java   
public void configure(Binder binder) {
    super.configure(binder);
    Multibinder<IEditProposalProvider> proposalProviderBinder = Multibinder.newSetBinder(binder,
            IEditProposalProvider.class);
    proposalProviderBinder.addBinding().to(SmartEditProposalProvider.class);
    proposalProviderBinder.addBinding().to(RefactoringProposalProvider.class);
    binder.bind(IResourceValidator.class).to(SCTResourceValidatorImpl.class);
    binder.bind(IValidationIssueProcessor.class).to(DefaultValidationIssueStore.class);
}
项目:gama    文件:GamlEditTemplateDialog.java   
protected SourceViewer createViewer(final Composite parent) {
    Builder editorBuilder = configuration.getEmbeddedEditorFactory().newEditor(resourceProvider);
    editorBuilder.processIssuesBy(new IValidationIssueProcessor() {

        @Override
        public void processIssues(final List<Issue> issues, final IProgressMonitor monitor) {
            IStatus result = Status.OK_STATUS;
            StringBuilder messages = new StringBuilder();
            for ( Issue issue : issues ) {
                if ( issue.getSeverity() == Severity.ERROR ) {
                    if ( messages.length() != 0 ) {
                        messages.append('\n');
                    }
                    messages.append(issue.getMessage());
                }
            }
            if ( messages.length() != 0 ) {
                result = createErrorStatus(messages.toString(), null);
            }
            final IStatus toBeUpdated = result;
            getShell().getDisplay().asyncExec(new Runnable() {

                @Override
                public void run() {
                    updateStatus(toBeUpdated);
                }
            });
        }
    });
    EmbeddedEditor handle = editorBuilder.withParent(parent);
    partialModelEditor = handle.createPartialEditor(getPrefix(), data.getTemplate().getPattern(), "", true);
    return handle.getViewer();
}
项目:statecharts    文件:ValidationJob.java   
public void setValidationIssueProcessor(IValidationIssueProcessor validationIssueProcessor) {
    this.validationIssueProcessor = validationIssueProcessor;
}
项目:statecharts    文件:LiveValidationListener.java   
public void setValidationIssueProcessor(IValidationIssueProcessor validationIssueProcessor) {
    validationJob.setValidationIssueProcessor(validationIssueProcessor);
}
项目:n4js    文件:CompositeValidationIssueProcessor.java   
/**
 * Creates a new composite issue processor with the given sub processor arguments.
 *
 * @param first
 *            the first sub processor.
 * @param others
 *            the other processor;
 */
public CompositeValidationIssueProcessor(final IValidationIssueProcessor first,
        final IValidationIssueProcessor... others) {
    processors = Lists.asList(first, others);
}