com.realtime.crossfire.jxclient.gui.commands
Class CommandCheckBoxOption

java.lang.Object
  extended by com.realtime.crossfire.jxclient.settings.options.Option
      extended by com.realtime.crossfire.jxclient.settings.options.CheckBoxOption
          extended by com.realtime.crossfire.jxclient.gui.commands.CommandCheckBoxOption

public class CommandCheckBoxOption
extends CheckBoxOption

A CheckBoxOption that executes CommandLists when checked/unchecked.


Field Summary
private  CommandList commandOff
          The command list to execute when unchecked.
private  CommandList commandOn
          The command list to execute when checked.
 
Constructor Summary
CommandCheckBoxOption(CommandList commandOn, CommandList commandOff, java.lang.String tooltipText)
          Creates a new instance.
 
Method Summary
protected  void execute(boolean checked)
          Execute the action associated with this check box option.
 boolean isDefaultChecked()
          Return the default value of CheckBoxOption.isChecked().
 
Methods inherited from class com.realtime.crossfire.jxclient.settings.options.CheckBoxOption
fireStateChangedEvent, getTooltipText, isChecked, setChecked, toggleChecked
 
Methods inherited from class com.realtime.crossfire.jxclient.settings.options.Option
addOptionListener, inhibitSave, removeOptionListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

commandOff

@NotNull
private final CommandList commandOff
The command list to execute when unchecked.


commandOn

@NotNull
private final CommandList commandOn
The command list to execute when checked.

Constructor Detail

CommandCheckBoxOption

public CommandCheckBoxOption(@NotNull
                             CommandList commandOn,
                             @NotNull
                             CommandList commandOff,
                             @NotNull
                             java.lang.String tooltipText)
Creates a new instance.

Parameters:
commandOn - the command list to execute when checked
commandOff - the command list to execute when unchecked
tooltipText - the tooltip text to explain this option
Method Detail

execute

protected void execute(boolean checked)
Execute the action associated with this check box option. Must be implemented in sub-classes.

Specified by:
execute in class CheckBoxOption
Parameters:
checked - whether the check box option is checked

isDefaultChecked

public boolean isDefaultChecked()
Return the default value of CheckBoxOption.isChecked().

Specified by:
isDefaultChecked in class CheckBoxOption
Returns:
The default value.