All Superinterfaces:
Action, ActionListener, EventListener
All Known Subinterfaces:
CommandControl, Controls, ToggleControl

public interface Control extends Action
A beefed up Action.
  • Method Details

    • description

      Optional<String> description()
      Returns:
      the description or an empty Optional if none is available
    • name

      Optional<String> name()
      Returns:
      the name or an empty Optional if none is available
    • enabled

      is.codion.common.state.StateObserver enabled()
      Returns:
      a StateObserver indicating whether this Control is enabled
    • mnemonic

      OptionalInt mnemonic()
      Returns:
      the mnemonic or an empty Optional if none is available
    • keyStroke

      Optional<KeyStroke> keyStroke()
      Returns:
      the KeyStroke associated with this Control or an empty Optional if none is available
    • smallIcon

      Optional<Icon> smallIcon()
      Returns:
      the small icon or an empty Optional if none is available
    • largeIcon

      Optional<Icon> largeIcon()
      Returns:
      the large icon or an empty Optional if none is available
    • background

      Optional<Color> background()
      Returns:
      the background color or an empty Optional if none is available
    • foreground

      Optional<Color> foreground()
      Returns:
      the foreground color or an empty Optional if none is available
    • font

      Optional<Font> font()
      Returns:
      the font or an empty Optional if none is available
    • keys

      Returns:
      the keys for values that have been set for this control
      See Also:
    • setEnabled

      void setEnabled(boolean enabled)
      Unsupported, the enabled state of Controls is based on their enabled state observer
      Specified by:
      setEnabled in interface Action
      Parameters:
      enabled - the enabled status
      Throws:
      UnsupportedOperationException - always
      See Also:
    • copy

      <C extends Control, B extends Control.Builder<C, B>> Control.Builder<C,B> copy()
      Returns a new Control.Builder instance, based on a copy of this control.
      Type Parameters:
      B - the builder type
      Returns:
      a new builder
    • commandControl

      static CommandControl commandControl(Control.Command command)
      Creates a control based on a Control.Command
      Parameters:
      command - the Control.Command on which to base the control
      Returns:
      a Control for calling the given Control.Command
    • actionControl

      static CommandControl actionControl(Control.ActionCommand actionCommand)
      Creates a control based on a Control.ActionCommand
      Parameters:
      actionCommand - the Control.ActionCommand on which to base the control
      Returns:
      a Control for calling the given Control.Command
    • toggleControl

      static ToggleControl toggleControl(is.codion.common.value.Value<Boolean> value)
      Creates a new ToggleControl based on the given value
      Parameters:
      value - the value
      Returns:
      a new ToggleControl
    • toggleControl

      static ToggleControl toggleControl(is.codion.common.state.State state)
      Creates a new ToggleControl based on the given state
      Parameters:
      state - the state
      Returns:
      a new ToggleControl
    • builder

      static Control.BuilderFactory builder()
      Returns:
      a new Control Control.BuilderFactory instance