4
A
回答
4
2
对于那些不喜欢像我这样的google showcase例子的人可以使用这个例子; http://google-web-toolkit.googlecode.com/svn/javadoc/2.1/com/google/gwt/user/cellview/client/CellTree.html
你可以复制粘贴它,它的工作原理。 “
简单的例子
public class CellTreeExample implements EntryPoint {
/**
* The model that defines the nodes in the tree.
*/
private static class CustomTreeModel implements TreeViewModel {
/**
* Get the {@link NodeInfo} that provides the children of the specified
* value.
*/
public <T> NodeInfo<?> getNodeInfo(T value) {
/*
* Create some data in a data provider. Use the parent value as a prefix
* for the next level.
*/
ListDataProvider<String> dataProvider = new ListDataProvider<String>();
for (int i = 0; i < 2; i++) {
dataProvider.getList().add(value + "." + String.valueOf(i));
}
// Return a node info that pairs the data with a cell.
return new DefaultNodeInfo<String>(dataProvider, new TextCell());
}
/**
* Check if the specified value represents a leaf node. Leaf nodes cannot be
* opened.
*/
public boolean isLeaf(Object value) {
// The maximum length of a value is ten characters.
return value.toString().length() > 10;
}
}
public void onModuleLoad() {
// Create a model for the tree.
TreeViewModel model = new CustomTreeModel();
/*
* Create the tree using the model. We specify the default value of the
* hidden root node as "Item 1".
*/
CellTree tree = new CellTree(model, "Item 1");
// Add the tree to the root layout panel.
RootLayoutPanel.get().add(tree);
}
}
”
相关问题
- 1. GWT CellList编辑细胞
- 2. GWT - 在细胞树中添加和移除节点
- 3. GTK中的自定义树细胞渲染器 - 如何获取细胞数据?
- 4. GWT:添加函数clickhandler到ImageResource细胞
- 5. 展开对GWT细胞表需求行
- 6. 如何使用环绕计数细胞自动机中的细胞邻居
- 7. 如何增加GWT celltable的细胞高度:IE问题?
- 8. 如何在同一细胞
- 9. 我如何在细胞
- 10. 如何找到细胞
- 11. 如何只在细胞
- 12. 如何修改在细胞
- 13. 如何编辑细胞Zfdatagrid
- 14. 如何使背景细胞褪色
- 15. 如何从细胞中保存新值,而不是旧细胞?
- 16. 如何合并两种细胞在一个细胞
- 17. 如何维持细胞编辑后的JTable细胞呈现
- 18. 细胞
- 19. 细胞
- 20. 单细胞之和空白细胞
- 21. 订购细胞由中心细胞(S)
- 22. 填充gridview的细胞通过细胞
- 23. 从UILongPressRecognizer确定细胞的细胞
- 24. 如何通过引用到细胞
- 25. 如何利用流式细胞
- 26. 同一视图在细胞大小不同,如何再利用细胞
- 27. Excel - 如何根据细胞的颜色和相邻细胞的颜色来计数细胞?
- 28. 如何使用VBA,使细胞在Excel 2007中的透明
- 29. 检索细胞
- 30. Dart细胞表?
,当前选中的答案是过时的,因为链接是无效的。 – Ben 2012-06-08 12:50:01
链接已更新 – 2012-12-10 13:40:00