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

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

public class DialogCloseCommand
extends java.lang.Object
implements GUICommand

A GUICommand which closes a Gui.


Field Summary
private  CommandCallback commandCallback
          The CommandCallback to use.
private  Gui dialog
          The dialog to close.
 
Constructor Summary
DialogCloseCommand(CommandCallback commandCallback, Gui dialog)
          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

commandCallback

@NotNull
private final CommandCallback commandCallback
The CommandCallback to use.


dialog

@NotNull
private final Gui dialog
The dialog to close.

Constructor Detail

DialogCloseCommand

public DialogCloseCommand(@NotNull
                          CommandCallback commandCallback,
                          @NotNull
                          Gui dialog)
Creates a new instance.

Parameters:
commandCallback - the command callback to use
dialog - the dialog to close
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