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

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


    public BundleGroupsStep(AbstractBundleCreateWizard wizard) {
        this.wizard = wizard;
    }

    public Canvas getCanvas() {
        canvas = new EnhancedVLayout();
        canvas.setWidth100();

        // go get the assignable/assigned bundle groups for this new bundle version, initial or not
        this.isInitialVersion = this.wizard.getBundleVersion() == null
            || this.wizard.getBundleVersion().getVersionOrder() == 0;
View Full Code Here


    public BundleUploadDataStep(AbstractBundleCreateWizard bundleCreationWizard) {
        this.wizard = bundleCreationWizard;
    }

    public Canvas getCanvas() {
        final EnhancedVLayout mainLayout = new EnhancedVLayout();
        mainLayout.setMargin(20);
        mainLayout.setWidth100();
        mainLayout.setHeight(10);

        bundleServer.getAllBundleVersionFilenames(this.wizard.getBundleVersion().getId(),
            new AsyncCallback<HashMap<String, Boolean>>() {

                public void onSuccess(HashMap<String, Boolean> result) {
View Full Code Here

        });
    }

    private Layout getCanvas() {
        if (this.canvas == null) {
            EnhancedVLayout layout = new EnhancedVLayout();
            layout.setHeight100();
            layout.setWidth100();
            layout.setMargin(5);
            this.canvas = layout;
        }

        return this.canvas;
    }
View Full Code Here

        form.setCellPadding(5);
        form.setFields(this.expressionItem, this.memberOfItem, this.memberOfGroupItem, this.groupByItem,
            this.resourceItem, this.expressionTypeItem, this.pluginItem, this.resourceTypeItem, this.propertyNameItem,
            this.unsetItem, this.compareTypeItem, this.valueItem, addButton, closeButton);

        EnhancedVLayout layout = new EnhancedVLayout();
        layout.setLayoutMargin(5);
        layout.setAutoHeight();
        layout.setAutoWidth();
        layout.addMember(form);
        addItem(layout);

        // initially enable/disable components as appropriate
        enableDisableComponents();
    }
View Full Code Here

    @Override
    protected void onInit() {
        super.onInit();

        contents = new EnhancedVLayout();
        contents.setWidth100();
        contents.setHeight100();

        addMember(contents);
View Full Code Here

    @Override
    public DynamicForm getCustomSettingsForm() {
        final DashboardPortlet storedPortlet = this.portletWindow.getStoredPortlet();
        final Configuration portletConfig = storedPortlet.getConfiguration();
        DynamicForm customSettings = new DynamicForm();
        EnhancedVLayout page = new EnhancedVLayout();
        //build editor form container
        final DynamicForm form = new DynamicForm();
        form.setMargin(5);

        //add sort priority selector
        //        final SelectItem resultSortSelector = PortletConfigurationEditorComponent
        //            .getResulSortOrderEditor(portletConfig);
        //add result status selector
        final SelectItem resultStatusSelector = PortletConfigurationEditorComponent
            .getConfigurationUpdateStatusEditor(portletConfig);

        //add result count selector
        final SelectItem resultCountSelector = PortletConfigurationEditorComponent.getResultCountEditor(portletConfig);

        //add range selector
        final CustomConfigMeasurementRangeEditor measurementRangeEditor = PortletConfigurationEditorComponent
            .getMeasurementRangeEditor(portletConfig);

        //        form.setItems(alertPrioritySelector, resultCountSelector);
        form.setItems(resultStatusSelector, resultCountSelector);

        //submit handler
        customSettings.addSubmitValuesHandler(new SubmitValuesHandler() {

            @Override
            public void onSubmitValues(SubmitValuesEvent event) {
                //                //result sort order
                //                selectedValue = resultSortSelector.getValue().toString();
                //                if ((selectedValue.trim().isEmpty()) || (selectedValue.equalsIgnoreCase(PageOrdering.DESC.name()))) {//then desc
                //                    portletConfig.put(new PropertySimple(Constant.RESULT_SORT_ORDER, PageOrdering.DESC));
                //                } else {
                //                    portletConfig.put(new PropertySimple(Constant.RESULT_SORT_ORDER, PageOrdering.ASC));
                //                }
                //config status
                Configuration updatedConfig = AbstractActivityView.saveConfigUpdateStatusSelectorSettings(
                    resultStatusSelector, portletConfig);

                //result count
                updatedConfig = AbstractActivityView.saveResultCounterSettings(resultCountSelector, updatedConfig);

                //time range settings
                updatedConfig = AbstractActivityView.saveMeasurementRangeEditorSettings(measurementRangeEditor,
                    updatedConfig);

                //persist and reload portlet
                storedPortlet.setConfiguration(updatedConfig);
                configure(portletWindow, storedPortlet);
                refresh();
            }
        });
        form.markForRedraw();
        page.addMember(measurementRangeEditor);
        page.addMember(form);
        customSettings.addChild(page);
        return customSettings;
    }
View Full Code Here

        }.run(); // fire the timer immediately
    }

    private Layout getCanvas() {
        if (this.canvas == null) {
            EnhancedVLayout layout = new EnhancedVLayout();
            layout.setHeight100();
            layout.setWidth100();
            layout.setMargin(5);
            this.canvas = layout;
        }

        return this.canvas;
    }
View Full Code Here

        final PluginKey pluginKey = PluginKey.createServerPluginKey(plugin.getType(), plugin.getName());

        pluginManager.getServerPluginConfigurationDefinition(pluginKey, new AsyncCallback<ConfigurationDefinition>() {
            public void onSuccess(ConfigurationDefinition def) {
                if (def != null) {
                    EnhancedVLayout layout = new EnhancedVLayout();

                    ToolStrip buttons = new ToolStrip();
                    buttons.setWidth100();
                    buttons.setExtraSpace(10);
                    buttons.setMembersMargin(5);
                    buttons.setLayoutMargin(5);

                    final IButton saveButtonPC = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);

                    final IButton resetButtonPC = new EnhancedIButton(MSG.common_button_reset(), ButtonColor.RED);

                    Configuration config = plugin.getPluginConfiguration();
                    final ConfigurationEditor editorPC = new ConfigurationEditor(def, config);
                    editorPC.setOverflow(Overflow.AUTO);
                    editorPC.addPropertyValueChangeListener(new PropertyValueChangeListener() {
                        public void propertyValueChanged(PropertyValueChangeEvent event) {
                            if (event.isInvalidPropertySetChanged()) {
                                Map<String, String> invalidPropertyNames = event.getInvalidPropertyNames();
                                if (invalidPropertyNames.isEmpty()) {
                                    saveButtonPC.enable();
                                } else {
                                    saveButtonPC.disable();
                                }
                            }
                        }
                    });

                    resetButtonPC.addClickHandler(new ClickHandler() {
                        public void onClick(ClickEvent event) {
                            editorPC.reset();
                        }
                    });

                    saveButtonPC.addClickHandler(new ClickHandler() {
                        public void onClick(ClickEvent event) {
                            if (!editorPC.validate()) {
                                Message msg = new Message(MSG.view_admin_plugins_serverConfig_badSettings(),
                                    Severity.Warning, EnumSet.of(Message.Option.Transient));
                                CoreGUI.getMessageCenter().notify(msg);
                                return;
                            }
                            pluginManager.updateServerPluginConfiguration(pluginKey, editorPC.getConfiguration(),
                                new AsyncCallback<Void>() {
                                    public void onSuccess(Void result) {
                                        Message m = new Message(MSG.view_admin_plugins_serverConfig_settingsSaved());
                                        CoreGUI.getMessageCenter().notify(m);
                                    }

                                    public void onFailure(Throwable caught) {
                                        CoreGUI.getErrorHandler().handleError(
                                            MSG.view_admin_plugins_serverConfig_saveFailed(), caught);
                                    }
                                });
                        }
                    });

                    buttons.addMember(saveButtonPC);
                    buttons.addMember(resetButtonPC);
                    layout.addMember(buttons);
                    layout.addMember(editorPC);

                    SectionStackSection section = new SectionStackSection(MSG.view_admin_plugins_serverConfig());
                    section.setExpanded(false);
                    section.setItems(layout);
View Full Code Here

        final PluginKey pluginKey = PluginKey.createServerPluginKey(plugin.getType(), plugin.getName());

        pluginManager.getServerPluginScheduledJobsDefinition(pluginKey, new AsyncCallback<ConfigurationDefinition>() {
            public void onSuccess(ConfigurationDefinition def) {
                if (def != null) {
                    EnhancedVLayout layout = new EnhancedVLayout();

                    ToolStrip buttons = new ToolStrip();
                    buttons.setWidth100();
                    buttons.setExtraSpace(10);
                    buttons.setMembersMargin(5);
                    buttons.setLayoutMargin(5);

                    final IButton saveButtonSJ = new EnhancedIButton(MSG.common_button_save(), ButtonColor.BLUE);
                    buttons.addMember(saveButtonSJ);

                    final IButton resetButtonSJ = new EnhancedIButton(MSG.common_button_reset(), ButtonColor.RED);
                    buttons.addMember(resetButtonSJ);

                    Configuration config = plugin.getScheduledJobsConfiguration();
                    final ConfigurationEditor editorSJ = new ConfigurationEditor(def, config);
                    editorSJ.setOverflow(Overflow.AUTO);
                    editorSJ.addPropertyValueChangeListener(new PropertyValueChangeListener() {
                        public void propertyValueChanged(PropertyValueChangeEvent event) {
                            if (event.isInvalidPropertySetChanged()) {
                                Map<String, String> invalidPropertyNames = event.getInvalidPropertyNames();
                                if (invalidPropertyNames.isEmpty()) {
                                    saveButtonSJ.enable();
                                } else {
                                    saveButtonSJ.disable();
                                }
                            }
                        }
                    });

                    resetButtonSJ.addClickHandler(new ClickHandler() {
                        public void onClick(ClickEvent event) {
                            editorSJ.reset();
                        }
                    });

                    saveButtonSJ.addClickHandler(new ClickHandler() {
                        public void onClick(ClickEvent event) {
                            if (!editorSJ.validate()) {
                                Message msg = new Message(MSG.view_admin_plugins_serverConfig_badSettings(),
                                    Severity.Warning, EnumSet.of(Message.Option.Transient));
                                CoreGUI.getMessageCenter().notify(msg);
                                return;
                            }
                            pluginManager.updateServerPluginScheduledJobs(pluginKey, editorSJ.getConfiguration(),
                                new AsyncCallback<Void>() {
                                    public void onSuccess(Void result) {
                                        Message m = new Message(MSG.view_admin_plugins_serverConfig_settingsSaved());
                                        CoreGUI.getMessageCenter().notify(m);
                                    }

                                    public void onFailure(Throwable caught) {
                                        CoreGUI.getErrorHandler().handleError(
                                            MSG.view_admin_plugins_serverConfig_saveFailed(), caught);
                                    }
                                });
                        }
                    });

                    layout.addMember(buttons);
                    layout.addMember(editorSJ);

                    SectionStackSection section = new SectionStackSection(MSG.view_admin_plugins_serverScheduleJobs());
                    section.setExpanded(false);
                    section.setItems(layout);
View Full Code Here

        return form;
    }

    private Canvas getActionLayout() {
        EnhancedVLayout actionLayout = new EnhancedVLayout(10);

        // we can only revert the live deployments, only show revert button when appropriate
        // in addition, we provide a purge button if you are viewing the live deployment, so
        // they can be shown an option to purge the platform content (since only the "live"
        // deployment represents content on the remote machines, showing purge only for live
        // deployments makes sense).
        if (deployment.isLive()) {
            IButton revertButton = new EnhancedIButton(MSG.view_bundle_revert(), ButtonColor.RED);
            //revertButton.setIcon("subsystems/bundle/BundleAction_Revert_16.png");
            revertButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
                @Override
                public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                    new BundleRevertWizard(deployment.getDestination()).startWizard();
                }
            });
            actionLayout.addMember(revertButton);

            IButton purgeButton = new EnhancedIButton(MSG.view_bundle_purge(), ButtonColor.RED);
            //purgeButton.setIcon("subsystems/bundle/BundleDestinationAction_Purge_16.png");
            purgeButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
                @Override
                public void onClick(com.smartgwt.client.widgets.events.ClickEvent clickEvent) {
                    SC.ask(MSG.view_bundle_dest_purgeConfirm(), new BooleanCallback() {
                        @Override
                        public void execute(Boolean aBoolean) {
                            if (aBoolean) {
                                final int destinationId = deployment.getDestination().getId();
                                final String destinationName = deployment.getDestination().getName();
                                BundleGWTServiceAsync bundleService = GWTServiceLookup.getBundleService(600000); // 10m should be enough right?
                                bundleService.purgeBundleDestination(destinationId, new AsyncCallback<Void>() {
                                    @Override
                                    public void onFailure(Throwable caught) {
                                        getErrorHandler().handleError(
                                            MSG.view_bundle_dest_purgeFailure(destinationName), caught);
                                    }

                                    @Override
                                    public void onSuccess(Void result) {
                                        getMessageCenter().notify(
                                            new Message(MSG.view_bundle_dest_purgeSuccessful(destinationName),
                                                Message.Severity.Info));
                                        // Bundle destination is purged, go back to bundle deployment view - it is not live anymore
                                        goToView(
                                            LinkManager.getBundleDeploymentLink(bundle.getId(), deployment.getId()),
                                            true);
                                    }
                                });
                            }
                        }
                    });
                }
            });
            actionLayout.addMember(purgeButton);

            if (!canDeploy) {
                revertButton.setDisabled(true);
                purgeButton.setDisabled(true);
            }
        }

        IButton deleteButton = new EnhancedIButton(MSG.common_button_delete(), ButtonColor.RED);
        //deleteButton.setIcon("subsystems/bundle/BundleDeploymentAction_Delete_16.png");
        deleteButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
            @Override
            public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                SC.ask(MSG.view_bundle_deploy_deleteConfirm(), new BooleanCallback() {
                    @Override
                    public void execute(Boolean confirmed) {
                        if (confirmed) {
                            doDeleteBundleDeployment();
                        }
                    }
                });
            }
        });
        actionLayout.addMember(deleteButton);

        if (!canDelete) {
            deleteButton.setDisabled(true);
        }
View Full Code Here

TOP

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

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.