Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008, 2010 itemis AG ( and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at /
 package org.eclipse.xtext.ui.editor.handler;
import  org.eclipse.core.commands.AbstractHandler;
import  org.eclipse.core.commands.ExecutionEvent;
import  org.eclipse.core.commands.ExecutionException;
import  org.eclipse.core.resources.IResource;

Dennis H´┐Żbner - Initial contribution and API
Michael Clay
Peter Friese
public class ValidateActionHandler extends AbstractHandler {
	public Object execute(ExecutionEvent eventthrows ExecutionException {
		XtextEditor xtextEditor = EditorUtils.getActiveXtextEditor(event);
		if (xtextEditor != null) {
			IValidationIssueProcessor issueProcessor;
			IXtextDocument xtextDocument = xtextEditor.getDocument();
			IResource resource = xtextEditor.getResource();
			if(resource != null)
				issueProcessor = new MarkerIssueProcessor(resource);
				issueProcessor = new AnnotationIssueProcessor(xtextDocumentxtextEditor.getInternalSourceViewer().getAnnotationModel(), );
			ValidationJob validationJob = new ValidationJob(xtextDocumentissueProcessor,
		return this;
New to GrepCode? Check out our FAQ X