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