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

GeneralCommandAction (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.modules.vcscore.actions
Class GeneralCommandAction

java.lang.Object
  extended byorg.openide.util.SharedClassObject
      extended byorg.openide.util.actions.SystemAction
          extended byorg.openide.util.actions.CallableSystemAction
              extended byorg.openide.util.actions.NodeAction
                  extended byorg.netbeans.modules.vcscore.actions.GeneralCommandAction
All Implemented Interfaces:
Action, ActionListener, ContextAwareAction, EventListener, Externalizable, HelpCtx.Provider, Presenter, Presenter.Menu, Presenter.Popup, Presenter.Toolbar, Serializable
Direct Known Subclasses:
AddCommandAction, ClusteringAction, CommitCommandAction, DiffCommandAction, HistoryCommandAction, RemoveCommandAction, UpdateCommandAction, VerifyGroupAction, VersioningExplorerAction

public class GeneralCommandAction
extends NodeAction

Action sensitive to nodes, that delegates the enable/perform processing to CommandActionSupporter instances. First all te fileobject that belong to the activated nodes are extracted. Then the CommandActionSupporter instances are found (these are attributes fo fileobjects) in case all the nodes have one supporter, the nodes are grouped by supporters and the supporters are asked about enabled() state. All supporters need to allow this action to be enabled. When performing the action the again the performing code is delegated to the supporters. Each supporter is given the fileobjects that belong to him.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.openide.util.actions.Presenter
Presenter.Menu, Presenter.Popup, Presenter.Toolbar
 
Field Summary
static String GROUP_DESCRIPTION_PROP
          a property accessible via the getValue() method.
static String GROUP_NAME_PROP
          a property accessible via the getValue() method.
static String VCS_ACTION_ATTRIBUTE
          Name of a FileObject attribute.
 
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
protected GeneralCommandAction()
           
 
Method Summary
protected  boolean asynchronous()
           
protected  boolean enable(Node[] nodes)
          Each supporter are checked if if they enable the action.
 HelpCtx getHelpCtx()
           
 String getName()
           
 HashMap getSupporterMap(Node[] activatedNodes)
          returns a map with CommandActionSupporters as keys.
 Component getToolbarPresenter()
           
protected  String iconResource()
           
 void performAction()
          The action performs it's job on the activated nodes..
protected  void performAction(Node[] nodes)
          This method doesn't extract the fileobjects from the activated nodes itself, but rather consults delegates to a list of supporters.
 
Methods inherited from class org.openide.util.actions.NodeAction
actionPerformed, addNotify, createContextAwareInstance, getActivatedNodes, initialize, isEnabled, removeNotify, setEnabled, surviveFocusChange
 
Methods inherited from class org.openide.util.actions.CallableSystemAction
getMenuPresenter, getPopupPresenter
 
Methods inherited from class org.openide.util.actions.SystemAction
clearSharedData, createPopupMenu, createToolbarPresenter, get, getIcon, getIcon, getValue, 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

VCS_ACTION_ATTRIBUTE

public static final String VCS_ACTION_ATTRIBUTE
Name of a FileObject attribute. Needs to be set on primary file of a node(dataobject) in order to trigger the GeneralCommandAction and it's suclasses. The value of the attribute is the

See Also:
Constant Field Values

GROUP_DESCRIPTION_PROP

public static final String GROUP_DESCRIPTION_PROP
a property accessible via the getValue() method. for VcsGroup nodes it holds the description of the group. Otherwise null. Can be used within the CommandActionSupporters in the modules.

See Also:
Constant Field Values

GROUP_NAME_PROP

public static final String GROUP_NAME_PROP
a property accessible via the getValue() method. for VcsGroup nodes it holds the display name of the group. Otherwise null. Can be used within the CommandActionSupporters in the modules. eg. for commit message.

See Also:
Constant Field Values
Constructor Detail

GeneralCommandAction

protected GeneralCommandAction()
Method Detail

asynchronous

protected boolean asynchronous()
Returns:
false to run in AWT thread.

performAction

protected void performAction(Node[] nodes)
This method doesn't extract the fileobjects from the activated nodes itself, but rather consults delegates to a list of supporters.


enable

protected boolean enable(Node[] nodes)
Each supporter are checked if if they enable the action. All supporters need to come to a concensus in order for the action to be enabled. *experimental* annotates the toolbar tooltip according to the supporter's requests.


getName

public String getName()

iconResource

protected String iconResource()

getHelpCtx

public HelpCtx getHelpCtx()

getToolbarPresenter

public Component getToolbarPresenter()

getSupporterMap

public HashMap getSupporterMap(Node[] activatedNodes)
returns a map with CommandActionSupporters as keys. values are Sets of activated FileObjects. returns null, if the action wasn't enabled. (thus none should be).


performAction

public void performAction()
The action performs it's job on the activated nodes..


 

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