Class CheckBoxOption

java.lang.Object
com.realtime.crossfire.jxclient.settings.options.Option
com.realtime.crossfire.jxclient.settings.options.CheckBoxOption
Direct Known Subclasses:
CommandCheckBoxOption, PickupOption, ShowSentCommandsCheckBoxOption, ShowTimestampMessagesCheckBoxOption, SoundEffectsCheckBoxOption, SoundMusicCheckBoxOption, TranslucentDialogsCheckBoxOption

public abstract class CheckBoxOption extends Option
The base class for all check box options. It manages the checked/unchecked state and notifies listeners about changes.
  • Constructor Details

    • CheckBoxOption

      protected CheckBoxOption(@NotNull @NotNull String tooltipText)
      Creates a new instance.
      Parameters:
      tooltipText - the tooltip text to explain this option
  • Method Details

    • isChecked

      public boolean isChecked()
      Returns the current state.
      Returns:
      the current state
    • setChecked

      public void setChecked(boolean checked)
      Sets the current state.
      Parameters:
      checked - the new state
    • toggleChecked

      public void toggleChecked()
      Toggles the checked state.
    • execute

      protected abstract void execute(boolean checked)
      Executes the action associated with this check box option. Must be implemented in subclasses.
      Parameters:
      checked - whether the checkbox option is checked
    • fireStateChangedEvent

      protected void fireStateChangedEvent()
      Description copied from class: Option
      Notifies all listeners that the state has changed.
      Overrides:
      fireStateChangedEvent in class Option
    • isDefaultChecked

      public abstract boolean isDefaultChecked()
      Returns the default value of isChecked().
      Returns:
      the default value
    • getTooltipText

      @NotNull public @NotNull String getTooltipText()
      Returns the tooltip text to explain this option.
      Returns:
      the tooltip text