00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 package com.realtime.crossfire.jxclient.gui.commands;
00022
00023 import com.realtime.crossfire.jxclient.gui.button.GUISelectable;
00024 import com.realtime.crossfire.jxclient.gui.commandlist.GUICommand;
00025 import com.realtime.crossfire.jxclient.gui.gui.GUIElement;
00026 import org.jetbrains.annotations.NotNull;
00027
00032 public class SelectCommand implements GUICommand {
00033
00037 @NotNull
00038 private final GUISelectable element;
00039
00044 private final boolean selected;
00045
00051 public SelectCommand(@NotNull final GUISelectable element, final boolean selected) {
00052 this.element = element;
00053 this.selected = selected;
00054 }
00055
00059 @Override
00060 public boolean canExecute() {
00061 return true;
00062 }
00063
00067 @Override
00068 public void execute() {
00069 element.select(selected);
00070 }
00071
00072 }