Crossfire JXClient, Trunk
Public Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.gui.commands.ToggleCommand Class Reference
Inheritance diagram for com.realtime.crossfire.jxclient.gui.commands.ToggleCommand:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.gui.commands.ToggleCommand:
Collaboration graph

Public Member Functions

boolean canExecute ()
 
void execute ()
 
 ToggleCommand (@NotNull final Component target)
 

Private Attributes

final Runnable executeRunnable
 
final Component target
 

Detailed Description

A GUICommand which toggles the visibility of a target GUIElement.

Author
Andreas Kirschbaum

Definition at line 36 of file ToggleCommand.java.

Constructor & Destructor Documentation

◆ ToggleCommand()

com.realtime.crossfire.jxclient.gui.commands.ToggleCommand.ToggleCommand ( @NotNull final Component  target)

Creates a new instance.

Parameters
targetthe gui element to toggle

Definition at line 62 of file ToggleCommand.java.

References com.realtime.crossfire.jxclient.gui.commands.ToggleCommand.target.

Member Function Documentation

◆ canExecute()

boolean com.realtime.crossfire.jxclient.gui.commands.ToggleCommand.canExecute ( )

Returns whether this command may be executed.

Returns
whether this command may be executed

Implements com.realtime.crossfire.jxclient.gui.commandlist.GUICommand.

Definition at line 67 of file ToggleCommand.java.

◆ execute()

void com.realtime.crossfire.jxclient.gui.commands.ToggleCommand.execute ( )

Executes the command. Does nothing if called while canExecute() returns

false

.

Implements com.realtime.crossfire.jxclient.gui.commandlist.GUICommand.

Definition at line 72 of file ToggleCommand.java.

References com.realtime.crossfire.jxclient.gui.commands.ToggleCommand.executeRunnable, and com.realtime.crossfire.jxclient.util.SwingUtilities2.invokeAndWait().

Here is the call graph for this function:

Member Data Documentation

◆ executeRunnable

final Runnable com.realtime.crossfire.jxclient.gui.commands.ToggleCommand.executeRunnable
private
Initial value:
= new Runnable() {
@Override
public void run() {
target.setVisible(!target.isVisible());
}
}

The Runnable that implements the functionality of execute().

Definition at line 49 of file ToggleCommand.java.

Referenced by com.realtime.crossfire.jxclient.gui.commands.ToggleCommand.execute().

◆ target

final Component com.realtime.crossfire.jxclient.gui.commands.ToggleCommand.target
private

The gui element to toggle.

Definition at line 42 of file ToggleCommand.java.

Referenced by com.realtime.crossfire.jxclient.gui.commands.ToggleCommand.ToggleCommand().


The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.gui.commands.ToggleCommand.target
final Component target
Definition: ToggleCommand.java:42