Class ButtonOption

All Implemented Interfaces:
Serializable, Option, OptionElement, OptionProperties

public class ButtonOption extends AbstractOption
Option implementation with a JButton or JToggleButton as the underlying component.
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • ButtonOption

      public ButtonOption()
      Constructor provided as a convenience to facilitate the creation of option elements through reflexion.
  • Method Details

    • createUI

      public void createUI()
      Description copied from class: AbstractOptionProperties
      Create the UI components for this option.
      Specified by:
      createUI in class AbstractOptionProperties
    • setupValueChangeNotifications

      protected void setupValueChangeNotifications()
      Description copied from class: AbstractOption
      Concrete subclasses should implement this method to properly forward changes in the value edited by the underlying UI component/editor.
      Specified by:
      setupValueChangeNotifications in class AbstractOption
    • setEnabled

      public void setEnabled(boolean enabled)
      Enable or disable this option.
      Parameters:
      enabled - true to enable this option, false to disable it.
    • isPersistent

      public boolean isPersistent()
      Description copied from class: AbstractOption
      Determine whether the value of this option should be saved in the user preferences.
      Specified by:
      isPersistent in interface Option
      Overrides:
      isPersistent in class AbstractOption
      Returns:
      true if the value should be saved, false otherwise.
    • isToggle

      public boolean isToggle()
      Determine whether this object is a JToggleButton or a simple JButton.
      Returns:
      true if this object is a toggle button, false otherwise.
    • setToggle

      public void setToggle(boolean toggle)
      Specify whether this object is a JToggleButton or a simple JButton.
      Parameters:
      toggle - true if this object is a toggle button, false otherwise.
    • getValue

      public Object getValue()
      Description copied from class: AbstractOption
      The value of this option.
      Specified by:
      getValue in interface Option
      Overrides:
      getValue in class AbstractOption
      Returns:
      the value as an Object instance.
    • setValue

      public void setValue(Object value)
      Description copied from class: AbstractOption
      Set the value of this option.
      Overrides:
      setValue in class AbstractOption
      Parameters:
      value - the value as an Object instance.