Package docking.widgets.dialogs

# Class InputDialog

java.lang.Object
docking.DialogComponentProvider
docking.widgets.dialogs.InputDialog

All Implemented Interfaces:
  `ActionContextProvider`, `StatusListener`, `TaskListener`

public class InputDialog extends DialogComponentProvider
A dialog that has text fields to get user input.

- ## Field Summary

  ### Fields inherited from class docking.DialogComponentProvider

  `applyButton, buttonPanel, cancelButton, dismissButton, okButton, rootPanel`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InputDialog(String dialogTitle, String label)`
  Creates a provider for a generic input dialog with the specified title, a text field, labeled by the specified label.
  `InputDialog(String dialogTitle, String[] labels, String[] initialValues)`
  Creates a generic input dialog with the specified title, a text field, labeled by the specified label.
  `InputDialog(String dialogTitle, String[] labels, String[] initialValues, InputDialogListener listener)`
  Creates a generic input dialog with the specified title, a text field, labeled by the specified label.
  `InputDialog(String dialogTitle, String label, String initialValue)`
  Creates a generic input dialog with the specified title, a text field, labeled by the specified label.
  `InputDialog(String dialogTitle, String label, String initialValue, boolean isModal)`
  Creates a generic input dialog with the specified title, a text field, labeled by the specified label.
  `InputDialog(String dialogTitle, String label, String initialValue, InputDialogListener listener)`
  Creates a generic input dialog with the specified title, a text field, labeled by the specified label.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected void`
  `cancelCallback()`
  The callback method for when the "Cancel" button is pressed.
  `String`
  `getValue()`
  Return the value of the first (and maybe only) text field
  `String[]`
  `getValues()`
  Return the values for all the text field(s)
  `boolean`
  `isCanceled()`
  Returns if this dialog is cancelled
  `protected void`
  `okCallback()`
  The callback method for when the "OK" button is pressed.
  `void`
  `setValue(String text)`
  Sets the text of the primary text field
  `void`
  `setValue(String text, int index)`
  Sets the text of the text field at the given index

  ### Methods inherited from class docking.DialogComponentProvider

  `addAction, addApplyButton, addButton, addCancelButton, addDismissButton, addOKButton, addWorkPanel, alertMessage, alertMessage, applyCallback, cancelCurrentTask, clearScheduledTask, clearStatusText, close, closeDialog, dialogClosed, dialogShown, dismissCallback, dispose, 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, 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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### InputDialog

    public InputDialog(String dialogTitle, String label)
    Creates a provider for a generic input dialog with the specified title, a text field, labeled by the specified label. The user should check the value of "isCanceled()" to know whether or not the user canceled the operation. Otherwise, use the "getValue()" or "getValues()" to get the value(s) entered by the user. Use the tool's "showDialog()" to display the dialog.

    Parameters:
      `dialogTitle` - used as the name of the dialog's title bar
      `label` - value to use for the label of the text field

  - ### InputDialog

    public InputDialog(String dialogTitle, String label, String initialValue)
    Creates a generic input dialog with the specified title, a text field, labeled by the specified label. The user should check the value of "isCanceled()" to know whether or not the user canceled the operation. Otherwise, use the "getValue()" or "getValues()" to get the value(s) entered by the user. Use the tool's "showDialog()" to display the dialog.

    Parameters:
      `dialogTitle` - used as the name of the dialog's title bar
      `label` - value to use for the label of the text field
      `initialValue` - initial value to use for the text field

  - ### InputDialog

    public InputDialog(String dialogTitle, String label, String initialValue, InputDialogListener listener)
    Creates a generic input dialog with the specified title, a text field, labeled by the specified label. The user should check the value of "isCanceled()" to know whether or not the user canceled the operation. Otherwise, use the "getValue()" or "getValues()" to get the value(s) entered by the user. Use the tool's "showDialog()" to display the dialog.

    Parameters:
      `dialogTitle` - used as the name of the dialog's title bar
      `label` - value to use for the label of the text field
      `initialValue` - initial value to use for the text field
      `listener` - the dialog listener (may be null)

  - ### InputDialog

    public InputDialog(String dialogTitle, String label, String initialValue, boolean isModal)
    Creates a generic input dialog with the specified title, a text field, labeled by the specified label. The user should check the value of "isCanceled()" to know whether or not the user canceled the operation. Otherwise, use the "getValue()" or "getValues()" to get the value(s) entered by the user. Use the tool's "showDialog()" to display the dialog.

    Parameters:
      `dialogTitle` - used as the name of the dialog's title bar
      `label` - value to use for the label of the text field
      `initialValue` - initial value to use for the text field
      `isModal` - whether or not the dialog is to be modal

  - ### InputDialog

    public InputDialog(String dialogTitle, String[] labels, String[] initialValues)
    Creates a generic input dialog with the specified title, a text field, labeled by the specified label. The user should check the value of "isCanceled()" to know whether or not the user canceled the operation. Otherwise, use the "getValue()" or "getValues()" to get the value(s) entered by the user. Use the tool's "showDialog()" to display the dialog.

    Parameters:
      `dialogTitle` - used as the name of the dialog's title bar
      `labels` - values to use for the labels of the text fields
      `initialValues` - initial values to use for the text fields

  - ### InputDialog

    public InputDialog(String dialogTitle, String[] labels, String[] initialValues, InputDialogListener listener)
    Creates a generic input dialog with the specified title, a text field, labeled by the specified label. The user should check the value of "isCanceled()" to know whether or not the user canceled the operation. Otherwise, use the "getValue()" or "getValues()" to get the value(s) entered by the user. Use the tool's "showDialog()" to display the dialog.

    Parameters:
      `dialogTitle` - used as the name of the dialog's title bar
      `labels` - values to use for the labels of the text fields
      `initialValues` - initial values to use for the text fields
      `listener` - listener that is called when the OK button is hit

- ## Method Details

  - ### okCallback

    protected void okCallback()
    Description copied from class: `DialogComponentProvider`
    The callback method for when the "OK" button is pressed.
    Overrides:
      `okCallback` in class `DialogComponentProvider`

  - ### cancelCallback

    protected void cancelCallback()
    Description copied from class: `DialogComponentProvider`
    The callback method for when the "Cancel" button is pressed. The default behavior is to call setVisible(false) and dispose() on the dialog.
    Overrides:
      `cancelCallback` in class `DialogComponentProvider`

  - ### isCanceled

    public boolean isCanceled()
    Returns if this dialog is cancelled
    Returns:
      true if cancelled

  - ### getValue

    public String getValue()
    Return the value of the first (and maybe only) text field
    Returns:
      the text field value

  - ### setValue

    public void setValue(String text)
    Sets the text of the primary text field
    Parameters:
      `text` - the text

  - ### setValue

    public void setValue(String text, int index)
    Sets the text of the text field at the given index
    Parameters:
      `text` - the text
      `index` - the index of the text field

  - ### getValues

    public String[] getValues()
    Return the values for all the text field(s)
    Returns:
      the text field values