|
|||||||||||
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.CallableSystemAction org.openide.util.actions.NodeAction org.openide.util.actions.CookieAction
An action dependent on the cookies of the selected nodes.
Nested Class Summary |
Nested classes inherited from class org.openide.util.actions.Presenter |
Presenter.Menu, Presenter.Popup, Presenter.Toolbar |
Field Summary | |
static int |
MODE_ALL
Action will be enabled if there are one or more selected nodes and all of them support the given cookies. |
static int |
MODE_ANY
Action will be enabled if there are one or more selected nodes and any of them (one, all, or some) support the given cookies. |
static int |
MODE_EXACTLY_ONE
Action will be enabled if there is exactly one selected node and it supports the given cookies. |
static int |
MODE_ONE
Action will be enabled if there are one or more selected nodes and there is exactly one node which supports the given cookies. |
static int |
MODE_SOME
Action will be enabled if there are several selected nodes and some of them (at least one, but not all) support the given cookies. |
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 | |
CookieAction()
|
Method Summary | |
protected abstract Class[] |
cookieClasses()
Get the cookies that this action requires. |
Action |
createContextAwareInstance(Lookup actionContext)
Implements ContextAwareAction interface method. |
protected boolean |
enable(Node[] activatedNodes)
Test for enablement based on the cookies of selected nodes. |
protected abstract int |
mode()
Get the mode of the action: how strict it should be about cookie support. |
Methods inherited from class org.openide.util.actions.NodeAction |
actionPerformed, addNotify, getActivatedNodes, initialize, isEnabled, performAction, performAction, removeNotify, setEnabled, surviveFocusChange |
Methods inherited from class org.openide.util.actions.CallableSystemAction |
asynchronous, getMenuPresenter, getPopupPresenter, getToolbarPresenter |
Methods inherited from class org.openide.util.actions.SystemAction |
clearSharedData, createPopupMenu, createToolbarPresenter, get, getHelpCtx, getIcon, getIcon, getName, getValue, iconResource, linkActions, putValue, setIcon |
Methods inherited from class org.openide.util.SharedClassObject |
addPropertyChangeListener, equals, finalize, findObject, findObject, firePropertyChange, getLock, getProperty, hashCode, putProperty, putProperty, readExternal, 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, getValue, putValue, removePropertyChangeListener |
Field Detail |
public static final int MODE_ONE
public static final int MODE_SOME
public static final int MODE_ALL
public static final int MODE_EXACTLY_ONE
public static final int MODE_ANY
Constructor Detail |
public CookieAction()
Method Detail |
protected abstract int mode()
MODE_XXX
constants.protected abstract Class[] cookieClasses()
protected boolean enable(Node[] activatedNodes)
cookieClasses()
and mode()
to specify
the enablement logic.
enable
in class NodeAction
activatedNodes
- the set of activated nodes
true
to enablepublic Action createContextAwareInstance(Lookup actionContext)
ContextAwareAction
interface method.
createContextAwareInstance
in interface ContextAwareAction
createContextAwareInstance
in class NodeAction
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |