|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.openide.util.SharedClassObject org.openide.util.actions.SystemAction org.openide.util.actions.BooleanStateAction
An action that can be toggled on or off.
The actual "performing" of the action is the toggle itself, so
this action should be used by listening to the PROP_BOOLEAN_STATE
property.
The default value of the state is true
(on).
Nested Class Summary |
Nested classes inherited from class org.openide.util.actions.Presenter |
Presenter.Menu, Presenter.Popup, Presenter.Toolbar |
Field Summary | |
static String |
PROP_BOOLEAN_STATE
Name of property hold the state of the action. |
Fields inherited from class org.openide.util.actions.SystemAction |
PROP_ENABLED, PROP_ICON |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
BooleanStateAction()
|
Method Summary | |
void |
actionPerformed(ActionEvent ev)
Actually perform the action. |
boolean |
getBooleanState()
Get the current state. |
JMenuItem |
getMenuPresenter()
Get a menu item that can present this action in a JMenu . |
JMenuItem |
getPopupPresenter()
Get a menu item that can present this action in a JPopupMenu . |
Component |
getToolbarPresenter()
Get a component that can present this action in a JToolBar . |
protected void |
initialize()
Initialize the action. |
void |
setBooleanState(boolean value)
Set the current state. |
Methods inherited from class org.openide.util.actions.SystemAction |
clearSharedData, createPopupMenu, createToolbarPresenter, get, getHelpCtx, getIcon, getIcon, getName, getValue, iconResource, isEnabled, linkActions, putValue, setEnabled, setIcon |
Methods inherited from class org.openide.util.SharedClassObject |
addNotify, addPropertyChangeListener, equals, finalize, findObject, findObject, firePropertyChange, getLock, getProperty, hashCode, putProperty, putProperty, readExternal, removeNotify, removePropertyChangeListener, reset, writeExternal, writeReplace |
Methods inherited from class java.lang.Object |
clone, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.Action |
addPropertyChangeListener, removePropertyChangeListener |
Field Detail |
public static final String PROP_BOOLEAN_STATE
Constructor Detail |
public BooleanStateAction()
Method Detail |
public JMenuItem getMenuPresenter()
Presenter.Menu
JMenu
.
getMenuPresenter
in interface Presenter.Menu
public JMenuItem getPopupPresenter()
Presenter.Popup
JPopupMenu
.
getPopupPresenter
in interface Presenter.Popup
public Component getToolbarPresenter()
Presenter.Toolbar
JToolBar
.
getToolbarPresenter
in interface Presenter.Toolbar
public boolean getBooleanState()
true
if onpublic void setBooleanState(boolean value)
value
- true
to turn on, false
to turn offprotected void initialize()
SystemAction
initialize
in class SystemAction
public void actionPerformed(ActionEvent ev)
SystemAction
ActionListener.actionPerformed(java.awt.event.ActionEvent)
.
In some cases, the implementation may have an empty body, if the presenters handle the performing of the action in a different way than by calling this method.
Since 4.11, will be performed directly in the event thread.
actionPerformed
in interface ActionListener
actionPerformed
in class SystemAction
ev
- the event triggering the action
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |