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

java.lang.Object
  extended bycom.google.gwt.user.client.ui.UIObject
      extended bycom.google.gwt.user.client.ui.Widget
          extended bycom.google.gwt.user.client.ui.Panel
              extended bycom.google.gwt.user.client.ui.HTMLTable
                  extended bycom.google.gwt.user.client.ui.FlexTable
All Implemented Interfaces:
EventListener, HasWidgets, SourcesTableEvents

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

code


Nested Class Summary
 class FlexTable.FlexCellFormatter
          FlexTable-specific implementation of CellFormatter.
 
Nested classes inherited from class com.google.gwt.user.client.ui.HTMLTable
HTMLTable.CellFormatter, HTMLTable.RowFormatter
 
Field Summary
 
Fields inherited from class java.lang.Object
typeId, typeName
 
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 row, int column)
          Inserts a new cell into the specified row.
 int insertRow(int beforeRow)
          Inserts a new row into the table.
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
add, addTableListener, checkCellBounds, checkRowBounds, clear, clearCell, computeKey, createCell, getBodyElement, getCellFormatter, getCellPadding, getCellSpacing, getDOMCellCount, getDOMRowCount, getHTML, getRowFormatter, getText, getWidget, insertCells, internalClearCell, isCellPresent, iterator, onBrowserEvent, remove, removeTableListener, setBorderWidth, setCellFormatter, setCellPadding, setCellSpacing, setHTML, setRowFormatter, setText, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
adopt, disown, onAttach, onDetach
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
getParent, isAttached, onLoad
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, isVisible, isVisible, removeStyleName, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode
 

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:
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:
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:
the table's row count

insertCell

public void insertCell(int row,
                       int column)
Description copied from class: HTMLTable
Inserts a new cell into the specified row.

Overrides:
insertCell in class HTMLTable
Parameters:
row - the row into which the new cell will be inserted
column - the column before which the cell will be inserted

insertRow

public int insertRow(int beforeRow)
Description copied from class: HTMLTable
Inserts a new row into the table.

Overrides:
insertRow in class HTMLTable
Parameters:
beforeRow - the index before which the new row will be inserted
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

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:
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:
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:
IndexOutOfBoundsException - if the row is negative


This javadoc distribution was not produced by Google. The official documentation is here.