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.runtime.IProgressMonitor;
import  org.eclipse.core.runtime.OperationCanceledException;
import  org.eclipse.core.runtime.SubMonitor;
Delivers all contained elements of an element to be renamed in order to updated references to them.

Author(s):
Jan Koehnlein - Initial contribution and API
	private static final int MONITOR_CHUNK_SIZE = 1000;
	public List<URIgetDependentElementURIs(EObject baseElement, IProgressMonitor monitor) {
		SubMonitor progress = SubMonitor.convert(monitor, 2);
		List<URIelementURIs = Lists.newArrayList();
		int counter = 0;
		for (Iterator<EObjectiterator = EcoreUtil.getAllProperContents(baseElementfalse); iterator.hasNext();) {
			if(progress.isCanceled()) {
				throw new OperationCanceledException();
			}
			EObject childElement = iterator.next();
			if (.getFullyQualifiedName(childElement)!=null) {
				URI childURI = EcoreUtil.getURI(childElement);
				if (childURI != null) {
					elementURIs.add(childURI);
				}
			}
			counter++;
			if (counter %  == 0) {
				progress.worked(1);
				progress.setWorkRemaining(2);
			}
		}
		return elementURIs;
	}
New to GrepCode? Check out our FAQ X