Klasse UiLayout

Bekannte direkte Unterklassen:
UiColumnGridLayout, UiContentLayout, UiDockLayout, UiFillLayout, UiFlexLayout, UiFlowLayout, UiFooterLayout, UiGridLayout, UiHeaderLayout, UiInlineLayout, UiSecondaryContentLayout, UiTableLayout

public class UiLayout extends UiLayoutElement<UiLayout>
The base class for layouts of process UI Containers. A layout consists of rows and columns which in turn contain layout cells for each component in the container at the respective layout position. If properties are set on either the layout, a row, or a column, they define the default values to be used for the creation of cells in the corresponding element.
  • Konstruktordetails

    • UiLayout

      public UiLayout(de.esoco.lib.property.LayoutType layoutType)
      Creates a new instance with a single column and row (i.e. a single cell).
      Parameter:
      layoutType - The layout type
    • UiLayout

      public UiLayout(de.esoco.lib.property.LayoutType layoutType, int columns)
      Creates a new instance with a single row.
      Parameter:
      layoutType - The layout type
      columns - The number of columns in this layout
    • UiLayout

      public UiLayout(de.esoco.lib.property.LayoutType layoutType, int rows, int columns)
      Creates a new instance with a fixed number of columns and rows. All rows and columns will be created and filled with empty cells (component = NULL).
      Parameter:
      layoutType - The layout type
      rows - The number of rows in this layout
      columns - The number of columns in this layout
  • Methodendetails

    • applyTo

      public final void applyTo(UiContainer<?> container)
      Applies this layout to the given container.
      Parameter:
      container - The container
    • getCells

      public List<UiLayout.Cell> getCells()
      Returns the cells in this layout. Their order will follow the layout structure, i.e. row by row and column after column in the respective row. Depending on the layout type cells can be empty, i.e. their component may be NULL.
      Gibt zurück:
      The layout cells
    • getColumns

      public List<UiLayout.Column> getColumns()
      Returns the columns in this layout.
      Gibt zurück:
      The column list
    • getCurrentRow

      public UiLayout.Row getCurrentRow()
      Returns the row in the layout which is used to add new components.
      Gibt zurück:
      The last row
    • getLayoutType

      public final de.esoco.lib.property.LayoutType getLayoutType()
      Returns the layout type.
      Gibt zurück:
      The layout type
    • getRows

      public List<UiLayout.Row> getRows()
      Returns the rows in this layout.
      Gibt zurück:
      The row list
    • nextRow

      public void nextRow()
      Signals that the next component added to this layout should be placed at the beginning of the next layout row. The actual effect of this call depends on the respective layout implementation.
    • removeColumn

      public void removeColumn(UiLayout.Column column)
      Removes a certain column from this layout. This will also remove all components in the column cells from their parent container. Attention: depending on the layout type this call can have unforeseen effects if the layout parameters are not adjusted accordingly (e.g. column count).
      Parameter:
      column - The column to remove
    • removeRow

      public void removeRow(UiLayout.Row row)
      Removes a certain row from this layout. This will also remove all components in the row cells from their parent container.
      Parameter:
      row - The row to remove
    • addComponent

      protected void addComponent(UiComponent<?,?> component)
      Internal method to initially add a component to the layout. This will add a dummy layout cell to the component that is not positioned in the layout but can be used to set layout parameters on the component by querying it with UiComponent.cell(). The actual layout is performed by the method layoutComponent(UiComponent).

      Invoked by UiContainer.addComponent(UiComponent).

      Parameter:
      component - The component that has been added to the container
    • applyToContainer

      protected void applyToContainer(UiContainer<?> container)
      Applies this layout to the given container.
      Parameter:
      container - The container
    • createCell

      protected UiLayout.Cell createCell(UiLayout.Row row, UiLayout.Column column)
      Creates a new layout cell. Can be overridden by subclasses to create layout-specific cell types. The default implementation returns an instance of the inner class UiLayout.Cell.
      Parameter:
      row - The row of the cell
      column - The column of the cell
      Gibt zurück:
      The new cell
    • getLayoutCell

      protected UiLayout.Cell getLayoutCell(UiLayout.Row row, UiLayout.Column column)
      Returns the layout cell for a certain component at the next calculated grid position. Can be overridden by subclasses that need to modify the grid position, e.g. because of irregular grid structures.
      Parameter:
      row - The row at which to place the component
      column - The column at which to place the component
      Gibt zurück:
      The layout cell
    • getNextGridColumn

      protected UiLayout.Column getNextGridColumn(int row, int column)
      Returns the next grid column under consideration of column spans that may have been set on the cell at the given grid coordinate. This method is intended to be used by subclasses that allow to define irregular grids.
      Parameter:
      row - The index of the cell column
      column - The index of the cell row
      Gibt zurück:
      The next row
    • getNextGridRow

      protected UiLayout.Row getNextGridRow(int row, int column)
      Returns the next grid row under consideration of row spans that may have been set on the cell at the given grid coordinate. This method is intended to be used by subclasses that allow to define irregular grids.
      Parameter:
      row - The index of the cell row
      column - The index of the cell column
      Gibt zurück:
      The next row
    • ignoreProperties

      protected void ignoreProperties(de.esoco.lib.property.PropertyName<?>... properties)
      Can be invoked by subclasses to exclude certain properties from application upon components.
      Parameter:
      properties - The properties to ignore
    • isIgnored

      protected boolean isIgnored(de.esoco.lib.property.PropertyName<?> property)
      Checks whether a certain property should be ignored for application on components.
      Parameter:
      property - The property name
      Gibt zurück:
      TRUE if the property is to be ignored
    • layoutComponent

      protected void layoutComponent(UiComponent<?,?> component)
      Internal method to place a component in the layout. Invoked by UiContainer.applyProperties().
      Parameter:
      component - The component to layout
    • reset

      protected void reset(int rowCount, int colCount)
      Resets this layout for recalculation.
      Parameter:
      rowCount - The number of rows
      colCount - The number of column