Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.google.gwt.user.client.ui
Class FlexTable

    java.lang.Object
      com.google.gwt.user.client.ui.UIObject
          com.google.gwt.user.client.ui.Widget
              com.google.gwt.user.client.ui.Panel
                  com.google.gwt.user.client.ui.HTMLTable
                      com.google.gwt.user.client.ui.FlexTable

All Implemented Interfaces:
  EventListener, HasWidgets, SourcesTableEvents, java.lang.Iterable<Widget>

    public class FlexTable

extends HTMLTable

A flexible table that creates cells on demand. It can be jagged (that is, each row can contain a different number of cells) and individual cells can be set to span multiple rows or columns.

### Example

>     public class FlexTableExample implements EntryPoint {

>       public void onModuleLoad() {
>         // Tables have no explicit size -- they resize automatically on demand.
>         FlexTable t = new FlexTable();

>         // Put some text at the table's extremes.  This forces the table to be
>         // 3 by 3.
>         t.setText(0, 0, "upper-left corner");
>         t.setText(2, 2, "bottom-right corner");

>         // Let's put a button in the middle...
>         t.setWidget(1, 0, new Button("Wide Button"));

>         // ...and set it's column span so that it takes up the whole row.
>         t.getFlexCellFormatter().setColSpan(1, 0, 3);

>         RootPanel.get().add(t);
>       }
>     }

Nested Class Summary
`class` | `FlexTable.FlexCellFormatter` FlexTable-specific implementation of `HTMLTable.CellFormatter`.

Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.HTMLTable
`HTMLTable.CellFormatter, HTMLTable.ColumnFormatter, HTMLTable.RowFormatter`

Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
`UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled`

Field Summary

Fields inherited from class com.google.gwt.user.client.ui.UIObject
`DEBUG_ID_PREFIX`

Constructor Summary
`FlexTable()`

Method Summary
`void` | `addCell(int row)` Appends a cell to the specified row.
`int` | `getCellCount(int row)` Gets the number of cells on a given row.
`FlexTable.FlexCellFormatter` | `getFlexCellFormatter()` Explicitly gets the `FlexTable.FlexCellFormatter`.
`int` | `getRowCount()` Gets the number of rows.
`void` | `insertCell(int beforeRow, int beforeColumn)` Inserts a cell into the FlexTable.
`int` | `insertRow(int beforeRow)` Inserts a row into the FlexTable.
`protected void` | `prepareCell(int row, int column)` Ensure that the cell exists.
`protected void` | `prepareRow(int row)` Ensure that the row exists.
`void` | `removeCell(int row, int col)` Removes the specified cell from the table.
`void` | `removeCells(int row, int column, int num)` Removes a number of cells from a row in the table.
`void` | `removeRow(int row)` Removes the specified row from the table.

Methods inherited from class com.google.gwt.user.client.ui.HTMLTable
`addTableListener, checkCellBounds, checkRowBounds, clear, clearCell, createCell, getBodyElement, getCellFormatter, getCellPadding, getCellSpacing, getColumnFormatter, getDOMCellCount, getDOMCellCount, getDOMRowCount, getDOMRowCount, getEventTargetCell, getHTML, getRowFormatter, getText, getWidget, insertCells, internalClearCell, isCellPresent, iterator, onBrowserEvent, onEnsureDebugId, prepareColumn, remove, removeTableListener, setBorderWidth, setCellFormatter, setCellPadding, setCellSpacing, setColumnFormatter, setHTML, setRowFormatter, setText, setWidget`

Methods inherited from class com.google.gwt.user.client.ui.Panel
`add, adopt, adopt, disown, doAttachChildren, doDetachChildren, onLoad, onUnload, orphan`

Methods inherited from class com.google.gwt.user.client.ui.Widget
`getParent, isAttached, onAttach, onDetach, removeFromParent`

Methods inherited from class com.google.gwt.user.client.ui.UIObject
`addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### FlexTable

    public FlexTable()

Method Detail

### addCell

    public void addCell(int row)

  Appends a cell to the specified row.

  Parameters:
    `row` - the row to which the new cell will be added
  Throws:
    `java.lang.IndexOutOfBoundsException`

### getCellCount

    public int getCellCount(int row)

  Gets the number of cells on a given row.

  Specified by:
    `getCellCount` in class `HTMLTable`
  Parameters:
    `row` - the row whose cells are to be counted
  Returns:
    the number of cells present
  Throws:
    `java.lang.IndexOutOfBoundsException`

### getFlexCellFormatter

    public FlexTable.FlexCellFormatter getFlexCellFormatter()

  Explicitly gets the `FlexTable.FlexCellFormatter`. The results of `HTMLTable.getCellFormatter()` may also be downcast to a `FlexTable.FlexCellFormatter`.

  Returns:
    the FlexTable's cell formatter

### getRowCount

    public int getRowCount()

  Gets the number of rows.

  Specified by:
    `getRowCount` in class `HTMLTable`
  Returns:
    number of rows

### insertCell

    public void insertCell(int beforeRow,
                           int beforeColumn)

  Inserts a cell into the FlexTable.

  Overrides:
    `insertCell` in class `HTMLTable`
  Parameters:
    `beforeRow` - the cell's row
    `beforeColumn` - the cell's column

### insertRow

    public int insertRow(int beforeRow)

  Inserts a row into the FlexTable.

  Overrides:
    `insertRow` in class `HTMLTable`
  Parameters:
    `beforeRow` - the row to insert
  Returns:
    the index of the newly-created row

### removeCell

    public void removeCell(int row,
                           int col)

  Description copied from class: `HTMLTable`
  Removes the specified cell from the table.

  Overrides:
    `removeCell` in class `HTMLTable`
  Parameters:
    `row` - the row of the cell to remove
    `col` - the column of cell to remove
  See Also:
    `HTMLTable.removeCell(int, int)`

### removeCells

    public void removeCells(int row,
                            int column,
                            int num)

  Removes a number of cells from a row in the table.

  Parameters:
    `row` - the row of the cells to be removed
    `column` - the column of the first cell to be removed
    `num` - the number of cells to be removed
  Throws:
    `java.lang.IndexOutOfBoundsException`

### removeRow

    public void removeRow(int row)

  Description copied from class: `HTMLTable`
  Removes the specified row from the table.

  Overrides:
    `removeRow` in class `HTMLTable`
  Parameters:
    `row` - the index of the row to be removed

### prepareCell

    protected void prepareCell(int row,
                               int column)

  Ensure that the cell exists.

  Specified by:
    `prepareCell` in class `HTMLTable`
  Parameters:
    `row` - the row to prepare.
    `column` - the column to prepare.
  Throws:
    `java.lang.IndexOutOfBoundsException` - if the row is negative

### prepareRow

    protected void prepareRow(int row)

  Ensure that the row exists.

  Specified by:
    `prepareRow` in class `HTMLTable`
  Parameters:
    `row` - The row to prepare.
  Throws:
    `java.lang.IndexOutOfBoundsException` - if the row is negative

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD