Class FormBlock


public class FormBlock extends Component<FormBlock>

Form block component

The component cannot be used on its own, it is used by the Form component and the form component builder classes. The component implements a block on the form, in which input fields can be grouped. These blocks can have an icon and/or a title, that appears on top of the form block.

Since:
4.0
Author:
JBStrap
  • Constructor Details

    • FormBlock

      public FormBlock(String id, String title)
      Creates a form block with the specified title
      Parameters:
      id - The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)
      title - The form block title. If null, no title will be used
    • FormBlock

      public FormBlock(String id, Icon icon, String title)
      Creates a form block with the specified title and icon
      Parameters:
      id - The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)
      icon - The form block icon. Usable icons can be found in the Icon enum. If null, no icon will be used
      title - The form block title. If null, no title will be used
  • Method Details

    • setIcon

      public final FormBlock setIcon(Icon icon)
      Sets the form block icon
      Parameters:
      icon - The form block icon. Usable icons can be found in the Icon enum. If null, no icon will be used
      Returns:
      The form block component
    • getIcon

      public final Icon getIcon()
      Gets the form block icon
      Returns:
      The form block icon, or null if none are used
    • setTitle

      public final FormBlock setTitle(String title)
      Sets the form block title
      Parameters:
      title - The form block title. If null, no title will be used
      Returns:
      The Form block component
    • getTitle

      public final String getTitle()
      Gets the form block title
      Returns:
      The form block title or null, if no title was set
    • writeHTML

      public boolean writeHTML(StringWriter writer)
      Description copied from class: Component
      Creates the component's HTML equivalent

      This method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (StringWriter class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return with false. Otherwise, it must return with true.

      Specified by:
      writeHTML in class Component<FormBlock>
      Returns:
      If the componentwas drawn, true, otherwise false