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 138924 - Action Wizard disables Shortcut Key feature for CookieActions
Summary: Action Wizard disables Shortcut Key feature for CookieActions
Status: RESOLVED WONTFIX
Alias: None
Product: apisupport
Classification: Unclassified
Component: Templates (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: rmichalsky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-03 11:36 UTC by nvarun
Modified: 2008-07-25 13:10 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nvarun 2008-07-03 11:36:40 UTC
I was trying to create a CookieAction using the Wizard, and Shortcut Key feature was disabled! It works fine for
CallableSystemAction. 

Gj made me realise this fact, that its a bug! Great, I thought CookieAction(s) doesn't support Shortcut Keys, didn't
realize it even, when I used several shortcuts using editor's or Project's sub-nodes, context-menu!

I ran NetBeans 5.5, 6.0 again and found similar problem! Please see if its possible to fix it before Feature Freeze!
Comment 1 nvarun 2008-07-07 14:02:37 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!
Comment 2 Jesse Glick 2008-07-15 13:39:57 UTC
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.)
Comment 3 nvarun 2008-07-15 13:54:22 UTC
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?
Comment 4 Jesse Glick 2008-07-15 15:25:28 UTC
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).
Comment 5 rmichalsky 2008-07-25 12:44:04 UTC
I agree that current behaviour is satisfactory, closing. Nvarun, object if you have strongly different opinion :).
Comment 6 nvarun 2008-07-25 13:10:51 UTC
No issues! Jesse clarified earlier why its not activated, its done for a purpose. I agree to it. Thank you everyone for
help!