com.google.gwt.user.client.ui.Tree.getItemCount()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(177)

本文整理了Java中com.google.gwt.user.client.ui.Tree.getItemCount()方法的一些代码示例,展示了Tree.getItemCount()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.getItemCount()方法的具体详情如下:
包路径:com.google.gwt.user.client.ui.Tree
类名称:Tree
方法名:getItemCount

Tree.getItemCount介绍

[英]Gets the number of items contained at the root of this tree.
[中]获取此树根中包含的项数。

代码示例

代码示例来源:origin: com.google.gwt/gwt-servlet

/**
 * Removes all items from the root level of this tree.
 */
@Override
public void removeItems() {
 while (getItemCount() > 0) {
  removeItem(getItem(0));
 }
}

代码示例来源:origin: oVirt/ovirt-engine

private void updateTreeState() {
  newSelectedItems.clear();
  for (int i = 0; i < tree.getItemCount(); i++) {
    updateItemSelection(tree.getItem(i));
  }
  selectedItems.clear();
  selectedItems.addAll(newSelectedItems);
  onItemsSelection();
}

代码示例来源:origin: org.eagle-i/eagle-i-search-gwt

TreeItem findGroupItem( String groupName ) {
  for (int i = 0; i < groupTree.getItemCount(); i++) {
    TreeItem groupItem = groupTree.getItem( i );
    if (((GroupWidget) groupItem.getWidget()).name.equals( groupName )) {
      return groupItem;
    }
  }
  return null;
}

代码示例来源:origin: net.wetheinter/gwt-user

/**
 * Removes all items from the root level of this tree.
 */
@Override
public void removeItems() {
 while (getItemCount() > 0) {
  removeItem(getItem(0));
 }
}

代码示例来源:origin: com.vaadin.external.gwt/gwt-user

/**
 * Removes all items from the root level of this tree.
 */
@Override
public void removeItems() {
 while (getItemCount() > 0) {
  removeItem(getItem(0));
 }
}

代码示例来源:origin: oVirt/ovirt-engine

private void saveTreeState() {
  oldItemStatesMap.clear();
  for (int i = 0; i < tree.getItemCount(); i++) {
    TreeItem rootItem = tree.getItem(i);
    oldRootItemsMap.put(rootItem.getUserObject(), rootItem);
    saveTreeItemState(rootItem);
  }
}

代码示例来源:origin: stackoverflow.com

System.out.println("item2: " + item2.getParent() + ", " + item2.getParentItem());
System.out.println(tree.getItemCount());
System.out.println(tree.getItems().length);

代码示例来源:origin: oVirt/ovirt-engine

TreeItem findSelectedTreeItemRecursive(TreeItem item, int x, int y) {
    if (null == item) {
      int count = tree.getItemCount();
      for (int i = 0; i < count; i++) {
        TreeItem selected = findSelectedTreeItemRecursive(tree.getItem(i), x, y);
        if (selected != null) {
          return selected;
        }
      }
      return null;
    }

    int count = item.getChildCount();
    for (int i = 0; i < count; i++) {
      TreeItem selected = findSelectedTreeItemRecursive(item.getChild(i), x, y);
      if (selected != null) {
        return selected;
      }
    }

    if (x >= item.getAbsoluteLeft()
        && x <= item.getAbsoluteLeft() + item.getOffsetWidth()
        && y >= item.getAbsoluteTop()
        && y <= item.getAbsoluteTop() + item.getOffsetHeight()) {
      return item;
    }
    return null;
  }
}

相关文章