]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - commands/OpenGenericNodeEditor.java
1 package org
.argeo
.jcr
.ui
.explorer
.commands
;
3 import org
.argeo
.ArgeoException
;
4 import org
.argeo
.eclipse
.ui
.jcr
.editors
.NodeEditorInput
;
5 import org
.argeo
.jcr
.ui
.explorer
.JcrExplorerConstants
;
6 import org
.argeo
.jcr
.ui
.explorer
.editors
.GenericNodeEditor
;
7 import org
.eclipse
.core
.commands
.AbstractHandler
;
8 import org
.eclipse
.core
.commands
.ExecutionEvent
;
9 import org
.eclipse
.core
.commands
.ExecutionException
;
10 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
12 /** Opens the generic node editor. */
13 public class OpenGenericNodeEditor
extends AbstractHandler
{
14 public final static String ID
= "org.argeo.jcr.ui.explorer.openGenericNodeEditor";
16 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
17 String path
= event
.getParameter(JcrExplorerConstants
.PARAM_PATH
);
19 NodeEditorInput nei
= new NodeEditorInput(path
);
20 HandlerUtil
.getActiveWorkbenchWindow(event
).getActivePage()
21 .openEditor(nei
, GenericNodeEditor
.ID
);
22 } catch (Exception e
) {
23 throw new ArgeoException("Cannot open editor", e
);