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 49034 - Run Other... submenu items should use lazy selection tracking
Summary: Run Other... submenu items should use lazy selection tracking
Status: RESOLVED WORKSFORME
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Projects UI (show other bugs)
Version: 4.x
Hardware: All All
: P4 blocker with 1 vote (vote)
Assignee: Milos Kleint
URL:
Keywords: API
Depends on:
Blocks: 41535
  Show dependency tree
 
Reported: 2004-09-14 22:05 UTC by Unknown
Modified: 2012-08-23 14:38 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Unknown 2004-09-14 22:05:13 UTC
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.
Comment 1 Jesse Glick 2004-09-15 17:34:59 UTC
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.
Comment 2 Jaroslav Tulach 2004-09-20 13:30:50 UTC
I think that the implementation of survivefocuschange can be directly
in openide/actions, we do not need to introduce new apis.
Comment 3 Jesse Glick 2004-09-20 15:07:30 UTC
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?
Comment 4 Jaroslav Tulach 2004-09-21 12:27:40 UTC
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.
Comment 5 Jesse Glick 2004-09-21 20:43:54 UTC
OK... maybe you can advise Petr on how to use actionsGlobalContext
then, since I don't believe this hack is documented.
Comment 6 Jaroslav Tulach 2004-09-29 07:24:43 UTC
The contract is described in my previous post, but of course I can,
just let me know Hrebejku when you want to do it.
Comment 7 Milos Kleint 2012-08-23 14:21:22 UTC
there's no Run Other submenu anymore.. closing as wontfix, not sure if the following tecnical discussion still applies, if so, please reopen
Comment 8 Jesse Glick 2012-08-23 14:38:49 UTC
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.