Package docking.widgets
Class PasswordDialog
- java.lang.Object
-
- docking.DialogComponentProvider
-
- docking.widgets.PasswordDialog
-
- All Implemented Interfaces:
ActionContextProvider
,StatusListener
,TaskListener
public class PasswordDialog extends DialogComponentProvider
PasswordDialog
is a modal dialog which prompts a user for a password.
-
-
Field Summary
-
Fields inherited from class docking.DialogComponentProvider
applyButton, buttonPanel, cancelButton, dismissButton, okButton, rootPanel
-
-
Constructor Summary
Constructors Constructor Description PasswordDialog(java.lang.String title, java.lang.String serverType, java.lang.String serverName, java.lang.String passPrompt, java.lang.String namePrompt, java.lang.String defaultUserID)
Construct a new PasswordDialog.PasswordDialog(java.lang.String title, java.lang.String serverType, java.lang.String serverName, java.lang.String passPrompt, java.lang.String namePrompt, java.lang.String defaultUserID, boolean hasMessages)
Construct a new PasswordDialog.PasswordDialog(java.lang.String title, java.lang.String serverType, java.lang.String serverName, java.lang.String passPrompt, java.lang.String namePrompt, java.lang.String defaultUserID, java.lang.String choicePrompt, java.lang.String[] choices, int defaultChoice, boolean includeAnonymousOption)
Construct a new PasswordDialog.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
anonymousAccessRequested()
Returns true if anonymous access is requestedvoid
dispose()
int
getChoice()
Returns index of selected choice or -1 if no choice has been madechar[]
getPassword()
Return the password entered in the password field.java.lang.String
getUserID()
Return the user ID entered in the password fieldprotected void
okCallback()
The callback method for when the "OK" button is pressed.boolean
okWasPressed()
Returns true if the OK button was pressed.void
setErrorText(java.lang.String text)
Display error status-
Methods inherited from class docking.DialogComponentProvider
addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, close, dialogClosed, dialogShown, dismissCallback, doInitialize, escapeCallback, executeProgressTask, getActionContext, getActions, getBackground, getBounds, getComponent, getDefaultButton, getDefaultSize, getDialogSize, getFocusComponent, getGlassPane, getHelpLocatdion, getId, getIntialLocation, getLocationOnScreen, getParent, getPreferredSize, getRemberSize, getRememberLocation, getStatusColor, getStatusLabel, getStatusText, getTaskMonitorComponent, getTaskScheduler, getTitle, getUseSharedLocation, hideTaskMonitorComponent, isApplyEnabled, isCancelEnabled, isModal, isOKEnabled, isResizeable, isRunningTask, isShowing, isTransient, isVisible, notifyContextChanged, removeAction, removeButton, removeWorkPanel, repack, setApplyEnabled, setApplyToolTip, setBackground, setCancelButtonText, setCancelEnabled, setCancelToolTip, setCursor, setDefaultButton, setDefaultSize, setDialogSize, setDismissToolTip, setFocusComponent, setGlassPane, setHelpLocation, setInitialLocation, setMinimumSize, setMinimumSize, setOkButtonText, setOkEnabled, setOkToolTip, setPreferredSize, setRememberLocation, setRememberSize, setResizable, setStatusJustification, setStatusText, setStatusText, setStatusText, setTitle, setTransient, setUseSharedLocation, showProgressBar, showTaskMonitorComponent, stopProgressTimer, taskCancelled, taskCompleted, toFront, toString, waitForCurrentTask
-
-
-
-
Constructor Detail
-
PasswordDialog
public PasswordDialog(java.lang.String title, java.lang.String serverType, java.lang.String serverName, java.lang.String passPrompt, java.lang.String namePrompt, java.lang.String defaultUserID, java.lang.String choicePrompt, java.lang.String[] choices, int defaultChoice, boolean includeAnonymousOption)
Construct a new PasswordDialog.- Parameters:
title
- title of the dialogserverType
- 'Server' or 'Key-store' designationserverName
- name of server or keystore pathnamepassPrompt
- password prompt to show in the dialog; may be null, in which case "Password:" is displayed next to the password fieldnamePrompt
- name prompt to show in the dialog, if null a name will not be prompted for.defaultUserID
- default name when prompting for a namechoicePrompt
- namePrompt name prompt to show in the dialog, if null a name will not be prompted for.choices
- array of choices to present if choicePrompt is not nulldefaultChoice
- default choice indexincludeAnonymousOption
- true signals to add a checkbox to request anonymous login
-
PasswordDialog
public PasswordDialog(java.lang.String title, java.lang.String serverType, java.lang.String serverName, java.lang.String passPrompt, java.lang.String namePrompt, java.lang.String defaultUserID)
Construct a new PasswordDialog.- Parameters:
title
- title of the dialogserverType
- 'Server' or 'Key-store' designationserverName
- name of server or keystore pathnamepassPrompt
- password prompt to show in the dialog; may be null, in which case "Password:" is displayed next to the password fieldnamePrompt
- name prompt to show in the dialog, if null a name will not be prompted for.defaultUserID
- default name when prompting for a name
-
PasswordDialog
public PasswordDialog(java.lang.String title, java.lang.String serverType, java.lang.String serverName, java.lang.String passPrompt, java.lang.String namePrompt, java.lang.String defaultUserID, boolean hasMessages)
Construct a new PasswordDialog.- Parameters:
title
- title of the dialogserverType
- 'Server' or 'Key-store' designationserverName
- name of server or keystore pathnamepassPrompt
- password prompt to show in the dialog; may be null, in which case "Password:" is displayed next to the password fieldnamePrompt
- name prompt to show in the dialog, if null a name will not be prompted for.defaultUserID
- default name when prompting for a namehasMessages
- true if the client will set messages on this dialog. If true, the dialog's minimum size will be increased
-
-
Method Detail
-
setErrorText
public void setErrorText(java.lang.String text)
Display error status- Parameters:
text
- the text
-
getPassword
public char[] getPassword()
Return the password entered in the password field.- Returns:
- the password chars
-
anonymousAccessRequested
public boolean anonymousAccessRequested()
Returns true if anonymous access is requested- Returns:
- true if anonymous access requested
-
getUserID
public java.lang.String getUserID()
Return the user ID entered in the password field- Returns:
- the user ID entered in the password field
-
getChoice
public int getChoice()
Returns index of selected choice or -1 if no choice has been made- Returns:
- index of selected choice or -1 if no choice has been made
-
okWasPressed
public boolean okWasPressed()
Returns true if the OK button was pressed.- Returns:
- true if the OK button was pressed.
-
okCallback
protected void okCallback()
Description copied from class:DialogComponentProvider
The callback method for when the "OK" button is pressed.- Overrides:
okCallback
in classDialogComponentProvider
-
dispose
public void dispose()
- Overrides:
dispose
in classDialogComponentProvider
-
-