Remove unused package.
[lgpl/argeo-commons.git] / org.argeo.cms.ui / src / org / argeo / cms / util / UserMenu.java
index 58dea808695b2a9497e339d0bdd36625d8a352fa..58b470dc8c46e49884eb32290ef479f08fd63039 100644 (file)
@@ -1,5 +1,7 @@
 package org.argeo.cms.util;
 
+import javax.jcr.Node;
+
 import org.argeo.cms.CmsException;
 import org.argeo.cms.widgets.auth.CmsLoginShell;
 import org.eclipse.swt.SWT;
@@ -12,9 +14,11 @@ import org.eclipse.swt.widgets.Shell;
 /** The site-related user menu */
 public class UserMenu extends CmsLoginShell {
        private final Control source;
+       private final Node context;
 
-       public UserMenu(Control source) {
+       public UserMenu(Control source, Node context) {
                super(CmsUtils.getCmsView());
+               this.context = context;
                createUi();
                if (source == null)
                        throw new CmsException("Source control cannot be null.");
@@ -24,8 +28,7 @@ public class UserMenu extends CmsLoginShell {
 
        @Override
        protected Shell createShell() {
-               return new Shell(Display.getCurrent(), SWT.NO_TRIM | SWT.BORDER
-                               | SWT.ON_TOP);
+               return new Shell(Display.getCurrent(), SWT.NO_TRIM | SWT.BORDER | SWT.ON_TOP);
        }
 
        @Override
@@ -33,8 +36,7 @@ public class UserMenu extends CmsLoginShell {
                Shell shell = getShell();
                shell.pack();
                shell.layout();
-               shell.setLocation(source.toDisplay(source.getSize().x
-                               - shell.getSize().x, source.getSize().y));
+               shell.setLocation(source.toDisplay(source.getSize().x - shell.getSize().x, source.getSize().y));
                shell.addShellListener(new ShellAdapter() {
                        private static final long serialVersionUID = 5178980294808435833L;
 
@@ -46,4 +48,8 @@ public class UserMenu extends CmsLoginShell {
                super.open();
        }
 
+       protected Node getContext() {
+               return context;
+       }
+
 }