Package docking.widgets
Class PasswordDialog
java.lang.Object
docking.DialogComponentProvider
docking.widgets.PasswordDialog
- All Implemented Interfaces:
ActionContextProvider
,StatusListener
,TaskListener
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
ConstructorsConstructorDescriptionPasswordDialog
(String title, String serverType, String serverName, String passPrompt) Construct a new PasswordDialog which only prompts for a password for a specified server type and name.PasswordDialog
(String title, String serverType, String serverName, String passPrompt, boolean hasMessages) Construct a new PasswordDialog which only prompts for a password for a specified server type and name.PasswordDialog
(String title, String serverType, String serverName, String passPrompt, boolean allowUserIdEntry, String userIdPrompt, String defaultUserId, boolean hasMessages) Construct a new PasswordDialog which may include user ID specification/prompt if eitherallowUserIdEntry
is true or a non-nulldefaultUserId
has been specified.PasswordDialog
(String title, String serverType, String serverName, String passPrompt, boolean allowUserIdEntry, String userIdPrompt, String defaultUserId, String choicePrompt, String[] choices, int defaultChoice, boolean includeAnonymousOption) Construct a new PasswordDialog which may include user ID specification/prompt, if eitherallowUserIdEntry
is true or a non-nulldefaultUserId
has been specified, and other optional elements. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true if anonymous access is requestedvoid
close()
void
dispose()
Disposes this dialog.int
Returns index of selected choice or -1 if no choice has been madechar[]
Return the password entered in the password field.Return the user ID / Name entered in the password fieldprotected void
The callback method for when the "OK" button is pressed.boolean
Returns true if the OK button was pressed.void
setErrorText
(String text) Display error statusMethods inherited from class docking.DialogComponentProvider
addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, closeDialog, createSharedActions, dialogClosed, dialogShown, dismissCallback, doInitialize, escapeCallback, executeProgressTask, getActionContext, getActions, getBackground, getBounds, getComponent, getDefaultButton, getDefaultSize, getDialogSize, getFocusComponent, getGlassPane, getHelpLocation, getId, getInitialLocation, getLocationOnScreen, getParent, getPreferredSize, getRememberLocation, getRememberSize, getStatusColor, getStatusLabel, getStatusText, getTaskMonitorComponent, getTaskScheduler, getTitle, getUseSharedLocation, hideTaskMonitorComponent, isApplyEnabled, isCancelEnabled, isDialogKeyBindingAction, isModal, isOKEnabled, isResizeable, isRunningTask, isShowing, isTransient, isVisible, notifyContextChanged, removeAction, removeButton, removeWorkPanel, repack, setAccessibleDescription, 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 Details
-
PasswordDialog
public PasswordDialog(String title, String serverType, String serverName, String passPrompt, boolean allowUserIdEntry, String userIdPrompt, String defaultUserId, String choicePrompt, String[] choices, int defaultChoice, boolean includeAnonymousOption) Construct a new PasswordDialog which may include user ID specification/prompt, if eitherallowUserIdEntry
is true or a non-nulldefaultUserId
has been specified, and other optional elements. The dialog includes a message text area which supports the use ofsetErrorText(String)
.- 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/empty, in which case "Password:" is displayed next to the password fieldallowUserIdEntry
- if true user ID entry will be supporteduserIdPrompt
- User ID / Name prompt to show in the dialog, if null "User ID:" is prompt if eitherallowUserIdEntry
is true or a non-nulldefaultUserId
has been specified.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
Construct a new PasswordDialog which only prompts for a password for a specified server type and name. The dialog will not include a User ID display, although server fields may be used for a similar display purpose. The dialog includes a message text area which supports the use ofsetErrorText(String)
.- 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 prompt.
-
PasswordDialog
public PasswordDialog(String title, String serverType, String serverName, String passPrompt, boolean hasMessages) Construct a new PasswordDialog which only prompts for a password for a specified server type and name. The dialog will not include a User ID display, although server fields may be used for a similar display purpose. The dialog optionally includes a message text area which supports the use ofsetErrorText(String)
.- 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 fieldhasMessages
- true if a message text area should be included allowing for use ofsetErrorText(String)
-
PasswordDialog
public PasswordDialog(String title, String serverType, String serverName, String passPrompt, boolean allowUserIdEntry, String userIdPrompt, String defaultUserId, boolean hasMessages) Construct a new PasswordDialog which may include user ID specification/prompt if eitherallowUserIdEntry
is true or a non-nulldefaultUserId
has been specified. The dialog optionally includes a message text area area which supports the use ofsetErrorText(String)
.- 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/empty, in which case "Password:" is displayed next to the password fieldallowUserIdEntry
- if true user ID entry will be supporteduserIdPrompt
- User ID / Name prompt to show in the dialog, if null "User ID:" is prompt if eitherallowUserIdEntry
is true or a non-nulldefaultUserId
has been specified.defaultUserId
- default name when prompting for a namehasMessages
- true if a message text area should be included allowing for use ofsetErrorText(String)
-
-
Method Details
-
setErrorText
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
Return the user ID / Name entered in the password field- Returns:
- the user ID / Name 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
-
close
public void close()- Overrides:
close
in classDialogComponentProvider
-
dispose
public void dispose()Description copied from class:DialogComponentProvider
Disposes this dialog. Only call this when the dialog is no longer used. Calling this method will close the dialog if it is open.- Overrides:
dispose
in classDialogComponentProvider
-