]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - argeo/cms/e4/jcr/JcrE4DClickListener.java
1 package org
.argeo
.cms
.e4
.jcr
;
4 import javax
.jcr
.RepositoryException
;
6 import org
.argeo
.cms
.CmsException
;
7 import org
.argeo
.cms
.ui
.jcr
.JcrDClickListener
;
8 import org
.eclipse
.e4
.ui
.model
.application
.ui
.basic
.MPart
;
9 import org
.eclipse
.e4
.ui
.workbench
.modeling
.EPartService
;
10 import org
.eclipse
.e4
.ui
.workbench
.modeling
.EPartService
.PartState
;
11 import org
.eclipse
.jface
.viewers
.TreeViewer
;
13 public class JcrE4DClickListener
extends JcrDClickListener
{
14 EPartService partService
;
16 public JcrE4DClickListener(TreeViewer nodeViewer
, EPartService partService
) {
18 this.partService
= partService
;
22 protected void openNode(Node node
) {
23 MPart part
= partService
.createPart(JcrNodeEditor
.DESCRIPTOR_ID
);
25 part
.setLabel(node
.getName());
26 part
.getPersistedState().put("nodeWorkspace", node
.getSession().getWorkspace().getName());
27 part
.getPersistedState().put("nodePath", node
.getPath());
28 } catch (RepositoryException e
) {
29 throw new CmsException("Cannot open " + node
, e
);
32 // the provided part is be shown
33 partService
.showPart(part
, PartState
.ACTIVATE
);