use of org.yakindu.sct.refactoring.refactor.impl.RenameRefactoring in project statecharts by Yakindu.
the class RenameElementHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
NamedElement element = refactoring.getContextObject();
if (element != null) {
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
InputDialog dialog = new InputDialog(window.getShell(), "Rename..", "Please enter new name:", element.getName(), new NameUniquenessValidator(element));
if (dialog.open() == Window.OK) {
String newName = dialog.getValue();
if (newName != null) {
((RenameRefactoring) refactoring).setNewName(newName);
refactoring.execute();
}
}
}
return null;
}
Aggregations