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

项目: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);
        });
    }
项目:bts    文件:XtextDocumentProvider.java   
@Override
protected void disposeElementInfo(Object element, ElementInfo info) {
    if (info.fDocument instanceof XtextDocument) {
        XtextDocument document = (XtextDocument) info.fDocument;
        ValidationJob job = (ValidationJob) document.getValidationJob();
        if (job != null) {
            job.cancel();
        }
        document.disposeInput();
    }
    super.disposeElementInfo(element, info);
}
项目:bts    文件:XtextDocumentProvider.java   
/**
 * @since 2.4
 */
protected void registerAnnotationInfoProcessor(ElementInfo info) {
    XtextDocument doc = (XtextDocument) info.fDocument;
    if(info.fModel != null) {
        AnnotationIssueProcessor annotationIssueProcessor = new AnnotationIssueProcessor(doc, info.fModel,
            issueResolutionProvider);
        ValidationJob job = new ValidationJob(resourceValidator, doc, annotationIssueProcessor, CheckMode.FAST_ONLY);
        doc.setValidationJob(job);
    }
}
项目:statecharts    文件:StyledTextXtextAdapter.java   
protected ValidationJob createValidationJob() {
    return new ValidationJob(getValidator(), getXtextDocument(),
            new AnnotationIssueProcessor(getXtextDocument(), getXtextSourceviewer().getAnnotationModel(), getResolutionProvider()),
            CheckMode.FAST_ONLY);
}
项目:statecharts    文件:StyledTextXtextAdapter.java   
protected ValidationJob getValidationJob() {
    return this.validationJob;
}
项目:PDFReporter-Studio    文件:StyledTextXtextAdapter.java   
protected ValidationJob createValidationJob() {
    return new ValidationJob(validator, document, new AnnotationIssueProcessor(document,
            sourceviewer.getAnnotationModel(), resolutionProvider), CheckMode.ALL);
}