Class ExecuteCommandCommand
java.lang.Object
com.realtime.crossfire.jxclient.gui.textinput.ExecuteCommandCommand
- All Implemented Interfaces:
GUICommand
,GUICommand2
A
GUICommand
which executes a Crossfire command.-
Constructor Summary
ConstructorsConstructorDescriptionExecuteCommandCommand
(@NotNull CommandExecutor commandExecutor, @NotNull String command, @NotNull Macros macros) Creates a new instance. -
Method Summary
-
Constructor Details
-
ExecuteCommandCommand
public ExecuteCommandCommand(@NotNull @NotNull CommandExecutor commandExecutor, @NotNull @NotNull String command, @NotNull @NotNull Macros macros) Creates a new instance.- Parameters:
commandExecutor
- the command executor for executing the commandcommand
- the command to executemacros
- the macros instance to use
-
-
Method Details
-
canExecute
public boolean canExecute()Description copied from interface:GUICommand
Returns whether this command may be executed.- Specified by:
canExecute
in interfaceGUICommand
- Returns:
- whether this command may be executed
-
execute
public void execute()Description copied from interface:GUICommand
Executes the command. Does nothing if called whileGUICommand.canExecute()
returnsfalse
.- Specified by:
execute
in interfaceGUICommand
-
getCommandString
Description copied from interface:GUICommand2
Returns the command as a string.- Specified by:
getCommandString
in interfaceGUICommand2
- Returns:
- the command
-