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 97325

Summary: No means of controlling which panel is selected
Product: platform Reporter: Nathan Fiedler <nlfiedler>
Component: NavigatorAssignee: David Simonek <dsimonek>
Status: RESOLVED FIXED    
Severity: blocker CC: anebuzelsky
Priority: P2    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on: 100457    
Bug Blocks: 97141    

Description Nathan Fiedler 2007-03-06 23:39:35 UTC
In the XML Schema editor we have a multiview editor and two NavigatorPanels that
are registered for the schema MIME type. Each of the panels is oriented toward
one of the multiview elements (e.g. a "Schema View" panel for the Schema view
MVE, a "Design View" for the Design view MVE). We would like (issue 97141) to be
able to select one of the panels over the other depending on which MVE is
selected. This would work fine, I suppose, if we did not register the
NavigatorPanel against the MIME type of our DataObject. However, taking that
away would be unthinkable (i.e. no navigator when selecting a schema file in the
project is not acceptable).

The problem is in the NavigatorController, which collects all of the available
providers, and if one of them is already the selected panel, then nothing
changes. This makes sense, of course, but leaves us with no way to
programmatically select one panel over the other, whether we install a
NavigatorLookupHint in our TopComponent Lookup or not.

It would suffice if there was an API for selecting the panel to be shown in the
Navigator, but I see none that comes close.
Comment 1 David Kaspar 2007-04-03 09:48:39 UTC
In Visual Mobile Designer we have similar problem. We have a "Design View" with
contains a NavigatorLookupHint. The lookup of the TopComponent also contains
related DataObject. Therefore the navigator is still showing the "Member View"
(from Java file navigator) and even though it does not make sense to have it for
this view. Instead our navigator should be shown.

The solution could be:
1) to be able to have a control for forcing the selected navigator panel or
2) to be able to remove navigator panel or
3) each navigator panel has to have a "priority" property which is used for
resolving a selected panel while a view/node/lookup is changed.

Setting as P2 since it becomes a significant usability problem now.
Comment 2 David Simonek 2007-04-03 10:12:47 UTC
Navigator API already contains NavigatorHandler.activatePanel method, which does
exactly what you would like to achieve I believe.

for details please see javadoc 
http://www.netbeans.org/download/dev/javadoc/org-netbeans-spi-navigator/org/netbeans/spi/navigator/NavigatorHandler.html

In case this API isn't enough, please reopen and describe, thanks.
Comment 3 Karol Harezlak 2007-04-04 13:35:11 UTC
Unfortunately NavigatorHandler.activatePanel depends on many conditions which
are not possible to check outside Navigator module. For example: if list of
Navigators is not yet initialized this method will throw NPE, this invalid state
its common while opening IDE, another problem is that while using 
NavigatorHandler.activatePanel developer is never sure if required
NavigatorPanel is already in list of NavigationPanels. Thees problems could be
avoid by modifying Navigator API and providing Priority for NavigatorPanel, so
ordering and activation of required NAvigatorPanel could be done inside
Navigator module based on priorities of panels available inside of
NavigatorPanels list.   
Comment 4 David Simonek 2007-04-04 14:52:26 UTC
I'm sorry but i don't understand most of what you said... I saw that you entered
the bug for NPE, I'll try to fix it. But aside from this, what are speficically
other problems? What prevents you from calling activatePanel when your top
component is activated?
Comment 5 David Kaspar 2007-04-04 17:09:03 UTC
After discussion with David we have find a conclusion that for NetBeans Mobility
Pack it would be enough to have ability to disable searching for
NavigatorLookHint in data-objects.
Comment 6 David Simonek 2008-10-16 15:31:53 UTC
OK I probably forgot to close this issue, closing now, hopefully problem is solved.