com.realtime.crossfire.jxclient.shortcuts
Class ShortcutCommand

java.lang.Object
  extended by com.realtime.crossfire.jxclient.shortcuts.Shortcut
      extended by com.realtime.crossfire.jxclient.shortcuts.ShortcutCommand

public class ShortcutCommand
extends Shortcut

A Shortcut that executes a Crossfire command.


Field Summary
private  java.lang.String command
          The command to execute.
private  CommandQueue commandQueue
          The command queue for sending commands.
 
Constructor Summary
ShortcutCommand(CommandQueue commandQueue, java.lang.String command)
          Creates a new instance.
 
Method Summary
 boolean displaysFace(Face face)
          Returns whether this shortcut displays the given face.
 void dispose()
          Releases all allocated resources.
 void execute()
          Execute the shortcut.
 java.lang.String getCommand()
          Return the command to execute.
 java.lang.String getTooltipText()
          Returns the current tooltip text.
 void visit(ShortcutVisitor visitor)
          Calls a ShortcutVisitor's visit() function for this instance.
 
Methods inherited from class com.realtime.crossfire.jxclient.shortcuts.Shortcut
addShortcutListener, fireModifiedEvent, removeShortcutListener
 
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.


commandQueue

@NotNull
private final CommandQueue commandQueue
The command queue for sending commands.

Constructor Detail

ShortcutCommand

public ShortcutCommand(@NotNull
                       CommandQueue commandQueue,
                       @NotNull
                       java.lang.String command)
Creates a new instance.

Parameters:
commandQueue - the command queue for sending commands
command - the command to execute
Method Detail

displaysFace

public boolean displaysFace(Face face)
Returns whether this shortcut displays the given face.

Specified by:
displaysFace in class Shortcut
Parameters:
face - the face to check for
Returns:
whether the face is displayed

dispose

public void dispose()
Releases all allocated resources.

Specified by:
dispose in class Shortcut

execute

public void execute()
Execute the shortcut.

Specified by:
execute in class Shortcut

getCommand

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

Returns:
The command.

getTooltipText

@NotNull
public java.lang.String getTooltipText()
Returns the current tooltip text.

Specified by:
getTooltipText in class Shortcut
Returns:
the tooltip text

visit

public void visit(@NotNull
                  ShortcutVisitor visitor)
Calls a ShortcutVisitor's visit() function for this instance.

Specified by:
visit in class Shortcut
Parameters:
visitor - the visitor to call