站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

ToolsAction (NetBeans APIs) - NetBeans API Javadoc 4.1.0


org.openide.actions
Class ToolsAction

java.lang.Object
  extended byorg.openide.util.SharedClassObject
      extended byorg.openide.util.actions.SystemAction
          extended byorg.openide.actions.ToolsAction
All Implemented Interfaces:
Action, ActionListener, ContextAwareAction, EventListener, Externalizable, HelpCtx.Provider, Presenter, Presenter.Menu, Presenter.Popup, Serializable

public class ToolsAction
extends SystemAction
implements ContextAwareAction, Presenter.Menu, Presenter.Popup

A "meta-action" that displays (in a submenu) a list of enabled actions provided by modules. Such registered actions are called "service actions": they are provided externally but seem to provide additional services on existing components. Often they will be NodeActions or CookieActions so that they will be enabled based on the node selection, i.e. the node containing this popup. It is desirable for most nodes to include this action somewhere in their popup menu.

Note: you do not need to touch this class to add a service action! Just add the action to a module manifest in an Action section.

The list of registered service actions is provided to this action from the implementation by means of ActionManager.

See Also:
Serialized Form

Nested Class Summary
static interface ToolsAction.Model
          Deprecated. Useless, see ActionManager.
 
Nested classes inherited from class org.openide.util.actions.Presenter
Presenter.Menu, Presenter.Toolbar
 
Field Summary
 
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
ToolsAction()
           
 
Method Summary
 void actionPerformed(ActionEvent ev)
          Actually perform the action.
 Action createContextAwareInstance(Lookup actionContext)
          Creates action instance for provided context.
 HelpCtx getHelpCtx()
          Get a help context for the action.
 JMenuItem getMenuPresenter()
          Get a menu item that can present this action in a JMenu.
 String getName()
          Get a human presentable name of the action.
 JMenuItem getPopupPresenter()
          Get a menu item that can present this action in a JPopupMenu.
static void setModel(ToolsAction.Model m)
          Deprecated. Useless, see ActionManager.
 
Methods inherited from class org.openide.util.actions.SystemAction
clearSharedData, createPopupMenu, createToolbarPresenter, get, getIcon, getIcon, getValue, iconResource, initialize, 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, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 

Constructor Detail

ToolsAction

public ToolsAction()
Method Detail

getName

public String getName()
Description copied from class: SystemAction
Get a human presentable name of the action. This may be presented as an item in a menu.

Using the normal menu presenters, an included ampersand before a letter will be treated as the name of a mnemonic.

Specified by:
getName in class SystemAction
Returns:
the name of the action

getHelpCtx

public HelpCtx getHelpCtx()
Description copied from class: SystemAction
Get a help context for the action.

Specified by:
getHelpCtx in interface HelpCtx.Provider
Specified by:
getHelpCtx in class SystemAction
Returns:
the help context for this action

getMenuPresenter

public JMenuItem getMenuPresenter()
Description copied from interface: Presenter.Menu
Get a menu item that can present this action in a JMenu.

Specified by:
getMenuPresenter in interface Presenter.Menu
Returns:
the representation for this action

getPopupPresenter

public JMenuItem getPopupPresenter()
Description copied from interface: Presenter.Popup
Get a menu item that can present this action in a JPopupMenu.

Specified by:
getPopupPresenter in interface Presenter.Popup
Returns:
the representation for this action

actionPerformed

public void actionPerformed(ActionEvent ev)
Description copied from class: SystemAction
Actually perform the action. Specified in 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.

Specified by:
actionPerformed in interface ActionListener
Specified by:
actionPerformed in class SystemAction
Parameters:
ev - the event triggering the action

createContextAwareInstance

public Action createContextAwareInstance(Lookup actionContext)
Description copied from interface: ContextAwareAction
Creates action instance for provided context.

Specified by:
createContextAwareInstance in interface ContextAwareAction

setModel

public static void setModel(ToolsAction.Model m)
Deprecated. Useless, see ActionManager.



Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.