Package org.zkoss.zul

Examples of org.zkoss.zul.Comboitem


    public List<Profile> getProfiles() {
        return userModel.getProfiles();
    }

    public void addSelectedProfile() {
        Comboitem comboItem = profilesCombo.getSelectedItem();
        if(comboItem != null) {
            addProfile((Profile)comboItem.getValue());
        }
    }
View Full Code Here


    private void prepareAuthenticationTypesCombo() {
        Combobox combo = (Combobox) editWindow
                .getFellowIfAny("authenticationTypeCombo");
        combo.getChildren().clear();
        for (UserAuthenticationType type : UserAuthenticationType.values()) {
            Comboitem item = combo.appendItem(_(type.toString()));
            item.setValue(type);
            if (type.equals(getAuthenticationType())) {
                combo.setSelectedItem(item);
            }
        }
View Full Code Here

        // Setter, set type selected to HourCost.type
        autocomplete.addEventListener("onSelect", new EventListener() {

            @Override
            public void onEvent(Event event) {
                final Comboitem comboitem = autocomplete.getSelectedItem();

                if (comboitem != null) {
                    // Update resourcesCostCategoryAssignment
                    CriterionDTO assignment = (CriterionDTO) row
                            .getValue();
                    assignment.getCriterion().setCostCategory(
                            (CostCategory) comboitem
                            .getValue());
                    row.setValue(assignment);
                }
            }
        });
View Full Code Here

        for(AdvanceType advanceType : listAdvanceType){
            if (!advanceType.getUnitName().equals(
                    PredefinedAdvancedTypes.CHILDREN.getTypeName())
                    && !advanceType.isQualityForm()
                    && !advanceType.isReadOnly()) {
                Comboitem comboItem = new Comboitem();
                comboItem.setValue(advanceType);
                comboItem.setLabel(advanceType.getUnitName());
                comboItem.setParent(comboAdvanceTypes);

                if ((advance.getAdvanceType() != null)
                    && (advance.getAdvanceType().getId().equals(advanceType
                                .getId()))) {
                    comboAdvanceTypes.setSelectedItem(comboItem);
                }
            }
        }

        comboAdvanceTypes.addEventListener(Events.ON_SELECT,
                new EventListener() {
                    @Override
                    public void onEvent(Event event) {
                        setMaxValue(listItem, comboAdvanceTypes);
                        cleanFields(advance);
                        setPercentage();
                        reloadAdvances();
                    }
        });

        Util.bind(comboAdvanceTypes,
                    new Util.Getter<Comboitem>() {
                        @Override
                        public Comboitem get(){
                                return comboAdvanceTypes.getSelectedItem();
                        }
                    }, new Util.Setter<Comboitem>() {
                @Override
            public void set(Comboitem comboItem) {
                            if(((comboItem!=null))&&(comboItem.getValue() != null)&&
                                    (comboItem.getValue() instanceof AdvanceType)){
                                AdvanceType advanceType = (AdvanceType)comboItem.getValue();
                                advance.setAdvanceType(advanceType);
                    advance.setMaxValue(manageOrderElementAdvancesModel
                            .getMaxValue(advanceType));
                            }
                        }
View Full Code Here

    }

    private void setMaxValue(final Listitem item,Combobox comboAdvanceTypes) {
        Listcell listCell = (Listcell)item.getChildren().get(1);
        Decimalbox miBox = ((Decimalbox) listCell.getFirstChild());
        Comboitem selectedItem = comboAdvanceTypes.getSelectedItem();
        if(selectedItem != null){
            AdvanceType advanceType = ((AdvanceType) selectedItem.getValue());
            if(advanceType != null){
                DirectAdvanceAssignment advance = (DirectAdvanceAssignment) item
                        .getValue();
                advance.setMaxValue(manageOrderElementAdvancesModel
                        .getMaxValue(advanceType));
View Full Code Here

        return criterionsModel.getCriterion();
    }

    private void setupResourceCombobox(Combobox combo) {
        for (ResourceEnum resource : ResourceEnum.values()) {
            Comboitem item = combo.appendItem(_(resource.getDisplayName()));
            item.setValue(resource);
        }
    }
View Full Code Here

    }

    private void setResourceComboboxValue(Combobox combo) {
        CriterionType criterionType = (CriterionType) getCriterionType();
        for (Object object : combo.getItems()) {
            Comboitem item = (Comboitem) object;
            if (criterionType != null
                    && item.getValue().equals(criterionType.getResource())) {
                combo.setSelectedItem(item);
            }
        }
    }
View Full Code Here

        row.appendChild(autocomplete);
    }

    private void changeResourceInLines(final Autocomplete autocomplete, Row row) {
        final WorkReportLine workReportLine = (WorkReportLine) row.getValue();
        final Comboitem comboitem = autocomplete.getSelectedItem();
        if ((comboitem == null) || ((Resource) comboitem.getValue() == null)) {
            workReportLine.setResource(null);
            throw new WrongValueException(autocomplete,
                    _("Please, select an item"));
        } else {
            workReportLine.setResource((Resource) comboitem.getValue());
        }
    }
View Full Code Here

        if (labelType != null) {
            final List<Label> listLabel = getMapLabelTypes()
                    .get(labelType);

            for (Label label : listLabel) {
                Comboitem comboItem = new Comboitem();
                comboItem.setValue(label);
                comboItem.setLabel(label.getName());
                comboItem.setParent(comboLabels);

                if ((selectedLabel != null)
                        && (selectedLabel.equals(label))) {
                    comboLabels.setSelectedItem(comboItem);
                }
View Full Code Here

                        type != PositionConstraintType.AS_SOON_AS_POSSIBLE) ||
                    (type == PositionConstraintType.AS_LATE_AS_POSSIBLE &&
                        order.getDeadline() != null) ||
                    (type == PositionConstraintType.AS_SOON_AS_POSSIBLE &&
                        order.getInitDate() != null)) {
                Comboitem comboitem = new Comboitem(_(type.getName()));
                comboitem.setValue(type);
                startConstraintTypes.appendChild(comboitem);
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Comboitem

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.