Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 187621 - Main-project-sensitive actions not consistently run when keystroke first pressed
Main-project-sensitive actions not consistently run when keystroke first pressed
Product: projects
Classification: Unclassified
Component: Generic Projects UI
PC Linux
: P3 (vote)
: 7.0
Assigned To: Jesse Glick
Depends on:
Blocks: 178848
  Show dependency treegraph
Reported: 2010-06-15 23:32 UTC by Jesse Glick
Modified: 2010-06-24 22:07 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2010-06-15 23:32:07 UTC
Probably due to fix of bug #178848, sometimes when you press F11, F6, etc. with a capable project selected, nothing happens until you press it again. Probably the action is still disabled. I am running with all toolbars disabled, in case it matters.
Comment 1 Jesse Glick 2010-06-22 16:20:13 UTC
If the Run toolbar is hidden there is no remaining property change listener to most main-project-sensitive actions. (Debug Project has a couple anyway, but Build Project etc. does not.) If the action was formerly disabled, and the selection is changed so that a valid project is selected, the action is marked "dirty" but not eagerly refreshed. However, in 6.8, if the keyboard shortcut (e.g. F11) is pressed, the IDE's keystroke handler checks action.isEnabled(), which forces an immediate refresh of action state. After refresh for m-p-s actions was made asynchronous in 6.9, the keystroke handler would call isEnabled and a refresh would be scheduled, but isEnabled would still return false on that call; that is why pressing the key a second time would work.

(When the Run toolbar is visible - the default setup for the IDE - all visible actions are refreshed eagerly as soon as selection changes, so the problem is not visible.)

The fix is to force synchronous refresh when action state is directly queried, while continuing to run asynchronous refresh in response to change events (usually change in selection). core-main #b10dc54b7c2e
Comment 2 Quality Engineering 2010-06-23 03:30:35 UTC
Integrated into 'main-golden', will be available in build *201006230001* on (upload may still be in progress)
User: Jesse Glick <>
Log: Issue #187621: update enablement state for (main-)project actions immediately if the keyboard shortcut is invoked.
Comment 3 rbalada 2010-06-23 22:30:50 UTC
Please verify bugfix for this bug ASAP, so it can be integrated into release691

Comment 4 Jesse Glick 2010-06-23 23:31:37 UTC
Anyone available to help verify?
Comment 5 Antonin Nebuzelsky 2010-06-24 14:22:45 UTC
I am able to reproduce reliably in 6.9 with the following steps:

* have 2 projects open, none of them as a main project
* unselect project A
* show Run menu in the main menu bar, actions shown as disabled
* select project A
* F6 - fails
* F6 - succeeds
* repeat from step 2

In the latest trunk build I am not able to reproduce anymore.

Comment 6 rbalada 2010-06-24 22:07:28 UTC
main #b10dc54b7c2e transplanted to release691 #f7c4e62beb1e

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo