本文整理汇总了Java中com.google.gwt.user.cellview.client.TreeNode.setChildOpen方法的典型用法代码示例。如果您正苦于以下问题:Java TreeNode.setChildOpen方法的具体用法?Java TreeNode.setChildOpen怎么用?Java TreeNode.setChildOpen使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.cellview.client.TreeNode
的用法示例。
在下文中一共展示了TreeNode.setChildOpen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openNode
import com.google.gwt.user.cellview.client.TreeNode; //导入方法依赖的package包/类
private boolean openNode(TreeNode node, TreePlace place) {
int childCount = node.getChildCount();
for (int i = 0; i < childCount; i++) {
if (node.getChildValue(i).equals(place)) {
//node.setChildOpen(i, true, true);
return true;
} else if (!node.isChildLeaf(i)) {
boolean wasOpen = node.isChildOpen(i);
TreeNode child = node.setChildOpen(i, true);
if (child != null && openNode(child, place)) {
return true;
} else if (!wasOpen) {
node.setChildOpen(i, false);
}
}
}
return false;
}
示例2: refreshTree
import com.google.gwt.user.cellview.client.TreeNode; //导入方法依赖的package包/类
private void refreshTree(TreeNode node) {
int childCount = node.getChildCount();
for (int i = 0; i < childCount; i++) {
if (!node.isChildLeaf(i) && node.isChildOpen(i)) {
node.setChildOpen(i, false);
TreeNode child = node.setChildOpen(i, true);
if (child != null) {
refreshTree(child);
}
}
}
}
示例3: ReportSelectListCellTree
import com.google.gwt.user.cellview.client.TreeNode; //导入方法依赖的package包/类
public ReportSelectListCellTree(List<ResourceListItem> resourceList, MultiSelectionModel<ResourceListItem> selectionModel) {
super(new CustomTreeModel(resourceList, selectionModel), null, (CellTree.Resources)GWT.create(CustomCellTreeResource.class));
setDefaultNodeSize(10000);
TreeNode treeNode = getRootTreeNode();
for(int i = 0; i < treeNode.getChildCount(); i++) {
treeNode.setChildOpen(i, true);
}
}