]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms/src/org/argeo/cms/widgets/auth/CmsLoginShell.java
Disable request for basic auth
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / widgets / auth / CmsLoginShell.java
1 package org.argeo.cms.widgets.auth;
2
3 import org.argeo.cms.CmsView;
4 import org.eclipse.rap.rwt.RWT;
5 import org.eclipse.swt.SWT;
6 import org.eclipse.swt.widgets.Display;
7 import org.eclipse.swt.widgets.Shell;
8
9 /** The site-related user menu */
10 public class CmsLoginShell extends CmsLogin {
11 private final Shell shell;
12
13 public CmsLoginShell(CmsView cmsView) {
14 super(cmsView);
15 shell = createShell();
16 shell.setData(RWT.CUSTOM_VARIANT, CMS_USER_MENU);
17 createUi(shell);
18 }
19
20 /** To be overridden. */
21 protected Shell createShell() {
22 Shell shell = new Shell(Display.getCurrent(), SWT.NO_TRIM);
23 shell.setMaximized(true);
24 return shell;
25 }
26
27 /** To be overridden. */
28 public void open() {
29 shell.open();
30 }
31
32 @Override
33 protected void login() {
34 super.login();
35 closeShell();
36 }
37
38 @Override
39 protected void logout() {
40 closeShell();
41 super.logout();
42 }
43
44 protected void closeShell() {
45 shell.close();
46 shell.dispose();
47 }
48
49 public Shell getShell() {
50 return shell;
51 }
52 }