本文整理汇总了Java中com.google.gwt.user.cellview.client.TreeNode.getChildCount方法的典型用法代码示例。如果您正苦于以下问题:Java TreeNode.getChildCount方法的具体用法?Java TreeNode.getChildCount怎么用?Java TreeNode.getChildCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.cellview.client.TreeNode
的用法示例。
在下文中一共展示了TreeNode.getChildCount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: findNode
import com.google.gwt.user.cellview.client.TreeNode; //导入方法依赖的package包/类
@Nullable
private TreeNode findNode(TreeNode node, String nodeId) {
int childCount = node.getChildCount();
for (int i = 0; i < childCount; i++) {
TreeNode child = node.getChild(i);
TreeState.TreeNodeState nodeState = (TreeState.TreeNodeState)child.getValue();
if (Objects.equals(nodeState.myId, nodeId)) {
return child;
}
TreeNode in = findNode(child, nodeId);
if (in != null) {
return in;
}
}
return null;
}
示例3: setOpen
import com.google.gwt.user.cellview.client.TreeNode; //导入方法依赖的package包/类
private void setOpen(TreeNode node, boolean open) {
if (node != null) {
for (int i = 0; i < node.getChildCount(); i++) {
if (!node.isChildLeaf(i)) {
setOpen(node.setChildOpen(i, open), open);
}
}
}
}
示例4: 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);
}
}
}
}
示例5: 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);
}
}