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

ContextAwareDelegateAction (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.modules.vcscore.actions
Class ContextAwareDelegateAction

java.lang.Object
  extended byorg.netbeans.modules.vcscore.actions.ContextAwareDelegateAction
All Implemented Interfaces:
Action, ActionListener, EventListener, LookupListener, Presenter, Presenter.Menu, Presenter.Popup

public class ContextAwareDelegateAction
extends Object
implements Action, LookupListener, Presenter.Menu, Presenter.Popup

A delegate action that is usually associated with a specific lookup and extract the nodes it operates on from it. Otherwise it delegates to the regular NodeAction. Copied from org.openide.util.actions.NodeAction.DelegareAction.


Nested Class Summary
static interface ContextAwareDelegateAction.Delegatable
          This interface should implement the action that needs to be delegated.
 
Nested classes inherited from class org.openide.util.actions.Presenter
Presenter.Menu, Presenter.Popup, Presenter.Toolbar
 
Field Summary
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
ContextAwareDelegateAction(ContextAwareDelegateAction.Delegatable delegate, Lookup actionContext)
          Creates a new instance of ContextAwareDelegateAction
 
Method Summary
 void actionPerformed(ActionEvent e)
          Invoked when an action occurs.
 void addPropertyChangeListener(PropertyChangeListener listener)
           
 JMenuItem getMenuPresenter()
           
 JMenuItem getPopupPresenter()
           
 Object getValue(String key)
           
 boolean isEnabled()
           
 Node[] nodes()
          Nodes are taken from the lookup if any.
 void putValue(String key, Object o)
           
 void removePropertyChangeListener(PropertyChangeListener listener)
           
 void resultChanged(LookupEvent ev)
           
 void setEnabled(boolean b)
           
 String toString()
          Overrides superclass method, adds delegate description.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContextAwareDelegateAction

public ContextAwareDelegateAction(ContextAwareDelegateAction.Delegatable delegate,
                                  Lookup actionContext)
Creates a new instance of ContextAwareDelegateAction

Method Detail

toString

public String toString()
Overrides superclass method, adds delegate description.


nodes

public final Node[] nodes()
Nodes are taken from the lookup if any.


actionPerformed

public void actionPerformed(ActionEvent e)
Invoked when an action occurs.

Specified by:
actionPerformed in interface ActionListener

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Specified by:
addPropertyChangeListener in interface Action

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Specified by:
removePropertyChangeListener in interface Action

putValue

public void putValue(String key,
                     Object o)
Specified by:
putValue in interface Action

getValue

public Object getValue(String key)
Specified by:
getValue in interface Action

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface Action

setEnabled

public void setEnabled(boolean b)
Specified by:
setEnabled in interface Action

resultChanged

public void resultChanged(LookupEvent ev)
Specified by:
resultChanged in interface LookupListener

getMenuPresenter

public JMenuItem getMenuPresenter()
Specified by:
getMenuPresenter in interface Presenter.Menu

getPopupPresenter

public JMenuItem getPopupPresenter()
Specified by:
getPopupPresenter in interface Presenter.Popup

 

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