com.realtime.crossfire.jxclient.gui.commands
Class ExecuteCommandCommand

java.lang.Object
  extended by com.realtime.crossfire.jxclient.gui.commands.ExecuteCommandCommand
All Implemented Interfaces:
GUICommand

public class ExecuteCommandCommand
extends java.lang.Object
implements GUICommand

A GUICommand which executes a Crossfire command.


Field Summary
private  java.lang.String command
          The command to execute.
private  Commands commands
          The commands instance for executing the command.
private  Macros macros
          The Macros instance to use.
 
Constructor Summary
ExecuteCommandCommand(Commands commands, java.lang.String command, Macros macros)
          Creates a new instance.
 
Method Summary
 boolean canExecute()
          Returns whether this command may be executed.
 void execute()
          Executes the command.
 java.lang.String getCommand()
          Returns the command to execute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

command

@NotNull
private final java.lang.String command
The command to execute.


commands

@NotNull
private final Commands commands
The commands instance for executing the command.


macros

@NotNull
private final Macros macros
The Macros instance to use.

Constructor Detail

ExecuteCommandCommand

public ExecuteCommandCommand(@NotNull
                             Commands commands,
                             @NotNull
                             java.lang.String command,
                             @NotNull
                             Macros macros)
Creates a new instance.

Parameters:
commands - the commands instance for executing the command
command - the command to execute
macros - the macros instance to use
Method Detail

canExecute

public boolean canExecute()
Returns whether this command may be executed.

Specified by:
canExecute in interface GUICommand
Returns:
whether this command may be executed

execute

public void execute()
Executes the command. Does nothing if called while GUICommand.canExecute() returns false.

Specified by:
execute in interface GUICommand

getCommand

@NotNull
public java.lang.String getCommand()
Returns the command to execute.

Returns:
the command to execute