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.
Run Other... submenu items should be always enabled whether or not the source window has the focus. It should default to the current open source file, if running/ debugging a file.
What Bryan means (I think) is that giving focus to a window which has no selection (distinct from an empty selection), such as the Output Window, should not cancel the menu item. E.g. in NodeAction's, this is handled by surviveFocusChange -> true. Selecting e.g. the Projects tab will continue to enable or disable actions acc. to what is selected in that tab. Probably this requires an API change. The problem is that ActionsInfraHid.UsefulThings.updateLookup operates on currentNodes, and here we want activatedNodes. For that to be possible, ContextGlobalProvider.createGlobalContext would have to take a boolean param 'activated' (or have an extension interface), and Utilities.actionsGlobalContext would need to have a variant using activatedNodes rather than currentNodes. Not possible for 4.0 -> future.
I think that the implementation of survivefocuschange can be directly in openide/actions, we do not need to introduce new apis.
Well of course we can do this w/o visible API changes if we change the behavior of the *existing* Utilities.actionsGlobalContext to survive focus change. Is that acceptable? Could anything be broken by it?
I was not clear enough, sorry. The NodeAction works over actionGlobalContext and works fine. So there is not incompatible behaviour, no changes in openide, we may just need to fix the lookupaction. The contract is not nice but is tested here: http://www.netbeans.org/source/browse/openide/test/unit/src/org/openide/windows/GlobalContextImplTest.java?rev=1.4.4.1&content-type=text/x-cvsweb-markup So both TopComponent.setActivatedNodes new Node[0] and null returns zero length from allInstances(), but the later returns allItems()[0].getInstance() == null.
OK... maybe you can advise Petr on how to use actionsGlobalContext then, since I don't believe this hack is documented.
The contract is described in my previous post, but of course I can, just let me know Hrebejku when you want to do it.
there's no Run Other submenu anymore.. closing as wontfix, not sure if the following tecnical discussion still applies, if so, please reopen
Was about making actions like Test File continue to be enabled after selecting Output Window. But that already works. So I guess this was fixed at some point.