Package org.rhq.coregui.client.components.configuration

Examples of org.rhq.coregui.client.components.configuration.ConfigurationEditor$LoadHandler


            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);

                        // nuke the settings window now that its config data is stored
                        PortletSettingsWindow.this.destroy();
View Full Code Here


            EnumSet.of(ResourceTypeRepository.MetadataType.pluginConfigurationDefinition),
            new ResourceTypeRepository.TypeLoadedCallback() {

                public void onTypesLoaded(ResourceType type) {
                    ConfigurationDefinition definition = type.getPluginConfigurationDefinition();
                    ConfigurationEditor editor = new ConfigurationEditor(definition, update.getConfiguration());
                    editor.setReadOnly(true);
                    editor.setEditorTitle(MSG.common_title_version() + " - " + update.getId());
                    addMember(editor);
                    markForRedraw();
                }
            });
    }
View Full Code Here

            editor.destroy();
            removeMember(editor);
        }
        // TODO (ips): Load the config and config def ourselves, so we can remove that logic from the ConfigurationEditor,
        //       whose only purpose should be to render a config.
        editor = new ConfigurationEditor(resource.getId(), resource.getResourceType().getId(),
            ConfigurationEditor.ConfigType.plugin);
        editor.setOverflow(Overflow.AUTO);
        editor.addPropertyValueChangeListener(this);
        editor.setReadOnly(!this.resourcePermission.isInventory());
        editor.setLoadHandler(new ConfigurationEditor.LoadHandler() {
View Full Code Here

                    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);
                                    }
View Full Code Here

                    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);
                                    }
View Full Code Here

TOP

Related Classes of org.rhq.coregui.client.components.configuration.ConfigurationEditor$LoadHandler

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.