use of org.eclipse.jdt.ui.refactoring.RenameSupport in project xtext-xtend by eclipse.
the class XImportSectionUpdateOnRenameTest method renameJavaElement.
public void renameJavaElement(final IType javaElement, final String newName) throws Exception {
this.syncUtil.totalSync(false);
final RenameSupport renameSupport = RenameSupport.create(javaElement, newName, RenameSupport.UPDATE_REFERENCES);
renameSupport.perform(this.workbench.getActiveWorkbenchWindow().getShell(), this.workbench.getActiveWorkbenchWindow());
this.syncUtil.totalSync(false);
Assert.assertTrue(this.compositeRefactoringProcessorAccess.isDisposed());
}
use of org.eclipse.jdt.ui.refactoring.RenameSupport in project xtext-xtend by eclipse.
the class XImportSectionUpdateOnRenameTest method renameJavaElement.
public void renameJavaElement(final IField javaElement, final String newName) throws Exception {
this.syncUtil.totalSync(false);
final RenameSupport renameSupport = RenameSupport.create(javaElement, newName, RenameSupport.UPDATE_REFERENCES);
renameSupport.perform(this.workbench.getActiveWorkbenchWindow().getShell(), this.workbench.getActiveWorkbenchWindow());
this.syncUtil.totalSync(false);
Assert.assertTrue(this.compositeRefactoringProcessorAccess.isDisposed());
}
use of org.eclipse.jdt.ui.refactoring.RenameSupport in project xtext-xtend by eclipse.
the class JavaRefactoringIntegrationTest method renameJavaElement.
protected void renameJavaElement(IType javaElement, String newName) throws CoreException, InterruptedException, InvocationTargetException {
syncUtil.totalSync(false);
RenameSupport renameSupport = RenameSupport.create(javaElement, newName, RenameSupport.UPDATE_REFERENCES);
renameSupport.perform(workbench.getActiveWorkbenchWindow().getShell(), workbench.getActiveWorkbenchWindow());
syncUtil.totalSync(false);
assertTrue(compositeRefactoringProcessorAccess.isDisposed());
}
use of org.eclipse.jdt.ui.refactoring.RenameSupport in project webtools.sourceediting by eclipse.
the class JSPRenameElementActionDelegate method run.
public void run(IAction action) {
IJavaElement element = getSelectedElement();
if (element != null) {
RenameSupport renameSupport = null;
try {
switch(element.getElementType()) {
case IJavaElement.TYPE:
renameSupport = RenameSupport.create((IType) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
break;
case IJavaElement.METHOD:
renameSupport = RenameSupport.create((IMethod) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
break;
case IJavaElement.PACKAGE_FRAGMENT:
renameSupport = RenameSupport.create((IPackageFragment) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
break;
}
if (renameSupport != null) {
renameSupport.openDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
PlatformStatusLineUtil.clearStatusLine();
}
} catch (CoreException e) {
Logger.logException(e);
}
} else {
// $NON-NLS-1$
PlatformStatusLineUtil.displayErrorMessage(JSPUIMessages.JSPRenameElementAction_0);
PlatformStatusLineUtil.addOneTimeClearListener();
}
}
use of org.eclipse.jdt.ui.refactoring.RenameSupport in project webtools.sourceediting by eclipse.
the class RenameElementHandler method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
fEditor = HandlerUtil.getActiveEditor(event);
IJavaElement element = getSelectedElement();
if (element != null) {
RenameSupport renameSupport = null;
try {
switch(element.getElementType()) {
case IJavaElement.TYPE:
renameSupport = RenameSupport.create((IType) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
break;
case IJavaElement.METHOD:
renameSupport = RenameSupport.create((IMethod) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
break;
case IJavaElement.PACKAGE_FRAGMENT:
renameSupport = RenameSupport.create((IPackageFragment) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
break;
case IJavaElement.FIELD:
renameSupport = RenameSupport.create((IField) element, element.getElementName(), RenameSupport.UPDATE_REFERENCES);
break;
}
if (renameSupport != null) {
renameSupport.openDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
PlatformStatusLineUtil.clearStatusLine();
}
} catch (CoreException e) {
Logger.logException(e);
}
} else {
// $NON-NLS-1$
PlatformStatusLineUtil.displayErrorMessage(JSPUIMessages.JSPRenameElementAction_0);
PlatformStatusLineUtil.addOneTimeClearListener();
}
return null;
}
Aggregations