22 package com.realtime.crossfire.jxclient.gui.commands;
27 import java.awt.Component;
28 import org.jetbrains.annotations.NotNull;
52 target.setVisible(!target.isVisible());
ToggleCommand(@NotNull final Component target)
Creates a new instance.
Interface defining an abstract GUI element.
boolean canExecute()
Returns whether this command may be executed.whether this command may be executed ...
final Component target
The gui element to toggle.
A GUICommand which toggles the visibility of a target GUIElement.
Utility class for Swing related functions.
void execute()
Executes the command.Does nothing if called while canExecute() returnsfalse .
static void invokeAndWait(@NotNull final Runnable runnable)
Calls SwingUtilities#invokeAndWait(Runnable) if not on the EDT or calls the Runnable directly if on t...
final Runnable executeRunnable
The Runnable that implements the functionality of execute().