Checkbox tree

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.

Checkbox tree

Postby jamindhar » Sun Jul 19, 2009 2:38 am

Hi,


I want to select all the check boxes by default in checkbox tree. how can i do that ...?
jamindhar
 
Posts: 18
Joined: Mon Aug 25, 2008 11:53 pm

Re: Checkbox tree

Postby JIDE Support » Sun Jul 19, 2009 7:12 am

Please try the following codes:

Code: Select all
        Object root = _tree.getModel().getRoot();
        _tree.getCheckBoxTreeSelectionModel().addSelectionPath(new TreePath(root));


Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Checkbox tree

Postby RajaRajeswari_V » Sun Jul 19, 2009 8:20 am

is it possible to select only few paths by default..? we are creating a ui where the user can select few paths to display a diagram. whenever he wants to revisit the application we want to show them the previous selected paths..we are storing the selection in Hashset<TreePath>.is there any way to do this?
RajaRajeswari_V
 
Posts: 25
Joined: Tue Apr 28, 2009 8:33 pm

Re: Checkbox tree

Postby JIDE Support » Sun Jul 19, 2009 8:26 am

Please try use TreeUtils#saveSelection/loadSelection to achieve your goal.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: Checkbox tree

Postby RajaRajeswari_V » Sun Jul 19, 2009 8:58 am

hi,

Thanks for your quick reply. but the treeutils.saveselction is returning the null. please send me any sample code to do this.
RajaRajeswari_V
 
Posts: 25
Joined: Tue Apr 28, 2009 8:33 pm

Re: Checkbox tree

Postby JIDE Support » Sun Jul 19, 2009 12:57 pm

Some similar terms are hidden here. We probably mistook your request in previous post. Here are the clarification.

TreeUtils#saveSelection() returns the visual selections which changes the background of the selected item like other JTree.

yourCheckBoxTree.getCheckBoxTreeSelectionModel().getSelectionPaths() returns the check box selections which reflects the state of check boxes in the CheckBoxTree.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


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

Who is online

Users browsing this forum: No registered users and 67 guests