How to insert node using FilterableTreeModel

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.

How to insert node using FilterableTreeModel

Postby ismail_mca » Sat Jul 04, 2009 11:35 am

I've implemented searchable menu tree using model as FiltrableTreeModel.

Per new requirement,we want ti implement Drag and Drop facility to the same Searchable Tree.

Since FiltrableTreeModel doesnt have methods like insert/remove node methods.So,we cant implement Drag and Drop.

Is there way to inser/remove node using FilterableTreeModel ?
(Its not possible to use model as DefaultTreeModel in place of FilterableTreeModel as we need searchable option)

Please help me.

Thanks
ismail_mca
 
Posts: 1
Joined: Thu Jun 25, 2009 6:22 am

Re: How to insert node using FilterableTreeModel

Postby JIDE Support » Sat Jul 04, 2009 3:30 pm

Since FilterableTreeModel is just a model wrapper, it just reflects the records in original data model after filtering. So we don't have a plan to implement insert/remove interfaces like DefaultTreeModel does.

To achieve your goal, please try change the original tree model accordingly while drag and drop happens then fire proper tree node remove/insert/change event. FilterableTeeModel will notify the update to the JTree as well. With these steps, JTree will update the UI just like you want, removing the node from the start dragging position and inserting the node to the target position.

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