use of org.eclipse.jface.dialogs.InputDialog in project sling by apache.
the class JcrNodeRenameHandler method execute.
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection sel = HandlerUtil.getCurrentSelection(event);
JcrNode node = SelectionUtils.getFirst(sel, JcrNode.class);
if (node == null) {
return null;
}
Shell shell = HandlerUtil.getActiveShell(event);
InputDialog id = new InputDialog(shell, "Change Node Name", "Enter new name for node '" + node.getDescription() + "':", node.getLabel(), NodeNameValidator.INSTANCE);
if (id.open() == IStatus.OK) {
node.rename(id.getValue());
}
return null;
}
Aggregations