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

Examples of org.jboss.ballroom.client.widgets.forms.TextBoxItem



        // --

        final Form<JDBCDriver> form = new Form<JDBCDriver>(JDBCDriver.class);
        TextBoxItem name = new TextBoxItem("name", "Name");
        TextBoxItem driverClass = new TextBoxItem("driverClass", "Driver Class");
        NumberBoxItem major = new NumberBoxItem("majorVersion", "Major Version");
        NumberBoxItem minor = new NumberBoxItem("minorVersion", "Minor Version");

        form.setFields(name, driverClass, major, minor);
View Full Code Here


        panel.add(toolStrip.asWidget());

        nameItem = null;

        if(overrideName)
            nameItem = new TextBoxItem("name", Console.CONSTANTS.common_label_name());
        else
            nameItem = new TextItem("name", Console.CONSTANTS.common_label_name());

        HeapBoxItem heapItem = new HeapBoxItem("heapSize", "Heap Size");
        HeapBoxItem maxHeapItem = new HeapBoxItem("maxHeapSize", "Max Heap Size");
View Full Code Here

            String unmanagedText = "<h3>" + Console.CONSTANTS.common_label_step() + "1/1: Specify Deployment</h3>";
            unmanagedPanel.add(new HTML(unmanagedText));

            unmanagedForm = new Form<DeploymentRecord>(DeploymentRecord.class);
            TextAreaItem path = new TextAreaItem("path", "Path");
            TextBoxItem relativeTo= new TextBoxItem("relativeTo", "Relative To", false);

            TextBoxItem name = new TextBoxItem("name", "Name");
            TextBoxItem runtimeName = new TextBoxItem("runtimeName", "Runtime Name");
            CheckBoxItem archive = new CheckBoxItem("archive", "Is Archive?");
            archive.setValue(true);
            unmanagedForm.setFields(path, relativeTo, archive, name, runtimeName);
            unmanagedPanel.add(unmanagedForm.asWidget());
            tabs.add(unmanagedPanel, "Unmanaged");
View Full Code Here

                }));

        Form<DeploymentRecord> form2 = new Form<DeploymentRecord>(DeploymentRecord.class);
        form2.setEnabled(false);
        TextAreaItem path = new TextAreaItem("path", "Path");
        TextBoxItem relative = new TextBoxItem("relativeTo", "Relative To");
        form2.setFields(path, relative);

        path.setEnabled(false);
        relative.setEnabled(false);

        form2.bind(deploymentsTable);

        MultipleToOneLayout layout = new MultipleToOneLayout()
                .setPlain(true)
View Full Code Here

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

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

        TextBoxItem nameItem = new TextBoxItem("name", "Name");
        TextAreaItem path = new TextAreaItem("path", "Path");
        TextBoxItem relativeTo = new TextBoxItem("relativeTo", "Relative To", false);

        form.setFields(nameItem, path, relativeTo);


        DialogueOptions options = new DialogueOptions(
View Full Code Here

    public Widget asWidget() {
        VerticalPanel layout = new VerticalPanel();
        layout.setStyleName("window-content");
        final Form<ConfigAdminData> form = new Form<ConfigAdminData>(ConfigAdminData.class);

        TextBoxItem pid = new TextBoxItem("pid", Console.CONSTANTS.subsys_configadmin_PIDShort());
        form.setFields(pid);

        layout.add(form.asWidget());
        propEditor = new PropertyEditor(this, true);
        layout.add(propEditor.asWidget());
View Full Code Here

                                ComboBoxItem combo = new ComboBoxItem(attr.getName(), label);
                                combo.setValueMap(allowedValues);
                            }
                            else
                            {
                                TextBoxItem tb = new TextBoxItem(attr.getName(), label);
                                tb.setRequired(required);
                                items.add(tb);
                            }
                            break;
                        default:
                            throw new RuntimeException("Unsupported ModelType "+type);
View Full Code Here

            form = new ModelNodeForm(address, securityContext);
            List<FormItem> items = new ArrayList<FormItem>();

            // each add operation requires an artificial parameter 'entity.key'
            if("add".equals(operationmetaData.get("operation-name").asString()))
                items.add(new TextBoxItem("entity.key", "Name", true));

            for(Property param : parameterMetaData)
            {

                char[] stringArray = param.getName().toCharArray();
                stringArray[0] = Character.toUpperCase(stringArray[0]);

                String label = new String(stringArray).replace("-", " ");
                ModelNode attrValue = param.getValue();

                boolean required = param.getValue().get(REQUIRED).asBoolean();

                // skip non-required parameters
                if(!required) continue;

                // help
                helpTexts.appendHtmlConstant("<tr class='help-field-row'>");
                helpTexts.appendHtmlConstant("<td class='help-field-name'>");
                helpTexts.appendEscaped(label).appendEscaped(": ");
                helpTexts.appendHtmlConstant("</td>");
                helpTexts.appendHtmlConstant("<td class='help-field-desc'>");
                try {
                    helpTexts.appendHtmlConstant(attrValue.get("description").asString());
                } catch (Throwable e) {
                    // ignore parse errors
                    helpTexts.appendHtmlConstant("<i>Failed to parse description</i>");
                }
                helpTexts.appendHtmlConstant("</td>");
                helpTexts.appendHtmlConstant("</tr>");

                ModelType type = ModelType.valueOf(attrValue.get(TYPE).asString());

                switch(type)
                {
                    case BOOLEAN:
                        CheckBoxItem checkBoxItem = new CheckBoxItem(param.getName(), label);
                        items.add(checkBoxItem);
                        if(param.getValue().hasDefined(DEFAULT))
                            checkBoxItem.setValue(param.getValue().get(DEFAULT).asBoolean());
                        break;
                    case DOUBLE:
                        NumberBoxItem num = new NumberBoxItem(param.getName(), label);
                        num.setRequired(required);
                        items.add(num);

                        if(param.getValue().hasDefined(DEFAULT))
                            num.setValue(param.getValue().get(DEFAULT).asDouble());

                        break;
                    case LONG:
                        NumberBoxItem num2 = new NumberBoxItem(param.getName(), label);
                        num2.setRequired(required);
                        items.add(num2);

                        if(param.getValue().hasDefined(DEFAULT))
                            num2.setValue(param.getValue().get(DEFAULT).asLong());

                        break;
                    case INT:
                        NumberBoxItem num3 = new NumberBoxItem(param.getName(), label);
                        num3.setRequired(required);
                        items.add(num3);

                        if(param.getValue().hasDefined(DEFAULT))
                            num3.setValue(param.getValue().get(DEFAULT).asInt());

                        break;
                    case STRING:
                        if(attrValue.hasDefined("allowed"))
                        {
                            List<ModelNode> allowed = attrValue.get("allowed").asList();
                            Set<String> allowedValues = new HashSet<String>(allowed.size());
                            for(ModelNode value : allowed)
                                allowedValues.add(value.asString());

                            ComboBoxItem combo = new ComboBoxItem(param.getName(), label);
                            combo.setValueMap(allowedValues);

                            if(param.getValue().hasDefined(DEFAULT))
                                combo.setValue(param.getValue().get(DEFAULT).asString());

                        }
                        else
                        {
                            TextBoxItem tb = new TextBoxItem(param.getName(), label);
                            tb.setRequired(required);
                            items.add(tb);

                            if(param.getValue().hasDefined(DEFAULT))
                                tb.setValue(param.getValue().get(DEFAULT).asString());

                        }

                        break;
                    default:
View Full Code Here

                }));

        Form<DeploymentRecord> form2 = new Form<DeploymentRecord>(DeploymentRecord.class);
        form2.setEnabled(false);
        TextAreaItem path = new TextAreaItem("path", "Path");
        TextBoxItem relative = new TextBoxItem("relativeTo", "Relative To");
        form2.setFields(path, relative);

        path.setEnabled(false);
        relative.setEnabled(false);

        form2.bind(deploymentsTable);


        MultipleToOneLayout layout = new MultipleToOneLayout()
View Full Code Here

        this.form = new Form<ScopedRole>(ScopedRole.class);
    }

    @Override
    public Widget asWidget() {
        TextBoxItem nameItem = new TextBoxItem("name", Console.CONSTANTS.common_label_name());
        final EnumFormItem<StandardRole> baseRoleItem = new EnumFormItem<StandardRole>("baseRole",
                Console.CONSTANTS.administration_base_role());
        baseRoleItem.setValues(ModelHelper.roles());
        typeItem = new EnumFormItem<ScopeType>("type", Console.CONSTANTS.common_label_type());
        typeItem.setDefaultToFirst(true);
View Full Code Here

TOP

Related Classes of org.jboss.ballroom.client.widgets.forms.TextBoxItem

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.