Class ColumnedFormBuilder

java.lang.Object
com.jbstrap.ui.components.form.builders.ColumnedFormBuilder
All Implemented Interfaces:
ColumnedForm, FormBuilder

public class ColumnedFormBuilder extends Object implements FormBuilder, ColumnedForm

Columned form builder class

With this class, columned forms can be built. This means that the form items will be placed into columns. The height of the columns will be the same as the form height. The full width of every column will be the same as the form itself. The individual column's width will be the same. The form items will fill out the columns. The form items that are in the same column will be placed under each other.

The columns to be used on the form can be created through the form component, by using the Form.addColumn(String) method. The individual form items can be assigned by the form item parameters. The parameters can be specified through code, directly for the form item component, or through a DataDescriptor column, by using the MetaParamName.FORM_COLUMN parameter.

Since:
4.0
Author:
JBStrap
See Also:
  • Constructor Details

    • ColumnedFormBuilder

      public ColumnedFormBuilder()
  • Method Details

    • createColumn

      public final FormColumn createColumn(String name)
      Creates a form column with the specified name
      Specified by:
      createColumn in interface ColumnedForm
      Parameters:
      name - The name of the column, has to be unique within the form component
      Returns:
      The created form column component
      Throws:
      NullPointerException - If the name is null
    • buildForm

      public Component<?> buildForm(List<FormItem<?,?>> formItems)
      Description copied from interface: FormBuilder
      Builds a form
      Specified by:
      buildForm in interface FormBuilder
      Parameters:
      formItems - A list containing the form items
      Returns:
      The built form content
    • getColumn

      public FormColumn getColumn(String name)
      Gets a form column, specified by the column name
      Specified by:
      getColumn in interface ColumnedForm
      Parameters:
      name - The name of the column
      Returns:
      The form column that has the specified name, or null, if not found