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 | Description |
---|---|---|
static java.lang.String |
HIDE |
Action command text for the action which hides the window associated
with this action.
|
static java.lang.String |
SHOW |
Action command text for the action which reveals the window associated
with this action.
|
static java.lang.String |
VISIBLE |
Name of the bound property which indicates whether the window associated
with this action is currently visible in the GUI.
|
Modifier | Constructor | Description |
---|---|---|
protected |
WindowAction(java.lang.String name,
javax.swing.Icon icon,
java.lang.String shortdesc) |
Constructs a new WindowAction.
|
Modifier and Type | Method | Description |
---|---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt) |
|
javax.swing.JToggleButton |
getButton() |
Returns a toggle button which toggles visibility of the window
associated with this action.
|
java.lang.Object |
getValue(java.lang.String key) |
|
abstract java.awt.Window |
getWindow(java.awt.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(java.lang.String key,
java.lang.Object newValue) |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, isEnabled, removePropertyChangeListener, setEnabled
getEventWindow
public static final java.lang.String HIDE
public static final java.lang.String SHOW
public static final java.lang.String VISIBLE
protected WindowAction(java.lang.String name, javax.swing.Icon icon, java.lang.String shortdesc)
name
- action nameicon
- action iconshortdesc
- action short description propertypublic void actionPerformed(java.awt.event.ActionEvent evt)
public java.lang.Object getValue(java.lang.String key)
getValue
in class javax.swing.AbstractAction
public void putValue(java.lang.String key, java.lang.Object newValue)
putValue
in class javax.swing.AbstractAction
public abstract java.awt.Window getWindow(java.awt.Component parent)
parent
- component which may be used for placing the new windowpublic abstract boolean hasWindow()
public javax.swing.JToggleButton getButton()
** Mostly working but not used at the moment **
Copyright ? 2003-2018 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.