- public UserMenu(Control source) {
- super(source.getDisplay(), SWT.NO_TRIM | SWT.BORDER | SWT.ON_TOP);
- setData(RWT.CUSTOM_VARIANT, CMS_USER_MENU);
+ public UserMenu(Control source, boolean autoclose) {
+ shell = new Shell(source.getDisplay(), SWT.NO_TRIM | SWT.BORDER
+ | SWT.ON_TOP);
+ shell.setData(RWT.CUSTOM_VARIANT, CMS_USER_MENU);
+ // cmsView = (CmsView) shell.getDisplay().getData(CmsView.KEY);
+ cmsView = CmsUtils.getCmsView();
+
+ if (cmsView != null) {
+ String username = CurrentUser.getUsername(CmsUtils.getCmsView()
+ .getSubject());
+ if (username == null
+ || username.equalsIgnoreCase(AuthConstants.ROLE_ANONYMOUS)) {
+ username = null;
+ anonymousUi(shell);
+ } else {
+ userUi(shell);
+ }
+ } else {
+ anonymousUi(shell);
+ }