public class SelectCommand extends java.lang.Object implements GUICommand
GUICommand
for selecting or deselecting a GUIElement
.Modifier and Type | Field and Description |
---|---|
private GUISelectable |
element
The
GUISelectable to affect. |
private boolean |
selected
Whether to select the
element . |
Constructor and Description |
---|
SelectCommand(GUISelectable element,
boolean selected)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canExecute()
Returns whether this command may be executed.
|
void |
execute()
Executes the command.
|
@NotNull private final GUISelectable element
GUISelectable
to affect.private final boolean selected
element
.public SelectCommand(@NotNull GUISelectable element, boolean selected)
element
- the element to affectselected
- whether to select the elementpublic boolean canExecute()
canExecute
in interface GUICommand
public void execute()
GUICommand.canExecute()
returns false
.execute
in interface GUICommand