Class AbstractOption<V>

    • Field Detail

      • value

        protected V value
        The value of the preference
    • Constructor Detail

      • AbstractOption

        public AbstractOption​(String prefrenceKey,
                              String presentation)
        Creates new Option with given associated preference key and manager to perform write/read. Also sets the value with default value according to given manager
        Parameters:
        prefrenceKey - The associated to this option preference key, cannot be null
        presentation - The options presentation that describes its aim, cannot be null
    • Method Detail

      • handleSelection

        public void handleSelection​(V value)
        Description copied from interface: IOption
        This method invoked when associated UI element has changed selection and the given value is now set to UI element So there is no need to update UI element but preference representation. This method shall not write preferences right to the store as this changes can be canceled with no callback.
        Specified by:
        handleSelection in interface IOption<V>
        Parameters:
        value - the new value to be set, can be null
      • setValue

        public void setValue​(V value)
        Description copied from interface: IOption
        Sets the value of this option to the given value. This shall update UI representation
        Specified by:
        setValue in interface IOption<V>
        Parameters:
        value - , cannot be null
      • getValue

        public V getValue()
        Description copied from interface: IOption
        Returns current value held by this option. This shall not be affected by IOption.handleSelection(Object).
        Specified by:
        getValue in interface IOption<V>
        Returns:
        value held by this option, cannot be null
      • getPreferenceKey

        public String getPreferenceKey()
        Description copied from interface: IOption
        Getter for #preferenceKey
        Specified by:
        getPreferenceKey in interface IOption<V>
        Returns:
        #preferenceKey, cannot be null
      • setControl

        public void setControl​(IUpdatableControl<V> control)
        Description copied from interface: IOption
        Associates this option with given control
        Specified by:
        setControl in interface IOption<V>
        Parameters:
        control - The control associated with this option, can be null
      • setUploaded

        protected void setUploaded()
        Sets the field isUploaded to true. Meaning that this option has its value initialized