]>
git.argeo.org Git - gpl/argeo-slc.git/blob - legacy/argeo-commons/org.argeo.cms.ui.workbench/src/org/argeo/cms/ui/workbench/internal/useradmin/commands/SaveArgeoUser.java
1 package org
.argeo
.cms
.ui
.workbench
.internal
.useradmin
.commands
;
3 import org
.argeo
.cms
.ui
.workbench
.WorkbenchUiPlugin
;
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
.jface
.dialogs
.MessageDialog
;
8 import org
.eclipse
.swt
.widgets
.Display
;
9 import org
.eclipse
.ui
.IEditorPart
;
10 import org
.eclipse
.ui
.IWorkbenchPart
;
11 import org
.eclipse
.ui
.handlers
.HandlerUtil
;
13 /** Save the currently edited Argeo user. */
14 public class SaveArgeoUser
extends AbstractHandler
{
15 public final static String ID
= WorkbenchUiPlugin
.PLUGIN_ID
18 public Object
execute(ExecutionEvent event
) throws ExecutionException
{
20 IWorkbenchPart iwp
= HandlerUtil
.getActiveWorkbenchWindow(event
)
21 .getActivePage().getActivePart();
22 if (!(iwp
instanceof IEditorPart
))
24 IEditorPart editor
= (IEditorPart
) iwp
;
26 } catch (Exception e
) {
27 MessageDialog
.openError(Display
.getDefault().getActiveShell(),
28 "Error", "Cannot save user: " + e
.getMessage());