Package org.jboss.as.console.mbui.widgets

Examples of org.jboss.as.console.mbui.widgets.ModelNodeForm


        FormAdapter(final InteractionUnit<StereoTypes> interactionUnit, EventBus coordinator, final ModelNode modelDescription)
        {
            this.interactionUnit = interactionUnit;
            this.coordinator = coordinator;

            this.form = new ModelNodeForm();
            this.form.setNumColumns(2);
            this.form.setEnabled(false);

            assert modelDescription.hasDefined("attributes") : "Invalid model description. Expected child 'attributes'";
View Full Code Here


            this.coordinator = coordinator;

            DMRMapping dmrMapping = (DMRMapping)
                    this.interactionUnit.findMapping(MappingType.DMR);

            this.form = new ModelNodeForm(dmrMapping.getAddress(), securityContext);
            this.form.setNumColumns(2);
            this.form.setEnabled(false);

            assert modelDescription.hasDefined("attributes") : "Invalid model description. Expected child 'attributes'";
View Full Code Here

            SafeHtmlBuilder helpTexts = new SafeHtmlBuilder();
            helpTexts.appendHtmlConstant("<table class='help-attribute-descriptions'>");

            // The form

            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));
View Full Code Here

        FormAdapter(final InteractionUnit<StereoTypes> interactionUnit, EventBus coordinator, final ModelNode modelDescription)
        {
            this.interactionUnit = interactionUnit;
            this.coordinator = coordinator;

            this.form = new ModelNodeForm();
            this.form.setNumColumns(2);
            this.form.setEnabled(false);

            assert modelDescription.hasDefined("attributes") : "Invalid model description. Expected child 'attributes'";
View Full Code Here

            SafeHtmlBuilder helpTexts = new SafeHtmlBuilder();
            helpTexts.appendHtmlConstant("<table class='help-attribute-descriptions'>");

            // The form

            form = new ModelNodeForm();
            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));
View Full Code Here

            SafeHtmlBuilder helpTexts = new SafeHtmlBuilder();
            helpTexts.appendHtmlConstant("<table class='help-attribute-descriptions'>");

            // The form

            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));
View Full Code Here

        FormAdapter(final InteractionUnit<StereoTypes> interactionUnit, EventBus coordinator, final ModelNode modelDescription)
        {
            this.interactionUnit = interactionUnit;
            this.coordinator = coordinator;

            this.form = new ModelNodeForm();
            this.form.setNumColumns(2);
            this.form.setEnabled(false);

            assert modelDescription.hasDefined("attributes") : "Invalid model description. Expected child 'attributes'";
View Full Code Here

                .setResourceDescription(description)
                .setSecurityContext(securityContext);

        ModelNodeFormBuilder.FormAssets assets = builder.build();

        final ModelNodeForm form = assets.getForm();
        form.setEnabled(true);

        if(form.hasWritableAttributes()) {
            final DefaultWindow window = new DefaultWindow("Create Resource '" + type + "'");
            window.addStyleName("browser-view");

            DialogueOptions options = new DialogueOptions(new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    // save
                    FormValidation validation = form.validate();
                    if(!validation.hasErrors())
                    {
                        presenter.onAddChildResource(address, form.getUpdatedEntity());
                        window.hide();
                    }
                }
            }, new ClickHandler() {
                @Override
                public void onClick(ClickEvent event) {
                    // cancel
                    window.hide();
                }
            });

            VerticalPanel layout = new VerticalPanel();
            layout.setStyleName("fill-layout-width");
            ModelNode opDescription = description.get("operations").get("add").get("description");
            ContentDescription text = new ContentDescription(opDescription.asString());
            layout.add(text);
            layout.add(form.asWidget());

            WindowContentBuilder content = new WindowContentBuilder(layout, options);
            window.trapWidget(content.build());
            window.setGlassEnabled(true);
            window.setWidth(480);
View Full Code Here

        formContainer.clear();
        currentAddress = address;


        String cacheKey = AddressUtils.asKey(address, true);
        ModelNodeForm form = null;
        if(widgetCache.containsKey(cacheKey))
        {
            // retrieve from cache
            form = widgetCache.get(cacheKey);
        }
        else {

            // construct new form (expensive)
            ModelNodeFormBuilder builder = new ModelNodeFormBuilder()
                    .setResourceDescription(description)
                    .setSecurityContext(securityContext);

            ModelNodeFormBuilder.FormAssets assets = builder.build();

            form = assets.getForm();

            // cache it
            widgetCache.put(cacheKey, form);
        }

        form.setEnabled(false);

        List<Property> tuples = address.asPropertyList();
        boolean isPlaceholder = tuples.isEmpty() ? false : tuples.get(tuples.size()-1).getValue().asString().equals("*");

        // some resources only provide runtime attributes, hence the form might be empty
        if(!isPlaceholder && form.getFormItemNames().size()>0) {
            // only provide tools when writable attributes are present
            if (form.hasWritableAttributes())
                form.setToolsCallback(new AddressableFormCallback(address));


            formContainer.add(form);
            form.edit(model.getValue());
        }
        else {
            formContainer.add(new HTML("No configurable attributes available."));
        }

View Full Code Here

            SafeHtmlBuilder helpTexts = new SafeHtmlBuilder();
            helpTexts.appendHtmlConstant("<table class='help-attribute-descriptions'>");

            // The form

            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));
View Full Code Here

TOP

Related Classes of org.jboss.as.console.mbui.widgets.ModelNodeForm

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.