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.
Allow control of the selection mode (choices in swing are SINGLE_TREE_SELECTION, CONTIGUOUS_TREE_SELECTION, DISCONTIGUOUS_TREE_SELECTION) from the TreeView APIs.
Target milestone -> 3.3
Target milestone -> 3.3.1.
I did bring this up on nbdev and this bug was filed as a result =). See <http://www.netbeans.org/servlets/ReadMsg?msgId=79269&listName=nbdev>
Once this is implemented, the DataObject editor in the core should be cleaned up to use this solution.
This should be easy and straighforward API change, remember modification of DataObject (consult wiht Petr Hamernik if needed).
x
Created attachment 5377 [details] a proposed implementation
I attached a simple patch. I played with it and it worked for me, JTree dial lowed multiple selection if I set SINGLE_TREE_SELECTION e.g. I was not sure if I understand demand correctly. If yes then a proposed patch solved it enough. Rochelle, could you look on the patch? Thank you
I guess our paths crossed =). I don't understand what you mean " JTree dial lowed multiple selection if I set SINGLE_TREE_SELECTION". I assume there's a typo there, but I'm unsure about the intent of the statement. Can you clarify?
Yes, you are right, it was typo. I thought the JTree *disallowed* multiple selection if I set SINGLE_TREE_SELECTION. (my spell checker made this replace :-) I wanted say: adding these two methods reach the TreeView behavior which is asked IMHO. Question for you should be: Is the last statement truthful? Sorry for my bad english.
Yes, JTree behavior was the goal. I didn't try the patch, but your description sounds like it is working correctly. The only other comment I have is to mention the default in the javadoc.
Probably those new methods should be final. What happens when one calls ExplorerManager.setSelectedNodes (new Node[2]) - will the JTree properly veto the selection?
What happens in that case if the JTree is configured for single selection via a java subclass of TreeView which allows access to the JTree? This should behave in the same way.
Created attachment 5500 [details] a binary patch
the methods are added, implemented in main trunk
There are 3 outstanding parts: 1) javadoc lists the choices without TreeSelectionModel as a prefix which means a user who reads it literally will have broken code 2) javadoc still doesn't list the default as I requested 3) DataObjectTreeView has not been cleaned up (see SingleSelectionBeanTreeView in core/src/org/netbeans/beaninfo/editors/DataObjectTreeView.java)
Assigned to new owner.
Just curious - what is the progress with this issue in NB5 so far?
The proposal was implemented, all Rochelle's complains were resolved over the time, so I can close this as fixed. Thanks to everybody involved.