Package org.zkoss.zul

Examples of org.zkoss.zul.Button$AuxInfo


            }
        }

        private void appendOperations(Row row,
                final SubcontractorCommunication subcontractorCommunication) {
            Button buttonEdit = new Button();
            buttonEdit.setSclass("icono");
            buttonEdit.setImage("/common/img/ico_editar1.png");
            buttonEdit.setHoverImage("/common/img/ico_editar.png");
            buttonEdit.setTooltiptext(_("Edit"));
            buttonEdit.addEventListener(Events.ON_CLICK, new EventListener() {
                @Override
                public void onEvent(Event arg0) throws Exception {
                    goToEdit(subcontractorCommunication);
                }
            });
View Full Code Here


        }
        return null;
    }

    private void disableCreateTemplateButtonIfNeeded(Component comp) {
        Button createTemplateButton = (Button) comp
                .getFellowIfAny("createTemplateButton");
        if (createTemplateButton != null) {
            if (!SecurityUtils
                    .isSuperuserOrUserInRoles(UserRole.ROLE_TEMPLATES)) {
                createTemplateButton.setDisabled(true);
                createTemplateButton
                        .setTooltiptext(_("Not enough permissions to create templates"));
            }
        }
    }
View Full Code Here

    private void appendExpandCollapseButton() {
        List<Component> children = orderElementFilter.getParent().getChildren();

        // Is already added?
        Button button = (Button) ComponentsFinder.findById("expandAllButton", children);
        if (button != null) {
            if (button.getSclass().equals("planner-command clicked")) {
                button.setSclass("planner-command");
                button.invalidate();
            }
            return;
        }

        // Append expand/collapse button
        final Button expandAllButton = new Button();
        expandAllButton.setId("expandAllButton");
        expandAllButton.setClass("planner-command");
        expandAllButton.setTooltiptext(_("Expand/Collapse all"));
        expandAllButton.setImage("/common/img/ico_expand.png");
        expandAllButton.addEventListener("onClick", new EventListener() {
            @Override
            public void onEvent(Event event) {
                if (expandAllButton.getSclass().equals("planner-command")) {
                    expandAll();
                    expandAllButton.setSclass("planner-command clicked");
                } else {
                    collapseAll();
                    expandAllButton.setSclass("planner-command");
                }
            }
        });
        children.add(expandAllButton);
    }
View Full Code Here

                    createRemoveButton(currentElement));
        }

        private Button createEditButton(
                final OrderElementTemplate currentTemplate) {
            Button result = createButton("/common/img/ico_editar1.png",
                    _("Edit"), "/common/img/ico_editar.png", "icono",
                    new EventListener() {
                        @Override
                        public void onEvent(Event event) {
                            Treeitem item = getTreeitem(event.getTarget());
View Full Code Here

    private void appendAddMeasurement(final Hbox hbox, final Listitem listItem,
            Boolean readOnly) {
        final AdvanceAssignment advance = (AdvanceAssignment) listItem
                .getValue();
        final Button addMeasurementButton = createAddMeasurementButton();

        addMeasurementButton.addEventListener(Events.ON_CLICK,
                new EventListener() {
                    @Override
                    public void onEvent(Event event) {
                        if (!listItem.equals(editAdvances.getSelectedItem())) {
                            selectAdvanceLine(listItem);
                        }
                        goToCreateLineAdvanceMeasurement();
                    }
                });

        if ((advance.getAdvanceType() != null)
                && (advance.getAdvanceType().isQualityForm())) {
            addMeasurementButton.setDisabled(true);
            addMeasurementButton
                    .setTooltiptext(_("Progress that are reported by quality forms can not be modified"));
        } else if ((advance.getAdvanceType() != null)
                && (advance.getAdvanceType().isReadOnly())) {
            addMeasurementButton.setDisabled(true);
            addMeasurementButton
                    .setTooltiptext(_("This progress type cannot be modified"));
        } else if (advance instanceof IndirectAdvanceAssignment) {
            addMeasurementButton.setDisabled(true);
            addMeasurementButton
                    .setTooltiptext(_("Calculated progress can not be modified"));
        } else if (readOnly) {
            addMeasurementButton.setDisabled(true);
            addMeasurementButton
                    .setTooltiptext(_("Subcontractor values are read only because they were reported by the subcontractor company."));
        }
        hbox.appendChild(addMeasurementButton);

    }
View Full Code Here

                    createRemoveButton(currentOrderElement));
        }

        private Button createEditButton(final OrderElement currentOrderElement,
                final Treeitem item) {
            Button editbutton = createButton("/common/img/ico_editar1.png",
                    _("Edit"), "/common/img/ico_editar.png", "icono",
                    new EventListener() {
                        @Override
                        public void onEvent(Event event) {
                            showEditionOrderElement(item);
View Full Code Here

     * @param eventListener
     *            A event listener for {@link Events.ON_CLICK}
     * @return An edit {@link Button}
     */
    public static Button createEditButton(EventListener eventListener) {
        Button result = new Button();
        result.setTooltiptext(_("Edit"));
        result.setSclass("icono");
        result.setImage("/common/img/ico_editar1.png");
        result.setHoverImage("/common/img/ico_editar.png");

        result.addEventListener(Events.ON_CLICK, eventListener);

        return result;
    }
View Full Code Here

     * @param eventListener
     *            A event listener for {@link Events.ON_CLICK}
     * @return A remove {@link Button}
     */
    public static Button createRemoveButton(EventListener eventListener) {
        Button result = new Button();
        result.setTooltiptext(_("Remove"));
        result.setSclass("icono");
        result.setImage("/common/img/ico_borrar1.png");
        result.setHoverImage("/common/img/ico_borrar.png");

        result.addEventListener(Events.ON_CLICK, eventListener);

        return result;
    }
View Full Code Here

        columns.setParent(gridItems);
    }

    private void appendOperations(final Row row) {
        Button buttonRemove = new Button();
        buttonRemove.setParent(row);
        buttonRemove.setClass("icono");
        buttonRemove.setImage("/common/img/ico_borrar1.png");
        buttonRemove.setHoverImage("/common/img/ico_borrar.png");
        buttonRemove.setTooltiptext(_("Delete"));

        buttonRemove.addEventListener(Events.ON_CLICK, new EventListener() {
            @Override
            public void onEvent(Event event) {
                confirmRemove((TaskQualityForm) row.getValue());
            }
        });
View Full Code Here

    @Override
    public Object addMenuItem(String name, String cssClass,
            org.zkoss.zk.ui.event.EventListener eventListener) {
        Vbox insertionPoint = getRegisteredItemsInsertionPoint();
        Button button = new Button();
        button.setLabel(_(name));
        if (cssClass != null) {
            toggleDomainCssClass(cssClass, button);
        }
        setDeselectedClass(button);
        button.addEventListener(Events.ON_CLICK, doNotCallTwice(button,
                eventListener));
        button.setMold("trendy");
        insertionPoint.appendChild(button);
        insertionPoint.appendChild(separator());
        return button;
    }
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.