Interface ToggleControl

All Superinterfaces:
Action, ActionListener, Control, EventListener

public interface ToggleControl extends Control
A Control for toggling a boolean value.
  • Method Details

    • value

      is.codion.common.value.Value<Boolean> value()
      Returns:
      the value being toggled by this toggle control
    • copy

      <B extends Control.Builder<ToggleControl, B>> Control.Builder<ToggleControl,B> copy(is.codion.common.value.Value<Boolean> value)
      Returns a Control.Builder instance, based on a copy of this control, using the given value.
      Type Parameters:
      B - the builder type
      Parameters:
      value - the value for the resulting toggle control
      Returns:
      a new builder
    • copy

      <B extends Control.Builder<ToggleControl, B>> Control.Builder<ToggleControl,B> copy(is.codion.common.state.State state)
      Returns a Control.Builder instance, based on a copy of this control, using the given state.
      Type Parameters:
      B - the builder type
      Parameters:
      state - the state for the resulting toggle control
      Returns:
      a new builder
    • 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 <B extends Control.Builder<ToggleControl, B>> Control.Builder<ToggleControl,B> builder(is.codion.common.value.Value<Boolean> value)
      Type Parameters:
      B - the builder type
      Parameters:
      value - the value to toggle
      Returns:
      a new ToggleControl.Builder
    • builder

      static <B extends Control.Builder<ToggleControl, B>> Control.Builder<ToggleControl,B> builder(is.codion.common.state.State state)
      Type Parameters:
      B - the builder type
      Parameters:
      state - the state to toggle
      Returns:
      a new ToggleControl.Builder