Improve Javadoc
[lgpl/argeo-commons.git] / org.argeo.cms.ui.workbench / src / org / argeo / cms / ui / workbench / internal / jcr / commands / RenameNode.java
index 7d3194022ec5490b3ae782ad0819d546d83e16e9..07c722b23acb390a08ff15fa8457064fecea6dac 100644 (file)
@@ -36,8 +36,8 @@ import org.eclipse.ui.IWorkbenchPage;
 import org.eclipse.ui.handlers.HandlerUtil;
 
 /**
- * Canonically call JCR {@link Session#move(String, String)} on the first
- * element returned by {@link HandlerUtil#getActiveWorkbenchWindow()}
+ * Canonically call JCR Session#move(String, String) on the first element
+ * returned by HandlerUtil#getActiveWorkbenchWindow()
  * (...getActivePage().getSelection()), if it is a {@link SingleJcrNodeElem}.
  * The user must then fill a new name in and confirm
  */
@@ -45,8 +45,7 @@ public class RenameNode extends AbstractHandler {
        public final static String ID = WorkbenchUiPlugin.PLUGIN_ID + ".renameNode";
 
        public Object execute(ExecutionEvent event) throws ExecutionException {
-               IWorkbenchPage iwp = HandlerUtil.getActiveWorkbenchWindow(event)
-                               .getActivePage();
+               IWorkbenchPage iwp = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage();
 
                ISelection selection = iwp.getSelection();
                if (selection == null || !(selection instanceof IStructuredSelection))
@@ -63,22 +62,19 @@ public class RenameNode extends AbstractHandler {
                                String oldPath = null;
                                try {
                                        newName = SingleValue.ask("New node name",
-                                                       "Please provide a new name for [" + node.getName()
-                                                                       + "]");
+                                                       "Please provide a new name for [" + node.getName() + "]");
                                        // TODO sanity check and user feedback
                                        newName = JcrUtils.replaceInvalidChars(newName);
                                        oldPath = node.getPath();
                                        session = node.getSession();
-                                       session.move(oldPath, JcrUtils.parentPath(oldPath) + "/"
-                                                       + newName);
+                                       session.move(oldPath, JcrUtils.parentPath(oldPath) + "/" + newName);
                                        session.save();
 
                                        // Manually refresh the browser view. Must be enhanced
                                        if (iwp.getActivePart() instanceof JcrBrowserView)
                                                ((JcrBrowserView) iwp.getActivePart()).refresh(sjn);
                                } catch (RepositoryException e) {
-                                       throw new EclipseUiException("Unable to rename " + node
-                                                       + " to " + newName, e);
+                                       throw new EclipseUiException("Unable to rename " + node + " to " + newName, e);
                                }
                        }
                }