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 214061 - Shortcut only becomes effective after Navigation to Menu
Summary: Shortcut only becomes effective after Navigation to Menu
Status: RESOLVED INVALID
Alias: None
Product: platform
Classification: Unclassified
Component: Actions (show other bugs)
Version: 8.0
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Jan Peska
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-12 17:01 UTC by ngx472
Modified: 2014-09-14 14:18 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 ngx472 2012-06-12 17:01:18 UTC
I define several shortcuts in py project: F6, F8, F9, F10, F11
For unknown reason only F10 works straight aw2ay
ALl other shortcuts dont
However, whenever you navigate to the menu, these shortcuts suddenly work afterwards and for the whole session 
The shortcuts are defined through the xml file as per the ancient recommendation...
Comment 1 ngx472 2012-08-06 19:49:36 UTC
Confirm this in 7.2
To be more precise: I have 2 actions in my SQL IDE:

1) a run action defined like this:

@SuppressWarnings("serial")
@ActionID(id = "com.sqlbrowser.module.sqlsupport.editor.actions.RunSQLAction", category = "Run")
@ActionRegistration(displayName = "Run", lazy=false)
@ActionReferences(value = {
  @ActionReference(path = "Shortcuts", name = "F10"),
  @ActionReference(path = "Menu/&Run", position = 351),
  @ActionReference(path = "Toolbars/Run", position = 352),
  @ActionReference(path = "Editors/Keybindings/NetBeans", name = "F10")})
public class RunSQLAction extends CookieAction {
...

2) a debug action defined like this:
@ActionID(id = "com.sqlbrowser.module.debugger.DebugStartAction", category = "Debug")
@ActionRegistration(displayName = "Start Debugger", lazy=false)
@ActionReferences(value = {
  @ActionReference(path = "Shortcuts", name = "F5"),
  @ActionReference(path = "Menu/Debug", position = 341),
  @ActionReference(path = "Toolbars/Run", position = 351),
  @ActionReference(path = "Editors/Keybindings/NetBeans", name = "F5")}
)
public final class DebugStartAction extends CookieAction {

I checked all the code that enable/disable these actions and nothing looks strange

So the behavior is that, from the Editor window, F10 is effective (launches the Run action) while F5 is irresponsive

However, if I swap F5 & F10 in the declaration, now F10 launches the SQL debugger

This shows that it is not so much the actions that are responsibles but more the shortcuts themselves, as if F5 has an assignment from another module which I use as  a dependency. 

So I removed the F5 bindings to see if F5 would be assigned to something else by looking at Options / Shortcuts, but F5 does not seem to be assigned to anything...
Comment 2 ngx472 2012-08-07 16:44:51 UTC
Additional comments:

Of course, as in 7.1.1 navigating to the menu by Alt + TopLevel menu accelerator and showing the menu 'magically' activates the F5 key

This happens for F5, F6, F7, F8

F10 & F12 work straight away
Comment 3 ngx472 2014-07-06 17:15:33 UTC
I am now only using 
  @ActionReference(path = "Shortcuts", name = "F10"),
i.e. no longer 
  @ActionReference(path = "Editors/Keybindings/NetBeans", name = "F10")

This shows the shortcut keys in the menu
However, for most of the shortcuts, an initial Navigation to the Menu with Enter pressed on the Action will 'trigger' the binding of the shortcut key (the shortcut key is not active until then)
Comment 4 ngx472 2014-09-14 14:18:55 UTC
Can't reproduce in 8