Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2010 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.resource;
  
 import  org.eclipse.core.resources.IFile;
 import  org.eclipse.core.resources.IProject;
 import  org.eclipse.core.resources.IResource;
 import  org.eclipse.core.resources.IStorage;
 import  org.eclipse.core.resources.IWorkspace;
 import  org.eclipse.jface.viewers.ILabelProvider;
 

Author(s):
Jan Koehnlein - Initial contribution and API
 
 
 	
 	private IJdtHelper jdtHelper;
 	
 	
 	@Inject(optional=true)
 	private IWorkspace workspace;
 
 		this. = delegate;
 	}
 
 	}
 
 	}
 
 	}
 
 	private ILabelProvider descriptionLabelProvider;
 
 	public ILabelProvider getLabelProvider() {
 	}
 	
 	public void setDescriptionLabelProvider(ILabelProvider descriptionLabelProvider) {
 		this. = descriptionLabelProvider;
 	}
 
 	public boolean canHandle(URI uri) {
 		boolean result = .canHandle(uri);
 		return result;
 	}

Compute whether the given storage is interesting in the context of Xtext. By default, it will delegate to canHandle(URI) and perform a subsequent check to filter storages from Java target folders.

Returns:
true if the uri / storage pair should be processed.
 
 	public boolean canHandle(URI uri, IStorage storage) {
 		if (.canHandle(uri)) {
 			if (isJavaCoreAvailable()) {
 				return !isJavaTargetFolder(storage);
 			}
 			return true;
 		}
 		return false;
	}

Since:
2.4
	public boolean canBuild(URI uri, IStorage storage) {
		return canHandle(uristorage);
	}

Since:
2.1
	protected boolean isJavaCoreAvailable() {
	}

Since:
2.1
	protected boolean isJavaTargetFolder(IStorage storage) {
		if (storage instanceof IResource) {
			return .isFromOutputPath((IResource) storage);
		}
		return false;
	}
	}
	@Inject(optional=true)
	}

Deprecated:
use get(IReferenceUpdater.class) instead
		return get(IReferenceUpdater.class);
	}
	public <T> T get(Class<T> t) {
		return .get(t);
	}

Since:
2.9
	public boolean isSource(URI uri) {
				return false;
		}
		if ( != null) {
			if (uri.isPlatformResource()) {
				String projectName = URI.decode(uri.segment(1));
				IProject project = .getRoot().getProject(projectName);
				return project.isAccessible();
			}
			if (uri.isPlatformPlugin()) {
				return false;
			}
		}
		Iterable<Pair<IStorage, IProject>> storages = .getStorages(uri);
		for (Pair<IStorage, IProject> pair : storages) {
			IStorage storage = pair.getFirst();
			if (storage instanceof IFile) {
				return ((IFile)storage).isAccessible();
else {
				return false;
			}
		}
		return true;
	}
New to GrepCode? Check out our FAQ X