Class ColorChooserButton

  • All Implemented Interfaces:
    ConstrainedVisual, Visual

    public class ColorChooserButton
    extends Button
    A component that allows a user to select a color. The color chooser is hidden until the user pushes the button.
    • Constructor Detail

      • ColorChooserButton

        public ColorChooserButton()
      • ColorChooserButton

        public ColorChooserButton​(java.lang.Object buttonData)
    • Method Detail

      • setSkin

        protected void setSkin​(Skin skin)
        Description copied from class: Component
        Sets the skin, replacing any previous skin.
        Overrides:
        setSkin in class Component
        Parameters:
        skin - The new skin.
      • getListPopup

        public Window getListPopup()
        Returns:
        The popup window associated with this component's skin.
      • setToggleButton

        @UnsupportedOperation
        public void setToggleButton​(boolean toggleButton)
        Description copied from class: Button
        Sets the button's toggle state.
        Overrides:
        setToggleButton in class Button
        Parameters:
        toggleButton - Whether or not this should be a toggle button.
        Throws:
        java.lang.UnsupportedOperationException - This method is not supported by ColorChooserButton.
      • getSelectedColor

        public java.awt.Color getSelectedColor()
        Returns:
        The currently selected color, or null if nothing is selected.
      • setSelectedColor

        public void setSelectedColor​(java.awt.Color selectedColor)
        Sets the selected color.
        Parameters:
        selectedColor - The color to select, or null to clear the selection.
      • setSelectedColor

        public final void setSelectedColor​(java.lang.String selectedColor)
        Sets the selected color.
        Parameters:
        selectedColor - A string representing a color.
        Throws:
        java.lang.IllegalArgumentException - if the string is null.
      • getSelectedColorKey

        public java.lang.String getSelectedColorKey()
        Returns:
        The data binding key that is set on this color chooser button.
      • setSelectedColorKey

        public void setSelectedColorKey​(java.lang.String selectedColorKey)
        Sets this color chooser button's data binding key.
        Parameters:
        selectedColorKey - The binding key for the selected color.
      • getSelectedColorBindType

        public BindType getSelectedColorBindType()
      • setSelectedColorBindType

        public void setSelectedColorBindType​(BindType selectedColorBindType)
      • load

        public void load​(java.lang.Object context)
        Loads the selected color from the specified bind context using this color picker button's bind key, if one is set.
        Overrides:
        load in class Button
        Parameters:
        context - The object to load the bound values from.
      • store

        public void store​(java.lang.Object context)
        Stores the selected color into the specified bind context using this color picker button's bind key, if one is set.
        Overrides:
        store in class Button
        Parameters:
        context - The object to store the bound values into.
      • clear

        public void clear()
        If a bind key is set, clears the selected color.
        Overrides:
        clear in class Button