Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #1869 > unrolled thread
| Started by | "Markward" <markward@THRWHITE.remove-dii-this> |
|---|---|
| First post | 2011-04-27 15:35 +0000 |
| Last post | 2011-04-27 15:35 +0000 |
| Articles | 3 — 2 participants |
Back to article view | Back to comp.lang.java.gui
JFace, CheckboxTreeViewer "Markward" <markward@THRWHITE.remove-dii-this> - 2011-04-27 15:35 +0000
Re: JFace, CheckboxTreeVi "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> - 2011-04-27 15:35 +0000
Re: JFace, CheckboxTreeVi "Markward" <markward@THRWHITE.remove-dii-this> - 2011-04-27 15:35 +0000
| From | "Markward" <markward@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:35 +0000 |
| Subject | JFace, CheckboxTreeViewer |
| Message-ID | <1182324673.729864.180420@q69g2000hsb.googlegroups.com> |
To: comp.lang.java.gui Hello everybody! I have a big problem understanding the setChecked and setCheckedElements methods of CheckboxTreeViewer. What exact data do these methods expect? This is our scenario: We have lets say "items", which are represented as leafs in the tree- structure. These items are organized in "folders" to facilitate finding the items in the Tree-Control. So to populate the TreeViewer-component, we build up a tree-data- structure consisting of folders and items. This works very well so far, as the tree is shown correctly. Now comes the usecase: The selected items are associated with entitys in our database. When reading such an entity from the db, we get back a flat list of items (without their folder-information), associated with the db-entity. Our goal is now to set the appropriate checkboxes in the CheckboxTreeViewer by calling setChecked/setCheckedElements. As the Javadocs say, that setCheckedElements expects Object[]. Our assuption was now, that we can provide a flat list of items, that can be uniquely identified by their .equals()-method, or with the help of an IElementComparer-implementation. But when such a flat list is provided, the items can not be found in the CheckboxedTreeViewer. Inspecting the code at runtime suggested, that the control tries to climb along some parent/child-structure, which of course is not present in our flat db-items. The only way we could get the methods to work was to access the exact reference of the underlying tree-data-structure, get a reference to one of its nodes and provide this reference to the mentioned methods. Does that mean, that we have to implement the search in the tree ourselfs and memorize the references to the proper tree-items in the Object[] ? Any help is very appreciated. Regards, Markward --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [next] | [standalone]
| From | "Roedy Green" <roedy.green@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:35 +0000 |
| Subject | Re: JFace, CheckboxTreeVi |
| Message-ID | <1oth739m1qrl1fsioj90pran7197n3cb57@4ax.com> |
| In reply to | #1869 |
To: comp.lang.java.gui On Wed, 20 Jun 2007 00:31:13 -0700, Markward <markward.schubert@gmail.com> wrote, quoted or indirectly quoted someone who said : >Does that mean, that we have to implement the search in the tree >ourselfs and memorize the references to the proper tree-items in the >Object[] ? I don't properly understand your question, so I will just make some general observations that might be useful. I apologise If am belabouring the obvious. Your objects you use to represent your nodes and leaves will be a custom class or two custom classes . They can have all manner of additional information in them. The tree structure is for controlling collapse of detail. You can have your own search stuff that works quite independently e.g. by adding your objects to various sorted ArrayLists or HashMaps or TreeMaps. -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [prev] | [next] | [standalone]
| From | "Markward" <markward@THRWHITE.remove-dii-this> |
|---|---|
| Date | 2011-04-27 15:35 +0000 |
| Subject | Re: JFace, CheckboxTreeVi |
| Message-ID | <1182337400.380313.134590@g4g2000hsf.googlegroups.com> |
| In reply to | #1870 |
To: comp.lang.java.gui Thanks for the reply! Sorry that I formulated the question so complicated. I will try to reduce it a bit :-). What kind of objects are expected by the setCheckedElements-method? Can I simply provide single objects, that are disconnected from the model's tree structure to specify, which item should be checked? Or is this method implemented to work only with references to objects properly wired in the tree-model (with all the parents and childs)? Regards, Markward --- * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet! --- Synchronet 3.15a-Win32 NewsLink 1.92 Time Warp of the Future BBS - telnet://time.synchro.net:24
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.gui
csiph-web