当前位置: 首页>>代码示例>>Java>>正文


Java TreeNode类代码示例

本文整理汇总了Java中com.google.gwt.user.cellview.client.TreeNode的典型用法代码示例。如果您正苦于以下问题:Java TreeNode类的具体用法?Java TreeNode怎么用?Java TreeNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TreeNode类属于com.google.gwt.user.cellview.client包,在下文中一共展示了TreeNode类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:19,代码来源:NavigationActivity.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:GwtTreeImpl.java

示例3: init

import com.google.gwt.user.cellview.client.TreeNode; //导入依赖的package包/类
@Override
protected void init() {
  super.init();

  getTree().setChildrenOpenHandler(state -> getRpcProxy(TreeServerRpc.class).onOpen(state.myId));
  getTree().setDoubleClickHandler((state) -> getRpcProxy(TreeServerRpc.class).onDoubleClick(state.myId));
  getTree().getTreeViewModel().getSelectionModel().addSelectionChangeHandler(event -> {
    TreeNode value = getTree().getKeyboardSelectedTreeNode();
    TreeState.TreeNodeState childValue = (TreeState.TreeNodeState)value.getValue();
    getRpcProxy(TreeServerRpc.class).onSelected(childValue.myId);
  });

  registerRpc(TreeClientRpc.class, new TreeClientRpc() {
    @Override
    public void expand(String nodeId) {
      getTree().expand(nodeId);
    }
  });
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:GwtTreeImplConnector.java

示例4: 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);
			}
		}
	}
}
 
开发者ID:sigmah-dev,项目名称:sigmah,代码行数:10,代码来源:PermissionTree.java

示例5: selectPlace

import com.google.gwt.user.cellview.client.TreeNode; //导入依赖的package包/类
private void selectPlace(TreePlace place) {
  TreeNode node = navigationView.getMenuTree().getRootTreeNode();
  if (openNode(node, place)) {
    navigationView.getSelectionModel().setSelected(place, true);
    pendingPlace = null;
  } else {
    navigationView.getSelectionModel().clear();
  }
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:10,代码来源:NavigationActivity.java

示例6: 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);
      }
    }
  }
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:13,代码来源:NavigationActivity.java

示例7: 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);
    }
    
}
 
开发者ID:qoswork,项目名称:opennmszh,代码行数:11,代码来源:ReportSelectListCellTree.java

示例8: expand

import com.google.gwt.user.cellview.client.TreeNode; //导入依赖的package包/类
public void expand(String nodeId) {
  TreeNode node = findNode(getRootTreeNode(), nodeId);
  if (node == null) {
    return;
  }

  int index = node.getIndex();
  node.getParent().setChildOpen(index, !node.getParent().isChildOpen(index));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:GwtTreeImpl.java


注:本文中的com.google.gwt.user.cellview.client.TreeNode类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。