All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.as.console.client.shared.viewframework.builder.FormLayout Maven / Gradle / Ivy

Go to download

Bundles the core AS7 console as a GWT module. Includes minor customizations to support extensions.

There is a newer version: 0.7.0.Final
Show newest version
package org.jboss.as.console.client.shared.viewframework.builder;

import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import org.jboss.as.console.client.shared.help.FormHelpPanel;
import org.jboss.as.console.client.widgets.forms.FormToolStrip;
import org.jboss.ballroom.client.widgets.forms.Form;

/**
 * @author Heiko Braun
 * @date 11/28/11
 */
public class FormLayout {

    private Form form;
    private FormHelpPanel help;
    private FormToolStrip tools;

    public FormLayout setForm(Form form) {
        this.form = form;
        return this;
    }

    public FormLayout setHelp(FormHelpPanel help) {

        this.help = help;
        return this;
    }

    public FormLayout setSetTools(FormToolStrip tools) {

        this.tools = tools;
        return this;
    }

    public Widget build() {

        if(null==form)
            throw new IllegalStateException("form not set");

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

        if(tools!=null)layout.add(tools.asWidget());
        if(help!=null)layout.add(help.asWidget());
        layout.add(form.asWidget());

        return layout;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy