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

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

public class ExecSelectionCommand
extends java.lang.Object
implements GUICommand

A GUICommand that executes a command on the selected item of a GUIItemList.


Field Summary
private  CommandType command
          The command to execute.
private  CommandQueue commandQueue
          The command queue to use.
private  CrossfireServerConnection crossfireServerConnection
          The connection to execute commands on.
private  FloorView floorView
          The FloorView to use.
private  GUIItemList list
          The list to execute in.
 
Constructor Summary
ExecSelectionCommand(GUIItemList list, CommandType command, CrossfireServerConnection crossfireServerConnection, FloorView floorView, CommandQueue commandQueue)
          Creates a new instance.
 
Method Summary
 boolean canExecute()
          Returns whether this command may be executed.
 void execute()
          Executes the command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

command

@NotNull
private final CommandType command
The command to execute.


commandQueue

@NotNull
private final CommandQueue commandQueue
The command queue to use.


crossfireServerConnection

@NotNull
private final CrossfireServerConnection crossfireServerConnection
The connection to execute commands on.


floorView

@NotNull
private final FloorView floorView
The FloorView to use.


list

@NotNull
private final GUIItemList list
The list to execute in.

Constructor Detail

ExecSelectionCommand

public ExecSelectionCommand(@NotNull
                            GUIItemList list,
                            @NotNull
                            CommandType command,
                            @NotNull
                            CrossfireServerConnection crossfireServerConnection,
                            @NotNull
                            FloorView floorView,
                            @NotNull
                            CommandQueue commandQueue)
Creates a new instance.

Parameters:
list - the list to execute in
command - the command to execute
crossfireServerConnection - the connection to execute commands on
floorView - the floor view to use
commandQueue - the command queue 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