Package org.zkoss.zul

Examples of org.zkoss.zul.Treerow


  public static class TreeRendererFactory {
    public static TreeitemRenderer getBeanTreeitemRenderer() {
      return new TreeitemRenderer() {
        public void render(Treeitem item, Object data) throws Exception {
          SampleBean b = (SampleBean) ((DefaultTreeNode) data).getData();
          Treerow tr;
          if (item.getTreerow() == null) {
            tr = new Treerow();
            tr.setParent(item);
          } else {
            tr = item.getTreerow();
            tr.getChildren().clear();
          }
          tr.appendChild(new Treecell(b.getName()));
          tr.appendChild(new Treecell(b.getNumber()+""));
          tr.appendChild(new Treecell(df.format(b.getDate())));
          item.setValue(data);
          item.setOpen(true);
        }
      };
    }
View Full Code Here


    }
    public static TreeitemRenderer getArrayTreeitemRenderer() {
      return new TreeitemRenderer() {
        public void render(Treeitem item, Object data) throws Exception {
          String[] ary = (String[]) ((DefaultTreeNode) data).getData();
          Treerow tr;
          if (item.getTreerow() == null) {
            tr = new Treerow();
            tr.setParent(item);
          } else {
            tr = item.getTreerow();
            tr.getChildren().clear();
          }
          tr.appendChild(new Treecell(ary[0]));
          tr.appendChild(new Treecell(ary[1]));
          tr.appendChild(new Treecell(ary[2]));
          item.setValue(data);
          item.setOpen(true);
        }
      };
    }
View Full Code Here

      };
    }
    public static TreeitemRenderer getSingleColTreeitemRenderer() {
      return new TreeitemRenderer() {
        public void render(Treeitem item, Object data) throws Exception {
          Treerow tr;
          if (item.getTreerow() == null) {
            tr = new Treerow();
            tr.setParent(item);
          } else {
            tr = item.getTreerow();
            tr.getChildren().clear();
          }
          tr.appendChild(new Treecell((String) ((DefaultTreeNode) data).getData()));
          item.setValue(data);
          item.setOpen(true);
        }
      };
    }
View Full Code Here

        /*
         * Since only one treerow is allowed, if treerow is not null, append
         * treecells to it. If treerow is null, contruct a new treerow and
         * attach it to item.
         */
        Treerow tr = null;
        if (item.getTreerow() == null) {
            tr = new Treerow();
            tr.setParent(item);
        } else {
            tr = item.getTreerow();
            tr.getChildren().clear();
        }

        // Attach treecells to treerow
        tcOrgName.setParent(tr);
        tcOrgTypeName.setParent(tr);
View Full Code Here

        /*
         * Since only one treerow is allowed, if treerow is not null, append
         * treecells to it. If treerow is null, contruct a new treerow and
         * attach it to item.
         */
        Treerow tr = null;
        if (item.getTreerow() == null) {
            tr = new Treerow();
            tr.setParent(item);
        } else {
            tr = item.getTreerow();
            tr.getChildren().clear();
        }

        // Attach treecells to treerow
        tcFunName.setParent(tr);

View Full Code Here

        //
        Tree funTree = (Tree) getFellow("funTree");
        Treeitem ti = funTree.getSelectedItem();
        List childrenData = ti.getChildren();

        Treerow tr = (Treerow) childrenData.get(0);

        List rowChildrenData = tr.getChildren();

        Treecell tcFunName = (Treecell) rowChildrenData.get(0);
        String funName = tcFunName.getLabel();

        Treecell tcFunPath = (Treecell) rowChildrenData.get(1);
View Full Code Here

            List children = treeItem.getChildren();
            Iterator it = children.iterator();
            while (it.hasNext()) {
                Object obj = it.next();
                if (obj instanceof Treerow) {
                    Treerow treerow = (Treerow) obj;
                    List treeRowChildren = treerow.getChildren();
                    Iterator it2 = treeRowChildren.iterator();
                    while (it2.hasNext()) {
                        Object obj2 = it2.next();
                        Treecell cell = (Treecell) obj2;
                        Iterator it3 = cell.getChildren().iterator();
View Full Code Here

    return item;
  }

  private ILabelElement insertTreeCell(Component parent) {
    final Treerow treerow = new Treerow();
    parent.appendChild(treerow);

    final DefaultTreecell treecell = new DefaultTreecell();
    treerow.appendChild(treecell);

    return treecell;
  }
View Full Code Here

                    {
                LimitingResourceQueue line = (LimitingResourceQueue) data;
                item.setOpen(false);
                item.setValue(line);

                Treerow row = new Treerow();
                Treecell cell = new Treecell();
                Component component = createComponent(line);
                item.appendChild(row);
                row.appendChild(cell);
                cell.appendChild(component);
            }

            private Component createComponent(LimitingResourceQueue line) {
                return isTopLevel(line) ? createFirstLevel(line)
View Full Code Here

        public void render(Treeitem ti, Object node) {
            final MaterialCategory materialCategory = (MaterialCategory) node;

            Label lblName = new Label(materialCategory.getName());

            Treerow tr = null;
            ti.setValue(node);
            if (ti.getTreerow() == null) {
                tr = new Treerow();
                tr.setParent(ti);
                ti.setOpen(true); // Expand node
            } else {
                tr = ti.getTreerow();
                tr.getChildren().clear();
            }
            // Add category name
            Treecell cellName = new Treecell();
            cellName.addEventListener("onClick", new EventListener() {
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Treerow

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.