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.refactoring.impl;
 
import  org.eclipse.core.resources.IProject;
Sorts reference descriptions by project and by resource to allow efficient processing later on.

Author(s):
Jan Koehnlein - Initial contribution and API
	public Multimap<IProject, IReferenceDescriptionsortByProject(Iterable<IReferenceDescriptionreferenceDescriptions) {
		Multimap<IProject, IReferenceDescriptionreferencesByProject = HashMultimap.create();
		for (IReferenceDescription referenceDescription : referenceDescriptions) {
			URI sourceResourceUri = referenceDescription.getSourceEObjectUri().trimFragment();
			IProject project = .getProject(sourceResourceUri);
			if(project != null) {
				referencesByProject.put(projectreferenceDescription);
			}
		}
		return referencesByProject;
	}
		Multimap<URIIReferenceDescriptionreferencesByResourceURI = HashMultimap.create();
		for (IReferenceDescription referenceDescription : referenceDescriptions) {
			URI sourceResourceUri = referenceDescription.getSourceEObjectUri().trimFragment();
			referencesByResourceURI.put(sourceResourceUrireferenceDescription);
		}
		return referencesByResourceURI;
	}
New to GrepCode? Check out our FAQ X