Package org.jboss.as.console.client.shared.subsys.configadmin.model

Examples of org.jboss.as.console.client.shared.subsys.configadmin.model.ConfigAdminData


                ModelNode response = result.get();
                ModelNode model = response.get(RESULT);

                List<ConfigAdminData> casDataList = new ArrayList<ConfigAdminData>();
                for (String pid : model.keys()) {
                    ConfigAdminData data = factory.configAdminData().as();
                    data.setPid(pid);

                    List<PropertyRecord> properties = new ArrayList<PropertyRecord>();
                    for(Property property : model.get(pid).get("entries").asPropertyList()) {
                        PropertyRecord record = factory.property().as();
                        record.setKey(property.getName());
                        record.setValue(property.getValue().asString());
                        properties.add(record);
                    }
                    data.setProperties(properties);
                    casDataList.add(data);
                }
                getView().updateConfigurationAdmin(casDataList, selectPid);
            }
        });
View Full Code Here


                ModelNode response = result.get();
                ModelNode model = response.get(RESULT);

                List<ConfigAdminData> casDataList = new ArrayList<ConfigAdminData>();
                for (String pid : model.keys()) {
                    ConfigAdminData data = factory.configAdminData().as();
                    data.setPid(pid);

                    List<PropertyRecord> properties = new ArrayList<PropertyRecord>();
                    for(Property property : model.get(pid).get("entries").asPropertyList()) {
                        PropertyRecord record = factory.property().as();
                        record.setKey(property.getName());
                        record.setValue(property.getValue().asString());
                        properties.add(record);
                    }
                    data.setProperties(properties);
                    casDataList.add(data);
                }
                getView().updateConfigurationAdmin(casDataList, selectPid);
            }
        });
View Full Code Here

        ToolStrip topLevelTools = new ToolStrip();
        ToolButton editBtn = new ToolButton(Console.CONSTANTS.common_label_edit(), new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                final ConfigAdminData model = pidTable.getSelection();

                dialog = new DefaultWindow(Console.CONSTANTS.subsys_configadmin_editPID());
                dialog.setWidth(320);
                dialog.setHeight(140);
                dialog.trapWidget(new InputWindow(model.getPid(), new InputWindow.Result() {
                    @Override
                    public void result(String value) {
                        if (value != null && !value.equals(model.getPid())) {
                            presenter.onDeleteConfigurationAdminData(model.getPid());
                            model.setPid(value);
                            presenter.onAddConfigurationAdminData(model);
                        }
                        closePropertyDialoge();
                    }
                }).asWidget());
                dialog.setGlassEnabled(true);
                dialog.center();
            }
        });
        editBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_edit_configAdminEditor());
        topLevelTools.addToolButton(editBtn);

        ToolButton deleteBtn = new ToolButton(Console.CONSTANTS.common_label_delete(), new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                final ConfigAdminData model = pidTable.getSelection();
                Feedback.confirm(Console.MESSAGES.subsys_configadmin_remove(), Console.MESSAGES.subsys_configadmin_removeConfirm(model.getPid()),
                    new Feedback.ConfirmationHandler() {
                        @Override
                        public void onConfirmation(boolean isConfirmed) {
                            if (isConfirmed)
                                presenter.onDeleteConfigurationAdminData(model.getPid());
                        }
                    });
            }
        });
        deleteBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_delete_configAdminEditor());
        topLevelTools.addToolButton(deleteBtn);

        ToolButton addBtn = new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                presenter.launchNewCASPropertyWizard();
            }
        });
        addBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_add_configAdminEditor());
        topLevelTools.addToolButtonRight(addBtn);
        layout.add(topLevelTools);

        VerticalPanel vpanel = new VerticalPanel();
        vpanel.setStyleName("rhs-content-panel");

        ScrollPanel scroll = new ScrollPanel(vpanel);
        layout.add(scroll);

        layout.setWidgetTopHeight(topLevelTools, 0, Style.Unit.PX, 30, Style.Unit.PX);
        layout.setWidgetTopHeight(scroll, 30, Style.Unit.PX, 100, Style.Unit.PCT);

        HorizontalPanel horzPanel = new HorizontalPanel();
        horzPanel.add(new ContentHeaderLabel(Console.CONSTANTS.subsys_configadmin_header()));
        vpanel.add(horzPanel);

        pidTable = new PIDTable();

        vpanel.add(new ContentGroupLabel(Console.CONSTANTS.subsys_configadmin_PIDLabel()));
        vpanel.add(pidTable.asWidget());

        propertyEditor = new PropertyEditor(this, true, 10);
        final SingleSelectionModel<ConfigAdminData> selectionModel = new SingleSelectionModel<ConfigAdminData>();
        selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
            @Override
            public void onSelectionChange(SelectionChangeEvent event) {
                ConfigAdminData pid = selectionModel.getSelectedObject();
                propertyEditor.setProperties(pid.getPid(), pid.getProperties());
            }
        });
        pidTable.setSelectionModel(selectionModel);

        vpanel.add(new ContentGroupLabel(Console.CONSTANTS.subsys_configadmin_valuesLabel()));
View Full Code Here

    }

    @Override
    public void onCreateProperty(String reference, PropertyRecord prop) {
        dialog.hide();
        ConfigAdminData data = findData(reference);
        if (data == null) {
            Feedback.alert(Console.CONSTANTS.subsys_configadmin_add(),
                new SafeHtmlBuilder().appendEscaped(Console.MESSAGES.subsys_configadmin_addNoPIDselected()).toSafeHtml());
        } else {
            data.getProperties().add(prop);
            presenter.onUpdateConfigurationAdminData(data);
        }
    }
View Full Code Here

        }
    }

    @Override
    public void onDeleteProperty(final String reference, PropertyRecord prop) {
        ConfigAdminData data = findData(reference);
        data.getProperties().remove(prop);
        if (data.getProperties().size() > 0) {
            presenter.onUpdateConfigurationAdminData(data);
        } else {
            // There are no properties left, remove the PID completely
            Feedback.confirm(Console.MESSAGES.subsys_configadmin_remove(),
                Console.MESSAGES.subsys_configadmin_removeOnLastValueConfirm(reference),
View Full Code Here

                    if (!validation.hasErrors()) {
                        if (properties.size() == 0) {
                            Feedback.alert(Console.CONSTANTS.subsys_configadmin_add(),
                                new SafeHtmlBuilder().appendEscaped(Console.MESSAGES.subsys_configadmin_oneValueRequired()).toSafeHtml());
                        } else {
                            ConfigAdminData data = form.getUpdatedEntity();
                            data.setProperties(properties);
                            presenter.onAddConfigurationAdminData(data);
                        }
                    }
                }
            }, new ClickHandler() {
View Full Code Here

        ToolStrip topLevelTools = new ToolStrip();
        ToolButton editBtn = new ToolButton(Console.CONSTANTS.common_label_edit(), new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                final ConfigAdminData model = pidTable.getSelection();

                dialog = new DefaultWindow(Console.CONSTANTS.subsys_configadmin_editPID());
                dialog.setWidth(320);
                dialog.setHeight(140);
                dialog.trapWidget(new InputWindow(model.getPid(), new InputWindow.Result() {
                    @Override
                    public void result(String value) {
                        if (value != null && !value.equals(model.getPid())) {
                            presenter.onDeleteConfigurationAdminData(model.getPid());
                            model.setPid(value);
                            presenter.onAddConfigurationAdminData(model);
                        }
                        closePropertyDialoge();
                    }
                }).asWidget());
                dialog.setGlassEnabled(true);
                dialog.center();
            }
        });
        editBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_edit_configAdminEditor());
        topLevelTools.addToolButton(editBtn);

        ToolButton deleteBtn = new ToolButton(Console.CONSTANTS.common_label_delete(), new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                final ConfigAdminData model = pidTable.getSelection();
                Feedback.confirm(Console.MESSAGES.subsys_configadmin_remove(), Console.MESSAGES.subsys_configadmin_removeConfirm(model.getPid()),
                    new Feedback.ConfirmationHandler() {
                        @Override
                        public void onConfirmation(boolean isConfirmed) {
                            if (isConfirmed)
                                presenter.onDeleteConfigurationAdminData(model.getPid());
                        }
                    });
            }
        });
        deleteBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_delete_configAdminEditor());
        topLevelTools.addToolButton(deleteBtn);

        ToolButton addBtn = new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                presenter.launchNewCASPropertyWizard();
            }
        });
        addBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_add_configAdminEditor());
        topLevelTools.addToolButtonRight(addBtn);
        layout.add(topLevelTools);

        VerticalPanel vpanel = new VerticalPanel();
        vpanel.setStyleName("rhs-content-panel");

        ScrollPanel scroll = new ScrollPanel(vpanel);
        layout.add(scroll);

        layout.setWidgetTopHeight(topLevelTools, 0, Style.Unit.PX, 30, Style.Unit.PX);
        layout.setWidgetTopHeight(scroll, 30, Style.Unit.PX, 100, Style.Unit.PCT);

        HorizontalPanel horzPanel = new HorizontalPanel();
        horzPanel.add(new ContentHeaderLabel(Console.CONSTANTS.subsys_configadmin_header()));
        vpanel.add(horzPanel);

        pidTable = new PIDTable();

        vpanel.add(new ContentGroupLabel(Console.CONSTANTS.subsys_configadmin_PIDLabel()));
        vpanel.add(pidTable.asWidget());

        propertyEditor = new PropertyEditor(this, true, 10);
        final SingleSelectionModel<ConfigAdminData> selectionModel = new SingleSelectionModel<ConfigAdminData>();
        selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
            @Override
            public void onSelectionChange(SelectionChangeEvent event) {
                ConfigAdminData pid = selectionModel.getSelectedObject();
                propertyEditor.setProperties(pid.getPid(), pid.getProperties());
            }
        });
        pidTable.setSelectionModel(selectionModel);

        vpanel.add(new ContentGroupLabel(Console.CONSTANTS.subsys_configadmin_valuesLabel()));
View Full Code Here

    }

    @Override
    public void onCreateProperty(String reference, PropertyRecord prop) {
        dialog.hide();
        ConfigAdminData data = findData(reference);
        if (data == null) {
            Feedback.alert(Console.CONSTANTS.subsys_configadmin_add(),
                new SafeHtmlBuilder().appendEscaped(Console.MESSAGES.subsys_configadmin_addNoPIDselected()).toSafeHtml());
        } else {
            data.getProperties().add(prop);
            presenter.onUpdateConfigurationAdminData(data);
        }
    }
View Full Code Here

        }
    }

    @Override
    public void onDeleteProperty(final String reference, PropertyRecord prop) {
        ConfigAdminData data = findData(reference);
        data.getProperties().remove(prop);
        if (data.getProperties().size() > 0) {
            presenter.onUpdateConfigurationAdminData(data);
        } else {
            // There are no properties left, remove the PID completely
            Feedback.confirm(Console.MESSAGES.subsys_configadmin_remove(),
                Console.MESSAGES.subsys_configadmin_removeOnLastValueConfirm(reference),
View Full Code Here

                ModelNode response = result.get();
                ModelNode model = response.get(RESULT);

                List<ConfigAdminData> casDataList = new ArrayList<ConfigAdminData>();
                for (String pid : model.keys()) {
                    ConfigAdminData data = factory.configAdminData().as();
                    data.setPid(pid);

                    List<PropertyRecord> properties = new ArrayList<PropertyRecord>();
                    for(Property property : model.get(pid).get("entries").asPropertyList()) {
                        PropertyRecord record = factory.property().as();
                        record.setKey(property.getName());
                        record.setValue(property.getValue().asString());
                        properties.add(record);
                    }
                    data.setProperties(properties);
                    casDataList.add(data);
                }
                getView().updateConfigurationAdmin(casDataList, selectPid);
            }
        });
View Full Code Here

TOP

Related Classes of org.jboss.as.console.client.shared.subsys.configadmin.model.ConfigAdminData

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.