当前页面:
在线文档首页 >
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
org.openide.util.SharedClassObject
org.openide.util.actions.SystemAction
org.openide.util.actions.CallableSystemAction
org.openide.util.actions.NodeAction
org.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
Methods inherited from class org.openide.util.SharedClassObject |
addPropertyChangeListener, equals, finalize, findObject, findObject, firePropertyChange, getLock, getProperty, hashCode, putProperty, putProperty, readExternal, removePropertyChangeListener, reset, writeExternal, writeReplace |
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
GeneralCommandAction
protected GeneralCommandAction()
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..