Class Column


public class Column extends Component<Column>

Column component

Components placed in a column appear below each other. You can use this component to horizontally divide the screen into several columns.

You can set the width, offset, alignment and order of each column separately. You can change these settings globally, or depending on the current screen size. This allows you to create different views for desktop, tablet and mobile devices.

Since:
4.0
Author:
JBStrap
  • Constructor Details

    • Column

      public Column()
      Creates an empty column.
    • Column

      public Column(Component<?>... content)
      Creates column with the specified parameters.
      Parameters:
      content - A list of components to be displayed in the column
    • Column

      public Column(String id, Component<?>... content)
      Creates a column with the specified ID and content
      Parameters:
      id - The column’s unique ID
      content - A list of components to be displayed in the column
  • Method Details

    • setSize

      public Column setSize(ColumnSize... sizes)
      Sets column type. If not specified, the column size is automatically determined by making the width of columns in a given row the same for all screen sizes.
      Parameters:
      sizes - Column size list * Available sizes are listed in the class ColumnSize.
      Returns:
      Column component
    • setAlignItems

      public Column setAlignItems(StyleAlign... aligns)
      Sets column alignment.
      Parameters:
      aligns - Column alignment For the applicable content aliaments see the VerticalAlign and the HorizontalAlign enums.
      Returns:
      Column component
    • setOrder

      public Column setOrder(ColumnOrder... orders)
      Sets the order the columns are displayed in. If you do not specify an order, columns are displayed in the same order they were added to the parent component.
      Parameters:
      orders - A list of column display orders Available orders are listed in the ColumnOrder class.
      Returns:
      Column component
    • setOffset

      public Column setOffset(ColumnOffset... offsets)
      Sets the column offset. If you do not specify a column offset, the column is displayed aligned to the left.
      Parameters:
      offsets - A list of column offsets Available offsets are listed in the ColumnOffset class.
      Returns:
      Column 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<Column>
      Returns:
      If the componentwas drawn, true, otherwise false