Java Code Examples for org.eclipse.xtext.validation.CheckMode#FAST_ONLY

The following examples show how to use org.eclipse.xtext.validation.CheckMode#FAST_ONLY . 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: GamlEditor.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
private void scheduleValidationJob() {
	if (!isEditable()) { return; }
	final IValidationIssueProcessor processor = new MarkerIssueProcessor(getResource(),
			getInternalSourceViewer().getAnnotationModel(), markerCreator, markerTypeProvider);
	final ValidationJob validate = new ValidationJob(validator, getDocument(), processor, CheckMode.FAST_ONLY) {
		@Override
		protected IStatus run(final IProgressMonitor monitor) {
			final List<Issue> issues = getDocument().readOnly(resource -> {
				if (resource.isValidationDisabled()) { return Collections.emptyList(); }
				return validator.validate(resource, getCheckMode(), null);
			});
			processor.processIssues(issues, monitor);
			return Status.OK_STATUS;
		}

	};
	validate.schedule();

}
 
Example 2
Source File: XtextDocumentProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @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);
	}
}
 
Example 3
Source File: ErrorToDiagnoticTranslator.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
private CheckType getType(final CheckMode mode) {
	if (mode == CheckMode.FAST_ONLY) {
		return CheckType.FAST;
	} else if (mode == CheckMode.EXPENSIVE_ONLY) {
		return CheckType.EXPENSIVE;
	} else if (mode == CheckMode.ALL) {
		return CheckType.FAST;
	} else if (mode == CheckMode.NORMAL_AND_FAST) {
		return CheckType.FAST;
	} else if (mode == CheckMode.NORMAL_ONLY) {
		return CheckType.NORMAL;
	} else {
		return CheckType.FAST;
	}
}
 
Example 4
Source File: StyledTextXtextAdapter.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
protected ValidationJob createValidationJob() {
	return new ValidationJob(getValidator(), getXtextDocument(), new AnnotationIssueProcessor(getXtextDocument(),
			getXtextSourceviewer().getAnnotationModel(), getResolutionProvider()), CheckMode.FAST_ONLY);
}