use of org.eclipse.xtext.ui.refactoring.impl.RefactoringException in project xtext-xtend by eclipse.
the class XtendRenameStrategy method getPathToRename.
protected IPath getPathToRename(URI elementURI, ResourceSet resourceSet) {
EObject targetObject = resourceSet.getEObject(elementURI, false);
if (targetObject instanceof XtendTypeDeclaration) {
URI resourceURI = EcoreUtil2.getPlatformResourceOrNormalizedURI(targetObject).trimFragment();
if (!resourceURI.isPlatformResource())
throw new RefactoringException("Renamed type does not reside in the workspace");
IPath path = new Path(resourceURI.toPlatformString(true));
if (context instanceof IChangeRedirector.Aware) {
if (((IChangeRedirector.Aware) context).getChangeRedirector().getRedirectedPath(path) != path)
return null;
}
return path;
}
return null;
}
Aggregations