This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 36537 - Use ContextAwareAction
Summary: Use ContextAwareAction
Status: NEW
Alias: None
Product: obsolete
Classification: Unclassified
Component: externaleditor (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@obsolete
URL: http://www.netbeans.org/download/dev/...
Keywords:
Depends on:
Blocks:
 
Reported: 2003-10-10 17:14 UTC by Jesse Glick
Modified: 2006-12-18 23:59 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2003-10-10 17:14:33 UTC
In NB 3.5, the API
org.openide.util.ContextAwareAction was introduced
to make it easier to invoke actions directly with
some parameters, rather than relying on the global
node selection.

Previously, NodeAction could be invoked with an
ActionEvent source of type Node or Node[], as a
hack for clients like externaleditor.

Now this is supported properly. No need to cast to
NodeAction in ExtEdKit, or to ask for the node
selection of the editor pane. For any Action you
wish to invoke, take the CloneableEditor and call
getLookup (see URL for API info incl. change to
OIDE-M-IDE-Dependencies). Then if the action is a
ContextAwareAction, pass that lookup to the cCAI()
method to get an action clone which is specific to
that node selection, cookies, etc. Now just call
it (ActionEvent irrelevant). This should correctly
pass the activated node, cookies, etc. to the
action - e.g. for CompileAction, the context aware
instance will have a reference to the
CompilerCookie held by the activated node in the
editor pane (i.e. the DataObject.nodeDelegate).