Class ExecuteCommandCommand

java.lang.Object
com.realtime.crossfire.jxclient.gui.textinput.ExecuteCommandCommand
All Implemented Interfaces:
GUICommand, GUICommand2

public class ExecuteCommandCommand extends Object implements GUICommand2
A GUICommand which executes a Crossfire command.
  • 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 command
      command - the command to execute
      macros - 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 interface GUICommand
      Returns:
      whether this command may be executed
    • execute

      public void execute()
      Description copied from interface: GUICommand
      Executes the command. Does nothing if called while GUICommand.canExecute() returns false.
      Specified by:
      execute in interface GUICommand
    • getCommandString

      @NotNull public @NotNull String getCommandString()
      Description copied from interface: GUICommand2
      Returns the command as a string.
      Specified by:
      getCommandString in interface GUICommand2
      Returns:
      the command