| 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
All known Subclasses: com.google.gwt.user.client.ui.Grid, com.google.gwt.user.client.ui.FlexTable,
Inner Class :public class CellFormatter | |
Inner Class :public class ColumnFormatter | |
Inner Class :public class RowFormatter | |
Constructor Summary | |
public | HTMLTable() Create a new empty HTML Table. |
Method Summary | |
public void | addTableListener(TableListener listener) Adds a listener to the current table. | protected void | checkCellBounds(int row, int column) Bounds checks that the cell exists at the specified location. | protected void | checkRowBounds(int row) Checks that the row is within the correct bounds. | public void | clear() Removes all widgets from this table, but does not remove other HTML or text
contents of cells. | public boolean | clearCell(int row, int column) Clears the given row and column. | protected Element | createCell() Creates a new cell. | protected Element | getBodyElement() Gets the table's TBODY element. | abstract public int | getCellCount(int row) Gets the number of cells in a given row. | public CellFormatter | getCellFormatter() Gets the
CellFormatter associated with this table. | public int | getCellPadding() Gets the amount of padding that is added around all cells. | public int | getCellSpacing() Gets the amount of spacing that is added around all cells. | public ColumnFormatter | getColumnFormatter() Gets the column formatter. | native protected int | getDOMCellCount(Element tableBody, int row) Directly ask the underlying DOM what the cell count on the given row is. | protected int | getDOMCellCount(int row) Directly ask the underlying DOM what the cell count on the given row is. | protected int | getDOMRowCount() Directly ask the underlying DOM what the row count is. | native protected int | getDOMRowCount(Element elem) | protected Element | getEventTargetCell(Event event) Determines the TD associated with the specified event. | public String | getHTML(int row, int column) Gets the HTML contents of the specified cell. | abstract public int | getRowCount() Gets the number of rows present in this table. | public RowFormatter | getRowFormatter() Gets the RowFormatter associated with this table. | public String | getText(int row, int column) Gets the text within the specified cell. | public Widget | getWidget(int row, int column) Gets the widget in the specified cell. | protected void | insertCell(int row, int column) Inserts a new cell into the specified row. | protected void | insertCells(int row, int column, int count) Inserts a number of cells before the specified cell. | protected int | insertRow(int beforeRow) Inserts a new row into the table. | protected boolean | internalClearCell(Element td, boolean clearInnerHTML) Does actual clearing, used by clearCell and cleanCell. | public boolean | isCellPresent(int row, int column) Determines whether the specified cell exists. | public Iterator<Widget> | iterator() Returns an iterator containing all the widgets in this table. | public void | onBrowserEvent(Event event) Method to process events generated from the browser. | abstract protected void | prepareCell(int row, int column) Subclasses must implement this method. | protected void | prepareColumn(int column) Subclasses can implement this method. | abstract protected void | prepareRow(int row) Subclasses must implement this method. | public boolean | remove(Widget widget) Remove the specified widget from the table. | protected void | removeCell(int row, int column) Removes the specified cell from the table. | protected void | removeRow(int row) Removes the specified row from the table. | public void | removeTableListener(TableListener listener) Removes the specified table listener. | public void | setBorderWidth(int width) Sets the width of the table's border. | protected void | setCellFormatter(CellFormatter cellFormatter) Sets the table's CellFormatter. | public void | setCellPadding(int padding) Sets the amount of padding to be added around all cells. | public void | setCellSpacing(int spacing) Sets the amount of spacing to be added around all cells. | protected void | setColumnFormatter(ColumnFormatter formatter) | public void | setHTML(int row, int column, String html) Sets the HTML contents of the specified cell. | protected void | setRowFormatter(RowFormatter rowFormatter) Sets the table's RowFormatter. | public void | setText(int row, int column, String text) Sets the text within the specified cell. | public void | setWidget(int row, int column, Widget widget) Sets the widget within the specified cell.
Inherited implementations may either throw IndexOutOfBounds exception if
the cell does not exist, or allocate a new cell to store the content.
FlexTable will automatically allocate the cell at the correct location and
then set the widget. |
HTMLTable | public HTMLTable()(Code) | | Create a new empty HTML Table.
|
addTableListener | public void addTableListener(TableListener listener)(Code) | | Adds a listener to the current table.
Parameters: listener - listener to add |
checkCellBounds | protected void checkCellBounds(int row, int column)(Code) | | Bounds checks that the cell exists at the specified location.
Parameters: row - cell's row Parameters: column - cell's column throws: IndexOutOfBoundsException - |
checkRowBounds | protected void checkRowBounds(int row)(Code) | | Checks that the row is within the correct bounds.
Parameters: row - row index to check throws: IndexOutOfBoundsException - |
clear | public void clear()(Code) | | Removes all widgets from this table, but does not remove other HTML or text
contents of cells.
|
clearCell | public boolean clearCell(int row, int column)(Code) | | Clears the given row and column. If it contains a Widget, it will be
removed from the table. If not, its contents will simply be cleared.
Parameters: row - the widget's column Parameters: column - the widget's column true if a widget was removed throws: IndexOutOfBoundsException - |
createCell | protected Element createCell()(Code) | | Creates a new cell. Override this method if the cell should have initial
contents.
the newly created TD |
getBodyElement | protected Element getBodyElement()(Code) | | Gets the table's TBODY element.
the TBODY element |
getCellCount | abstract public int getCellCount(int row)(Code) | | Gets the number of cells in a given row.
Parameters: row - the row whose cells are to be counted the number of cells present in the row |
getCellFormatter | public CellFormatter getCellFormatter()(Code) | | Gets the
CellFormatter associated with this table. Use casting to
get subclass-specific functionality
this table's cell formatter |
getCellPadding | public int getCellPadding()(Code) | | Gets the amount of padding that is added around all cells.
the cell padding, in pixels |
getCellSpacing | public int getCellSpacing()(Code) | | Gets the amount of spacing that is added around all cells.
the cell spacing, in pixels |
getColumnFormatter | public ColumnFormatter getColumnFormatter()(Code) | | Gets the column formatter.
the column formatter |
getDOMCellCount | native protected int getDOMCellCount(Element tableBody, int row)(Code) | | Directly ask the underlying DOM what the cell count on the given row is.
Parameters: tableBody - the element Parameters: row - the row number of columns in the row |
getDOMCellCount | protected int getDOMCellCount(int row)(Code) | | Directly ask the underlying DOM what the cell count on the given row is.
Parameters: row - the row number of columns in the row |
getDOMRowCount | protected int getDOMRowCount()(Code) | | Directly ask the underlying DOM what the row count is.
Returns the number of rows in the table |
getDOMRowCount | native protected int getDOMRowCount(Element elem)(Code) | | |
getEventTargetCell | protected Element getEventTargetCell(Event event)(Code) | | Determines the TD associated with the specified event.
Parameters: event - the event to be queried the TD associated with the event, or null if none isfound. |
getHTML | public String getHTML(int row, int column)(Code) | | Gets the HTML contents of the specified cell.
Parameters: row - the cell's row Parameters: column - the cell's column the cell's HTML contents throws: IndexOutOfBoundsException - |
getRowCount | abstract public int getRowCount()(Code) | | Gets the number of rows present in this table.
the table's row count |
getRowFormatter | public RowFormatter getRowFormatter()(Code) | | Gets the RowFormatter associated with this table.
the table's row formatter |
getText | public String getText(int row, int column)(Code) | | Gets the text within the specified cell.
Parameters: row - the cell's row Parameters: column - the cell's column the cell's text contents throws: IndexOutOfBoundsException - |
getWidget | public Widget getWidget(int row, int column)(Code) | | Gets the widget in the specified cell.
Parameters: row - the cell's row Parameters: column - the cell's column the widget in the specified cell, or null if none ispresent throws: IndexOutOfBoundsException - |
insertCell | protected void insertCell(int row, int column)(Code) | | Inserts a new cell into the specified row.
Parameters: row - the row into which the new cell will be inserted Parameters: column - the column before which the cell will be inserted throws: IndexOutOfBoundsException - |
insertCells | protected void insertCells(int row, int column, int count)(Code) | | Inserts a number of cells before the specified cell.
Parameters: row - the row into which the new cells will be inserted Parameters: column - the column before which the new cells will be inserted Parameters: count - number of cells to be inserted throws: IndexOutOfBoundsException - |
insertRow | protected int insertRow(int beforeRow)(Code) | | Inserts a new row into the table.
Parameters: beforeRow - the index before which the new row will be inserted the index of the newly-created row throws: IndexOutOfBoundsException - |
internalClearCell | protected boolean internalClearCell(Element td, boolean clearInnerHTML)(Code) | | Does actual clearing, used by clearCell and cleanCell. All HTMLTable
methods should use internalClearCell rather than clearCell, as clearCell
may be overridden in subclasses to format an empty cell.
Parameters: td - element to clear Parameters: clearInnerHTML - should the cell's inner html be cleared? returns whether a widget was cleared |
isCellPresent | public boolean isCellPresent(int row, int column)(Code) | | Determines whether the specified cell exists.
Parameters: row - the cell's row Parameters: column - the cell's column true if the specified cell exists |
iterator | public Iterator<Widget> iterator()(Code) | | Returns an iterator containing all the widgets in this table.
the iterator |
onBrowserEvent | public void onBrowserEvent(Event event)(Code) | | Method to process events generated from the browser.
Parameters: event - the generated event |
prepareCell | abstract protected void prepareCell(int row, int column)(Code) | | Subclasses must implement this method. It allows them to decide what to do
just before a cell is accessed. If the cell already exists, this method
must do nothing. Otherwise, a subclass must either ensure that the cell
exists or throw an
IndexOutOfBoundsException .
Parameters: row - the cell's row Parameters: column - the cell's column |
prepareColumn | protected void prepareColumn(int column)(Code) | | Subclasses can implement this method. It allows them to decide what to do
just before a column is accessed. For classes, such as
FlexTable , that do not have a concept of a global column
length can ignore this method.
Parameters: column - the cell's column throws: IndexOutOfBoundsException - |
prepareRow | abstract protected void prepareRow(int row)(Code) | | Subclasses must implement this method. If the row already exists, this
method must do nothing. Otherwise, a subclass must either ensure that the
row exists or throw an
IndexOutOfBoundsException .
Parameters: row - the cell's row |
remove | public boolean remove(Widget widget)(Code) | | Remove the specified widget from the table.
Parameters: widget - widget to remove was the widget removed from the table. |
removeCell | protected void removeCell(int row, int column)(Code) | | Removes the specified cell from the table.
Parameters: row - the row of the cell to remove Parameters: column - the column of cell to remove throws: IndexOutOfBoundsException - |
removeRow | protected void removeRow(int row)(Code) | | Removes the specified row from the table.
Parameters: row - the index of the row to be removed throws: IndexOutOfBoundsException - |
removeTableListener | public void removeTableListener(TableListener listener)(Code) | | Removes the specified table listener.
Parameters: listener - listener to remove |
setBorderWidth | public void setBorderWidth(int width)(Code) | | Sets the width of the table's border. This border is displayed around all
cells in the table.
Parameters: width - the width of the border, in pixels |
setCellFormatter | protected void setCellFormatter(CellFormatter cellFormatter)(Code) | | Sets the table's CellFormatter.
Parameters: cellFormatter - the table's cell formatter |
setCellPadding | public void setCellPadding(int padding)(Code) | | Sets the amount of padding to be added around all cells.
Parameters: padding - the cell padding, in pixels |
setCellSpacing | public void setCellSpacing(int spacing)(Code) | | Sets the amount of spacing to be added around all cells.
Parameters: spacing - the cell spacing, in pixels |
setColumnFormatter | protected void setColumnFormatter(ColumnFormatter formatter)(Code) | | |
setHTML | public void setHTML(int row, int column, String html)(Code) | | Sets the HTML contents of the specified cell.
Parameters: row - the cell's row Parameters: column - the cell's column Parameters: html - the cell's HTML contents throws: IndexOutOfBoundsException - |
setRowFormatter | protected void setRowFormatter(RowFormatter rowFormatter)(Code) | | Sets the table's RowFormatter.
Parameters: rowFormatter - the table's row formatter |
setText | public void setText(int row, int column, String text)(Code) | | Sets the text within the specified cell.
Parameters: row - the cell's row Parameters: column - cell's column Parameters: text - the cell's text contents throws: IndexOutOfBoundsException - |
setWidget | public void setWidget(int row, int column, Widget widget)(Code) | | Sets the widget within the specified cell.
Inherited implementations may either throw IndexOutOfBounds exception if
the cell does not exist, or allocate a new cell to store the content.
FlexTable will automatically allocate the cell at the correct location and
then set the widget. Grid will set the widget if and only if the cell is
within the Grid's bounding box.
Parameters: widget - The widget to be added Parameters: row - the cell's row Parameters: column - the cell's column throws: IndexOutOfBoundsException - |
|
|