]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.security.ui.admin/src/org/argeo/security/ui/admin/internal/providers/UserTableDefaultDClickListener.java
Rename Commons bundles
[lgpl/argeo-commons.git] / org.argeo.security.ui.admin / src / org / argeo / security / ui / admin / internal / providers / UserTableDefaultDClickListener.java
diff --git a/org.argeo.security.ui.admin/src/org/argeo/security/ui/admin/internal/providers/UserTableDefaultDClickListener.java b/org.argeo.security.ui.admin/src/org/argeo/security/ui/admin/internal/providers/UserTableDefaultDClickListener.java
deleted file mode 100644 (file)
index 8f4a35a..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.argeo.security.ui.admin.internal.providers;
-
-import org.argeo.cms.CmsException;
-import org.argeo.eclipse.ui.workbench.WorkbenchUiPlugin;
-import org.argeo.security.ui.admin.internal.parts.UserEditor;
-import org.argeo.security.ui.admin.internal.parts.UserEditorInput;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.osgi.service.useradmin.Group;
-import org.osgi.service.useradmin.User;
-
-/**
- * Default double click listener for the various user tables, will open the
- * clicked item in the editor
- */
-public class UserTableDefaultDClickListener implements IDoubleClickListener {
-       public void doubleClick(DoubleClickEvent evt) {
-               if (evt.getSelection().isEmpty())
-                       return;
-               Object obj = ((IStructuredSelection) evt.getSelection())
-                               .getFirstElement();
-               User user = (User) obj;
-               IWorkbenchWindow iww = WorkbenchUiPlugin.getDefault().getWorkbench()
-                               .getActiveWorkbenchWindow();
-               IWorkbenchPage iwp = iww.getActivePage();
-               UserEditorInput uei = new UserEditorInput(user.getName());
-
-               try {
-                       // Works around the fact that dynamic setting of the editor icon
-                       // causes NPE after a login/logout on RAP
-                       if (user instanceof Group)
-                               iwp.openEditor(uei, UserEditor.GROUP_EDITOR_ID);
-                       else
-                               iwp.openEditor(uei, UserEditor.USER_EDITOR_ID);
-               } catch (PartInitException pie) {
-                       throw new CmsException("Unable to open UserEditor for " + user,
-                                       pie);
-               }
-       }
-}
\ No newline at end of file