1 package org
.argeo
.jcr
.ui
.explorer
.editors
;
5 import org
.apache
.commons
.logging
.Log
;
6 import org
.apache
.commons
.logging
.LogFactory
;
7 import org
.argeo
.ArgeoException
;
8 import org
.argeo
.jcr
.JcrUtils
;
9 import org
.argeo
.jcr
.ui
.explorer
.JcrExplorerPlugin
;
10 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
11 import org
.eclipse
.ui
.IEditorInput
;
12 import org
.eclipse
.ui
.IEditorSite
;
13 import org
.eclipse
.ui
.PartInitException
;
14 import org
.eclipse
.ui
.forms
.editor
.FormEditor
;
18 * Container for the node editor page. At creation time, it takes a JCR Node
19 * that cannot be changed afterwards.
22 public class GenericNodeEditor
extends FormEditor
{
24 private final static Log log
= LogFactory
.getLog(GenericNodeEditor
.class);
25 public final static String ID
= "org.argeo.jcr.ui.explorer.genericNodeEditor";
27 private Node currentNode
;
29 private GenericNodePage networkDetailsPage
;
30 private ChildNodesPage childNodesPage
;
31 private NodeRightsManagementPage nodeRightsManagementPage
;
32 private NodeVersionHistoryPage nodeVersionHistoryPage
;
34 public void init(IEditorSite site
, IEditorInput input
)
35 throws PartInitException
{
36 super.init(site
, input
);
37 GenericNodeEditorInput nei
= (GenericNodeEditorInput
) getEditorInput();
38 currentNode
= nei
.getCurrentNode();
39 this.setPartName(JcrUtils
.lastPathElement(nei
.getPath()));
43 protected void addPages() {
45 networkDetailsPage
= new GenericNodePage(this,
46 JcrExplorerPlugin
.getMessage("genericNodePageTitle"),
48 addPage(networkDetailsPage
);
50 childNodesPage
= new ChildNodesPage(this,
51 JcrExplorerPlugin
.getMessage("childNodesPageTitle"),
53 addPage(childNodesPage
);
55 nodeRightsManagementPage
= new NodeRightsManagementPage(this,
57 .getMessage("nodeRightsManagementPageTitle"),
59 addPage(nodeRightsManagementPage
);
61 nodeVersionHistoryPage
= new NodeVersionHistoryPage(
63 JcrExplorerPlugin
.getMessage("nodeVersionHistoryPageTitle"),
65 addPage(nodeVersionHistoryPage
);
66 } catch (PartInitException e
) {
67 throw new ArgeoException("Not able to add an empty page ", e
);
72 public void doSaveAs() {
73 // unused compulsory method
77 public void doSave(IProgressMonitor monitor
) {
79 // Automatically commit all pages of the editor
81 firePropertyChange(PROP_DIRTY
);
82 } catch (Exception e
) {
83 throw new ArgeoException("Error while saving node", e
);
89 public boolean isSaveAsAllowed() {
93 Node
getCurrentNode() {