Java 类com.google.gwt.user.client.ui.HasTreeItems 实例源码

项目:appformer    文件:GalleryTreeViewImpl.java   
private void populateNavigationTree(List<GalleryTreeNode> nodes, HasTreeItems items) {
    if (nodes == null) return;
    for (GalleryTreeNode node: nodes) {
        TreeItem ti = new TreeItem();
        ti.setText(node.getName());
        ti.setUserObject(node);
        ti.getElement().getStyle().setCursor(Style.Cursor.POINTER);
        items.addItem(ti);
        populateNavigationTree(node.getChildren(), ti);
    }
}
项目:dashbuilder    文件:GalleryTreeViewImpl.java   
private void populateNavigationTree(List<GalleryTreeNode> nodes, HasTreeItems items) {
    if (nodes == null) return;
    for (GalleryTreeNode node: nodes) {
        TreeItem ti = new TreeItem();
        ti.setText(node.getName());
        ti.setUserObject(node);
        ti.getElement().getStyle().setCursor(Style.Cursor.POINTER);
        items.addItem(ti);
        populateNavigationTree(node.getChildren(), ti);
    }
}
项目:droopy    文件:AlignedTree.java   
private static HorizontalPanel findFirstHBox(final HasTreeItems tree) {
  for (final Widget w : iter(tree)) {
    if (w instanceof HorizontalPanel) {
      return (HorizontalPanel) w;
    }
  }
  return null;
}
项目:droopy    文件:AlignedTree.java   
private static Iterable<Widget> iter(final HasTreeItems tree) {
  if (tree instanceof Tree) {
    return (Tree) tree;
  } else if (tree instanceof TreeItem) {
    return new TreeItemIterator((TreeItem) tree);
  } else {
    throw new AssertionError("should never happen!  tree is neither a"
                             + " TreeItem nor a Iterable: " + tree);
  }
}
项目:droopy    文件:Trace.java   
private static void deferredAlign(final HasTreeItems tree) {
  // We need to align the tree outside of the processing of this event,
  // otherwise the browser won't have actually computed the layout of the
  // Tree, and the nested widgets will appear to have a size of 0.
  // It's kind of ugly because it means the browser does the layout once,
  // then we "fix" it by aligning widgets, so users can see the layout
  // flicker a bit after we "fix" it, but I don't know of a better way...
  Scheduler.get().scheduleDeferred(new Scheduler.ScheduledCommand() {
    public void execute() {
      AlignedTree.align(tree);
    }
  });
}
项目:droopy    文件:AlignedTree.java   
public static void align(final HasTreeItems tree) {
  align(tree, DEFAULT_SPACING);
}