RSE
Release 1.0

org.eclipse.rse.connectorservice.ssh
Class UserValidationDialog

java.lang.Object
  extended byorg.eclipse.jface.window.Window
      extended byorg.eclipse.jface.dialogs.Dialog
          extended byorg.eclipse.jface.dialogs.TrayDialog
              extended byorg.eclipse.rse.connectorservice.ssh.UserValidationDialog
All Implemented Interfaces:
IShellProvider

public class UserValidationDialog
extends TrayDialog

A dialog for prompting for a username and password


Nested Class Summary
 
Nested classes inherited from class org.eclipse.jface.window.Window
Window.IExceptionHandler
 
Field Summary
protected  boolean allowCaching
           
protected  Button allowCachingButton
           
protected  String defaultUsername
           
protected  String domain
           
protected  boolean isUsernameMutable
           
protected  Image keyLockImage
           
protected  String message
           
protected  String password
           
protected  Text passwordField
           
protected  String username
           
protected  Text usernameField
           
 
Fields inherited from class org.eclipse.jface.dialogs.Dialog
blockedHandler, buttonBar, DIALOG_DEFAULT_BOUNDS, DIALOG_PERSISTLOCATION, DIALOG_PERSISTSIZE, dialogArea, DLG_IMG_ERROR, DLG_IMG_HELP, DLG_IMG_INFO, DLG_IMG_MESSAGE_ERROR, DLG_IMG_MESSAGE_INFO, DLG_IMG_MESSAGE_WARNING, DLG_IMG_QUESTION, DLG_IMG_WARNING, ELLIPSIS
 
Fields inherited from class org.eclipse.jface.window.Window
CANCEL, OK
 
Constructor Summary
UserValidationDialog(Shell parentShell, String location, String defaultName, String message)
          Creates a new UserValidationDialog.
 
Method Summary
 boolean close()
           
protected  void configureShell(Shell newShell)
           
 void create()
           
protected  Control createDialogArea(Composite parent)
           
protected  void createPasswordFields(Composite parent)
          Creates the three widgets that represent the password entry area.
protected  void createUsernameFields(Composite parent)
          Creates the three widgets that represent the user name entry area.
 boolean getAllowCaching()
          Returns true if the save password checkbox was selected.
 String getPassword()
          Returns the password entered by the user, or null if the user canceled.
 String getUsername()
          Returns the username entered by the user, or null if the user canceled.
protected  void okPressed()
          Notifies that the ok button of this dialog has been pressed.
 void setUsernameMutable(boolean value)
          Sets whether or not the username field should be mutable.
 
Methods inherited from class org.eclipse.jface.dialogs.TrayDialog
closeTray, createButtonBar, createHelpControl, getLayout, getTray, isDialogHelpAvailable, isHelpAvailable, openTray, setDialogHelpAvailable, setHelpAvailable
 
Methods inherited from class org.eclipse.jface.dialogs.Dialog
applyDialogFont, buttonPressed, cancelPressed, convertHeightInCharsToPixels, convertHeightInCharsToPixels, convertHorizontalDLUsToPixels, convertHorizontalDLUsToPixels, convertVerticalDLUsToPixels, convertVerticalDLUsToPixels, convertWidthInCharsToPixels, convertWidthInCharsToPixels, createButton, createButtonsForButtonBar, createContents, dialogFontIsDefault, getBlockedHandler, getButton, getButtonBar, getCancelButton, getDialogArea, getDialogBoundsSettings, getDialogBoundsStrategy, getImage, getInitialLocation, getInitialSize, getOKButton, initializeBounds, initializeDialogUnits, setBlockedHandler, setButtonLayoutData, setButtonLayoutFormData, shortenText
 
Methods inherited from class org.eclipse.jface.window.Window
canHandleShellCloseEvent, constrainShellSize, createShell, getConstrainedShellBounds, getContents, getDefaultImage, getDefaultImages, getDefaultOrientation, getParentShell, getReturnCode, getShell, getShellListener, getShellStyle, getWindowManager, handleFontChange, handleShellCloseEvent, open, setBlockOnOpen, setDefaultImage, setDefaultImages, setDefaultModalParent, setDefaultOrientation, setExceptionHandler, setParentShell, setReturnCode, setShellStyle, setWindowManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

usernameField

protected Text usernameField

passwordField

protected Text passwordField

allowCachingButton

protected Button allowCachingButton

domain

protected String domain

defaultUsername

protected String defaultUsername

password

protected String password

allowCaching

protected boolean allowCaching

keyLockImage

protected Image keyLockImage

isUsernameMutable

protected boolean isUsernameMutable

username

protected String username

message

protected String message
Constructor Detail

UserValidationDialog

public UserValidationDialog(Shell parentShell,
                            String location,
                            String defaultName,
                            String message)
Creates a new UserValidationDialog.

Parameters:
parentShell - the parent shell
location - the location
defaultName - the default user name
message - a mesage to display to the user
Method Detail

configureShell

protected void configureShell(Shell newShell)
See Also:
Window.configureShell(org.eclipse.swt.widgets.Shell)

create

public void create()
See Also:
Window.create()

createDialogArea

protected Control createDialogArea(Composite parent)
See Also:
Dialog.createDialogArea(org.eclipse.swt.widgets.Composite)

createPasswordFields

protected void createPasswordFields(Composite parent)
Creates the three widgets that represent the password entry area.

Parameters:
parent - the parent of the widgets

createUsernameFields

protected void createUsernameFields(Composite parent)
Creates the three widgets that represent the user name entry area.

Parameters:
parent - the parent of the widgets

getPassword

public String getPassword()
Returns the password entered by the user, or null if the user canceled.

Returns:
the entered password

getUsername

public String getUsername()
Returns the username entered by the user, or null if the user canceled.

Returns:
the entered username

getAllowCaching

public boolean getAllowCaching()
Returns true if the save password checkbox was selected.

Returns:
true if the save password checkbox was selected and false otherwise.

okPressed

protected void okPressed()
Notifies that the ok button of this dialog has been pressed.

The default implementation of this framework method sets this dialog's return code to Window.OK and closes the dialog. Subclasses may override.


setUsernameMutable

public void setUsernameMutable(boolean value)
Sets whether or not the username field should be mutable. This method must be called before create(), otherwise it will be ignored.

Parameters:
value - whether the username is mutable

close

public boolean close()

RSE
Release 1.0

Copyright (c) IBM Corporation and others 2000, 2006. All Rights Reserved.