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

Examples of org.jboss.as.console.client.shared.subsys.osgi.model.OSGiConfigAdminData


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

                dialog = new DefaultWindow(Console.CONSTANTS.subsys_osgi_configAdminEditPID());
                dialog.setWidth(320);
                dialog.setHeight(140);
                dialog.setWidget(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();
            }
        }));
        topLevelTools.addToolButton(new ToolButton(Console.CONSTANTS.common_label_delete(), new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                final OSGiConfigAdminData model = pidTable.getSelection();
                Feedback.confirm(Console.MESSAGES.subsys_osgi_removeConfigAdmin(), Console.MESSAGES.subsys_osgi_removeConfigAdminConfirm(model.getPid()),
                    new Feedback.ConfirmationHandler() {
                        @Override
                        public void onConfirmation(boolean isConfirmed) {
                            if (isConfirmed)
                                presenter.onDeleteConfigurationAdminData(model.getPid());
                        }
                    });
            }
        }));
        topLevelTools.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_add(), new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {
                presenter.launchNewCASPropertyWizard();
            }
        }));
        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_osgi_configAdminHeader()));
        vpanel.add(horzPanel);

        pidTable = new PIDTable();

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

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

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


    }

    @Override
    public void onCreateProperty(String reference, PropertyRecord prop) {
        dialog.hide();
        OSGiConfigAdminData data = findData(reference);
        data.getProperties().add(prop);
        presenter.onDeleteConfigurationAdminData(data.getPid());
        presenter.onAddConfigurationAdminData(data);
    }
View Full Code Here

        presenter.onAddConfigurationAdminData(data);
    }

    @Override
    public void onDeleteProperty(String reference, PropertyRecord prop) {
        OSGiConfigAdminData data = findData(reference);
        data.getProperties().remove(prop);
        presenter.onDeleteConfigurationAdminData(data.getPid());
        presenter.onAddConfigurationAdminData(data);
    }
View Full Code Here

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

                List<OSGiConfigAdminData> casDataList = new ArrayList<OSGiConfigAdminData>();
                for (String pid : model.keys()) {
                    OSGiConfigAdminData data = factory.osgiConfigAdminData().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

    public List<OSGiConfigAdminData> getData() {
        return dataProvider.getList();
    }

    void setData(List<OSGiConfigAdminData> data, String selectPid) {
        OSGiConfigAdminData sel = selectionModel.getSelectedObject();
        if (selectPid == null && sel != null)
            selectPid = sel.getPid();

        dataProvider.getList().clear();
        dataProvider.getList().addAll(data);

        if (selectPid != null) {
View Full Code Here

            new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    FormValidation validation = form.validate();
                    if (!validation.hasErrors()) {
                        OSGiConfigAdminData data = form.getUpdatedEntity();
                        data.setProperties(properties);
                        presenter.onAddConfigurationAdminData(data);
                    }
                }
            }, new ClickHandler() {
                @Override
View Full Code Here

TOP

Related Classes of org.jboss.as.console.client.shared.subsys.osgi.model.OSGiConfigAdminData

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.