public abstract class WindowAction extends BasicAction
Action
which controls display of a window.
ActionEvent
s passed to this action may
have the action command set to one of the strings
HIDE
or SHOW
to define what the command means
(in fact anything other than HIDE
counts as SHOW
).
It has a bound property with key VISIBLE
which indicates
whether the associated window is currently showing or not.
Setting the VISIBLE
property true/false has the same effect as
invoking the action with the SHOW
/HIDE
command string.
This class is currently a bit messy and overspecified for what it does.
Modifier and Type | Field and Description |
---|---|
static String |
HIDE
Action command text for the action which hides the window associated
with this action.
|
static String |
SHOW
Action command text for the action which reveals the window associated
with this action.
|
static String |
VISIBLE
Name of the bound property which indicates whether the window associated
with this action is currently visible in the GUI.
|
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Modifier | Constructor and Description |
---|---|
protected |
WindowAction(String name,
Icon icon,
String shortdesc)
Constructs a new WindowAction.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent evt) |
JToggleButton |
getButton()
Returns a toggle button which toggles visibility of the window
associated with this action.
|
Object |
getValue(String key) |
abstract Window |
getWindow(Component parent)
Returns the window associated with this action, creating it if
necessary.
|
abstract boolean |
hasWindow()
Indicates whether the window associated with this window is
currently in existence.
|
void |
putValue(String key,
Object newValue) |
create, getEventWindow
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, isEnabled, removePropertyChangeListener, setEnabled
public static final String HIDE
public static final String SHOW
public static final String VISIBLE
public void actionPerformed(ActionEvent evt)
public Object getValue(String key)
getValue
in interface Action
getValue
in class AbstractAction
public void putValue(String key, Object newValue)
putValue
in interface Action
putValue
in class AbstractAction
public abstract Window getWindow(Component parent)
parent
- component which may be used for placing the new windowpublic abstract boolean hasWindow()
public JToggleButton getButton()
** Mostly working but not used at the moment **
Copyright © 2003-2025 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.