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.
Summary: | Action Wizard disables Shortcut Key feature for CookieActions | ||
---|---|---|---|
Product: | apisupport | Reporter: | nvarun <nvarun> |
Component: | Templates | Assignee: | rmichalsky <rmichalsky> |
Status: | RESOLVED WONTFIX | ||
Severity: | blocker | ||
Priority: | P3 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
nvarun
2008-07-03 11:36:40 UTC
I have found a workaround, follow the steps to execute the Workaround! 1. Add this code into the appropriate XML Layer- <folder name="Shortcuts"> <file name="O-F3.shadow"> <attr name="originalFile" stringvalue="Actions/Tools/org-nvarun-tat-SayCheez.instance"/> </file> </folder> 2. O-F3.shadow means you have registered "Alt+F3" symbolic link, for action to be listed under Tools Menu! Refer this for more details - http://wiki.netbeans.org/DevFaqActionsFolder 3. For putting shortcut key of your choice, refer this - http://wiki.netbeans.org/FaqHowToTweakRegistryByCodeReplacement 4. replace org-nvarun-tat with your package, and SayCheez with your Action class. Hope this helps! Intentional IIRC, since CookieAction's are most commonly used for context-sensitive actions that are likely to reside just in a context menu. However it is certainly permitted to create global shortcuts even for context-sensitive actions. (It is not _advisable_ unless you expect there to be a lot of nodes for which the action would be enabled. Ditto for creating global menu items or toolbar buttons.) Should I consider there's gonna be a fix, or should I follow the workaround wherever possible, as you rightly said- CookieAction are context-aware, rather it might not always be necessary to have a shortcut.. What say? I don't know if the wizard will be changed for 6.5 or not. Regardless, adding a shortcut registration to the layer directly is not a "workaround", it is just normal module development that happens to not have a wizard for it yet. And yes, you should consider whether a shortcut is really appropriate for a context-sensitive action, but this is a decision that has to be made with the whole application's workflow in mind. For example, SaveAction is sensitive to SaveCookie. It is bound to Ctrl-S even though it will be disabled on most nodes, because people expect Ctrl-S to be available when a document is modified, and as a shortcut it is used very frequently. Less generic actions which only make sense in a handful of places and would not be used routinely should not have accelerators by default (users can always add them if they have an unusual working style). I agree that current behaviour is satisfactory, closing. Nvarun, object if you have strongly different opinion :). No issues! Jesse clarified earlier why its not activated, its done for a purpose. I agree to it. Thank you everyone for help! |