Examples of AdminObject


Examples of org.jboss.as.console.client.shared.subsys.jca.model.AdminObject

        ClickHandler clickHandler = new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {

                final AdminObject selection = getCurrentSelection();

                if(selection!=null)
                {
                    Feedback.confirm(
                            Console.MESSAGES.deleteTitle("Admin Object"),
                            Console.MESSAGES.deleteConfirm("Admin Object" + selection.getJndiName()),
                            new Feedback.ConfirmationHandler() {
                                @Override
                                public void onConfirmation(boolean isConfirmed) {
                                    if (isConfirmed) {
                                        presenter.onRemoveAdmin(selection);
                                    }
                                }
                            });
                }
            }
        };

        ToolButton deleteBtn = new ToolButton(Console.CONSTANTS.common_label_delete());
        deleteBtn.addClickHandler(clickHandler);
        topLevelTools.addToolButtonRight(deleteBtn);

        disableBtn = new ToolButton(Console.CONSTANTS.common_label_disable(), new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {

                final AdminObject selection = getCurrentSelection();

                if(selection!=null)
                {
                    selection.setEnabled(!selection.isEnabled());

                    Feedback.confirm(
                            Console.MESSAGES.modify("Admin Object"),
                            Console.MESSAGES.modifyConfirm("Admin Object " + selection.getJndiName()),
                            new Feedback.ConfirmationHandler() {
                                @Override
                                public void onConfirmation(boolean isConfirmed) {
                                    if (isConfirmed) {
                                        presenter.enOrDisbaleAdminObject(currentAdapter, selection);
                                    }
                                }
                            });
                }

            }
        });
        topLevelTools.addToolButtonRight(disableBtn);

        // -------

        table = new DefaultCellTable<AdminObject>(10, new ProvidesKey<AdminObject>() {
            @Override
            public Object getKey(AdminObject item) {
                return item.getJndiName();
            }
        });

        dataProvider = new ListDataProvider<AdminObject>();
        dataProvider.addDataDisplay(table);

        TextColumn<AdminObject> nameColumn = new TextColumn<AdminObject>() {
            @Override
            public String getValue(AdminObject record) {
                return record.getName();
            }
        };

        Column<AdminObject, ImageResource> statusColumn =
                new Column<AdminObject, ImageResource>(new ImageResourceCell()) {
                    @Override
                    public ImageResource getValue(AdminObject ra) {

                        ImageResource res = null;

                        if(ra.isEnabled())
                            res = Icons.INSTANCE.status_good();
                        else
                            res = Icons.INSTANCE.status_bad();

                        return res;
                    }
                };


        table.addColumn(nameColumn, "Name");
        table.addColumn(statusColumn, "Enabled?");


        // ---

        configProperties = new PropertyEditor(this, true);

        // ----

        VerticalPanel formpanel = new VerticalPanel();
        formpanel.setStyleName("fill-layout-width");

        Form<AdminObject> form = new Form<AdminObject>(AdminObject.class);
        form.setNumColumns(2);

        TextItem name = new TextItem("name", "Name");
        TextBoxItem jndiItem = new TextBoxItem("jndiName", "JNDI");
        TextBoxItem classItem = new TextBoxItem("adminClass", "Class Name");
        //CheckBoxItem enabled = new CheckBoxItem("enabled", "Enabled?");

        form.setFields(name, jndiItem, classItem);

        form.setEnabled(false);
        form.bind(table);

        FormToolStrip<AdminObject> tools = new FormToolStrip<AdminObject>(
                form, new FormToolStrip.FormCallback<AdminObject>() {
            @Override
            public void onSave(Map<String, Object> changeset) {
                presenter.onSaveAdmin(getCurrentSelection(), changeset);
            }

            @Override
            public void onDelete(AdminObject entity) {
                // not possible
            }
        }
        );

        tools.providesDeleteOp(false);

        final FormHelpPanel helpPanel = new FormHelpPanel(
                new FormHelpPanel.AddressCallback() {
                    @Override
                    public ModelNode getAddress() {
                        ModelNode address = Baseadress.get();
                        address.add("subsystem", "resource-adapters");
                        address.add("resource-adapter", "*");
                        address.add("admin-objects", "*");
                        return address;
                    }
                }, form
        );

        formpanel.add(tools.asWidget());
        formpanel.add(helpPanel.asWidget());
        formpanel.add(form.asWidget());


        table.getSelectionModel().addSelectionChangeHandler(new SelectionChangeEvent.Handler() {

            public void onSelectionChange(SelectionChangeEvent event) {
                AdminObject selection = getCurrentSelection();
                configProperties.setProperties("", selection.getProperties());

                String nextState = selection.isEnabled() ?
                        Console.CONSTANTS.common_label_disable():Console.CONSTANTS.common_label_enable();
                disableBtn.setText(nextState);
            }
        });

View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.model.AdminObject

                        List<AdminObject> adminEntities = new ArrayList<AdminObject>(admins.size());

                        for(Property admin : admins)
                        {
                            ModelNode adminModel = admin.getValue();
                            AdminObject adminObject = adminAdapter.fromDMR(adminModel);
                            adminObject.setName(admin.getName()); // just to make sure
                            List<PropertyRecord> adminConfig = parseConfigProperties(adminModel);
                            adminObject.setProperties(adminConfig);

                            adminEntities.add(adminObject);
                        }

                        resourceAdapter.setAdminObjects(adminEntities);
View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.model.AdminObject

        ClickHandler clickHandler = new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {

                final AdminObject selection = getCurrentSelection();

                if(selection!=null)
                {
                    Feedback.confirm(
                            Console.MESSAGES.deleteTitle("Admin Object"),
                            Console.MESSAGES.deleteConfirm("Admin Object" + selection.getJndiName()),
                            new Feedback.ConfirmationHandler() {
                                @Override
                                public void onConfirmation(boolean isConfirmed) {
                                    if (isConfirmed) {
                                        presenter.onRemoveAdmin(selection);
                                    }
                                }
                            });
                }
            }
        };

        ToolButton deleteBtn = new ToolButton(Console.CONSTANTS.common_label_delete());
        deleteBtn.addClickHandler(clickHandler);
        topLevelTools.addToolButtonRight(deleteBtn);

        disableBtn = new ToolButton(Console.CONSTANTS.common_label_disable(), new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {

                final AdminObject selection = getCurrentSelection();

                if(selection!=null)
                {
                    selection.setEnabled(!selection.isEnabled());

                    Feedback.confirm(
                            Console.MESSAGES.modify("Admin Object"),
                            Console.MESSAGES.modifyConfirm("Admin Object " + selection.getJndiName()),
                            new Feedback.ConfirmationHandler() {
                                @Override
                                public void onConfirmation(boolean isConfirmed) {
                                    if (isConfirmed) {
                                        presenter.enOrDisbaleAdminObject(currentAdapter, selection);
                                    }
                                }
                            });
                }

            }
        });
        topLevelTools.addToolButtonRight(disableBtn);

        // -------

        table = new DefaultCellTable<AdminObject>(10, new ProvidesKey<AdminObject>() {
            @Override
            public Object getKey(AdminObject item) {
                return item.getJndiName();
            }
        });

        dataProvider = new ListDataProvider<AdminObject>();
        dataProvider.addDataDisplay(table);

        TextColumn<AdminObject> nameColumn = new TextColumn<AdminObject>() {
            @Override
            public String getValue(AdminObject record) {
                return record.getJndiName();
            }
        };

        Column<AdminObject, ImageResource> statusColumn =
                new Column<AdminObject, ImageResource>(new ImageResourceCell()) {
                    @Override
                    public ImageResource getValue(AdminObject ra) {

                        ImageResource res = null;

                        if(ra.isEnabled())
                            res = Icons.INSTANCE.status_good();
                        else
                            res = Icons.INSTANCE.status_bad();

                        return res;
                    }
                };


        table.addColumn(nameColumn, "JNDI Name");
        table.addColumn(statusColumn, "Enabled?");


        // ---

        configProperties = new PropertyEditor(this, true);

        // ----

        VerticalPanel formpanel = new VerticalPanel();
        formpanel.setStyleName("fill-layout-width");

        Form<AdminObject> form = new Form<AdminObject>(AdminObject.class);
        form.setNumColumns(2);

        TextItem jndiItem = new TextItem("jndiName", "JNDI");
        TextBoxItem classItem = new TextBoxItem("adminClass", "Class Name");
        CheckBoxItem enabled = new CheckBoxItem("enabled", "Enabled?");

        form.setFields(jndiItem, classItem, enabled);

        form.setEnabled(false);
        form.bind(table);

        FormToolStrip<AdminObject> tools = new FormToolStrip<AdminObject>(
                form, new FormToolStrip.FormCallback<AdminObject>() {
            @Override
            public void onSave(Map<String, Object> changeset) {
                presenter.onSaveAdmin(getCurrentSelection(), changeset);
            }

            @Override
            public void onDelete(AdminObject entity) {
                // not possible
            }
        }
        );

        tools.providesDeleteOp(false);

        final FormHelpPanel helpPanel = new FormHelpPanel(
                new FormHelpPanel.AddressCallback() {
                    @Override
                    public ModelNode getAddress() {
                        ModelNode address = Baseadress.get();
                        address.add("subsystem", "resource-adapters");
                        address.add("resource-adapter", "*");
                        address.add("admin-objects", "*");
                        return address;
                    }
                }, form
        );

        formpanel.add(tools.asWidget());
        formpanel.add(helpPanel.asWidget());
        formpanel.add(form.asWidget());


        table.getSelectionModel().addSelectionChangeHandler(new SelectionChangeEvent.Handler() {

            public void onSelectionChange(SelectionChangeEvent event) {
                AdminObject selection = getCurrentSelection();
                configProperties.setProperties("", selection.getProperties());

                String nextState = selection.isEnabled() ?
                        Console.CONSTANTS.common_label_disable():Console.CONSTANTS.common_label_enable();
                disableBtn.setText(nextState);
            }
        });

View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.model.AdminObject

                        List<AdminObject> adminEntities = new ArrayList<AdminObject>(admins.size());

                        for(Property admin : admins)
                        {
                            ModelNode adminModel = admin.getValue();
                            AdminObject adminObject = adminAdapter.fromDMR(adminModel);
                            adminObject.setName(admin.getName()); // just to make sure
                            List<PropertyRecord> adminConfig = parseConfigProperties(adminModel);
                            adminObject.setProperties(adminConfig);

                            adminEntities.add(adminObject);
                        }

                        resourceAdapter.setAdminObjects(adminEntities);
View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.model.AdminObject

                // save
                new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        // merge base
                        AdminObject admin = form.getUpdatedEntity();

                        FormValidation validation = form.validate();
                        if(validation.hasErrors())
                            return;
View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.model.AdminObject

        ClickHandler clickHandler = new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {

                final AdminObject selection = getCurrentSelection();

                if(selection!=null)
                {
                    Feedback.confirm(
                            Console.MESSAGES.deleteTitle("Admin Object"),
                            Console.MESSAGES.deleteConfirm("Admin Object" + selection.getJndiName()),
                            new Feedback.ConfirmationHandler() {
                                @Override
                                public void onConfirmation(boolean isConfirmed) {
                                    if (isConfirmed) {
                                        presenter.onRemoveAdmin(selection);
                                    }
                                }
                            });
                }
            }
        };

        ToolButton deleteBtn = new ToolButton(Console.CONSTANTS.common_label_delete());
        deleteBtn.addClickHandler(clickHandler);
        topLevelTools.addToolButtonRight(deleteBtn);

        disableBtn = new ToolButton("", new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {

                final AdminObject selection = getCurrentSelection();

                if(selection!=null)
                {
                    selection.setEnabled(!selection.isEnabled());

                    Feedback.confirm(
                            Console.MESSAGES.modify("Admin Object"),
                            Console.MESSAGES.modifyConfirm("Admin Object " + selection.getJndiName()),
                            new Feedback.ConfirmationHandler() {
                                @Override
                                public void onConfirmation(boolean isConfirmed) {
                                    if (isConfirmed) {
                                        presenter.enOrDisbaleAdminObject(currentAdapter, selection);
                                    }
                                }
                            });
                }

            }
        });
        topLevelTools.addToolButtonRight(disableBtn);

        // -------

        table = new DefaultCellTable<AdminObject>(10, new ProvidesKey<AdminObject>() {
            @Override
            public Object getKey(AdminObject item) {
                return item.getJndiName();
            }
        });

        dataProvider = new ListDataProvider<AdminObject>();
        dataProvider.addDataDisplay(table);

        TextColumn<AdminObject> nameColumn = new TextColumn<AdminObject>() {
            @Override
            public String getValue(AdminObject record) {
                return record.getJndiName();
            }
        };

        Column<AdminObject, ImageResource> statusColumn =
                new Column<AdminObject, ImageResource>(new ImageResourceCell()) {
                    @Override
                    public ImageResource getValue(AdminObject ra) {

                        ImageResource res = null;

                        if(ra.isEnabled())
                            res = Icons.INSTANCE.status_good();
                        else
                            res = Icons.INSTANCE.status_bad();

                        return res;
                    }
                };


        table.addColumn(nameColumn, "JNDI Name");
        table.addColumn(statusColumn, "Enabled?");


        // ---

        configProperties = new PropertyEditor(this, true);

        // ----

        VerticalPanel formpanel = new VerticalPanel();
        formpanel.setStyleName("fill-layout-width");

        Form<AdminObject> form = new Form<AdminObject>(AdminObject.class);
        form.setNumColumns(2);

        TextItem jndiItem = new TextItem("jndiName", "JNDI");
        TextBoxItem classItem = new TextBoxItem("adminClass", "Class Name");
        CheckBoxItem enabled = new CheckBoxItem("enabled", "Enabled?");

        form.setFields(jndiItem, classItem, enabled);

        form.setEnabled(false);
        form.bind(table);

        FormToolStrip<AdminObject> tools = new FormToolStrip<AdminObject>(
                form, new FormToolStrip.FormCallback<AdminObject>() {
            @Override
            public void onSave(Map<String, Object> changeset) {
                presenter.onSaveAdmin(getCurrentSelection(), changeset);
            }

            @Override
            public void onDelete(AdminObject entity) {
                // not possible
            }
        }
        );

        tools.providesDeleteOp(false);

        final FormHelpPanel helpPanel = new FormHelpPanel(
                new FormHelpPanel.AddressCallback() {
                    @Override
                    public ModelNode getAddress() {
                        ModelNode address = Baseadress.get();
                        address.add("subsystem", "resource-adapters");
                        address.add("resource-adapter", "*");
                        address.add("admin-objects", "*");
                        return address;
                    }
                }, form
        );

        formpanel.add(tools.asWidget());
        formpanel.add(helpPanel.asWidget());
        formpanel.add(form.asWidget());


        table.getSelectionModel().addSelectionChangeHandler(new SelectionChangeEvent.Handler() {

            public void onSelectionChange(SelectionChangeEvent event) {
                AdminObject selection = getCurrentSelection();
                configProperties.setProperties("", selection.getProperties());

                String nextState = selection.isEnabled() ?
                        Console.CONSTANTS.common_label_disable():Console.CONSTANTS.common_label_enable();
                disableBtn.setText(nextState);
            }
        });

View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.model.AdminObject

        ClickHandler clickHandler = new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {

                final AdminObject selection = getCurrentSelection();

                if(selection!=null)
                {
                    Feedback.confirm(
                            Console.MESSAGES.deleteTitle("Admin Object"),
                            Console.MESSAGES.deleteConfirm("Admin Object" + selection.getJndiName()),
                            new Feedback.ConfirmationHandler() {
                                @Override
                                public void onConfirmation(boolean isConfirmed) {
                                    if (isConfirmed) {
                                        presenter.onRemoveAdmin(selection);
                                    }
                                }
                            });
                }
            }
        };

        ToolButton deleteBtn = new ToolButton(Console.CONSTANTS.common_label_delete());
        deleteBtn.addClickHandler(clickHandler);
        topLevelTools.addToolButtonRight(deleteBtn);

        disableBtn = new ToolButton(Console.CONSTANTS.common_label_disable(), new ClickHandler() {
            @Override
            public void onClick(ClickEvent event) {

                final AdminObject selection = getCurrentSelection();

                if(selection!=null)
                {
                    selection.setEnabled(!selection.isEnabled());

                    Feedback.confirm(
                            Console.MESSAGES.modify("Admin Object"),
                            Console.MESSAGES.modifyConfirm("Admin Object " + selection.getJndiName()),
                            new Feedback.ConfirmationHandler() {
                                @Override
                                public void onConfirmation(boolean isConfirmed) {
                                    if (isConfirmed) {
                                        presenter.enOrDisbaleAdminObject(selection);
                                    }
                                }
                            });
                }

            }
        });
        topLevelTools.addToolButtonRight(disableBtn);

        // -------

        table = new DefaultCellTable<AdminObject>(10, new ProvidesKey<AdminObject>() {
            @Override
            public Object getKey(AdminObject item) {
                return item.getJndiName();
            }
        });

        dataProvider = new ListDataProvider<AdminObject>();
        dataProvider.addDataDisplay(table);

        TextColumn<AdminObject> nameColumn = new TextColumn<AdminObject>() {
            @Override
            public String getValue(AdminObject record) {
                return record.getName();
            }
        };

        Column<AdminObject, ImageResource> statusColumn =
                new Column<AdminObject, ImageResource>(new ImageResourceCell()) {
                    @Override
                    public ImageResource getValue(AdminObject ra) {

                        ImageResource res = null;

                        if(ra.isEnabled())
                            res = Icons.INSTANCE.status_good();
                        else
                            res = Icons.INSTANCE.status_bad();

                        return res;
                    }
                };


        table.addColumn(nameColumn, "Name");
        table.addColumn(statusColumn, "Enabled?");


        // ---

        configProperties = new PropertyEditor(this, true);

        // ----

        VerticalPanel formpanel = new VerticalPanel();
        formpanel.setStyleName("fill-layout-width");

        Form<AdminObject> form = new Form<AdminObject>(AdminObject.class);
        form.setNumColumns(2);

        TextItem name = new TextItem("name", "Name");
        TextBoxItem jndiItem = new TextBoxItem("jndiName", "JNDI");
        TextBoxItem classItem = new TextBoxItem("adminClass", "Class Name");
        //CheckBoxItem enabled = new CheckBoxItem("enabled", "Enabled?");

        form.setFields(name, jndiItem, classItem);

        form.setEnabled(false);
        form.bind(table);

        FormToolStrip<AdminObject> tools = new FormToolStrip<AdminObject>(
                form, new FormToolStrip.FormCallback<AdminObject>() {
            @Override
            public void onSave(Map<String, Object> changeset) {
                presenter.onSaveAdmin(getCurrentSelection(), changeset);
            }

            @Override
            public void onDelete(AdminObject entity) {
                // not possible
            }
        }
        );

        tools.providesDeleteOp(false);

        final FormHelpPanel helpPanel = new FormHelpPanel(
                new FormHelpPanel.AddressCallback() {
                    @Override
                    public ModelNode getAddress() {
                        ModelNode address = Baseadress.get();
                        address.add("subsystem", "resource-adapters");
                        address.add("resource-adapter", "*");
                        address.add("admin-objects", "*");
                        return address;
                    }
                }, form
        );

        formpanel.add(tools.asWidget());
        formpanel.add(helpPanel.asWidget());
        formpanel.add(form.asWidget());


        table.getSelectionModel().addSelectionChangeHandler(new SelectionChangeEvent.Handler() {

            public void onSelectionChange(SelectionChangeEvent event) {
                AdminObject selection = getCurrentSelection();
                configProperties.setProperties("", selection.getProperties());

                String nextState = selection.isEnabled() ?
                        Console.CONSTANTS.common_label_disable():Console.CONSTANTS.common_label_enable();
                disableBtn.setText(nextState);
            }
        });

View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.model.AdminObject

                        List<Property> admins = raModel.get("admin-objects").asPropertyList();
                        List<AdminObject> adminEntities = new ArrayList<AdminObject>(admins.size());

                        for (final Property admin : admins) {
                            ModelNode adminModel = admin.getValue();
                            AdminObject adminObject = adminAdapter
                                    .with(new KeyAssignment() {
                                        @Override
                                        public Object valueForKey(String key) {
                                            return admin.getName();
                                        }
                                    }).fromDMR(adminModel);

                            adminObject.setName(admin.getName()); // just to make sure
                            List<PropertyRecord> adminConfig = parseConfigProperties(adminModel);
                            adminObject.setProperties(adminConfig);

                            adminEntities.add(adminObject);
                        }

                        resourceAdapter.setAdminObjects(adminEntities);
View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.model.AdminObject

                        List<AdminObject> adminEntities = new ArrayList<AdminObject>(admins.size());

                        for(Property admin : admins)
                        {
                            ModelNode adminModel = admin.getValue();
                            AdminObject adminObject = adminAdapter.fromDMR(adminModel);
                            adminObject.setName(admin.getName()); // just to make sure
                            List<PropertyRecord> adminConfig = parseConfigProperties(adminModel);
                            adminObject.setProperties(adminConfig);

                            adminEntities.add(adminObject);
                        }

                        resourceAdapter.setAdminObjects(adminEntities);
View Full Code Here

Examples of org.jboss.as.console.client.shared.subsys.jca.model.AdminObject

                // save
                new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        // merge base
                        AdminObject admin = form.getUpdatedEntity();

                        FormValidation validation = form.validate();
                        if(validation.hasErrors())
                            return;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.