- shell = new Shell(source.getDisplay(), SWT.NO_TRIM | SWT.BORDER
- | SWT.ON_TOP);
- shell.setData(RWT.CUSTOM_VARIANT, CMS_USER_MENU);
-
- if (isAnonymous()) {
- anonymousUi(shell);
- } else {
- userUi(shell);
- }
-
- shell.pack();
- shell.layout();
- if (autoclose)// popup
- shell.setLocation(source.toDisplay(
- source.getSize().x - shell.getSize().x, source.getSize().y));
- else // centered
- {
- Rectangle shellBounds = Display.getCurrent().getBounds();// RAP
- Point dialogSize = shell.getSize();
- int x = shellBounds.x + (shellBounds.width - dialogSize.x) / 2;
- int y = shellBounds.y + (shellBounds.height - dialogSize.y) / 2;
- shell.setLocation(x, y);
-
- }
- if (autoclose)
- shell.addShellListener(new ShellAdapter() {
- private static final long serialVersionUID = 5178980294808435833L;
-
- @Override
- public void shellDeactivated(ShellEvent e) {
- closeShell();
- }
- });
- shell.open();
-