• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java IValidationIssueProcessor类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.eclipse.xtext.ui.editor.validation.IValidationIssueProcessor的典型用法代码示例。如果您正苦于以下问题:Java IValidationIssueProcessor类的具体用法?Java IValidationIssueProcessor怎么用?Java IValidationIssueProcessor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

IValidationIssueProcessor类属于org.eclipse.xtext.ui.editor.validation包,在下文中一共展示了IValidationIssueProcessor类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: newValidationJob

点赞 3

import org.eclipse.xtext.ui.editor.validation.IValidationIssueProcessor; //导入依赖的package包/类
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);
		});
	}
 

开发者ID:eclipse,
项目名称:n4js,
代码行数:20,
代码来源:OwnResourceValidatorAwareValidatingEditorCallback.java

示例2: processIssues

点赞 2

import org.eclipse.xtext.ui.editor.validation.IValidationIssueProcessor; //导入依赖的package包/类
@Override
public void processIssues(final List<Issue> issues, final IProgressMonitor monitor) {
	for (final IValidationIssueProcessor processor : processors) {
		if (null != processor) {
			processor.processIssues(issues, monitor);
		}
	}
}
 

开发者ID:eclipse,
项目名称:n4js,
代码行数:9,
代码来源:CompositeValidationIssueProcessor.java

示例3: processIssuesBy

点赞 2

import org.eclipse.xtext.ui.editor.validation.IValidationIssueProcessor; //导入依赖的package包/类
public Builder processIssuesBy(IValidationIssueProcessor issueProcessor) {
	if (this.issueProcessor != null)
		throw new IllegalStateException();
	if (issueProcessor == null)
		throw new IllegalArgumentException();
	this.issueProcessor = issueProcessor;
	return this;
}
 

开发者ID:cplutte,
项目名称:bts,
代码行数:9,
代码来源:EmbeddedEditorFactory.java

示例4: configure

点赞 2

import org.eclipse.xtext.ui.editor.validation.IValidationIssueProcessor; //导入依赖的package包/类
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);
}
 

开发者ID:Yakindu,
项目名称:statecharts,
代码行数:10,
代码来源:GenericEditorModule.java

示例5: createViewer

点赞 2

import org.eclipse.xtext.ui.editor.validation.IValidationIssueProcessor; //导入依赖的package包/类
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();
}
 

开发者ID:gama-platform,
项目名称:gama,
代码行数:34,
代码来源:GamlEditTemplateDialog.java

示例6: setValidationIssueProcessor

点赞 2

import org.eclipse.xtext.ui.editor.validation.IValidationIssueProcessor; //导入依赖的package包/类
public void setValidationIssueProcessor(IValidationIssueProcessor validationIssueProcessor) {
	this.validationIssueProcessor = validationIssueProcessor;
}
 

开发者ID:Yakindu,
项目名称:statecharts,
代码行数:4,
代码来源:ValidationJob.java

示例7: setValidationIssueProcessor

点赞 2

import org.eclipse.xtext.ui.editor.validation.IValidationIssueProcessor; //导入依赖的package包/类
public void setValidationIssueProcessor(IValidationIssueProcessor validationIssueProcessor) {
	validationJob.setValidationIssueProcessor(validationIssueProcessor);
}
 

开发者ID:Yakindu,
项目名称:statecharts,
代码行数:4,
代码来源:LiveValidationListener.java

示例8: CompositeValidationIssueProcessor

点赞 1

import org.eclipse.xtext.ui.editor.validation.IValidationIssueProcessor; //导入依赖的package包/类
/**
 * 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);
}
 

开发者ID:eclipse,
项目名称:n4js,
代码行数:13,
代码来源:CompositeValidationIssueProcessor.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)