00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 package com.realtime.crossfire.jxclient.gui.commands;
00023
00024 import com.realtime.crossfire.jxclient.gui.commandlist.CommandList;
00025 import com.realtime.crossfire.jxclient.settings.options.CheckBoxOption;
00026 import org.jetbrains.annotations.NotNull;
00027
00033 public class CommandCheckBoxOption extends CheckBoxOption {
00034
00038 @NotNull
00039 private final CommandList commandOn;
00040
00044 @NotNull
00045 private final CommandList commandOff;
00046
00053 public CommandCheckBoxOption(@NotNull final CommandList commandOn, @NotNull final CommandList commandOff, @NotNull final String tooltipText) {
00054 super(tooltipText);
00055 this.commandOn = commandOn;
00056 this.commandOff = commandOff;
00057 }
00058
00062 @Override
00063 protected void execute(final boolean checked) {
00064 if (checked) {
00065 commandOn.execute();
00066 } else {
00067 commandOff.execute();
00068 }
00069 }
00070
00074 @Override
00075 public boolean isDefaultChecked() {
00076 return true;
00077 }
00078
00079 }