1 package org
.argeo
.security
.ui
.admin
.commands
;
3 import org
.argeo
.security
.ui
.admin
.editors
.ArgeoUserEditor
;
4 import org
.argeo
.security
.ui
.admin
.editors
.ArgeoUserEditorInput
;
5 import org
.eclipse
.core
.commands
.AbstractHandler
;
6 import org
.eclipse
.core
.commands
.ExecutionEvent
;
7 import org
.eclipse
.core
.commands
.ExecutionException
;
8 import org
.eclipse
.ui
.IWorkbenchPage
;
9 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
11 /** Command handler to set visible or open a Argeo user. */
12 public class OpenArgeoUserEditor
extends AbstractHandler
{
13 public final static String COMMAND_ID
= "org.argeo.security.ui.admin.openArgeoUserEditor";
14 public final static String PARAM_USERNAME
= "org.argeo.security.ui.admin.username";
16 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
18 ArgeoUserEditorInput editorInput
= new ArgeoUserEditorInput(
19 event
.getParameter(PARAM_USERNAME
));
20 IWorkbenchPage activePage
= HandlerUtil
.getActiveWorkbenchWindow(
21 event
).getActivePage();
22 activePage
.openEditor(editorInput
, ArgeoUserEditor
.ID
);
23 } catch (Exception e
) {
24 throw new ExecutionException("Cannot open editor", e
);