Class ColorPickerHistory

    • Constructor Detail

      • ColorPickerHistory

        public ColorPickerHistory()
    • Method Detail

      • initContent

        protected Component initContent()
        Description copied from class: CustomField
        Create the content component or layout for the field. Subclasses of CustomField should implement this method. Note that this method is called when the CustomField is attached to a layout or when CustomField.getContent() is called explicitly for the first time. It is only called once for a CustomField.
        Specified by:
        initContent in class CustomField<Color>
        Returns:
        Component representing the UI of the CustomField
      • setHeight

        public void setHeight​(String height)
        Description copied from interface: Sizeable
        Sets the height of the component using String presentation. String presentation is similar to what is used in Cascading Style Sheets. Size can be length or percentage of available size. The empty string ("") or null will unset the height and set the units to pixels. See CSS specification for more details.
        Specified by:
        setHeight in interface Sizeable
        Overrides:
        setHeight in class AbstractComponent
        Parameters:
        height - in CSS style string representation
      • getValue

        public Color getValue()
        Description copied from interface: HasValue
        Returns the current value of this object.

        Implementation note: the implementing class should document whether null values may be returned or not.

        Returns:
        the current value
      • doSetValue

        protected void doSetValue​(Color color)
        Description copied from class: AbstractField
        Sets the value of this field. May do sanitization or throw IllegalArgumentException if the value is invalid. Typically saves the value to shared state.
        Specified by:
        doSetValue in class AbstractField<Color>
        Parameters:
        color - the new value of the field
      • getHistory

        public List<Color> getHistory()
        Gets the history.
        Returns:
        the history
      • hasColor

        public boolean hasColor​(Color c)
        Checks if the history contains given color.
        Parameters:
        c - the color
        Returns:
        true, if successful