gwt cellbrowser [selecting a node] vs [opening a node]
I'm using the gwt cellbrowser, so far it has been an uphill battle. I got this bad feeling that I'm not using it as it is intended to be used.
It seems to me that:
- there is a difference between selecting a node and opening that node.
- there is no way to open/close nodes programatically.
- the cellbrowser's open/close handlers never fire (although clicking on a node renders that node's children in the next panel.
I'm able to use the selectionModel to select a node but that doesn't open the node. 开发者_如何学运维In other words, the node's children don't show up (until I click on the node).
Is there anyway, I can open and close nodes programatically?
Thanks in advance.
I hope this helps. First time helping but long time user. :)
SomeTreeModel treeModel = new SomeTreeModel();
CellBrowser cellBrowser = new CellBrowser(treeModel, null);
// this opens your first node
TreeNode firstNode = cellBrowser.getRootTreeNode().setChildOpen(0, true);
// this opens child of the first node
TreeNode secondNode = firstNode.setChildOpen(0, true);
//etc
In the TreeNode
class there are several helpful methods, like, getChildValue(int index)
, getChildCount()
...
精彩评论