Class DialogRememberOption


  • public class DialogRememberOption
    extends java.lang.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​(java.lang.String description)
      Constructs a new DialogRememberOption for use in an OptionDialog for adding an "Apply to all", "Remember my decision", etc.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.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 SavedDialogChoice 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 Detail

      • DialogRememberOption

        public DialogRememberOption​(java.lang.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 Detail

      • getDescription

        public java.lang.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 SavedDialogChoice 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. The, 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