Package docking.widgets

# Class DialogRememberOption

java.lang.Object
docking.widgets.DialogRememberOption

public class DialogRememberOption extends Object
Instances of this type are used to add a checkBox to a Dialog so that the dialog results can be saved and reused in future uses of that dialog (e.g., "Apply to all", "Remember my decision"). If the checkBox is selected, the dialog results are saved and subsequent calls to show the same dialog or another dialog constructed with the same instance of this object will immediately return the result instead of actually showing the dialog.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DialogRememberOption(String description)`
  Constructs a new DialogRememberOption for use in an OptionDialog for adding an "Apply to all", "Remember my decision", etc.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getDescription()`
  Returns the description that will be displayed to the user.
  `int`
  `getRememberedResult()`
  Returns the result from a previous call to an OptionDialog that had this class installed.
  `boolean`
  `hasRememberedResult()`
  Returns true if a previous call to the dialog was remembered (The user selected the checkBox)
  `void`
  `rememberResult(int choice)`
  Sets the results from the dialog only if choice is true.

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

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

- ## Constructor Details

  - ### DialogRememberOption

    public DialogRememberOption(String description)
    Constructs a new DialogRememberOption for use in an OptionDialog for adding an "Apply to all", "Remember my decision", etc. checkBox.
    Parameters:
      `description` - the checkBox text (e.g. "Apply to all")

- ## Method Details

  - ### getDescription

    public String getDescription()
    Returns the description that will be displayed to the user.
    Returns:
      the description that will be displayed to the user.

  - ### getRememberedResult

    public int getRememberedResult()
    Returns the result from a previous call to an OptionDialog that had this class installed.
    Returns:
      the saved results from a previous call to an OptionDialog.

  - ### hasRememberedResult

    public boolean hasRememberedResult()
    Returns true if a previous call to the dialog was remembered (The user selected the checkBox)
    Returns:
      true if a previous call to the dialog was remembered

  - ### rememberResult

    public void rememberResult(int choice)
    Sets the results from the dialog only if choice is true.

    In other words, if the user selects the checkBox, then the result will be saved. Then, whenever the dialog is shown, if there is a saved result, it will be returned instead of actually showing the dialog.

    Parameters:
      `choice` - the user's choice from the OptionDialog