Class LoginDialog
- java.lang.Object
-
- org.eclipse.nebula.widgets.opal.loginDialog.LoginDialog
-
public class LoginDialog extends java.lang.Object
Instances of this class are Login Dialog box, which is composed of- A login
- A password
- An image
- (optional)
- A description
- (optional)
- A checkbox "remember the password"
- (optional)
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<java.lang.String>
autorizedLogin
private org.eclipse.swt.widgets.Button
buttonOk
private java.lang.String
description
private boolean
displayRememberPassword
private org.eclipse.swt.graphics.Image
image
private java.lang.String
login
private java.lang.String
password
private boolean
rememberPassword
private boolean
returnedValue
private org.eclipse.swt.widgets.Shell
shell
private LoginDialogVerifier
verifier
-
Constructor Summary
Constructors Constructor Description LoginDialog()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
buildButtons()
Build the buttonsprivate void
buildCancelButton()
private void
buildDescription()
Build the description part of the boxprivate void
buildDialog()
Build the dialog boxprivate void
buildImage()
Build the image on top of the login box.private void
buildLogin()
Build the login part of the boxprivate void
buildLoginCombo()
private void
buildLoginText()
private void
buildOkButton()
private void
buildPassword()
Build the password part of the boxprivate void
buildRememberPassword()
Build the "remember password" part of the boxprivate void
buildShell()
Build the shellprivate void
changeButtonOkState()
Enable/Disable the button when the login and the password is empty (or not)private org.eclipse.swt.graphics.Image
createDefaultImage(int w, int h)
Create a default image.java.util.List<java.lang.String>
getAutorizedLogin()
java.lang.String
getDescription()
org.eclipse.swt.graphics.Image
getImage()
java.lang.String
getLogin()
java.lang.String
getPassword()
LoginDialogVerifier
getVerifier()
boolean
isDisplayRememberPassword()
boolean
isRememberPassword()
boolean
open()
Open the Login boxprivate void
openShell()
Open the shellvoid
setAutorizedLogin(java.lang.String... autorizedLogin)
void
setAutorizedLogin(java.util.List<java.lang.String> autorizedLogin)
void
setDescription(java.lang.String description)
void
setDisplayRememberPassword(boolean displayRememberPassword)
void
setImage(org.eclipse.swt.graphics.Image image)
void
setLogin(java.lang.String login)
void
setPassword(java.lang.String password)
void
setRememberPassword(boolean rememberPassword)
void
setVerifier(LoginDialogVerifier verifier)
-
-
-
Field Detail
-
image
private org.eclipse.swt.graphics.Image image
-
description
private java.lang.String description
-
login
private java.lang.String login
-
password
private java.lang.String password
-
autorizedLogin
private java.util.List<java.lang.String> autorizedLogin
-
displayRememberPassword
private boolean displayRememberPassword
-
rememberPassword
private boolean rememberPassword
-
verifier
private LoginDialogVerifier verifier
-
shell
private org.eclipse.swt.widgets.Shell shell
-
returnedValue
private boolean returnedValue
-
buttonOk
private org.eclipse.swt.widgets.Button buttonOk
-
-
Method Detail
-
open
public boolean open()
Open the Login box- Returns:
true
if the authentication is OK,false
if the user pressed on cancel.
-
buildDialog
private void buildDialog()
Build the dialog box
-
buildShell
private void buildShell()
Build the shell
-
buildImage
private void buildImage()
Build the image on top of the login box. If no image has been set, create a default image
-
createDefaultImage
private org.eclipse.swt.graphics.Image createDefaultImage(int w, int h)
Create a default image. It is a port of the image used by the Login Box in the project SwingX- Parameters:
w
- widthh
- height- Returns:
- a default image (blue wave)
-
buildDescription
private void buildDescription()
Build the description part of the box
-
buildLogin
private void buildLogin()
Build the login part of the box
-
buildLoginCombo
private void buildLoginCombo()
-
buildLoginText
private void buildLoginText()
-
buildPassword
private void buildPassword()
Build the password part of the box
-
changeButtonOkState
private void changeButtonOkState()
Enable/Disable the button when the login and the password is empty (or not)
-
buildRememberPassword
private void buildRememberPassword()
Build the "remember password" part of the box
-
buildButtons
private void buildButtons()
Build the buttons
-
buildOkButton
private void buildOkButton()
-
buildCancelButton
private void buildCancelButton()
-
openShell
private void openShell()
Open the shell
-
getImage
public org.eclipse.swt.graphics.Image getImage()
- Returns:
- the image
-
getDescription
public java.lang.String getDescription()
- Returns:
- the description
-
getLogin
public java.lang.String getLogin()
- Returns:
- the login
-
getPassword
public java.lang.String getPassword()
- Returns:
- the password
-
getAutorizedLogin
public java.util.List<java.lang.String> getAutorizedLogin()
- Returns:
- the list of autorized logins
-
isDisplayRememberPassword
public boolean isDisplayRememberPassword()
- Returns:
true
if the checkbox "remember the password" is displayed,false
otherwise
-
isRememberPassword
public boolean isRememberPassword()
- Returns:
true
if the checkbox "remember the password" is checked,false
otherwise
-
getVerifier
public LoginDialogVerifier getVerifier()
- Returns:
- the verifier associated to this box
-
setImage
public void setImage(org.eclipse.swt.graphics.Image image)
- Parameters:
image
- the image to set
-
setDescription
public void setDescription(java.lang.String description)
- Parameters:
description
- the description to set
-
setLogin
public void setLogin(java.lang.String login)
- Parameters:
login
- the login to set
-
setPassword
public void setPassword(java.lang.String password)
- Parameters:
password
- the password to set
-
setAutorizedLogin
public void setAutorizedLogin(java.util.List<java.lang.String> autorizedLogin)
- Parameters:
autorizedLogin
- the list of autorized logins to set
-
setAutorizedLogin
public void setAutorizedLogin(java.lang.String... autorizedLogin)
- Parameters:
autorizedLogin
- the list of autorized logins to set
-
setDisplayRememberPassword
public void setDisplayRememberPassword(boolean displayRememberPassword)
- Parameters:
displayRememberPassword
- iftrue
, the checkbox "remember the password" is displayed
-
setRememberPassword
public void setRememberPassword(boolean rememberPassword)
- Parameters:
rememberPassword
- iftrue
, the checkbox "remember the password" is selected
-
setVerifier
public void setVerifier(LoginDialogVerifier verifier)
- Parameters:
verifier
- the verifier to set
-
-