Class BlockedFormBuilder
- All Implemented Interfaces:
BlockedForm
,FormBuilder
Blocked form builder class
This class builds blocked forms. This means that the form items will be placed into blocks. The blocks will be placed under each other, in the order they were added to the form. A title is displayed on the top of the blocks. Under the title, the form items will be placed. They will have the width of the block.
The individual blocks can be created through the form component, by using the Form.addBlock(String, String)
method. Form items can be added to the blocks with the use of parameters.
The parameters can be specified through code, directly for the form item component, or through a DataDescriptor column, by using the MetaParamName.BLOCK_NAME
parameter.
If the form has a form item that is not assigned to the block, the form item is displayed in a separate block, with the title "Unnamed".
- Since:
- 4.0
- Author:
- JBStrap
- See Also:
-
Field Summary
Fields inherited from interface com.jbstrap.ui.components.form.builders.interfaces.BlockedForm
UNNAMED_BLOCK
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
BlockedFormBuilder
public BlockedFormBuilder()Creates a blocked form builder class
-
-
Method Details
-
createBlock
Creates a form block with the specified name- Specified by:
createBlock
in interfaceBlockedForm
- Parameters:
name
- The name of the form block, has to be unique within the form componenttitle
- The form title. Ifnull
, no title will be used- Returns:
- The created form block component
- Throws:
NullPointerException
- If the name isnull
-
buildForm
Description copied from interface:FormBuilder
Builds a form- Specified by:
buildForm
in interfaceFormBuilder
- Parameters:
formItems
- A list containing the form items- Returns:
- The built form content
-
getBlock
Gets the block, specified by its name- Specified by:
getBlock
in interfaceBlockedForm
- Parameters:
name
- The name of the block- Returns:
- The form block that has the specified name, or
null
, if not found
-