Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.rse.ui.preferences
Class InputDialog

java.lang.Object
  extended by Dialog
      extended by com.ibm.etools.iseries.rse.ui.preferences.InputDialog

public class InputDialog
extends Dialog

A simple input dialog for soliciting an input string from the user.

This concete dialog class can be instantiated as is, or further subclassed as required.

This is a copy of the JFace InputDialog class, with a text limit feature.


Field Summary
protected  int _iTextLimit
           
static String Copyright
           
protected  Label errorMessageLabel
          Error message label widget.
protected  String helpContext
          The help context for the dialog
protected  String message
          The message to display, or null if none.
protected  Button okButton
          Ok button widget.
protected  Text text
          Input text widget.
protected  String title
          The title of the dialog.
protected  String tooltipText
          The text to use for the entry field tooltip
protected  IInputValidator validator
          The input validator, or null if none.
protected  String value
          The input value; the empty string by default.
 
Constructor Summary
InputDialog(Shell parentShell, String dialogTitle, String dialogMessage, String initialValue, IInputValidator validator)
          Creates an input dialog with OK and Cancel buttons.
InputDialog(Shell parentShell, String dialogTitle, String dialogMessage, String initialValue, String tooltip, String helpContext, IInputValidator validator)
          Creates an input dialog with OK and Cancel buttons.
 
Method Summary
protected  void buttonPressed(int buttonId)
           
protected  void configureShell(Shell shell)
           
protected  void createButtonsForButtonBar(Composite parent)
           
protected  Control createDialogArea(Composite parent)
           
protected  Label getErrorMessageLabel()
          Returns the error message label.
protected  Button getOkButton()
          Returns the ok button.
protected  Text getText()
          Returns the text area.
protected  IInputValidator getValidator()
          Returns the validator.
 String getValue()
          Returns the string typed into this input dialog.
 void setTextLimit(int iTextLimit)
           
protected  void validateInput()
          Validates the input.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

_iTextLimit

protected int _iTextLimit

title

protected String title
The title of the dialog.


message

protected String message
The message to display, or null if none.


value

protected String value
The input value; the empty string by default.


validator

protected IInputValidator validator
The input validator, or null if none.


okButton

protected Button okButton
Ok button widget.


text

protected Text text
Input text widget.


errorMessageLabel

protected Label errorMessageLabel
Error message label widget.


tooltipText

protected String tooltipText
The text to use for the entry field tooltip


helpContext

protected String helpContext
The help context for the dialog

Constructor Detail

InputDialog

public InputDialog(Shell parentShell,
                   String dialogTitle,
                   String dialogMessage,
                   String initialValue,
                   IInputValidator validator)
Creates an input dialog with OK and Cancel buttons. Note that the dialog will have no visual representation (no widgets) until it is told to open.

Note that the open method blocks for input dialogs.

Parameters:
parentShell - the parent shell
dialogTitle - the dialog title, or null if none
dialogMessage - the dialog message, or null if none
initialValue - the initial input value, or null if none (equivalent to the empty string)
validator - an input validator, or null if none

InputDialog

public InputDialog(Shell parentShell,
                   String dialogTitle,
                   String dialogMessage,
                   String initialValue,
                   String tooltip,
                   String helpContext,
                   IInputValidator validator)
Creates an input dialog with OK and Cancel buttons. Note that the dialog will have no visual representation (no widgets) until it is told to open.

Note that the open method blocks for input dialogs.

Parameters:
parentShell - the parent shell
dialogTitle - the dialog title, or null if none
dialogMessage - the dialog message, or null if none
initialValue - the initial input value, or null if none (equivalent to the empty string)
tooltip - tooltip text for the entry field
helpContext - the help context to use for this dialog
validator - an input validator, or null if none
Method Detail

buttonPressed

protected void buttonPressed(int buttonId)

configureShell

protected void configureShell(Shell shell)

createButtonsForButtonBar

protected void createButtonsForButtonBar(Composite parent)

createDialogArea

protected Control createDialogArea(Composite parent)

getErrorMessageLabel

protected Label getErrorMessageLabel()
Returns the error message label.

Returns:
the error message label

getOkButton

protected Button getOkButton()
Returns the ok button.

Returns:
the ok button

getText

protected Text getText()
Returns the text area.

Returns:
the text area

getValidator

protected IInputValidator getValidator()
Returns the validator.

Returns:
the validator

getValue

public String getValue()
Returns the string typed into this input dialog.

Returns:
the input string

validateInput

protected void validateInput()
Validates the input.

The default implementation of this framework method delegates the request to the supplied input validator object; if it finds the input invalid, the error message is displayed in the dialog's message line. This hook method is called whenever the text changes in the input field.


setTextLimit

public void setTextLimit(int iTextLimit)

Rational Developer for Power Systems Software
V7.6

Copyright © 2011 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.