Package org.zkoss.zul

Examples of org.zkoss.zul.Treerow


            Label lblName = new Label(materialCategory.getName());
            Label lblUnits = new Label(getUnits(materialCategory).toString());
            Label lblPrice = new Label(getPrice(materialCategory).toString()
                    + getCurrencySymbol());

            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();
            lblName.setParent(cellName);
            cellName.setParent(tr);
View Full Code Here


                    {
                LoadTimeLine line = (LoadTimeLine) 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);

                appendOperations(cell, line);

                cell.appendChild(component);

                collapse(line);
                addExpandedListener(item, line);

                row.setSclass("resourceload-leftpanel-row");
            }

            private void appendOperations(final Treecell cell,
                    final LoadTimeLine line) {
                if (line.getRole().isVisibleScheduled()) {
View Full Code Here

            }
        }

        private Treerow getTreeRowWithoutChildrenFor(final Treeitem item,
                T element) {
            Treerow result = createOrRetrieveFor(item);
            // Attach treecells to treerow
            if (element.isUpdatedFromTimesheets()) {
                result.setDraggable("false");
                result.setDroppable("false");
            } else {
                result.setDraggable("true");
                result.setDroppable("true");
            }
            result.getChildren().clear();
            return result;
        }
View Full Code Here

            return result.toString();
        }

        private Treerow createOrRetrieveFor(final Treeitem item) {
            if (item.getTreerow() == null) {
                Treerow result = new Treerow();
                result.setParent(item);
                return result;
            } else {
                return item.getTreerow();
            }
        }
View Full Code Here

                    }
                });
            }

            private void registerNavigableElement(InputElement inputElement) {
                Treerow treeRow = getCurrentTreeRow();
                if (!navigableElementsByRow.containsKey(treeRow)) {
                    navigableElementsByRow.put(treeRow,
                            new ArrayList<InputElement>());
                }
                navigableElementsByRow.get(treeRow).add(inputElement);
View Full Code Here

                            .getTreechildren();
                    if (treechildren == null
                            || treechildren.getChildren().size() == 0) {
                        // the previous brother doesn't have children,
                        // or it has children but they are unloaded
                        Treerow upTreerow = treeItems.get(myPosition - 1)
                                .getTreerow();

                        focusCorrectBox(upTreerow, position, Navigation.LEFT);
                    } else {
                        // we have to move to the last child of the previous
                        // brother
                        Treerow upTreerow = findLastTreerow(treeItems
                                .get(myPosition - 1));

                        while (!upTreerow.isVisible()) {
                            upTreerow = ((Treeitem) upTreerow.getParent()
                                    .getParent().getParent()).getTreerow();
                        }

                        focusCorrectBox(upTreerow, position, Navigation.LEFT);
                    }
                } else {
                    // the node is the first brother
                    if (parent.getParent().getParent() instanceof Treeitem) {
                        // the node has a parent, so we move up to it
                        Treerow upTreerow = ((Treeitem) parent.getParent()
                                .getParent()).getTreerow();

                        focusCorrectBox(upTreerow, position, Navigation.LEFT);
                    }
                }
View Full Code Here

                    List<Treeitem> treeItems = parent.getParent().getChildren();
                    int myPosition = parent.indexOf();

                    if (myPosition < treeItems.size() - 1) {
                        // the current node is not the last one
                        Treerow downTreerow = treeItems.get(myPosition + 1)
                                .getTreerow();

                        focusCorrectBox(downTreerow, position, Navigation.RIGHT);
                    } else {
                        // the node is the last brother
                        if (parent.getParent().getParent() instanceof Treeitem) {
                            focusGoDown((Treeitem) parent.getParent()
                                    .getParent(), position, true);
                        }
                    }
                } else {
                    // Moving from a parent node to its children
                    Treechildren treechildren = parent.getTreechildren();

                    if (treechildren.getChildren().size() == 0) {
                        // the children are unloaded yet
                        focusGoDown(parent, position, true);
                        return;
                    }
                    Treerow downTreerow = ((Treeitem) treechildren
                            .getChildren().get(0)).getTreerow();

                    if (!downTreerow.isVisible()) {
                        // children are loaded but not visible
                        focusGoDown(parent, position, true);
                        return;
                    }
View Full Code Here

         * Copied verbatim from org.zkoss.zul.Tree;
         */
        @Override
        public void render(Treeitem ti, Object node) {
            Treecell tc = new Treecell(Objects.toString(node));
            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();
            }
            tc.setParent(tr);
        }
View Full Code Here

            } else if (node instanceof Material) {
                final Material material = (Material) node;
                lblName = new Label(material.getDescription());
            }

            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();
            lblName.setParent(cellName);
            cellName.setParent(tr);
View Full Code Here

        }
        return null;
    }

    private Textbox getMaterialCategoryTextbox(Treeitem treeitem) {
        final Treerow tr = treeitem.getTreerow();
        final Treecell tc = (Treecell) tr.getChildren().get(0);
        return (Textbox) tc.getChildren().get(0);
    }
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.