1 package org
.argeo
.eclipse
.ui
.jcr
.commands
;
3 import org
.argeo
.eclipse
.ui
.jcr
.editors
.JcrQueryEditorInput
;
4 import org
.eclipse
.core
.commands
.AbstractHandler
;
5 import org
.eclipse
.core
.commands
.ExecutionEvent
;
6 import org
.eclipse
.core
.commands
.ExecutionException
;
7 import org
.eclipse
.ui
.IWorkbenchPage
;
8 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
10 /** Open a JCR query editor. */
11 public class OpenGenericJcrQueryEditor
extends AbstractHandler
{
12 private String editorId
;
14 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
16 JcrQueryEditorInput editorInput
= new JcrQueryEditorInput("", null);
17 IWorkbenchPage activePage
= HandlerUtil
.getActiveWorkbenchWindow(
18 event
).getActivePage();
19 activePage
.openEditor(editorInput
, editorId
);
20 } catch (Exception e
) {
21 throw new ExecutionException("Cannot open editor", e
);
26 public void setEditorId(String editorId
) {
27 this.editorId
= editorId
;