Class ExecuteCommandCommand
- java.lang.Object
-
- com.realtime.crossfire.jxclient.gui.textinput.ExecuteCommandCommand
-
- All Implemented Interfaces:
GUICommand,GUICommand2
public class ExecuteCommandCommand extends java.lang.Object implements GUICommand2
AGUICommandwhich executes a Crossfire command.
-
-
Constructor Summary
Constructors Constructor Description ExecuteCommandCommand(@NotNull CommandExecutor commandExecutor, @NotNull java.lang.String command, @NotNull Macros macros)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanExecute()Returns whether this command may be executed.voidexecute()Executes the command.@NotNull java.lang.StringgetCommandString()Returns the command as a string.
-
-
-
Constructor Detail
-
ExecuteCommandCommand
public ExecuteCommandCommand(@NotNull @NotNull CommandExecutor commandExecutor, @NotNull @NotNull java.lang.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 Detail
-
canExecute
public boolean canExecute()
Description copied from interface:GUICommandReturns whether this command may be executed.- Specified by:
canExecutein interfaceGUICommand- Returns:
- whether this command may be executed
-
execute
public void execute()
Description copied from interface:GUICommandExecutes the command. Does nothing if called whileGUICommand.canExecute()returnsfalse.- Specified by:
executein interfaceGUICommand
-
getCommandString
@NotNull public @NotNull java.lang.String getCommandString()
Description copied from interface:GUICommand2Returns the command as a string.- Specified by:
getCommandStringin interfaceGUICommand2- Returns:
- the command
-
-