Package org.rhq.coregui.client.util.enhanced

Examples of org.rhq.coregui.client.util.enhanced.EnhancedIButton


        form.validate();
        markForRedraw();
    }

    private EnhancedToolStrip buildToolStrip() {
        saveButton = new EnhancedIButton(MSG.common_button_save());
        saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                if (form.validate()) {
                    if (!checkNewHeapLowerThanMaxHeap()) {
                        Map<String, String> errors = new HashMap<String, String>(2);
View Full Code Here


        StaticTextItem lastUpdateItem = new StaticTextItem(FIELD_MTIME.propertyName(), FIELD_MTIME.title());
        lastUpdateItem.setValue(TimestampCellFormatter.format(Long.valueOf(server.getMtime()),
            TimestampCellFormatter.DATE_TIME_FORMAT_LONG));

        IButton saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        saveButton.setOverflow(Overflow.VISIBLE);
        saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                if (form.validate()) {
                    server.setAddress(addressItem.getValueAsString());
                    server.setPort(Integer.parseInt(portItem.getValueAsString()));
                    server.setSecurePort(Integer.parseInt(securePortItem.getValueAsString()));
View Full Code Here

        footer = new EnhancedToolStrip();
        footer.setPadding(5);
        footer.setWidth100();
        footer.setMembersMargin(15);

        editButton = new EnhancedIButton(editMode ? MSG.common_title_view_mode() : MSG.common_title_edit_mode());
        editButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                editMode = !editMode;
                editButton.setTitle(editMode ? MSG.common_title_view_mode() : MSG.common_title_edit_mode());
                dashboardView.setEditMode(editMode);
            }
        });

        resetButton = new EnhancedIButton(MSG.common_button_reset());
        resetButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                String message = MSG.view_summaryDashboard_resetConfirm();

                SC.ask(message, new BooleanCallback() {
View Full Code Here


    private Layout getButtons() {
        buttonsForm = new HLayout();

        installButton = new EnhancedIButton(MSG.view_remoteAgentInstall_installAgent());
        installButton.setExtraSpace(10);
        installButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                absPathValidator.setPerformCheck(true);
                try {
                    if (connectionForm.validate()) {
                        new CheckSSHConnectionCallback() {
                            @Override
                            protected void doActualWork() {
                                installAgent();
                            }
                        }.execute();
                    }
                } finally {
                    absPathValidator.setPerformCheck(false);
                }
            }
        });

        uninstallButton = new EnhancedIButton(MSG.view_remoteAgentInstall_uninstallAgent());
        uninstallButton.setExtraSpace(10);
        uninstallButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                absPathValidator.setPerformCheck(true);
                try {
                    if (connectionForm.validate()) {
                        new CheckSSHConnectionCallback() {
                            @Override
                            protected void doActualWork() {
                                uninstallAgent();
                            }
                        }.execute();
                    }
                } finally {
                    absPathValidator.setPerformCheck(false);
                }
            }
        });

        startButton = new EnhancedIButton(MSG.common_label_startAgent());
        startButton.setExtraSpace(10);
        startButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                if (connectionForm.validate()) {
                    new CheckSSHConnectionCallback() {
                        @Override
                        protected void doActualWork() {
                            startAgent();
                        }
                    }.execute();
                }
            }
        });

        stopButton = new EnhancedIButton(MSG.view_remoteAgentInstall_stopAgent());
        stopButton.setExtraSpace(10);
        stopButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                if (connectionForm.validate()) {
                    new CheckSSHConnectionCallback() {
View Full Code Here

            VLayout spacer = new VLayout();
            spacer.setHeight(10);
            layout.addMember(spacer);

            IButton cancel = new EnhancedIButton(MSG.common_button_cancel());
            cancel.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    PortletSettingsWindow.this.destroy();
                }
            });
            IButton save = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
            save.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    if (form.validate()) {
                        // the form submit handler code is responsible for performing the configure and refresh as
                        // needed. This ensures that the updated configuration is used.                       
                        form.submit();

                        // the portlet does not have a handle on its container, so saving the new settings is down here
                        parentWindow.save();

                        // nuke the settings window now that its form field values have been processed
                        PortletSettingsWindow.this.destroy();
                    }
                }
            });
            toolStrip = new EnhancedToolStrip();
            toolStrip.setPadding(5);
            toolStrip.setWidth100();
            toolStrip.setMembersMargin(15);
            toolStrip.addMember(cancel);
            toolStrip.addMember(save);
            toolStrip.setLayoutAlign(Alignment.CENTER);
        } else if (view instanceof ConfigurablePortlet) {
            ConfigurationDefinition definition = ((ConfigurablePortlet) view).getConfigurationDefinition();
            Configuration configuration = storedPortlet.getConfiguration();

            final ConfigurationEditor editor = new ConfigurationEditor(definition, configuration);
            editor.setWidth(400);
            editor.setHeight(400);
            layout.addMember(editor);

            IButton cancel = new EnhancedIButton(MSG.common_button_cancel());
            cancel.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    PortletSettingsWindow.this.destroy();
                }
            });
            IButton save = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
            save.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    if (editor.validate()) {
                        // set the portlet config to the new config
                        Configuration configuration = editor.getConfiguration();
                        storedPortlet.setConfiguration(configuration);
View Full Code Here

        for (final CarouselActionInfo carouselAction : carouselActions) {

            if (null == carouselAction.getValueMap()) {
                // button action
                IButton button = new EnhancedIButton(carouselAction.getTitle());
                button.setDisabled(true);
                button.setOverflow(Overflow.VISIBLE);
                button.addClickHandler(new ClickHandler() {
                    public void onClick(ClickEvent clickEvent) {
                        disableAllFooterControls();
                        if (carouselAction.confirmMessage != null) {
                            String message = carouselAction.confirmMessage.replaceAll("\\#", "TODO:");

                            SC.ask(message, new BooleanCallback() {
                                public void execute(Boolean confirmed) {
                                    if (confirmed) {
                                        carouselAction.action.executeAction(null);
                                    } else {
                                        refreshCarouselInfo();
                                    }
                                }
                            });
                        } else {
                            carouselAction.action.executeAction(null);
                        }
                    }
                });

                carouselAction.actionCanvas = button;
                footer.addMember(button);

            } else {
                // menu action
                Menu menu = new Menu();
                final Map<String, ? extends Object> menuEntries = carouselAction.getValueMap();
                for (final String key : menuEntries.keySet()) {
                    MenuItem item = new MenuItem(key);
                    item.addClickHandler(new com.smartgwt.client.widgets.menu.events.ClickHandler() {
                        public void onClick(MenuItemClickEvent event) {
                            disableAllFooterControls();
                            carouselAction.getAction().executeAction(menuEntries.get(key));
                        }
                    });
                    menu.addItem(item);
                }

                IMenuButton menuButton = new IMenuButton(carouselAction.getTitle());
                menuButton.setMenu(menu);
                menuButton.setDisabled(true);
                menuButton.setOverflow(Overflow.VISIBLE);
                menuButton.setShowMenuBelow(false);

                carouselAction.actionCanvas = menuButton;
                footer.addMember(menuButton);
            }
        }

        for (Canvas extraWidgetCanvas : extraWidgetsInMainFooter) {
            footer.addMember(extraWidgetCanvas);
        }

        footer.addMember(new LayoutSpacer());

        widthButton = new EnhancedIButton(MSG.common_button_fixedWidth());
        widthButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                carouselUsingFixedWidths = !carouselUsingFixedWidths;
                widthButton.setTitle(carouselUsingFixedWidths ? MSG.common_button_scaleToFit() : MSG
                    .common_button_fixedWidth());
                buildCarousel(true);
            }
        });
        footer.addMember(widthButton);

        if (isShowFooterRefresh()) {
            this.refreshButton = new EnhancedIButton(MSG.common_button_refresh());
            refreshButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    disableAllFooterControls();
                    refresh();
                }
            });
            footer.addMember(refreshButton);
        }

        previousButton = new EnhancedIButton(MSG.common_button_previous());
        previousButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                disableAllFooterControls();
                previous();
            }
        });
        footer.addMember(previousButton);

        nextButton = new EnhancedIButton(MSG.common_button_next(), ButtonColor.BLUE);
        nextButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                disableAllFooterControls();
                next();
            }
View Full Code Here

        form.setSaveOperationType(saveOperationType);

        final DynaGroupChildrenView dynaGroupChildrenView = new DynaGroupChildrenView(groupDefinitionId);

        // button setup
        IButton saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                if (form.validate()) {
                    saveFormCheckCannedExpr(form, dynaGroupChildrenView, false);
                }
            }
        });

        IButton recalculateButton = new EnhancedIButton(MSG.view_dynagroup_saveAndRecalculate());
        recalculateButton.setWidth(150);
        recalculateButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                if (form.validate()) {
                    saveFormCheckCannedExpr(form, dynaGroupChildrenView, true);
                }
            }
        });

        IButton resetButton = new EnhancedIButton(MSG.common_button_reset());
        resetButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                form.reset();
            }
        });
View Full Code Here

        toolStrip.setWidth100();
        toolStrip.setExtraSpace(10);
        toolStrip.setMembersMargin(5);
        toolStrip.setLayoutMargin(5);

        IButton saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                save();
                if (ResourceResourceGroupsView.this.saveButtonHandler != null) {
                    ResourceResourceGroupsView.this.saveButtonHandler.onClick(clickEvent);
                }
View Full Code Here

        final AffinityGroupServersSelector selector = new AffinityGroupServersSelector(affinityGroupId);
        selector.setMargin(10);
        layout.addMember(selector);

        IButton cancel = new EnhancedIButton(MSG.common_button_cancel());
        cancel.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                closeAndRefresh(parrent, false);
            }
        });
        IButton save = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        save.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                List<Integer> actuallySelected = getIdList(selector.getSelectedRecords());
                List<Integer> originallySelected = selector.getOriginallyAssignedIds();
                originallySelected.removeAll(actuallySelected);
                actuallySelected.removeAll(selector.getOriginallyAssignedIds());
View Full Code Here

        toolStrip.setBackgroundImage(null);
        toolStrip.setWidth100();
        toolStrip.setMembersMargin(3);
        toolStrip.setPadding(3);

        this.saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        this.saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                save();
            }
        });
View Full Code Here

TOP

Related Classes of org.rhq.coregui.client.util.enhanced.EnhancedIButton

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.