|
org.openide.actions 6.12.1 | |||||||||
PREV NEXT | FRAMES NO FRAMES |
See:
Description
Actions APIs | |
---|---|
org.openide.actions | There are a number of standard system actions available for use in NetBeans. |
XXX no answer for arch-overall
HeapView
preserves its settings between sessions
Settings of showDropShadow
, showText
and tickStyle
are now preserved between sessions in NBPreferences of the same corresponding names.
Use
topComponent.getActionMap().put("jumpPrev", new YourPrevAction()); topComponent.getActionMap().put("jumpNext", new YourNextAction());if your component provides items and you want the user to jump among them using standard next/prev actions.
ActionManager.getDefault()
added
This method should be more convenient than looking for an instance in lookup. Also there is a simple implementation for standalone use available.
This action was used only as default action on templates. It instantiates the template when it was double clicked in the Options dialog. This behaviour was changed and action is not useful anymore. It is deprecated and it usage should be avoided. Part of the deprecatation was that org.openide.loadersDataNode.getDefaultAction() does not return this action on templates anymore.
Introduction of new action system, which generally means
move from usage of SystemAction
to Action
instances.
Look at
general proposal. That document also focuses on declarative actions
usage which is not subject of current change, it will be part of later changes.
Current change is described by description of already implemented changes which also summarizes these API changes.
In order for the action to show up in Keyboards Shortcut dialog you need the action defined in the layer file under "Actions" folder and have the shortcut defined there under "Keymaps/<Profile Name>" linking to your action.
<folder name="Actions" > <folder name="Window"> <file name="org-netbeans-core-actions-PreviousViewCallbackAction.instance"/> </folder> </folder> <folder name="Keymaps"> <folder name="NetBeans"> <file name="S-A-Left.shadow"> <attr name="originalFile" stringvalue="Actions/Window/org-netbeans-core-actions-PreviousViewCallbackAction.instance"/> </file> </folder> </folder>
The mentioned Action has to be a subclass of org.openide.util.actions.CallbackSystemAction
. It does not necessarily has to
perform the action, it's just a placeholder for linking the shortcut. You might want to override it's getActionMapKey()
and give it a
reasonable key.
The actual action that does the work in your component (preferably a simple Swing javax.swing.Action
)
is to be put into your TopComponent
's ActionMap
. The key for the ActionMap
has to match the key defined in the global action's getActionMapKey()
method.
getActionMap().put("PreviousViewAction", new MyPreviousTabAction());
This way even actions from multiple TopComponent
s with the same gesture (eg. "switch to next tab") can share the same configurable shortcut.
Note: Don't define your action's shortcut and don't put it into any of the TopComponent
's
javax.swing.InputMap
. Otherwise the component would not pick up the changed shortcut from the
global context.
|
|
The sources for the module are in the NetBeans Mercurial repositories.
Nothing.
Read more about the implementation in the answers to architecture questions.
|
org.openide.actions 6.12.1 | |||||||||
PREV NEXT | FRAMES NO FRAMES |