]>
git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms.ui/src/org/argeo/cms/util/UserMenu.java
a654dddd4054f7aa27b318352afe65d892a0ec29
1 package org
.argeo
.cms
.util
;
3 import org
.argeo
.cms
.CmsException
;
4 import org
.argeo
.cms
.widgets
.auth
.CmsLoginShell
;
5 import org
.eclipse
.swt
.SWT
;
6 import org
.eclipse
.swt
.events
.ShellAdapter
;
7 import org
.eclipse
.swt
.events
.ShellEvent
;
8 import org
.eclipse
.swt
.widgets
.Control
;
9 import org
.eclipse
.swt
.widgets
.Display
;
10 import org
.eclipse
.swt
.widgets
.Shell
;
12 /** The site-related user menu */
13 public class UserMenu
extends CmsLoginShell
{
14 private final Control source
;
16 public UserMenu(Control source
) {
17 super(CmsUtils
.getCmsView());
19 throw new CmsException("Source control cannot be null.");
25 protected Shell
createShell() {
26 return new Shell(Display
.getCurrent(), SWT
.NO_TRIM
| SWT
.BORDER
32 Shell shell
= getShell();
35 shell
.setLocation(source
.toDisplay(source
.getSize().x
36 - shell
.getSize().x
, source
.getSize().y
));
37 shell
.addShellListener(new ShellAdapter() {
38 private static final long serialVersionUID
= 5178980294808435833L;
41 public void shellDeactivated(ShellEvent e
) {