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 136919 - There is doubled navigator panels list in case DataObject and NavigatorLookupHint are used together
Summary: There is doubled navigator panels list in case DataObject and NavigatorLookup...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Navigator (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: David Simonek
URL:
Keywords:
: 148057 (view as bug list)
Depends on:
Blocks: 127687
  Show dependency tree
 
Reported: 2008-06-10 14:08 UTC by Vitaly Bychkov
Modified: 2009-02-19 22:53 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
modified NavigatorController (31.78 KB, text/plain)
2008-10-14 02:35 UTC, Vitaly Bychkov
Details
diff (1.16 KB, text/plain)
2008-10-14 02:35 UTC, Vitaly Bychkov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vitaly Bychkov 2008-06-10 14:08:55 UTC
There is a case when TopComponent has Lookup with Dataobject and has dynamic node activation logic. 
The activated node has a NavigatorLookupHint.
In result if node has NavigatorLookupHint with the same mime-type the list of navigator panels are doubled.

It isn't good approach to use NavigatorLookupHint and Dataobject at once but any way it is wrong behavior to return
doubled panels list. 

I guess the problem is in NavigatorController.obtainProviders(Collection<? extends Node> nodes)
in the part // search based on Node/DataObject's primary file mime type.
Comment 1 David Simonek 2008-06-18 13:26:11 UTC
It's really bad approach to use NavigatorLookupHint and Dataobject at once...
Comment 2 David Simonek 2008-09-30 14:46:45 UTC
After evaluation, my conclusion is that this bug must be fixed on client's side. Navigator infrastructure has no
reliable way of recognition that two panels are identical. There should be two instances of panels in this case, one
from DataObject and one from NavigatorLookupHint, so identity check won't work. Please change providers so that only one
way of registration is at the place all the time, thank you.
Comment 3 Vitaly Bychkov 2008-10-14 02:32:03 UTC
dsimonek as I know the list of navigator panels are defined by mime-type.
In case data object it is mime-type of the primary file of data object.
In case lookup hint it is mime-type defined by NavigatorLookupHint.

So in case the same mime-types we always got 2 absolutly identical lists of the navigator panels.
More over in case navigator panels  defined by NavigatorLookupHint the NavigatorController#obtainProviders has a check 
statement to avoid doubled panels.

I've looked through the NaviogatorController#obtainProviders to fix the issue.
Please take a look at the suggested solution it is in attachment.

Comment 4 Vitaly Bychkov 2008-10-14 02:35:08 UTC
Created attachment 71717 [details]
modified NavigatorController
Comment 5 Vitaly Bychkov 2008-10-14 02:35:41 UTC
Created attachment 71718 [details]
diff
Comment 6 David Simonek 2008-12-04 15:56:45 UTC
hello, finally I had time to look at this issue - and i agree with you, sorry for misunderstanding. If providers produce
duplicated instances, then of course we may and should strip them out - I thought that instances are not identical in
your case.

Thank you for the patch, unfortunately it works correctly only for single node selection, however I modified it easily,
thanks.

fixed in #032d7cacebe1
Comment 7 David Simonek 2008-12-04 16:05:02 UTC
*** Issue 148057 has been marked as a duplicate of this issue. ***
Comment 8 Quality Engineering 2008-12-05 06:12:38 UTC
Integrated into 'main-golden', will be available in build *200812050201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/032d7cacebe1
User: Dafe Simonek <dsimonek@netbeans.org>
Log: #136919: eliminate duplicated navigator panels