]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - SaveArgeoUser.java
aed34747231592fd6633647eda688382ddeae7ca
1 package org
.argeo
.security
.ui
.admin
.commands
;
3 import org
.eclipse
.core
.commands
.AbstractHandler
;
4 import org
.eclipse
.core
.commands
.ExecutionEvent
;
5 import org
.eclipse
.core
.commands
.ExecutionException
;
6 import org
.eclipse
.jface
.dialogs
.MessageDialog
;
7 import org
.eclipse
.swt
.widgets
.Display
;
8 import org
.eclipse
.ui
.IEditorPart
;
9 import org
.eclipse
.ui
.IWorkbenchPart
;
10 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
12 /** Save the currently edited Argeo user. */
13 public class SaveArgeoUser
extends AbstractHandler
{
14 public final static String COMMAND_ID
= "org.argeo.security.ui.admin.saveArgeoUser";
16 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
18 IWorkbenchPart iwp
= HandlerUtil
.getActiveWorkbenchWindow(event
)
19 .getActivePage().getActivePart();
21 if (!(iwp
instanceof IEditorPart
))
23 IEditorPart editor
= (IEditorPart
) iwp
;
25 } catch (Exception e
) {
26 MessageDialog
.openError(Display
.getDefault().getActiveShell(),
27 "Error", "Cannot save user: " + e
.getMessage());