How to detect if cell has parents in CellTree?

31 views
Skip to first unread message

membersound

unread,
Jan 11, 2013, 6:41:53 AM1/11/13
to google-we...@googlegroups.com
On selection of a child item in a CellTree, I can get the selected item by:
MyItem item = selectionModel.getSelectedObject();


How can I tell if MyItem has a parent? Or that it is not a root element?

Thomas Broyer

unread,
Jan 11, 2013, 7:17:24 AM1/11/13
to google-we...@googlegroups.com
  • Use a different selection model for the root nodes than for the others
  • or look for the selected item in the list of root items (getRootTreeNode then getChildCount and getChildValue)
?

membersound

unread,
Jan 11, 2013, 7:30:22 AM1/11/13
to google-we...@googlegroups.com
Gosh, I did not think about adding different selection models. This makes it very easy to track indeed!
Reply all
Reply to author
Forward
0 new messages