jhomenet.server.auth.swingx
Class JHSLoginPanel

java.lang.Object
  extended by JXPanel
      extended by jhomenet.server.auth.swingx.JHSLoginPanel

public class JHSLoginPanel
extends JXPanel

TODO: Class description.

Id: $Id: $

Author:
Dave Irwin (jhomenet at gmail dot com)

Nested Class Summary
static class JHSLoginPanel.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
protected  class JHSLoginPanel.LoginListenerImpl
          Listener class to track state in the LoginService.
static interface JHSLoginPanel.NameComponent
           
static class JHSLoginPanel.SaveMode
          The JXLoginPanel can attempt to save certain user information such as the username, password, or both to their respective stores.
static class JHSLoginPanel.SimpleNamePanel
          If a UserNameStore is not used, then this text field is presented allowing the user to simply enter their user name
static class JHSLoginPanel.Status
          Returns the status of the login process
 
Field Summary
static java.lang.String CANCEL_LOGIN_ACTION_COMMAND
          Action key for an Action in the ActionMap that cancels the Login procedure
static java.lang.String LOGIN_ACTION_COMMAND
          Action key for an Action in the ActionMap that initiates the Login procedure
 
Constructor Summary
JHSLoginPanel()
           
JHSLoginPanel(JHSLoginService loginService)
           
JHSLoginPanel(JHSLoginService loginService, PasswordStore ps, UserNameStore us)
           
JHSLoginPanel(JHSLoginService loginService, PasswordStore passwordStore, UserNameStore userStore, java.util.List<java.lang.String> servers)
           
 
Method Summary
protected  void cancelLogin()
          Cancels the login procedure.
protected  javax.swing.Action createCancelAction()
          Create and return an Action for canceling login
protected  javax.swing.Action createLoginAction()
          Create and return an Action for logging in
 JHSLoginService getLoginService()
          Gets the LoginService for this panel.
 char[] getPassword()
          Gets the Password for this panel.
 PasswordStore getPasswordStore()
          Gets the PasswordStore for this panel.
 JHSLoginPanel.SaveMode getSaveMode()
           
 java.util.List<java.lang.String> getServers()
           
 JHSLoginPanel.Status getStatus()
          Returns the panel's status
 java.lang.String getUserName()
          Gets the User name for this panel.
protected  void recreateLoginPanel()
           
protected  void replacePanels(JXPanel panelToRemove, JXPanel panelToAdd)
           
protected  void savePassword()
          TODO
 void setLoginService(JHSLoginService service)
          Sets the LoginService for this panel.
 void setPassword(char[] password)
          Sets the Password for this panel.
 void setPasswordStore(PasswordStore store)
          Sets the PasswordStore for this panel.
 void setSaveMode(JHSLoginPanel.SaveMode saveMode)
          The save mode indicates whether the "save" password is checked by default.
 void setServers(java.util.List<java.lang.String> servers)
          Sets the list of servers.
protected  void setStatus(JHSLoginPanel.Status newStatus)
          Change the status
 void setUserName(java.lang.String username)
          Sets the User name for this panel.
protected  void startLogin()
          Initiates the login procedure.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGIN_ACTION_COMMAND

public static final java.lang.String LOGIN_ACTION_COMMAND
Action key for an Action in the ActionMap that initiates the Login procedure

See Also:
Constant Field Values

CANCEL_LOGIN_ACTION_COMMAND

public static final java.lang.String CANCEL_LOGIN_ACTION_COMMAND
Action key for an Action in the ActionMap that cancels the Login procedure

See Also:
Constant Field Values
Constructor Detail

JHSLoginPanel

public JHSLoginPanel()

JHSLoginPanel

public JHSLoginPanel(JHSLoginService loginService)
Parameters:
service -

JHSLoginPanel

public JHSLoginPanel(JHSLoginService loginService,
                     PasswordStore ps,
                     UserNameStore us)
Parameters:
service -
ps -
us -

JHSLoginPanel

public JHSLoginPanel(JHSLoginService loginService,
                     PasswordStore passwordStore,
                     UserNameStore userStore,
                     java.util.List<java.lang.String> servers)
Parameters:
service -
passwordStore -
userStore -
servers -
Method Detail

recreateLoginPanel

protected void recreateLoginPanel()

replacePanels

protected void replacePanels(JXPanel panelToRemove,
                             JXPanel panelToAdd)
Parameters:
panelToRemove -
panelToAdd -

getSaveMode

public JHSLoginPanel.SaveMode getSaveMode()
Returns:
Returns the saveMode.

setSaveMode

public void setSaveMode(JHSLoginPanel.SaveMode saveMode)
The save mode indicates whether the "save" password is checked by default. This method makes no difference if the passwordStore is null.

Parameters:
saveMode - The saveMode to set either SAVE_NONE, SAVE_PASSWORD or SAVE_USERNAME

getServers

public java.util.List<java.lang.String> getServers()
Returns:
the List of servers

setServers

public void setServers(java.util.List<java.lang.String> servers)
Sets the list of servers. See the servers field javadoc for more info


setLoginService

public void setLoginService(JHSLoginService service)
Sets the LoginService for this panel.

Parameters:
service - service

getLoginService

public JHSLoginService getLoginService()
Gets the LoginService for this panel.

Returns:
service service

setPasswordStore

public void setPasswordStore(PasswordStore store)
Sets the PasswordStore for this panel.

Parameters:
store - PasswordStore

getPasswordStore

public PasswordStore getPasswordStore()
Gets the PasswordStore for this panel.

Returns:
store PasswordStore

setUserName

public void setUserName(java.lang.String username)
Sets the User name for this panel.

Parameters:
username - User name

getUserName

public java.lang.String getUserName()
Gets the User name for this panel.

Returns:
the user name

setPassword

public void setPassword(char[] password)
Sets the Password for this panel.

Parameters:
password - Password

getPassword

public char[] getPassword()
Gets the Password for this panel.

Returns:
password Password

getStatus

public JHSLoginPanel.Status getStatus()
Returns the panel's status


setStatus

protected void setStatus(JHSLoginPanel.Status newStatus)
Change the status


createLoginAction

protected javax.swing.Action createLoginAction()
Create and return an Action for logging in


createCancelAction

protected javax.swing.Action createCancelAction()
Create and return an Action for canceling login


startLogin

protected void startLogin()
Initiates the login procedure. This method is called internally by the LoginAction. This method handles cursor management, and actually calling the LoginService's startAuthentication method.


cancelLogin

protected void cancelLogin()
Cancels the login procedure. Handles cursor management and interfacing with the LoginService's cancelAuthentication method


savePassword

protected void savePassword()
TODO



Copyright © 2004-2007 David Irwin. All Rights Reserved.