Class Div


public class Div extends Component<Div>

The DIV component

The component doesn't have a visual representation on the ui, it's used to group other individual components together. The component appears in the HTML DOM as a DIV tag. Events can't be assigned to this component directly, but the components grouped under it can have events handlers.

Since:
4.0
Author:
JBStrap
  • Constructor Details

    • Div

      public Div(String id)
      Create an empty Div component
      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.)
    • Div

      public Div(Component<?> component)
      Creates a DIV component and places the specified component inside it.
      Parameters:
      component - The component that will be put inside the DIV
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
    • Div

      public Div(String id, Component<?> component)
      Creates a DIV component and places the specified component inside it.
      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.)
      component - The component that will be put inside the DIV
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
    • Div

      public Div(Component<?>... components)
      Creates a DIV and places the specified component in it.
      Parameters:
      components - The components that will be put in the DIV
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
    • Div

      public Div(String id, Component<?>... components)
      Creates a DIV and places the specified component in it.
      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.)
      components - The components that will be put in the DIV
      Throws:
      IllegalStateException - If the component is set to be both Private and Public, through an annotation.
  • Method Details

    • 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<Div>
      Returns:
      If the componentwas drawn, true, otherwise false