Package org.zkoss.zul

Examples of org.zkoss.zul.Textbox$AuxInfo


                addTextbox(orderElement);
            }
        }

        private void addTextbox(final OrderElement orderElement) {
            Textbox textBoxCode = new Textbox();
            Util.bind(textBoxCode, new Util.Getter<String>() {
                @Override
                public String get() {
                    return orderElement.getCode();
                }
            }, new Util.Setter<String>() {

                @Override
                public void set(String value) {
                    orderElement.setCode(value);
                }
            });
            textBoxCode.setConstraint(new Constraint() {
                @Override
                public void validate(Component comp, Object value)
                        throws WrongValueException {
                    if (!orderElement.isFormatCodeValid((String) value)) {
                        throw new WrongValueException(
                                comp,
                                _("Value is not valid.\n Code cannot contain chars like '_' \n and should not be empty"));
                    }
                }
            });

            if (orderModel.isCodeAutogenerated() || readOnly) {
                textBoxCode.setDisabled(true);
            }

            addCell(textBoxCode);
            putCodeTextbox(orderElement, textBoxCode);
        }
View Full Code Here


            super.removeCodeTextbox(key);
        }

        public void addResourcesBudgetCell(final OrderElement currentElement) {
            BigDecimal value = currentElement.getSubstractedBudget();
            Textbox autoBudgetCell = new Textbox(Util.addCurrencySymbol(value));
            autoBudgetCell.setDisabled(true);
            addCell(autoBudgetCell);
        }
View Full Code Here

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

            final Textbox tb = new Textbox(materialCategory.getName());
            tb.setWidth("90%");
            tb.addEventListener("onChange", new EventListener() {
                @Override
                public void onEvent(Event event) {
                    final InputEvent ie = (InputEvent) event;
                    materialCategory.setName(ie.getValue());
                }
            });
            tb.addEventListener("onFocus", new EventListener() {
                @Override
                public void onEvent(Event event) {
                    ((Treeitem)tb.getParent().getParent().getParent()).setSelected(true);
                    refreshMaterials();
                }
            });
            Treecell tc = new Treecell();

            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();
            }
            tb.setParent(tc);
            tc.setParent(tr);

            final Textbox codeTb = new Textbox(materialCategory.getCode());
            codeTb.setWidth("95%");
            codeTb.setDisabled(materialCategory.isCodeAutogenerated());
            codeTb.addEventListener("onChange", new EventListener() {
                @Override
                public void onEvent(Event event) {
                    final InputEvent ie = (InputEvent) event;
                    materialCategory.setCode(ie.getValue());
                }
            });
            codeTb.addEventListener("onFocus", new EventListener() {
                @Override
                public void onEvent(Event event) {
                    ((Treeitem)codeTb.getParent().getParent().getParent()).setSelected(true);
                    refreshMaterials();
                }
            });
            Treecell codeTc = new Treecell();
            codeTb.setParent(codeTc);
            codeTc.setParent(tr);

            final Checkbox cb = new Checkbox();
            cb.setChecked(materialCategory.isCodeAutogenerated());
            cb.addEventListener("onCheck", new EventListener() {
                @Override
                public void onEvent(Event event) {
                    final CheckEvent ce = (CheckEvent) event;
                    materialCategory.setCodeAutogenerated(ce.isChecked());
                    if (ce.isChecked()) {
                        try {
                            materialsModel.setCodeAutogenerated(ce.isChecked(),
                                    materialCategory);
                        } catch (ConcurrentModificationException err) {
                            messagesForUser.showMessage(Level.ERROR, err
                                    .getMessage());
                        }
                    }
                    codeTb.setValue(materialCategory.getCode());
                    codeTb.setDisabled(ce.isChecked());
                    Util.reloadBindings(codeTb);
                    Util.reloadBindings(gridMaterials);
                }
            });
            Treecell generateCodeTc = new Treecell();
View Full Code Here

        Rows rows = entitySequencesGrid.getRows();
        for (Row row : (List<Row>) rows.getChildren()) {

                EntitySequence seq = (EntitySequence) row.getValue();
                if (seq != null) {
                Textbox prefixBox = (Textbox) row.getChildren().get(2);
                    if (!seq.isAlreadyInUse()) {
                        String errorMessage = this.validPrefix(seq,
                                prefixBox.getValue());
                        if (errorMessage != null) {
                            throw new WrongValueException(prefixBox,
                                    errorMessage);
                        }
                    }
View Full Code Here

            updateEndDateFor(element);
        }

        private void updateCodeFor(T element) {
            if (!readOnly && !element.isJiraIssue()) {
                Textbox textbox = codeTextboxByElement.get(element);
                textbox.setValue(getCodeHandler().getCodeFor(element));
            }
        }
View Full Code Here

            }
        }

        private void appendPrefixTextbox(Row row,
                final EntitySequence entitySequence) {
            final Textbox tempTextbox = new Textbox();
            tempTextbox.setWidth("200px");
            Textbox textbox = Util.bind(tempTextbox, new Util.Getter<String>() {

                @Override
                public String get() {
                    return entitySequence.getPrefix();
                }
            }, new Util.Setter<String>() {

                @Override
                public void set(String value) {
                    try {
                        entitySequence.setPrefix(value);
                    } catch (IllegalArgumentException e) {
                        throw new WrongValueException(tempTextbox, e
                                .getMessage());
                    }
                }
            });
            textbox.setConstraint(checkConstraintFormatPrefix());

            if (entitySequence.isAlreadyInUse()) {
                textbox.setDisabled(true);
            }

            row.appendChild(textbox);
        }
View Full Code Here

            }
        }

        private void updateNameFor(T element) {
            if (!readOnly) {
                Textbox textbox = nameTextboxByElement.get(element);
                textbox.setValue(getNameHandler().getNameFor(element));
            }
        }
View Full Code Here

            row.appendChild(intbox);
        }

        private void appendLastValueInbox(Row row,
                final EntitySequence entitySequence) {
            Textbox textbox = Util.bind(new Textbox(),
                    new Util.Getter<String>() {

                        @Override
                        public String get() {
                            return EntitySequence.formatValue(
View Full Code Here

            public void render(Row row, Object data) throws Exception {

                final UserRole role = (UserRole) data;
                row.appendChild(new Label(role.getDisplayName()));

                final Textbox tempTextbox = new Textbox();
                Textbox textbox = Util.bind(tempTextbox, new Util.Getter<String>() {
                    @Override
                    public String get() {
                        List<String> listRoles = configurationModel.
                            getLdapConfiguration().getMapMatchingRoles().get(role.name());
                        Collections.sort(listRoles);
                        return StringUtils.join(listRoles, ";");
                    }
                }, new Util.Setter<String>() {
                    @Override
                    public void set(String value) {
                                // Created a set in order to avoid duplicates
                                Set<String> rolesLdap = new HashSet<String>(
                                        Arrays.asList(StringUtils.split(value,
                                                ";")));
                                configurationModel.getLdapConfiguration()
                                        .setConfigurationRolesLdap(role.name(),
                                                rolesLdap);
                    }
                });
                textbox.setWidth("300px");
                row.appendChild(textbox);
            }
        };
    }
View Full Code Here

                appendValueTextbox(row, property);
            }

            private void appendValueTextbox(Row row,
                    final ConnectorProperty property) {
                final Textbox textbox = new Textbox();
                textbox.setWidth("400px");
                textbox.setConstraint(checkPropertyValue(property));

                Util.bind(textbox, new Util.Getter<String>() {

                    @Override
                    public String get() {
                        return property.getValue();
                    }
                }, new Util.Setter<String>() {

                    @Override
                    public void set(String value) {
                        property.setValue(value);
                    }
                });
                if (property.getKey().equals(
                        PredefinedConnectorProperties.PASSWORD)) {
                    textbox.setType("password");
                }

                row.appendChild(textbox);
            }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Textbox$AuxInfo

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.