Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2011 itemis AG (http://www.itemis.eu) 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 http://www.eclipse.org/legal/epl-v10.html /
 
 package org.eclipse.xtext.ui.validation;
 
import  org.eclipse.core.resources.IFile;
import  org.eclipse.core.runtime.CoreException;
import  org.eclipse.core.runtime.IProgressMonitor;
import  org.eclipse.core.runtime.OperationCanceledException;

Author(s):
Michael Clay - Initial contribution and API
Since:
2.1
	private final static Logger log = Logger.getLogger(DefaultResourceUIValidatorExtension.class);
	public void updateValidationMarkers(IFile fileResource resourceCheckMode mode, IProgressMonitor monitorthrows OperationCanceledException {
		if (shouldProcess(file)) {
			addMarkers(fileresourcemodemonitor);
		}
	}

	public void deleteValidationMarkers(IFile fileCheckMode checkMode, IProgressMonitor monitor) {
		super.deleteValidationMarkers(filecheckModemonitor);
	}
	protected void addMarkers(IFile fileResource resourceCheckMode mode, IProgressMonitor monitorthrows OperationCanceledException {
		try {
			List<Issuelist = .validate(resourcemodegetCancelIndicator(monitor));
			if (monitor.isCanceled()) {
				throw new OperationCanceledException();
			}
			deleteMarkers(filemodemonitor);
			if (monitor.isCanceled()) {
				throw new OperationCanceledException();
			}
			createMarkers(filelistmonitor);
catch (OperationCanceledError error) {
			throw error.getWrapped();
catch (CoreException e) {
			.error(e.getMessage(), e);
		}
	}
	protected void createMarkers(IFile fileList<Issuelist, IProgressMonitor monitorthrows CoreException {
		for (Issue issue : list) {
		}
	}
	protected CancelIndicator getCancelIndicator(final IProgressMonitor monitor) {
		return new CancelIndicator() {
			public boolean isCanceled() {
				return monitor.isCanceled();
			}
		};
	}
New to GrepCode? Check out our FAQ X