Пример #1
0
  protected void loadChildren(final TreeItem it, final CategoryItem category) {
    for (final CategoryItem child : category.getChildren()) {
      final TreeItem ct = buildTreeItem(child);

      it.addItem(ct);

      if (child.hasChild()) {
        loadChildren(ct, child);
      }
    }
  }
Пример #2
0
  protected void buildTree(final Categories categories) {
    final TreeItem root = new TreeItem();
    root.setHTML(AbstractImagePrototype.create(ImageResources.INSTANCE.desc()).getHTML());
    navTreeWidget.addItem(root);

    for (final CategoryItem category : categories) {
      final TreeItem it = buildTreeItem(category);
      root.addItem(it);

      if (category.hasChild()) {
        loadChildren(it, category);
      }
    }

    root.setState(true);
  }