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

VcsFSCommandsAction (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.modules.vcscore
Class VcsFSCommandsAction

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.VcsFSCommandsAction
All Implemented Interfaces:
Action, ActionListener, ContextAwareAction, ContextAwareDelegateAction.Delegatable, EventListener, Externalizable, HelpCtx.Provider, Presenter, Presenter.Menu, Presenter.Popup, Presenter.Toolbar, Serializable

public class VcsFSCommandsAction
extends NodeAction
implements ActionListener, ContextAwareDelegateAction.Delegatable

The system action with VCS commands, that are provided by the FileSystem.

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
protected  Collection selectedFileObjects
           
 
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
VcsFSCommandsAction()
          Creates a new instance of VcsFSCommandsAction
 
Method Summary
 Action createContextAwareInstance(Lookup actionContext)
           
 JMenuItem[] createMenuItems(boolean inMenu, Lookup lookup)
           
 JMenuItem[] createMenuItems(boolean inMenu, Lookup lookup, boolean checkFSAction)
           
 boolean enable(Node[] nodes)
          Test whether the action should be enabled based on the currently activated nodes.
static CommandTask executeCommand(Command cmd, FileObject[] files)
          Execute the command.
 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.
 JMenuItem getPresenter(boolean inMenu, Lookup lookup)
           
protected  void performAction(Node[] nodes)
          This action does not have a generic performer, since it's composed from all VCS commands.
 
Methods inherited from class org.openide.util.actions.NodeAction
actionPerformed, addNotify, getActivatedNodes, initialize, isEnabled, performAction, removeNotify, setEnabled, surviveFocusChange
 
Methods inherited from class org.openide.util.actions.CallableSystemAction
asynchronous, getToolbarPresenter
 
Methods inherited from class org.openide.util.actions.SystemAction
clearSharedData, createPopupMenu, createToolbarPresenter, get, getIcon, getIcon, 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 java.awt.event.ActionListener
actionPerformed
 
Methods inherited from interface javax.swing.Action
addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 

Field Detail

selectedFileObjects

protected Collection selectedFileObjects
Constructor Detail

VcsFSCommandsAction

public VcsFSCommandsAction()
Creates a new instance of VcsFSCommandsAction

Method Detail

getName

public String getName()
Get a human presentable name of the action.

Returns:
the name of the action

enable

public boolean enable(Node[] nodes)
Test whether the action should be enabled based on the currently activated nodes.

Specified by:
enable in interface ContextAwareDelegateAction.Delegatable
Returns:
true for non-empty set of nodes.

getMenuPresenter

public JMenuItem getMenuPresenter()
Get a menu item that can present this action in a JMenu.

Specified by:
getMenuPresenter in interface Presenter.Menu

getPopupPresenter

public JMenuItem getPopupPresenter()
Get a menu item that can present this action in a JPopupMenu.

Specified by:
getPopupPresenter in interface Presenter.Popup

getPresenter

public JMenuItem getPresenter(boolean inMenu,
                              Lookup lookup)
Specified by:
getPresenter in interface ContextAwareDelegateAction.Delegatable

createMenuItems

public JMenuItem[] createMenuItems(boolean inMenu,
                                   Lookup lookup)

createMenuItems

public JMenuItem[] createMenuItems(boolean inMenu,
                                   Lookup lookup,
                                   boolean checkFSAction)

performAction

protected void performAction(Node[] nodes)
This action does not have a generic performer, since it's composed from all VCS commands. Use actionPerformed() with the command's name as the action command.


executeCommand

public static CommandTask executeCommand(Command cmd,
                                         FileObject[] files)
Execute the command. If the command is CheckInCommand, check for the presence of VcsObjectIntegritySupport is done and AddCommand is performed if necessary.

Every command execution, that wish to present the object integrity dialog should go through this method.

Parameters:
cmd - The command to execute.
files - The files to act on. It's necessary to pass the files here rather than set them directly to the command, because the command can ignore some files, that would then not be considered for addition.
Returns:
The task representing the running command or null when the command is not executed.

getHelpCtx

public HelpCtx getHelpCtx()
Get a help context for the action.

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

createContextAwareInstance

public Action createContextAwareInstance(Lookup actionContext)
Specified by:
createContextAwareInstance in interface ContextAwareAction

 

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