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

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


        footer = new EnhancedToolStrip();
        footer.setStyleName("footer");
        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


    public void hideMessage() {
        this.messageBar.hide();
    }

    private void setupButtons() {
        cancelButton = new EnhancedIButton(CANCEL);
        cancelButton.setDisabled(false);
        cancelButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                wizard.cancel();
                closeDialog();
            }
        });
        buttonBar.addMember(cancelButton);

        buttonBar.addMember(new LayoutSpacer());

        previousButton = new EnhancedIButton(PREVIOUS);
        previousButton.setDisabled(true);
        previousButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {

                WizardStep step = wizard.getSteps().get(currentStep);
                if (step.previousPage()) {
                    decrementStep();
                }
            }
        });
        if (wizard.getSteps().size() <= 1) {
            previousButton.setVisible(false);
        }
        buttonBar.addMember(previousButton);

        nextButton = new EnhancedIButton(NEXT, ButtonColor.BLUE);
        nextButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {

                WizardStep step = wizard.getSteps().get(currentStep);
                if (step.nextPage()) {
View Full Code Here

            EnhancedHLayout hLayout = new EnhancedHLayout();
            hLayout.setMembersMargin(10);
            vLayout.addMember(hLayout);

            saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
            saveButton.setDisabled(true);
            saveButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    save(new DSRequest());
                }
            });
            hLayout.addMember(saveButton);

            resetButton = new EnhancedIButton(MSG.common_button_reset());
            resetButton.setDisabled(true);
            resetButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    resetButton.disable();
                    saveButton.disable();
                    reset();
                }
            });
            hLayout.addMember(resetButton);

            cancelButton = new EnhancedIButton(MSG.common_button_cancel());
            cancelButton.addClickHandler(new ClickHandler() {
                public void onClick(ClickEvent clickEvent) {
                    CoreGUI.goToView(getListViewPath());
                }
            });
View Full Code Here

                    }
                });
            }
        });

        IButton updateOnAgentsButton = new EnhancedIButton(MSG.view_admin_plugins_update_on_agents(), ButtonColor.BLUE);
        updateOnAgentsButton.addClickHandler(new ClickHandler() {
            @Override
            public void onClick(ClickEvent clickEvent) {
                VLayout layout = new VLayout();
                final PopupWindow w = new PopupWindow(null);

                Canvas nowCanvas = new Canvas();
                nowCanvas.setWidth(1);
                nowCanvas.setHeight(1);


                DynamicForm delayForm = new DynamicForm();
                delayForm.setTitleOrientation(TitleOrientation.TOP);
                TreeSet<TimeUnit> timeUnits = new TreeSet<TimeUnit>();
                timeUnits.add(TimeUnit.SECONDS);
                timeUnits.add(TimeUnit.MINUTES);
                timeUnits.add(TimeUnit.HOURS);
                timeUnits.add(TimeUnit.DAYS);
                final DurationItem startDelay = new DurationItem("duration", "", timeUnits, false, false);

                delayForm.setFields(startDelay);

                DynamicForm scheduleForm = new DynamicForm();

                final DateTimeItem schedule = new DateTimeItem("schedule");
                schedule.setEnforceDate(true);
                schedule.setCenturyThreshold(99);
                schedule.setShowTitle(false);
                schedule.setStartDate(new Date());
                schedule.setUseMask(true);
                schedule.setShowHint(true);

                scheduleForm.setFields(schedule);


                LinkedHashMap<String, Canvas> items = new LinkedHashMap<String, Canvas>();
                items.put(MSG.view_admin_plugins_update_on_agents_now(), nowCanvas);
                items.put(MSG.view_admin_plugins_update_on_agents_delayed(), delayForm);
                items.put(MSG.view_admin_plugins_update_on_agents_scheduled(), scheduleForm);

                DynamicForm form = new DynamicForm();
                form.setWidth(300);
                final RadioGroupWithComponentsItem scheduling = new RadioGroupWithComponentsItem("scheduling", "", items, form);

                form.setFields(scheduling);

                layout.addMember(form);

                ButtonItem ok = new ButtonItem("ok", MSG.common_button_ok());
                ok.setEndRow(false);
                ok.setAlign(Alignment.RIGHT);
                ButtonItem cancel = new ButtonItem("cancel", MSG.common_button_cancel());
                cancel.setStartRow(false);
                cancel.setAlign(Alignment.LEFT);

                DynamicForm buttons = new DynamicForm();
                buttons.setNumCols(2);
                buttons.setFields(ok, cancel);

                layout.addMember(buttons);

                ok.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
                    @Override
                    public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent clickEvent) {
                        long delay;
                        if (MSG.view_admin_plugins_update_on_agents_now().equals(scheduling.getSelected())) {
                            delay = 0;
                        } else if (MSG.view_admin_plugins_update_on_agents_delayed().equals(scheduling.getSelected())) {
                            Integer value = (Integer) startDelay.getValue();
                            TimeUnit u = startDelay.getValueUnit();

                            if (value == null) {
                                CoreGUI.getErrorHandler()
                                    .handleError(MSG.view_admin_plugins_update_on_agents_no_time_specified());
                                w.hide();
                                return;
                            }

                            delay = value;
                            switch (u) {
                            case SECONDS:
                                delay *= 1000;
                                break;
                            case MINUTES:
                                delay *= 60 * 1000;
                                break;
                            case HOURS:
                                delay *= 60 * 60 * 1000;
                                break;
                            case DAYS:
                                delay *= 24 * 60 * 60 * 1000;
                                break;
                            }
                        } else {
                            Date scheduledDate = schedule.getValueAsDate();
                            delay = scheduledDate.getTime() - new Date().getTime();
                        }

                        GWT.log("About to schedule update of the plugins on the agent in " + delay + " milliseconds.");

                        GWTServiceLookup.getPluginService().updatePluginsOnAgents(delay, new AsyncCallback<Void>() {
                            @Override
                            public void onFailure(Throwable caught) {
                                CoreGUI.getErrorHandler().handleError(
                                    MSG.view_admin_plugins_update_on_agents_failure() + " " +
                                        caught.getMessage(), caught);
                                w.hide();
                            }

                            @Override
                            public void onSuccess(Void result) {
                                w.hide();
                            }
                        });
                    }
                });

                scheduling.setValue(MSG.view_admin_plugins_update_on_agents_now());

                cancel.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() {
                    @Override
                    public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent clickEvent) {
                        w.hide();
                    }
                });

                w.addItem(layout);

                w.setTitle(MSG.view_admin_plugins_update_on_agents());
                w.setHeight(200);
                w.setWidth(340);
                w.show();
            }

        });

        IButton scanForUpdatesButton = new EnhancedIButton(MSG.view_admin_plugins_scan());
        scanForUpdatesButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                GWTServiceLookup.getPluginService().scanAndRegister(new AsyncCallback<Void>() {
                    @Override
                    public void onSuccess(Void result) {
                        Message msg = new Message(MSG.view_admin_plugins_scanComplete(), Severity.Info);
View Full Code Here

        form = new DynamicForm();
        form.setItems(formItems.toArray(new FormItem[formItems.size()]));
    }

    private ToolStrip buildToolStrip() {
        IButton ok = new EnhancedIButton(MSG.common_button_ok(), ButtonColor.BLUE);
        ok.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                if (form.validate(false)) {
                    if (saveCondition()) {
                        closeFunction.run();
                    }
                }
            }
        });

        IButton cancel = new EnhancedIButton(MSG.common_button_cancel());
        cancel.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                closeFunction.run();
            }
        });
View Full Code Here

                    }
                });
            }
        });

        IButton scanForUpdatesButton = new EnhancedIButton(MSG.view_admin_plugins_scan(), ButtonColor.BLUE);
        scanForUpdatesButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                GWTServiceLookup.getPluginService().scanAndRegister(new AsyncCallback<Void>() {
                    @Override
                    public void onSuccess(Void result) {
                        Message msg = new Message(MSG.view_admin_plugins_scanComplete(), Severity.Info);
                        CoreGUI.getMessageCenter().notify(msg);
                        refresh();
                    }

                    @Override
                    public void onFailure(Throwable caught) {
                        CoreGUI.getErrorHandler().handleError(
                            MSG.view_admin_plugins_scanFailure() + " " + caught.getMessage(), caught);
                        refreshTableInfo();
                    }
                });
            }
        });

        IButton restartMasterPCButton = new EnhancedIButton(MSG.view_admin_plugins_restartMasterPC(), ButtonColor.RED);
        restartMasterPCButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                Message msg = new Message(MSG.view_admin_plugins_restartMasterPCStarted(), Severity.Info);
                CoreGUI.getMessageCenter().notify(msg);

                GWTServiceLookup.getPluginService().restartMasterPluginContainer(new AsyncCallback<Void>() {
View Full Code Here

        footer.setWidth100();
        footer.setMembersMargin(15);

        addMember(footer);

        final IButton importButton = new EnhancedIButton(MSG.common_button_import(), ButtonColor.BLUE);
        final IButton ignoreButton = new EnhancedIButton(MSG.view_autoDiscoveryQ_ignore(), ButtonColor.RED);
        final IButton unignoreButton = new EnhancedIButton(MSG.view_autoDiscoveryQ_unignore());

        footer.addMember(importButton);
        footer.addMember(ignoreButton);
        footer.addMember(unignoreButton);

        disableButtons(importButton, ignoreButton, unignoreButton);

        footer.addMember(new LayoutSpacer());

        // The remaining footer items (status filter, (de)select all buttons, and refresh button) will be right-aligned.

        DynamicForm form = new DynamicForm();
        final SelectItem statusSelectItem = new SelectItem("status", MSG.view_autoDiscoveryQ_showStatus());
        statusSelectItem.setValueMap(AutodiscoveryQueueDataSource.NEW, AutodiscoveryQueueDataSource.IGNORED,
            AutodiscoveryQueueDataSource.NEW_AND_IGNORED);
        statusSelectItem.setValue(AutodiscoveryQueueDataSource.NEW);
        statusSelectItem.setWrapTitle(false);
        form.setItems(statusSelectItem);

        statusSelectItem.addChangedHandler(new ChangedHandler() {
            public void onChanged(ChangedEvent changedEvent) {
                treeGrid.fetchData(new Criteria("status", (String) statusSelectItem.getValue()));
            }
        });
        footer.addMember(form);

        final IButton selectAllButton = new EnhancedIButton(MSG.view_autoDiscoveryQ_selectAll());
        footer.addMember(selectAllButton);
        final IButton deselectAllButton = new EnhancedIButton(MSG.view_autoDiscoveryQ_deselectAll());
        deselectAllButton.setDisabled(true);
        footer.addMember(deselectAllButton);

        IButton refreshButton = new EnhancedIButton(MSG.common_button_refresh());
        refreshButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                refresh();
            }
        });
        footer.addMember(refreshButton);
View Full Code Here

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

        IButton saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        saveButton.setOverflow(Overflow.VISIBLE);
        saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                affinityGroup.setName(nameItem.getValueAsString());
                GWTServiceLookup.getTopologyService().updateAffinityGroup(affinityGroup, new AsyncCallback<Void>() {
                    public void onSuccess(Void result) {
                        Message msg = new Message(MSG.view_adminTopology_message_agroupRenamed(
View Full Code Here

    public void refresh() {
        fetchClusterSettings();
    }

    private EnhancedToolStrip buildToolStrip() {
        saveButton = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
        saveButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent clickEvent) {
                if (clusterForm.validate() && deploymentForm.validate() && credentialsForm.validate()
                    && regularSnapshotsForm.validate()) {
                    SC.ask(MSG.view_adminTopology_storageNodes_clusterSettings_message_confirmation(),
View Full Code Here

        final AffinityGroupAgentsSelector selector = new AffinityGroupAgentsSelector(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

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.