Class WTableColumn

java.lang.Object
eu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WTableColumn

public class WTableColumn extends WObject
A table column.

A WTableColumn is returned by WTable#getColumnAt() and managing various properties of a single column in a table (it is however not a widget).

A table column corresponds to the HTML <col> tag.

See Also:
  • Constructor Details

    • WTableColumn

      public WTableColumn()
      Creates a new table column.

      Table columns must be added to a table using WTable#insertColumn() before you can access contents in it using elementAt().

  • Method Details

    • getTable

      public WTable getTable()
      Returns the table to which this column belongs.

      See Also:
    • elementAt

      public WTableCell elementAt(int row)
      Access the column element at the given row.

      Like WTable#getElementAt(), if the row is beyond the current table dimensions, then the table is expanded automatically.

      The column must be inserted within a table first.

    • getColumnNum

      public int getColumnNum()
      Returns the column number of this column in the table.

      Returns -1 if the column is not yet part of a table.

      See Also:
    • setWidth

      public void setWidth(WLength width)
      Sets the column width.

      The default column width is WLength.Auto.

      See Also:
    • getWidth

      public WLength getWidth()
      Returns the column width.

      See Also:
    • setStyleClass

      public void setStyleClass(String style)
      Sets the CSS style class for this column.

      The style is inherited by all table cells in this column.

      See Also:
    • getStyleClass

      public String getStyleClass()
      Returns the CSS style class for this column.

      See Also:
    • setId

      public void setId(String id)
      Sets the CSS Id.

      Sets a custom Id. Note that the Id must be unique across the whole widget tree, can only be set right after construction and cannot be changed.

      See Also:
    • getId

      public String getId()
      Description copied from class: WObject
      Returns the (unique) identifier for this object

      For a WWidget, this corresponds to the id of the DOM element that represents the widget. This is not entirely unique, since a WCompositeWidget shares the same id as its implementation.

      By default, the id is auto-generated, unless a custom id is set for a widget using WWidget.setId(String). The auto-generated id is created by concatenating WObject.getObjectName() with a unique number.

      Overrides:
      getId in class WObject
    • setObjectName

      public void setObjectName(String name)
      Description copied from class: WObject
      Sets an object name.

      The object name can be used to easily identify a type of object in the DOM, and does not need to be unique. It will usually reflect the widget type or role. The object name is prepended to the auto-generated object WObject.getId().

      The default object name is empty.

      Overrides:
      setObjectName in class WObject
      Parameters:
      name - the object name.