CheckBoxTree with DigIn

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.

CheckBoxTree with DigIn

Postby Bosk » Fri Oct 09, 2009 6:01 am

How to easy change CheckBoxThree behavior with DigIn. I need functionality similar as DigIn, but if undo parent we haven't checked childs DigIn remove selection from parent, but I want save this selection for parent.

1. If we set check in parent node - all childs under parent must be cheked.
2. If we remove check in all childs - parent node must be cheked.
3. If we remove check from parent - check from child must be removed.
4. If we set check for child but parent is uncheked, we must set check to parent.
Bosk
 
Posts: 2
Joined: Wed Jan 09, 2008 7:11 am

Re: CheckBoxTree with DigIn

Postby JIDE Support » Fri Oct 09, 2009 9:12 am

Please try extend CheckBoxTreeSelectionModel to create your own selection model. Since the item 2 in your request is kind of conflict with the concept of digIn, I cannot see an easy way to achieve this in just a few lines. The issue is that, if all children are unchecked, which selection path will you save in the selection model? If you save the parent as checked, the children nodes will be painted as checked automatically in next painting. Hence, you probably have to add a flag to distinguish the normal parent check and the empty parent check and control the behavior everywhere with the flag.

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

Re: CheckBoxTree with DigIn

Postby Bosk » Tue Oct 13, 2009 6:30 am

I try to extend CheckBoxTreeSelectionModel.
Code: Select all
public class MyCheckBoxTreeSelectionModel extends CheckBoxTreeSelectionModel
{

   public MyCheckBoxTreeSelectionModel(TreeModel model)
   {
      super(model);
   }
}

But I don't understand in which methods I must use flags. I try to create my own method
Code: Select all
public void removeSelectionPaths(TreePath[] paths, boolean doFireEvent)

it's don't help me, because toggleRemoveSelection and delegateRemoveSelectionPaths is not visible. May be i'm moving in a wrong way?
Bosk
 
Posts: 2
Joined: Wed Jan 09, 2008 7:11 am

Re: CheckBoxTree with DigIn

Postby JIDE Support » Tue Oct 13, 2009 8:42 am

As we said, it's not easy to do so due to the reason we stated in the previous post. Please feel free to create your own selection model with JIDE CheckBoxTreeSelectionModel source code at https://jide-oss.dev.java.net/.

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 74 guests