Package org.zkoss.zul

Examples of org.zkoss.zul.Combobox


    private void showInvalidWorkReportLabelTypeAssigment(int combo,
            String message, WorkReportLabelTypeAssigment labelType) {
        Row row = findRowByValue(listWorkReportLabelTypeAssigments.getRows(),
                labelType);
        Combobox comboLabelType = (Combobox) row.getChildren().get(combo);
        throw new WrongValueException(comboLabelType, _(message));
    }
View Full Code Here


            BaseCalendar calendar = (BaseCalendar) data;
            item.setLabel(calendar.getName());
            item.setValue(calendar);

            if (isDefaultCalendar(calendar)) {
                Combobox combobox = (Combobox) item.getParent();
                combobox.setSelectedItem(item);
            }
        }
View Full Code Here

    private void reloadTypeDatesAndDuration() {
        LocalDate selectedDay = baseCalendarModel.getSelectedDay();

        CalendarExceptionType type = baseCalendarModel
                .getCalendarExceptionType(new LocalDate(selectedDay));
        Combobox exceptionTypes = (Combobox) window.getFellow("exceptionTypes");
        @SuppressWarnings("unchecked")
        List<Comboitem> items = exceptionTypes.getItems();
        for (Comboitem item : items) {
            CalendarExceptionType value = (CalendarExceptionType) item
                    .getValue();
            if ((value == null) && (type == null)) {
                exceptionTypes.setSelectedItem(item);
                break;
            }
            if ((value != null) && (type != null)
                    && (value.getName().equals(type.getName()))) {
                exceptionTypes.setSelectedItem(item);
                break;
            }
        }

        Datebox dateboxStartDate = (Datebox) window
View Full Code Here

    public String getWorkableTime() {
        return asString(baseCalendarModel.getWorkableTime());
    }

    public void createException() {
        Combobox exceptionTypes = (Combobox) window.getFellow("exceptionTypes");
        CalendarExceptionType type = (CalendarExceptionType) exceptionTypes
                .getSelectedItem().getValue();
        if (type == null) {
            throw new WrongValueException(exceptionTypes,
                    _("Please, select type of exception"));
        } else {
View Full Code Here

                .getFellow("expiringDateValidFromNewVersion");
        LocalDate expiringDate = getLocalDateFrom((Datebox) compExpiringDate);

        BaseCalendar selected = null;
        if (isDerived()) {
            Combobox parentCalendars = (Combobox) createNewVersionWindow
                    .getFellow("parentCalendars");
            if (parentCalendars.getSelectedItem() == null) {
                throw new WrongValueException(parentCalendars,
                        _("cannot be empty"));
            }
            selected = (BaseCalendar) parentCalendars.getSelectedItem()
                    .getValue();
        }

        try {
            baseCalendarModel.createNewVersion(startDate, expiringDate,
View Full Code Here

    public boolean isNotOwnExceptionDay() {
        return !isOwnExceptionDay();
    }

    public void updateException() {
        Combobox exceptionTypes = (Combobox) window.getFellow("exceptionTypes");
        CalendarExceptionType type = (CalendarExceptionType) exceptionTypes
                .getSelectedItem().getValue();

        Datebox dateboxStartDate = (Datebox) window
                .getFellow("exceptionStartDate");
        Date startDate = dateboxStartDate.getValue();
View Full Code Here

            listItem.appendChild(listCell);
        }

        private void appendParentCombobox(final Listitem listItem,
                final CalendarData version) {
            final Combobox comboParents = new Combobox();
            final List<BaseCalendar> listParents = getParentCalendars();

            for (BaseCalendar parent : listParents) {
                Comboitem comboItem = new Comboitem();
                comboItem.setValue(parent);
                comboItem.setLabel(parent.getName());
                comboItem.setParent(comboParents);

                if ((version.getParent()) != null
                        && (parent.getId().equals(version.getParent().getId()))) {
                    comboParents.setSelectedItem(comboItem);
                }
            }

            comboParents.addEventListener(Events.ON_SELECT,
                    new EventListener() {
                        @Override
                        public void onEvent(Event event) throws Exception {
                            if (comboParents.getSelectedItem() != null) {
                                BaseCalendar parent = (BaseCalendar) comboParents
                                        .getSelectedItem().getValue();
                                version.setParent(parent);
                            }
                        }
                    });

            Util.bind(comboParents, new Util.Getter<Comboitem>() {
                @Override
                public Comboitem get() {
                    return comboParents.getSelectedItem();
                }
            }, new Util.Setter<Comboitem>() {
                @Override
                public void set(Comboitem comboItem) {
                    if (((comboItem != null)) && (comboItem.getValue() != null)
View Full Code Here

        public void render(Comboitem item, Object data) {
            BaseCalendar calendar = (BaseCalendar) data;
            item.setLabel(calendar.getName());
            item.setValue(calendar);

            Combobox combobox = (Combobox) item.getParent();
            if (combobox.getSelectedIndex() != 0) {
                combobox.setSelectedIndex(0);
            }
        }
View Full Code Here

        //setup authentication type combo box
        prepareAuthenticationTypesCombo();
    }

    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);
            }
        }

        Row comboRow = (Row) editWindow
                .getFellowIfAny("authenticationTypeComboRow");
View Full Code Here

    }

    private void appendComboboxAdvanceType(final Listitem listItem) {
        final DirectAdvanceAssignment advance = (DirectAdvanceAssignment) listItem
                .getValue();
        final Combobox comboAdvanceTypes = new Combobox();
        final List<AdvanceType> listAdvanceType = manageOrderElementAdvancesModel
                .getPossibleAdvanceTypes(advance);

        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)&&
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Combobox

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.