Class TableHeader

All Implemented Interfaces:
Animatable<TableHeader>, CanDrop<TableHeader>, Clickable<TableHeader>, Draggable<TableHeader>, HandleMouseEvents<TableHeader>, Touchable<TableHeader>

Table header row component

This component is used with the Table component. This represents a table header row, that can have a cell, or other components added to it.  If a component is added, it will be automatically placed inside a cell component.

Supported events:

AnimationStart AnimationEnd, Click, DoubleClick, MouseDown, MouseDown, MouseLeave, MouseMove, MouseOver, MouseOut, MouseUp, Wheel, TouchCancel, TouchEnd, TouchMove, TouchStart, Drop, DragStart, DragEnd

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

    • TableHeader

      public TableHeader()
      Creates an empty table header row component.
    • TableHeader

      public TableHeader(String id)
      Creates an empty table header row component with specified ID.
      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.)
    • TableHeader

      public TableHeader(Component<?>... cells)
      Creates a table header row, and adds the specified components to it, as table cells. Each component listed here will be in their own, separate cells, in their own columns.
      Parameters:
      cells - The components to be added, as columns. Each component will have its own column.
    • TableHeader

      public TableHeader(String id, Component<?>... cells)
      Creates a table header row, and adds the specified components to it, as table cells. Each component listed here will be in their own, separate cells, in their own columns.
      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.)
      cells - The components to be added, as columns. Each component will have its own column.
  • Method Details

    • addComponent

      public TableHeader addComponent(Component<?> component)
      Adds the specified component to the header, in a new column. If the component is not a TableCell (or extends from it), it will be placed in a cell before it is added.
      Overrides:
      addComponent in class Component<TableHeader>
      Parameters:
      component - The component to be added
      Returns:
      The component
    • 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<TableHeader>
      Returns:
      If the componentwas drawn, true, otherwise false
    • setEnabled

      public TableHeader setEnabled(boolean enabled)
      Enables or disables the header. Applies to every cell that is in the header row.
      Overrides:
      setEnabled in class Component<TableHeader>
      Parameters:
      enabled - true, the component is enabled, otherwise it's disabled
      Returns:
      The table header row component.