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

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

public class ConnectCommand
extends java.lang.Object
implements GUICommand

A GUICommand which connects to a Crossfire server.


Field Summary
private  GuiStateManager guiStateManager
          The GuiStateManager instance.
private  GUIText hostNameInputField
          The host name input field.
 
Constructor Summary
ConnectCommand(GuiStateManager guiStateManager, GUIText hostNameInputField)
          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

guiStateManager

@NotNull
private final GuiStateManager guiStateManager
The GuiStateManager instance.


hostNameInputField

@NotNull
private final GUIText hostNameInputField
The host name input field.

Constructor Detail

ConnectCommand

public ConnectCommand(@NotNull
                      GuiStateManager guiStateManager,
                      @NotNull
                      GUIText hostNameInputField)
Creates a new instance.

Parameters:
guiStateManager - the gui state manager instance
hostNameInputField - the host name input field
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