Examples of IntBox


Examples of org.zkoss.zul.Intbox

                }
            }
        }

        private Intbox buildHoursIntboxFor(final T element) {
            Intbox result = new IntboxDirectValue();
            if (element.isLeaf()) {
                Util.bind(result, getHoursGetterFor(element),
                        getHoursSetterFor(element));
                result.setConstraint(getHoursConstraintFor(element));
            } else {
                // If it's a container hours cell is not editable
                Util.bind(result, getHoursGetterFor(element));
            }
            return result;
View Full Code Here

Examples of org.zkoss.zul.Intbox

            };
        }

        private void updateHoursFor(T element) {
            if (!readOnly && element.isLeaf()) {
                Intbox boxHours = (Intbox) hoursIntBoxByElement.get(element);
                Treecell tc = (Treecell) boxHours.getParent();
                setReadOnlyHoursCell(element, boxHours, tc);
                boxHours.invalidate();
                refreshHoursValueForThisNodeAndParents(element);
            }
        }
View Full Code Here

Examples of org.zkoss.zul.Intbox

            refreshHoursValueForNodes(nodeAndItsParents);
        }

        public void refreshHoursValueForNodes(List<T> nodes) {
            for (T node : nodes) {
                Intbox intbox = hoursIntBoxByElement.get(node);
                // For the Order node there is no associated intbox
                if (intbox != null) {
                    Integer currentHours = getHoursGroupHandler()
                            .getWorkHoursFor(node);
                    intbox.setValue(currentHours);
                }
            }
        }
View Full Code Here

Examples of org.zkoss.zul.Intbox

            }
        });
    }

    private void appendIntBoxLengthDescriptionField(final Row row) {
        Intbox boxLength = new Intbox();
        boxLength.setHflex("1");
        boxLength.setReadonly(isReadOnly());
        boxLength.setParent(row);
        boxLength.setConstraint("no negative, no zero");

        Util.bind(boxLength, new Util.Getter<Integer>() {
            @Override
            public Integer get() {
                return ((DescriptionField) row.getValue()).getLength();
View Full Code Here

Examples of org.zkoss.zul.Intbox

    }

    private void showInvalidDescriptionFieldLength(DescriptionField field) {
        // Find which row contains the description field inside grid
        Row row = findRowByValue(listDescriptionFields.getRows(), field);
        Intbox fieldName = (Intbox) row.getChildren().get(1);
        throw new WrongValueException(fieldName,
                _("The length must be greater than 0 and not empty"));
    }
View Full Code Here

Examples of org.zkoss.zul.Intbox

    }

    public void addElement(Component cmp) {
        viewStateSnapshot = TreeViewStateSnapshot.takeSnapshot(tree);
        Textbox name = (Textbox) cmp.getFellow("newOrderElementName");
        Intbox hours = (Intbox) cmp.getFellow("newOrderElementHours");

        if (StringUtils.isEmpty(name.getValue())) {
            throw new WrongValueException(name, _("cannot be empty"));
        }

        if (hours.getValue() == null) {
            hours.setValue(0);
        }

        Textbox nameTextbox = null;

        // Parse hours
        try {
            if (tree.getSelectedCount() == 1) {
                T node = getSelectedNode();

                T newNode = getModel().addElementAt(node, name.getValue(),
                        hours.getValue());
                getRenderer().refreshHoursValueForThisNodeAndParents(newNode);
                getRenderer().refreshBudgetValueForThisNodeAndParents(newNode);

                // Moved here in order to have items already renderer in order
                // to select the proper element to focus
                reloadTreeUIAfterChanges();

                if (node.isLeaf() && !node.isEmptyLeaf()) {
                    // Then a new container will be created
                    nameTextbox = getRenderer().getNameTextbox(node);
                } else {
                    // select the parent row to add new children ASAP
                    tree.setSelectedItem(getRenderer().getTreeitemForNode(
                            newNode.getParent().getThis()));
                }
            } else {
                getModel().addElement(name.getValue(), hours.getValue());

                // This is needed in both parts of the if, but it's repeated in
                // order to simplify the code
                reloadTreeUIAfterChanges();
            }
        } catch (IllegalStateException e) {
            LOG.warn("exception ocurred adding element", e);
            messagesForUser.showMessage(Level.ERROR, e.getMessage());
        }

        name.setValue("");
        hours.setValue(0);

        if (nameTextbox != null) {
            nameTextbox.focus();
        } else {
            name.focus();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.