开发者

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:

  1. there is a difference between selecting a node and opening that node.
  2. there is no way to open/close nodes programatically.
  3. 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()...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜