Package org.jboss.ballroom.client.widgets.forms

Examples of org.jboss.ballroom.client.widgets.forms.Form$FormItemVisitor


        return "Scheduled Pools";
    }

    @Override
    protected FormAdapter<ScheduledThreadPool> makeAddEntityForm() {
        Form<ScheduledThreadPool> form = new Form(ScheduledThreadPool.class);
        form.setNumColumns(1);
        form.setFields(formMetaData.findAttribute("name").getFormItemForAdd(),
                formMetaData.findAttribute("keepaliveTimeout").getFormItemForAdd(),
                formMetaData.findAttribute("keepaliveTimeoutUnit").getFormItemForAdd(),
                formMetaData.findAttribute("maxThreadsCount").getFormItemForAdd(),
                formMetaData.findAttribute("maxThreadsPerCPU").getFormItemForAdd());
        return form;
View Full Code Here


        return "Unbounded Pools";
    }

    @Override
    protected FormAdapter<UnboundedQueueThreadPool> makeAddEntityForm() {
        Form<UnboundedQueueThreadPool> form = new Form(UnboundedQueueThreadPool.class);
        form.setNumColumns(1);
        form.setFields(formMetaData.findAttribute("name").getFormItemForAdd(),
                formMetaData.findAttribute("keepaliveTimeout").getFormItemForAdd(),
                formMetaData.findAttribute("keepaliveTimeoutUnit").getFormItemForAdd(),
                formMetaData.findAttribute("maxThreadsCount").getFormItemForAdd(),
                formMetaData.findAttribute("maxThreadsPerCPU").getFormItemForAdd());
        return form;
View Full Code Here

        return "Queueless Pools";
    }

    @Override
    protected FormAdapter<QueuelessThreadPool> makeAddEntityForm() {
        Form<QueuelessThreadPool> form = new Form(QueuelessThreadPool.class);
        form.setNumColumns(1);
        form.setFields(formMetaData.findAttribute("name").getFormItemForAdd(),
                formMetaData.findAttribute("keepaliveTimeout").getFormItemForAdd(),
                formMetaData.findAttribute("keepaliveTimeoutUnit").getFormItemForAdd(),
                formMetaData.findAttribute("maxThreadsCount").getFormItemForAdd(),
                formMetaData.findAttribute("maxThreadsPerCPU").getFormItemForAdd());
        return form;
View Full Code Here

    private DataSourcePresenter presenter;
    private ToolButton disableBtn;

    public XADataSourceDetails(DataSourcePresenter presenter) {
        this.presenter = presenter;
        form = new Form(XADataSource.class);
        form.setNumColumns(2);
    }
View Full Code Here

        return "Thread Factories";
    }

    @Override
    protected FormAdapter<ThreadFactory> makeAddEntityForm() {
        Form<ThreadFactory> form = new Form(ThreadFactory.class);
        form.setNumColumns(1);
        form.setFields(formMetaData.findAttribute("name").getFormItemForAdd(),
                       formMetaData.findAttribute("priority").getFormItemForAdd(this));
        return form;
    }
View Full Code Here

        layout.add(new ContentHeaderLabel("Servlet/HTTP Configuration"));

        // ----

        form = new Form(JSPContainerConfiguration.class);
        form.setNumColumns(2);

        ContentGroupLabel label = new ContentGroupLabel("JSP Container");
        label.getElement().setAttribute("style", "margin-bottom:0px;");
        layout.add(label);
View Full Code Here

    public Widget asWidget() {

        VerticalPanel layout = new VerticalPanel();
        layout.setStyleName("window-content");

        final Form<ResourceAdapter> form = new Form(ResourceAdapter.class);

        TextBoxItem name = new TextBoxItem("name", "Name");
        final TextBoxItem archiveItem = new TextBoxItem("archive", "Archive", false);
        final TextBoxItem moduleItem = new TextBoxItem("module", "Module", false);

        ComboBoxItem txItem = new ComboBoxItem("transactionSupport", "TX");
        txItem.setDefaultToFirstOption(true);
        txItem.setValueMap(new String[]{"NoTransaction", "LocalTransaction", "XATransaction"});

        form.setFields(name,archiveItem, moduleItem, txItem);

        form.addFormValidator(new FormValidator() {
            @Override
            public void validate(List<FormItem> items, FormValidation outcome) {
                TextBoxItem archive = (TextBoxItem)findItem(items, "archive");
                TextBoxItem module = (TextBoxItem)findItem(items, "module");

                boolean archiveIsSet = archive.getValue()==null || !archive.getValue().equals("");
                boolean moduleIsSet = module.getValue()==null || !module.getValue().equals("");
                if(archiveIsSet && moduleIsSet)
                {
                    String msg = "Either archive or module can be set";
                    outcome.addError(msg);
                    archive.setErrMessage(msg);
                    archive.setErroneous(true);
                    module.setErrMessage(msg);
                    module.setErroneous(true);
                }
                else if(!archiveIsSet && !moduleIsSet)
                {
                    String msg = "One of archive or module has to be specified";
                    outcome.addError(msg);
                    archive.setErrMessage(msg);
                    archive.setErroneous(true);
                    module.setErrMessage(msg);
                    module.setErroneous(true);
                }


            }

            private FormItem findItem(List<FormItem> items, String name) {
                for (FormItem item : items) {
                    if (name.equals(item.getName())) {
                        return item;
                    }
                }
                return null;
            }
        });
        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", "*");
                        return address;
                    }
                }, form
        );

        layout.add(helpPanel.asWidget());

        layout.add(form.asWidget());

        form.editTransient(bean);

        DialogueOptions options = new DialogueOptions(

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

        VerticalPanel layout = new VerticalPanel();
        layout.setStyleName("window-content");

        layout.add(new HTML("<h2>Connection Definition Step1/2</h2>"));

        final Form<ConnectionDefinition> form = new Form(ConnectionDefinition.class);

        TextBoxItem jndiName = new JndiNameItem("jndiName", "JNDI Name");
        TextBoxItem classItem = new TextBoxItem("connectionClass", "Connection Class");

        form.setFields(jndiName, classItem);

        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("connection-definitions", "*");
                        return address;
                    }
                }, form
        );
        layout.add(helpPanel.asWidget());

        layout.add(form.asWidget());

        DialogueOptions options = new DialogueOptions(

                // save

                new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        FormValidation validation = form.validate();
                        if(!validation.hasErrors())
                           parent.onCompleteStep1(form.getUpdatedEntity());
                    }
                },

                // cancel

View Full Code Here

        return toolStrip;
    }

    @Override
    protected FormAdapter<CacheContainer> makeAddEntityForm() {
        Form<CacheContainer> form = new Form(CacheContainer.class);
        form.setNumColumns(1);
        form.setFields(getFormMetaData().findAttribute("name").getFormItemForAdd());
                      // getFormMetaData().findAttribute("defaultCache").getFormItemForAdd());
        return form;
    }
View Full Code Here

        return Console.CONSTANTS.subsys_logging_loggers();
    }

    @Override
    protected FormAdapter<Logger> makeAddEntityForm() {
        Form<Logger> form = new Form(Logger.class, "{selected.profile}/subsystem=logging/logger=*");
        form.setNumColumns(1);
        form.setFields(formMetaData.findAttribute("name").getFormItemForAdd(),
                levelItemForAdd,
                formMetaData.findAttribute("useParentHandlers").getFormItemForAdd());
        return form;
    }
View Full Code Here

TOP

Related Classes of org.jboss.ballroom.client.widgets.forms.Form$FormItemVisitor

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.