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.
I hook the ExplorerManager of a BeanTreeView to listen for PROP_SELECTED_NODES change. But when I try to click the view with CTRL pressed, a) the event is sent only for some nodes. b) the set if nodes for which it works change - for a while, the event is fired for some, then after some more clicking some other ones start to work and others stop c) when clicking with CTRL held down, sometimes it goes all wrong - nothing selected, click one and several get selected at once It looks like the ExplMan is out of sync with the view. It probably holds some internal state of the selection, but this state does not agree with the selection displayed in the view.
Ondro, I evaluate ASAP what's wrong.
Created attachment 10439 [details] a demo program
I don't see what's wrong. The selection changes in JTree are correctly propagated to ExplorerManager and followup fired outside, for me it looks ok. I attached a simple program, it listens on ExplorerManager and prints a content of this property. Could you reproduce this problem with the attached program? Or could attach any program which can demonstrate it? I left it open for now. Pls. attach a comment. Thanks
I didn't reproduced it in your demo test, but I did in JarPackager but also in the Options dialog in projects. I didn't manage to find any regularity of when it appears, but when I click it for some time, it appears. Just give me a call when it suits you and I'll show you. I've probably got the right clicking pattern ;-)
Created attachment 10551 [details] a help code for investigate
I attached a code for deeply investigation. There are println from TreeView's TreeSelectionListener and from ExplorerManager's PropertyChangeListener. You could see the content of native JTree's selection paths and compare with value of PROP_SELECTED_NODES in ExplorerManager. Pls. send a result of your scrutiny. Thanks
I tried it with your patch and found out that *selection in TreeView and ExplorerManager are the same, but it the nodes don't appear to be selected*. At some point , even that the TV correctly deselects as I click , the internal state ov TV and EM incorrectly indicates that the node is still selected. Simply put, there's a difference between what is kept internally (inside TV and EM) and what is shown on the screen. The logic of selections is correct with respect to *what is seen*, only from time to time the internal state of the selection is displayed -- that appears as *one click -> many selections at once*. But internally it is wildly out of sync.
I'm sure. The prints in TreeView display a state from TreeSelectionListener attched on JTree, prints the content of TreeSelectionEvent. Do you want to say that JTree wrongly fires selection changes? I suppose: not. Could you more precise problem or call me home?
There are discrepancies in visible selection in TreeTableView and content of PROP_SELECTED_NODES. It is maybe regression of issue 32462.
I reverted fix of 32462; now it should bahave same as in nb3.5.
verified