Class TablePane

  • All Implemented Interfaces:
    java.lang.Iterable<Component>, Sequence<Component>, ConstrainedVisual, Visual
    Direct Known Subclasses:
    LinkButtonDataRenderer, MenuItemDataRenderer

    @DefaultProperty("rows")
    public class TablePane
    extends Container
    Container that arranges components in a two-dimensional grid, optionally spanning multiple rows and columns, much like an HTML <table> element.

    Note that unlike an HTML <tablei>, components that span multiple rows or columns will not "push" other components out of their way. Instead, the spanning components will simply overlay the cells into which they span. This means that application developers may have to use filler cells in the cells that are spanned.

    • Field Detail

      • RELATIVE_SIZE_INDICATOR

        public static final java.lang.String RELATIVE_SIZE_INDICATOR
        See Also:
        Constant Field Values
    • Constructor Detail

      • TablePane

        public TablePane()
        Creates a new TablePane with empty row and column sequences.
      • TablePane

        public TablePane​(Sequence<TablePane.Column> columns)
        Creates a new TablePane with the specified columns.
        Parameters:
        columns - The column sequence to use. A copy of this sequence will be made
    • Method Detail

      • setSkin

        protected void setSkin​(Skin skin)
        Description copied from class: Component
        Sets the skin, replacing any previous skin.
        Overrides:
        setSkin in class Component
        Parameters:
        skin - The new skin.
      • getRows

        public TablePane.RowSequence getRows()
        Returns the table pane row sequence.
        Returns:
        The table pane row sequence
      • getRowAt

        public int getRowAt​(int y)
        Returns the index of the row at a given location.
        Parameters:
        y - The y-coordinate of the row to identify.
        Returns:
        The row index, or -1 if there is no row at the given y-coordinate.
      • getRowBounds

        public Bounds getRowBounds​(int row)
        Parameters:
        row - The row index.
        Returns:
        The bounds of a given row.
      • getColumnAt

        public int getColumnAt​(int x)
        Returns the index of the column at a given location.
        Parameters:
        x - The x-coordinate of the column to identify.
        Returns:
        The column index, or -1 if there is no column at the given x-coordinate.
      • getColumnBounds

        public Bounds getColumnBounds​(int column)
        Parameters:
        column - The column index.
        Returns:
        The bounds of a given column.
      • getCellComponent

        public Component getCellComponent​(int rowIndex,
                                          int columnIndex)
        Gets the component at the specified cell in this table pane.
        Parameters:
        rowIndex - The row index of the cell
        columnIndex - The column index of the cell
        Returns:
        The component in the specified cell, or null if the cell is empty
      • remove

        public Sequence<Component> remove​(int index,
                                          int count)
        Overrides the base method to check whether or not a cell component is being removed, and fires the appropriate event in that case.
        Specified by:
        remove in interface Sequence<Component>
        Overrides:
        remove in class Container
        Parameters:
        index - The index at which components were removed
        count - The number of components removed
        Returns:
        The sequence of components that were removed
      • getRowSpan

        public static int getRowSpan​(Component component)
      • setRowSpan

        public static void setRowSpan​(Component component,
                                      int rowSpan)
      • getColumnSpan

        public static int getColumnSpan​(Component component)
      • setColumnSpan

        public static void setColumnSpan​(Component component,
                                         int columnSpan)