|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jdesktop.swingx.JXPanel
org.jdesktop.swingx.JXImagePanel
org.jdesktop.swingx.JXLoginPanel
public class JXLoginPanel
JXLoginPanel is a JPanel that implements a Login dialog with support for saving passwords supplied for future use in a secure manner. It is intended to work with LoginService and PasswordStore to implement the authentication.
In order to perform the authentication, JXLoginPanel
calls the authenticate
method of the LoginService
. In order to perform the persistence of the password,
JXLoginPanel calls the put method of the
PasswordStore object that is supplied. If
the PasswordStore is null
, then the password
is not saved. Similarly, if a PasswordStore is
supplied and the password is null, then the PasswordStore
will be queried for the password using the get
method.
Nested Class Summary | |
---|---|
static class |
JXLoginPanel.ComboNamePanel
If a UserNameStore is used, then this combo box is presented allowing the user to select a previous login name, or type in a new login name |
static class |
JXLoginPanel.JXLoginDialog
|
static class |
JXLoginPanel.JXLoginFrame
|
protected class |
JXLoginPanel.LoginListenerImpl
Listener class to track state in the LoginService |
static interface |
JXLoginPanel.NameComponent
|
static class |
JXLoginPanel.SaveMode
The JXLoginPanel can attempt to save certain user information such as the username, password, or both to their respective stores. |
static class |
JXLoginPanel.SimpleNamePanel
If a UserNameStore is not used, then this text field is presented allowing the user to simply enter their user name |
static class |
JXLoginPanel.Status
Returns the status of the login process |
Nested classes/interfaces inherited from class org.jdesktop.swingx.JXImagePanel |
---|
JXImagePanel.Style |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
CANCEL_LOGIN_ACTION_COMMAND
Action key for an Action in the ActionMap that cancels the Login procedure |
static String |
LOGIN_ACTION_COMMAND
Action key for an Action in the ActionMap that initiates the Login procedure |
static String |
uiClassID
UI Class ID |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JXLoginPanel()
Create a new JXLoginPanel |
|
JXLoginPanel(LoginService service)
Create a new JXLoginPanel |
|
JXLoginPanel(LoginService service,
PasswordStore passwordStore,
UserNameStore userStore)
Create a new JXLoginPanel |
|
JXLoginPanel(LoginService service,
PasswordStore passwordStore,
UserNameStore userStore,
List<String> servers)
Create a new JXLoginPanel |
Method Summary | |
---|---|
protected void |
cancelLogin()
Cancels the login procedure. |
protected Action |
createCancelAction()
Create and return an Action for canceling login |
protected Action |
createLoginAction()
Create and return an Action for logging in |
protected Image |
createLoginBanner()
Create and return an image to use for the Banner. |
Image |
getBanner()
Return the image used as the banner |
String |
getBannerText()
Returns text used when creating the banner |
String |
getErrorMessage()
Returns the error message for this login panel |
LoginService |
getLoginService()
Gets the LoginService for this panel. |
String |
getMessage()
Returns the custom message for this login panel |
char[] |
getPassword()
Gets the Password for this panel. |
PasswordStore |
getPasswordStore()
Gets the PasswordStore for this panel. |
JXLoginPanel.SaveMode |
getSaveMode()
|
List<String> |
getServers()
|
JXLoginPanel.Status |
getStatus()
Returns the panel's status |
LoginPanelUI |
getUI()
|
String |
getUIClassID()
Returns the name of the L&F class that renders this component. |
String |
getUserName()
Gets the User name for this panel. |
protected void |
recreateLoginPanel()
Recreates the login panel, and replaces the current one with the new one |
protected void |
savePassword()
TODO |
void |
setBanner(Image img)
Set the image to use for the banner |
void |
setBannerText(String text)
Set the text to use when creating the banner. |
void |
setComponentOrientation(ComponentOrientation orient)
This method adds functionality to support bidi languages within this component |
void |
setErrorMessage(String errorMessage)
Sets the error message for this login panel |
void |
setLoginService(LoginService service)
Sets the LoginService for this panel. |
void |
setMessage(String message)
Sets a custom message for this login panel |
void |
setPassword(char[] password)
Sets the Password for this panel. |
void |
setPasswordStore(PasswordStore store)
Sets the PasswordStore for this panel. |
void |
setSaveMode(JXLoginPanel.SaveMode saveMode)
The save mode indicates whether the "save" password is checked by default. |
void |
setServers(List<String> servers)
Sets the list of servers. |
protected void |
setStatus(JXLoginPanel.Status newStatus)
Change the status |
void |
setUserName(String username)
Sets the User name for this panel. |
static JXLoginPanel.Status |
showLoginDialog(Component parent,
JXLoginPanel panel)
Shows a login dialog. |
static JXLoginPanel.Status |
showLoginDialog(Component parent,
LoginService svc)
Shows a login dialog. |
static JXLoginPanel.Status |
showLoginDialog(Component parent,
LoginService svc,
PasswordStore ps,
UserNameStore us)
Shows a login dialog. |
static JXLoginPanel.Status |
showLoginDialog(Component parent,
LoginService svc,
PasswordStore ps,
UserNameStore us,
List<String> servers)
Shows a login dialog. |
static JXLoginPanel.JXLoginFrame |
showLoginFrame(JXLoginPanel panel)
|
static JXLoginPanel.JXLoginFrame |
showLoginFrame(LoginService svc)
Shows a login frame. |
static JXLoginPanel.JXLoginFrame |
showLoginFrame(LoginService svc,
PasswordStore ps,
UserNameStore us)
|
static JXLoginPanel.JXLoginFrame |
showLoginFrame(LoginService svc,
PasswordStore ps,
UserNameStore us,
List<String> servers)
|
protected void |
startLogin()
Initiates the login procedure. |
Methods inherited from class org.jdesktop.swingx.JXImagePanel |
---|
getImage, getPreferredSize, getStyle, isEditable, paintComponent, setEditable, setImage, setPreferredSize, setStyle |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String uiClassID
public static final String LOGIN_ACTION_COMMAND
public static final String CANCEL_LOGIN_ACTION_COMMAND
Constructor Detail |
---|
public JXLoginPanel()
public JXLoginPanel(LoginService service)
service
- The LoginService to use for logging inpublic JXLoginPanel(LoginService service, PasswordStore passwordStore, UserNameStore userStore)
service
- passwordStore
- userStore
- public JXLoginPanel(LoginService service, PasswordStore passwordStore, UserNameStore userStore, List<String> servers)
service
- passwordStore
- userStore
- servers
- Method Detail |
---|
public LoginPanelUI getUI()
getUI
in class JPanel
public String getUIClassID()
getUIClassID
in class JPanel
uiClassID
JComponent.getUIClassID()
,
UIDefaults.getUI(javax.swing.JComponent)
protected void recreateLoginPanel()
public void setComponentOrientation(ComponentOrientation orient)
setComponentOrientation
in class Component
protected Image createLoginBanner()
protected Action createLoginAction()
protected Action createCancelAction()
public JXLoginPanel.SaveMode getSaveMode()
public void setSaveMode(JXLoginPanel.SaveMode saveMode)
saveMode
- The saveMode to set either SAVE_NONE, SAVE_PASSWORD or SAVE_USERNAMEpublic List<String> getServers()
public void setServers(List<String> servers)
public void setLoginService(LoginService service)
service
- servicepublic LoginService getLoginService()
public void setPasswordStore(PasswordStore store)
store
- PasswordStorepublic PasswordStore getPasswordStore()
public void setUserName(String username)
username
- User namepublic String getUserName()
public void setPassword(char[] password)
password
- Passwordpublic char[] getPassword()
public Image getBanner()
public void setBanner(Image img)
public void setBannerText(String text)
public String getBannerText()
public String getMessage()
public void setMessage(String message)
public String getErrorMessage()
public void setErrorMessage(String errorMessage)
public JXLoginPanel.Status getStatus()
protected void setStatus(JXLoginPanel.Status newStatus)
protected void startLogin()
protected void cancelLogin()
protected void savePassword()
public static JXLoginPanel.Status showLoginDialog(Component parent, LoginService svc)
public static JXLoginPanel.Status showLoginDialog(Component parent, LoginService svc, PasswordStore ps, UserNameStore us)
public static JXLoginPanel.Status showLoginDialog(Component parent, LoginService svc, PasswordStore ps, UserNameStore us, List<String> servers)
public static JXLoginPanel.Status showLoginDialog(Component parent, JXLoginPanel panel)
public static JXLoginPanel.JXLoginFrame showLoginFrame(LoginService svc)
public static JXLoginPanel.JXLoginFrame showLoginFrame(LoginService svc, PasswordStore ps, UserNameStore us)
public static JXLoginPanel.JXLoginFrame showLoginFrame(LoginService svc, PasswordStore ps, UserNameStore us, List<String> servers)
public static JXLoginPanel.JXLoginFrame showLoginFrame(JXLoginPanel panel)
|
swingx Version 2005-08-19 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |