Package org.zkoss.zul

Examples of org.zkoss.zul.Button$AuxInfo


    }

    private void appendDeleteButton(final Treeitem ti) {
        final MaterialCategory materialCategory = (MaterialCategory) ti.getValue();

        Button btnDelete = new Button("", "/common/img/ico_borrar1.png");
        btnDelete.setHoverImage("/common/img/ico_borrar.png");
        btnDelete.setSclass("icono");
        btnDelete.setTooltiptext(_("Delete"));
        btnDelete.addEventListener(Events.ON_CLICK, new EventListener() {
            @Override
            public void onEvent(Event event) {
                confirmRemove(materialCategory);
            }
        });
        btnDelete.setDisabled(hasSubcategoriesOrMaterials(materialCategory));
        Treecell tc = new Treecell();
        tc.setParent(ti.getTreerow());
        btnDelete.setParent(tc);
    }
View Full Code Here


                final Rows rows = gridLabels.getRows();
                for (Iterator i = rows.getChildren().iterator(); i.hasNext();) {
                    final Row row = (Row) i.next();
                    final Label label = (Label) row.getValue();
                    Button btnDelete = (Button) row.getChildren().get(2);
                    if (!canRemoveLabel(label)) {
                        btnDelete.setDisabled(true);
                        btnDelete.setImage("/common/img/ico_borrar_out.png");
                        btnDelete
                                .setHoverImage("/common/img/ico_borrar_out.png");
                        btnDelete.setTooltiptext("");
                    }
                }
            }

            private boolean canRemoveLabel(Label label) {
View Full Code Here

                final Rows rows = gridLabelTypes.getRows();
                for (Iterator i = rows.getChildren().iterator(); i.hasNext();) {
                    final Row row = (Row) i.next();
                    final LabelType labelType = (LabelType) row.getValue();
                    Hbox hbox = (Hbox) row.getChildren().get(2);
                    Button btnDelete = (Button) hbox.getChildren().get(1);
                    if (!canRemoveLabelType(labelType)) {
                        btnDelete.setDisabled(true);
                        btnDelete.setImage("/common/img/ico_borrar_out.png");
                        btnDelete
                                .setHoverImage("/common/img/ico_borrar_out.png");
                        btnDelete.setTooltiptext("");
                    }
                }
            }

            private boolean canRemoveLabelType(LabelType labelType) {
View Full Code Here

     * Append a delete {@link Button} to {@link Row}
     *
     * @param row
     */
    private void appendDeleteButton(final Row row) {
        Button delete = new Button("", "/common/img/ico_borrar1.png");
        delete.setHoverImage("/common/img/ico_borrar.png");
        delete.setSclass("icono");
        delete.setTooltiptext(_("Delete"));
        delete.addEventListener(Events.ON_CLICK, new EventListener() {
            @Override
            public void onEvent(Event event) {
                confirmRemove((ResourcesCostCategoryAssignment) row.getValue());
            }
        });
View Full Code Here

            nameTreecell.appendChild(nameLabel);
            treerow.appendChild(nameTreecell);

            Treecell operationsTreecell = new Treecell();

            Button createDerivedButton = new Button();
            createDerivedButton.setTooltiptext(_("Create derived"));
            createDerivedButton.setSclass("icono");
            createDerivedButton.setImage("/common/img/ico_derived1.png");
            createDerivedButton.setHoverImage("/common/img/ico_derived.png");

            createDerivedButton.addEventListener(Events.ON_CLICK,
                    new EventListener() {

                @Override
                public void onEvent(Event event) {
                    goToCreateDerivedForm(scenario);
                }

            });
            operationsTreecell.appendChild(createDerivedButton);

            Button editButton = Util.createEditButton(new EventListener() {

                @Override
                public void onEvent(Event event) {
                    goToEditForm(scenario);
                }

            });
            operationsTreecell.appendChild(editButton);

            Button removeButton = Util.createRemoveButton(new EventListener() {

                @Override
                public void onEvent(Event event) {
                    confirmDelete(scenario);
                }

            });

            boolean isMainScenario = PredefinedScenarios.MASTER.getScenario()
                    .getId().equals(scenario.getId());
            List<Scenario> derivedScenarios = scenarioModel
                    .getDerivedScenarios(scenario);
            if (isCurrentScenario || isMainScenario
                    || !derivedScenarios.isEmpty()) {
                removeButton.setDisabled(true);
            }
            operationsTreecell.appendChild(removeButton);

            Button connectButton = new Button(_("Connect"));
            connectButton.addEventListener(Events.ON_CLICK,
                    new EventListener() {

                        @Override
                        public void onEvent(Event event) {
                            connectTo(scenario);
                        }

                        private void connectTo(Scenario scenario) {
                            templateModel.setScenario(SecurityUtils
                                    .getSessionUserLoginName(),
                                    scenario,
                                    new IOnFinished() {
                                        @Override
                                        public void onWithoutErrorFinish() {
                                            Executions
                                                    .sendRedirect("/scenarios/scenarios.zul");
                                        }

                                        @Override
                                        public void errorHappened(
                                                Exception exceptionHappened) {
                                            errorHappenedDoingReassignation(exceptionHappened);
                                        }
                                    });
                        }

                    });
            if (isCurrentScenario) {
                connectButton.setDisabled(true);
            }
            operationsTreecell.appendChild(connectButton);

            treerow.appendChild(operationsTreecell);
View Full Code Here

            appendChild(item, decimalBox);
            focusState.focusIfApplycableOnAmountWork(stretch, decimalBox);
        }

        private void appendOperations(Listitem item, final Stretch stretch) {
            Button button;
            if (item.isDisabled()) {
                button = new Button("", "/common/img/ico_borrar_out.png");
                button.setHoverImage("/common/img/ico_borrar_out.png");
                button.setSclass("icono");
                button.setDisabled(true);
            } else {
                button = new Button("", "/common/img/ico_borrar1.png");
                button.setHoverImage("/common/img/ico_borrar.png");
                button.setSclass("icono");
                button.setTooltiptext(_("Delete"));

                button.addEventListener(Events.ON_CLICK, new EventListener() {
                    @Override
                    public void onEvent(Event event) {
                        stretchesFunctionModel.removeStretch(stretch);
                        reloadStretchesListAndCharts();
                    }
View Full Code Here

        }

        private Button getDeleteButton(
                final SubcontractorDeliverDate subcontractorDeliverDate) {

            Button deleteButton = new Button();
            deleteButton.setDisabled(isNotUpdate(subcontractorDeliverDate));
            deleteButton.setSclass("icono");
            deleteButton.setImage("/common/img/ico_borrar1.png");
            deleteButton.setHoverImage("/common/img/ico_borrar.png");
            deleteButton.setTooltiptext(_("Delete"));
            deleteButton.addEventListener(Events.ON_CLICK, new EventListener() {
                @Override
                public void onEvent(Event event) {
                    removeRequiredDeliverDate(subcontractorDeliverDate);
                }
            });
View Full Code Here

            row.appendChild(hbox);
        }

        private Button getUpdateButton(final EndDateCommunication endDateFromSubcontractor) {

            Button updateButton = new Button(_("Update task end"));
            updateButton.setDisabled(!isUpgradeable(endDateFromSubcontractor));

            updateButton.setTooltiptext(_("Update task end"));
            updateButton.addEventListener(Events.ON_CLICK, new EventListener() {
                @Override
                public void onEvent(Event event) {
                    updateTaskEnd(endDateFromSubcontractor.getEndDate());
                }
            });
View Full Code Here

            listcell.appendChild(createRemoveButton(calendarData));
            item.appendChild(listcell);
        }

        private Button createRemoveButton(final CalendarData calendarData) {
            Button result = createButton("/common/img/ico_borrar1.png",
                    _("Delete"), "/common/img/ico_borrar.png", "icono",
                    new EventListener() {
                        @Override
                        public void onEvent(Event event) {
                            baseCalendarModel.removeCalendarData(calendarData);
                            reloadWorkWeeksList();
                        }
                    });
            if (baseCalendarModel.getBaseCalendar() == null
                    || baseCalendarModel.getBaseCalendar()
                            .getCalendarDataVersions().size() == 1) {
                result.setDisabled(true);
            } else {
                result.setDisabled(false);
            }
            return result;
        }
View Full Code Here

        }

        private Button createButton(String image, String tooltip,
                String hoverImage, String styleClass,
                EventListener eventListener) {
            Button result = new Button("", image);
            result.setHoverImage(hoverImage);
            result.setSclass(styleClass);
            result.setTooltiptext(tooltip);
            result.addEventListener(Events.ON_CLICK, eventListener);
            return result;
        }
View Full Code Here

TOP

Related Classes of org.zkoss.zul.Button$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.