Class DefaultOption<T>

  • Type Parameters:
    T - The type of the property of the OptionBase value
    All Implemented Interfaces:
    Option<T>

    public class DefaultOption<T>
    extends OptionBase<T>
    A convenience class for creating an OptionBase for use in the SettingsPane control based on the given property. When an T value is passed, based on the type of that value, a Property is created and based on it, a proper editor will be selected. Developers can override this, and provide their own editor
    Since:
    2.0.0
    See Also:
    OptionBase, SettingsPane
    • Constructor Detail

      • DefaultOption

        public DefaultOption​(String caption)
        Creates an option instance, without graphic and without editor. Using the caption Option.SEPARATOR will create a Separator. Otherwise it will create an empty option
        Parameters:
        caption - a String, usually Option.SEPARATOR
      • DefaultOption

        public DefaultOption​(String caption,
                             String description,
                             String category)
        Creates an option instance, without graphic and without editor, intended to open a new view with a new group of sub-options, that are set calling Option.getChildren()
        Parameters:
        caption - a String a short name
        description - a String more descriptive
        category - a String indicating the category, in case the option belongs to a group
      • DefaultOption

        public DefaultOption​(Node graphic,
                             String caption,
                             String description,
                             String category)
        Creates an option instance, with graphic and without editor, intended to open a new view with a new group of sub-options, that are set calling Option.getChildren()
        Parameters:
        graphic - a Node with a graphic
        caption - a String a short name
        description - a String more descriptive
        category - a String indicating the category, in case the option belongs to a group
      • DefaultOption

        public DefaultOption​(String caption,
                             String description,
                             String category,
                             T value,
                             boolean isEditable)
        Creates an option instance, without graphic and with default editor, based on the values set for the option
        Parameters:
        caption - a String a short name
        description - a String more descriptive
        category - a String indicating the category, in case the option belongs to a group
        value - the underlying Property that the editor can monitor for changes
        isEditable - if the option is editable or read-only
      • DefaultOption

        public DefaultOption​(String caption,
                             String description,
                             String category,
                             T value,
                             boolean isEditable,
                             Function<Option<T>,​OptionEditor<T>> editorFactory)
        Creates an option instance, without graphic and with custom editor, based on the values set for the option
        Parameters:
        caption - a String a short name
        description - a String more descriptive
        category - a String indicating the category, in case the option belongs to a group
        value - the underlying Property that the editor can monitor for changes
        isEditable - if the option is editable or read-only
        editorFactory - a Function that returns a valid OptionEditor for editing this Option
      • DefaultOption

        public DefaultOption​(Node graphic,
                             String caption,
                             String description,
                             String category,
                             T value,
                             boolean isEditable)
        Creates an option instance, with graphic and with default editor, based on the values set for the option
        Parameters:
        graphic - a Node with a graphic
        caption - a String a short name
        description - a String more descriptive
        category - a String indicating the category, in case the option belongs to a group
        value - the underlying Property that the editor can monitor for changes
        isEditable - if the option is editable or read-only
      • DefaultOption

        public DefaultOption​(Node graphic,
                             String caption,
                             String description,
                             String category,
                             T value,
                             boolean isEditable,
                             Function<Option<T>,​OptionEditor<T>> editorFactory)
        Creates an option instance, with graphic and with custom editor, based on the values set for the option
        Parameters:
        graphic - a Node with a graphic
        caption - a String a short name
        description - a String more descriptive
        category - a String indicating the category, in case the option belongs to a group
        value - the underlying Property that the editor can monitor for changes
        isEditable - if the option is editable or read-only
        editorFactory - a Function that returns a valid OptionEditor for editing this Option