com.isti.util.propertyeditor
Class LoginPropertyEditor

java.lang.Object
  extended by java.beans.PropertyEditorSupport
      extended by com.isti.util.propertyeditor.AbstractPropertyEditor
          extended by com.isti.util.propertyeditor.ShowDialogPropertyEditor
              extended by com.isti.util.propertyeditor.LoginPropertyEditor
All Implemented Interfaces:
java.beans.PropertyEditor

public class LoginPropertyEditor
extends ShowDialogPropertyEditor

A PropertyEditor for a login username and password.


Field Summary
static java.lang.String DEF_TITLE_STR
          The default title string.
protected  java.util.Vector listenerList
          The listener list.
 
Constructor Summary
LoginPropertyEditor()
          Creates a login property editor.
LoginPropertyEditor(java.awt.Component parentCompObj)
          Creates a login property editor.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener l)
          Adds an ActionListener to the button.
 IstiPasswordDialog createDialog(java.awt.Component parent)
          Creates up the dialog.
 IstiPasswordDialog createDialog(java.awt.Component parent, java.lang.String panelPromptStr)
          Creates up the dialog.
static LoginInformation createLoginInformation(LoginInformation loginInformationObj, java.lang.String text)
          Creates login information for the specified text.
static LoginInformation createLoginInformation(LoginInformation loginInformationObj, java.lang.String usernameText, java.lang.String passwordText)
          Creates login information for the specified user name and password.
protected  void fireActionPerformed(java.awt.event.ActionEvent event)
          Notifies all listeners that have registered interest for notification on this event type.
 java.lang.String getAsText()
          Returns value as a String.
 java.awt.Component getCustomEditor()
          Returns the editor GUI component.
 boolean getDialogModalFlag()
          Returns the dialog modal flag.
 java.lang.String getLoginDialogMsgStr()
          Returns the message string to be shown in the login dialog.
 LoginInformation getLoginInformation()
          Gets the login information.
 java.lang.String getPasswordText()
          Gets the password text.
 java.lang.String getUsernameText()
          Gets the username text.
 java.lang.Object getValue()
          Returns value.
 void removeActionListener(java.awt.event.ActionListener l)
          Removes an ActionListener from the button.
 void setAsText(java.lang.String text)
          Sets value as text.
 void setDialogModalFlag(boolean flgVal)
          Sets the dialog modal flag.
 void setLoginDialogMsgStr(java.lang.String str)
          Sets a message string to be shown in the login dialog.
protected  void setLoginInformation(java.lang.String usernameText, java.lang.String passwordText)
          Sets the login information.
static void setupDialog(LoginInformation loginInformationObj, IstiPasswordDialog dialogObj)
          Sets up the dialog.
 void setValue(LoginInformation loginInformationObj)
          Sets the login information.
 void setValue(java.lang.Object someObj)
          Sets the login information.
 boolean showEditorDialog()
          Displays the login dialog.
 boolean showEditorDialog(java.awt.Component parentComp, java.lang.String panelPromptStr)
          Displays the login dialog.
 boolean showEditorDialog(java.lang.String panelPromptStr)
          Displays the login dialog.
 boolean supportsCustomEditor()
          Determines whether the propertyeditor can provide a custom editor.
 
Methods inherited from class java.beans.PropertyEditorSupport
addPropertyChangeListener, firePropertyChange, getJavaInitializationString, getSource, getTags, isPaintable, paintValue, removePropertyChangeListener, setSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEF_TITLE_STR

public static final java.lang.String DEF_TITLE_STR
The default title string.

See Also:
Constant Field Values

listenerList

protected final java.util.Vector listenerList
The listener list.

Constructor Detail

LoginPropertyEditor

public LoginPropertyEditor()
Creates a login property editor.


LoginPropertyEditor

public LoginPropertyEditor(java.awt.Component parentCompObj)
Creates a login property editor.

Parameters:
parentCompObj - the default parent component for the password dialog, or null for none.
Method Detail

setDialogModalFlag

public void setDialogModalFlag(boolean flgVal)
Sets the dialog modal flag. This determines whether or not the password dialod will be modal. The default is non-modal (allows other windows to operate).

Parameters:
flgVal - true for modal, false for non-modal (modeless).

getDialogModalFlag

public boolean getDialogModalFlag()
Returns the dialog modal flag. This indicates whether or not the password dialod will be modal.

Returns:
true for modal, false for non-modal (modeless).

showEditorDialog

public boolean showEditorDialog()
Displays the login dialog.

Specified by:
showEditorDialog in class ShowDialogPropertyEditor
Returns:
true if the user closed the dialog by selected the "OK" button; false if not.

showEditorDialog

public boolean showEditorDialog(java.lang.String panelPromptStr)
Displays the login dialog.

Specified by:
showEditorDialog in class ShowDialogPropertyEditor
Parameters:
panelPromptStr - the "prompt" text to be shown on the panel, or null for none.
Returns:
true if the user closed the dialog by selected the "OK" button; false if not.

showEditorDialog

public boolean showEditorDialog(java.awt.Component parentComp,
                                java.lang.String panelPromptStr)
Displays the login dialog.

Parameters:
parentComp - the parent component to use, or null to use the default parent component.
panelPromptStr - the "prompt" text to be shown on the panel, or null for none.
Returns:
true if the user closed the dialog by selected the "OK" button; false if not.

addActionListener

public void addActionListener(java.awt.event.ActionListener l)
Adds an ActionListener to the button.

Specified by:
addActionListener in class AbstractPropertyEditor
Parameters:
l - the ActionListener to be added

createDialog

public IstiPasswordDialog createDialog(java.awt.Component parent,
                                       java.lang.String panelPromptStr)
Creates up the dialog.

Parameters:
parent - the parent of the dialog or null for none.
panelPromptStr - the "prompt" text to be shown on the panel, or null for none.
Returns:
the dialog.

createDialog

public IstiPasswordDialog createDialog(java.awt.Component parent)
Creates up the dialog.

Parameters:
parent - the parent of the dialog or null for none.
Returns:
the dialog.

createLoginInformation

public static LoginInformation createLoginInformation(LoginInformation loginInformationObj,
                                                      java.lang.String text)
Creates login information for the specified text.

Parameters:
loginInformationObj - the current login information.
text - the text.
Returns:
the new login information or null if error.

createLoginInformation

public static LoginInformation createLoginInformation(LoginInformation loginInformationObj,
                                                      java.lang.String usernameText,
                                                      java.lang.String passwordText)
Creates login information for the specified user name and password.

Parameters:
loginInformationObj - the current login information.
usernameText - the user name text.
passwordText - the password text.
Returns:
the new login information or null if error.

getAsText

public java.lang.String getAsText()
Returns value as a String.

Specified by:
getAsText in interface java.beans.PropertyEditor
Overrides:
getAsText in class java.beans.PropertyEditorSupport
Returns:
the value as a string

getCustomEditor

public java.awt.Component getCustomEditor()
Returns the editor GUI component.

Specified by:
getCustomEditor in interface java.beans.PropertyEditor
Overrides:
getCustomEditor in class java.beans.PropertyEditorSupport
Returns:
component for editor.

getLoginInformation

public LoginInformation getLoginInformation()
Gets the login information.

Returns:
the login information.

getPasswordText

public java.lang.String getPasswordText()
Gets the password text.

Returns:
the password text.

getUsernameText

public java.lang.String getUsernameText()
Gets the username text.

Returns:
the username text.

getValue

public java.lang.Object getValue()
Returns value.

Specified by:
getValue in interface java.beans.PropertyEditor
Overrides:
getValue in class java.beans.PropertyEditorSupport
Returns:
the value

removeActionListener

public void removeActionListener(java.awt.event.ActionListener l)
Removes an ActionListener from the button. If the listener is the currently set Action for the button, then the Action is set to null.

Specified by:
removeActionListener in class AbstractPropertyEditor
Parameters:
l - the listener to be removed

setAsText

public void setAsText(java.lang.String text)
Sets value as text.

Specified by:
setAsText in interface java.beans.PropertyEditor
Overrides:
setAsText in class java.beans.PropertyEditorSupport
Parameters:
text - value

setupDialog

public static void setupDialog(LoginInformation loginInformationObj,
                               IstiPasswordDialog dialogObj)
Sets up the dialog.

Parameters:
loginInformationObj - the login information.
dialogObj - the dialog object.
See Also:
createDialog

setValue

public void setValue(LoginInformation loginInformationObj)
Sets the login information.

Parameters:
loginInformationObj - the login information.

setValue

public void setValue(java.lang.Object someObj)
Sets the login information.

Specified by:
setValue in interface java.beans.PropertyEditor
Overrides:
setValue in class java.beans.PropertyEditorSupport
Parameters:
someObj - the login information.

supportsCustomEditor

public boolean supportsCustomEditor()
Determines whether the propertyeditor can provide a custom editor.

Specified by:
supportsCustomEditor in interface java.beans.PropertyEditor
Overrides:
supportsCustomEditor in class java.beans.PropertyEditorSupport
Returns:
true

fireActionPerformed

protected void fireActionPerformed(java.awt.event.ActionEvent event)
Notifies all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.

Parameters:
event - the ChangeEvent object
See Also:
EventListenerList

setLoginInformation

protected void setLoginInformation(java.lang.String usernameText,
                                   java.lang.String passwordText)
Sets the login information.

Parameters:
usernameText - the user name text.
passwordText - the password text.

setLoginDialogMsgStr

public void setLoginDialogMsgStr(java.lang.String str)
Sets a message string to be shown in the login dialog. If a prompt string is given via the 'showEditorDialog()' method then this message string will be appended to the prompt string.

Specified by:
setLoginDialogMsgStr in class ShowDialogPropertyEditor
Parameters:
str - the message string to show, or null for none.

getLoginDialogMsgStr

public java.lang.String getLoginDialogMsgStr()
Returns the message string to be shown in the login dialog.

Specified by:
getLoginDialogMsgStr in class ShowDialogPropertyEditor
Returns:
The message string to be shown in the login dialog, or null if none was given.