TreeComboBox with multiple selection or checkboxes

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

TreeComboBox with multiple selection or checkboxes

Postby td84 » Wed Dec 09, 2015 2:16 am

Hello,

i would like to use in a project TreeComboBox like here (http://undocumentedmatlab.com/blog/usin ... ombo-boxes) and combine it with checkboxes. The Tree should then allow multiple selections. This means, someone should be able to select the leafs of the tree separately or a complete node could be selectable (selecting all leafs automatically). Is it possible to expand TreeComboBox with checkboxes, or is there an option to have a TreeComboBox more then one selected items at a time?

At the end, i would like to have something like this (https://www.jstree.com/) in Java.

Can you provide some simple code?

Thanx in advance, Daniel
td84
 
Posts: 32
Joined: Tue Dec 08, 2015 4:02 pm

Re: TreeComboBox with multiple selection or checkboxes

Postby JIDE Support » Wed Dec 09, 2015 9:23 am

Unfortunately it needs quite an effort to get it working. I can add this code to show a CheckBoxTree in the combobox but it still behaves like a normal tree (a single click will dismiss the popup). If you really need it, you will have to create your own customize combobox. Try to create your own popup panel subclass to do it. In the CheckBoxListComboBox, we created MultiSelectListChooserPanel and CheckBoxListChooserPanel. Both have OK and Cancel buttons. You can do the same thing except using CheckBoxTree.

Code: Select all
        ExComboBox treeComboBox = new TreeExComboBox() {
            @Override
            protected JTree createTree(TreeModel model) {
                return new CheckBoxTree(model);
            }
        };
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: TreeComboBox with multiple selection or checkboxes

Postby td84 » Sat Dec 12, 2015 5:59 am

Ok, thanx. I'll play a bit with it.
td84
 
Posts: 32
Joined: Tue Dec 08, 2015 4:02 pm


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 14 guests

cron