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 262548

Summary: wrong selection synchronization of OutlineViews that share a single ExplorerManager
Product: platform Reporter: michael.kuettner
Component: ExplorerAssignee: Jan Peska <JPESKA>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:
Attachments: Test application (zipped Eclipse project)

Description michael.kuettner 2016-06-23 11:26:59 UTC
Created attachment 160147 [details]
Test application (zipped Eclipse project)

My application has multiple OutlineViews that share a single ExplorerManager.
If the user selects a node in one OutlineView all other Views will be synchronized (selection and expand state of the nodes).
This works well in most cases. But there are also cases where this synchronization does not work correctly.

I created a small test application (see attachment tree_view_sync.zip).
This application consists of 5 OutlineViews that share the same ExplorerManager.
On the bottom of the main frame there is a JTextArea that displays all selection events that are generated by the ExplorerManager.
You can select nodes from any of the trees and the other trees will be synchronized.

But is does not work in the following case (see also attached screenshot):
- restart the application
- expand node "2" and select node "2.2" in the first tree
- text area will show the even: SELECTED_NODES: old node: []; new node: [2.2]
- now expand node "1" and select node "1.2" within the same tree
- ExplorerManager now creates a lot of selection events:
SELECTED_NODES: old node: [2.2]; new node: [1.2]
SELECTED_NODES: old node: [1.2]; new node: [2.2]
SELECTED_NODES: old node: [2.2]; new node: []
SELECTED_NODES: old node: []; new node: [2.2]
- but the synchronization between the OutlineViews is not done correctly
- the second selection event seems to re-select the original "old" node

The synchronization seems not to work correctly if you start from the bottom of the tree and select a (still collapsed) node from above the current selection. 

see also: http://forums.netbeans.org/topic66093.html