X-Git-Url: https://git.argeo.org/?a=blobdiff_plain;f=server%2Fplugins%2Forg.argeo.jcr.ui.explorer%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fjcr%2Fui%2Fexplorer%2Feditors%2FGenericNodeEditor.java;h=f7e57c6cb7dc11fe0191b422f85fbba89d8acf2c;hb=774e4da3fb247a95d327674045af5b5ab2a1a62a;hp=4510ea3fcfac769656bb6b78fae5e0dfd45c9ecc;hpb=c425aea5b318f0c291804cf3973b3059f923e9b5;p=lgpl%2Fargeo-commons.git diff --git a/server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/editors/GenericNodeEditor.java b/server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/editors/GenericNodeEditor.java index 4510ea3fc..f7e57c6cb 100644 --- a/server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/editors/GenericNodeEditor.java +++ b/server/plugins/org.argeo.jcr.ui.explorer/src/main/java/org/argeo/jcr/ui/explorer/editors/GenericNodeEditor.java @@ -14,7 +14,10 @@ import org.eclipse.ui.PartInitException; import org.eclipse.ui.forms.editor.FormEditor; /** - * Parent Abstract GR multitab editor. Insure the presence of a GrBackend + * + * Container for the node editor page. At creation time, it takes a JCR Node + * that cannot be changed afterwards. + * */ public class GenericNodeEditor extends FormEditor { @@ -24,33 +27,44 @@ public class GenericNodeEditor extends FormEditor { private Node currentNode; private GenericNodePage networkDetailsPage; + private ChildNodesPage childNodesPage; + private NodeRightsManagementPage nodeRightsManagementPage; + private NodeVersionHistoryPage nodeVersionHistoryPage; public void init(IEditorSite site, IEditorInput input) throws PartInitException { super.init(site, input); GenericNodeEditorInput nei = (GenericNodeEditorInput) getEditorInput(); + currentNode = nei.getCurrentNode(); this.setPartName(JcrUtils.lastPathElement(nei.getPath())); } @Override protected void addPages() { - EmptyNodePage enp = new EmptyNodePage(this, "Empty node page"); - try { - addPage(enp); - } catch (PartInitException e) { - throw new ArgeoException("Not able to add an empty page ", e); - } - } - - private void addPagesAfterNodeSet() { try { networkDetailsPage = new GenericNodePage(this, JcrExplorerPlugin.getMessage("genericNodePageTitle"), currentNode); addPage(networkDetailsPage); - this.setActivePage(networkDetailsPage.getIndex()); + + childNodesPage = new ChildNodesPage(this, + JcrExplorerPlugin.getMessage("childNodesPageTitle"), + currentNode); + addPage(childNodesPage); + + nodeRightsManagementPage = new NodeRightsManagementPage(this, + JcrExplorerPlugin + .getMessage("nodeRightsManagementPageTitle"), + currentNode); + addPage(nodeRightsManagementPage); + + nodeVersionHistoryPage = new NodeVersionHistoryPage( + this, + JcrExplorerPlugin.getMessage("nodeVersionHistoryPageTitle"), + currentNode); + addPage(nodeVersionHistoryPage); } catch (PartInitException e) { - throw new ArgeoException("Not able to add page ", e); + throw new ArgeoException("Not able to add an empty page ", e); } } @@ -79,13 +93,4 @@ public class GenericNodeEditor extends FormEditor { Node getCurrentNode() { return currentNode; } - - public void setCurrentNode(Node currentNode) { - boolean nodeWasNull = this.currentNode == null; - this.currentNode = currentNode; - if (nodeWasNull) { - this.removePage(0); - addPagesAfterNodeSet(); - } - } }