|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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
HTMLTable contains the common table algorithms for
Grid
and
FlexTable
.
Nested Class Summary | |
class |
HTMLTable.CellFormatter
This class contains methods used to format a table's cells. |
class |
HTMLTable.RowFormatter
This class contains methods used to format a table's rows. |
Field Summary |
Fields inherited from class java.lang.Object |
typeId, typeName |
Constructor Summary | |
HTMLTable()
|
Method Summary | |
boolean |
add(Widget w)
This method is not implemented, as widgets must be added to specific cells in the table. |
void |
addTableListener(TableListener listener)
Adds a listener interface to receive click events. |
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. |
void |
clear()
Removes all widgets from this table, but does not remove other HTML or text contents of cells. |
boolean |
clearCell(int row,
int column)
Clears the given row and column. |
protected String |
computeKey(int row,
int column)
Gets the key associated with the cell. |
protected Element |
createCell()
Creates a new cell. |
protected Element |
getBodyElement()
Gets the table's TBODY element. |
abstract int |
getCellCount(int row)
Gets the number of cells in a given row. |
HTMLTable.CellFormatter |
getCellFormatter()
Gets the HTMLTable.CellFormatter associated with this table. |
int |
getCellPadding()
Gets the amount of padding that is added around all cells. |
int |
getCellSpacing()
Gets the amount of spacing that is added around all cells. |
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. |
String |
getHTML(int row,
int column)
Gets the HTML contents of the specified cell. |
abstract int |
getRowCount()
Gets the number of rows present in this table. |
HTMLTable.RowFormatter |
getRowFormatter()
Gets the RowFormatter associated with this table. |
String |
getText(int row,
int column)
Gets the text within the specified cell. |
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(int row,
int column,
Element td)
Does actual clearing, used by clearCell and cleanCell. |
boolean |
isCellPresent(int row,
int column)
Determines whether the specified cell exists. |
Iterator |
iterator()
Gets an iterator for the contained widgets. |
void |
onBrowserEvent(Event event)
Fired whenever a browser event is received. |
protected abstract void |
prepareCell(int row,
int column)
Subclasses must implement this method. |
protected abstract void |
prepareRow(int row)
Subclasses must implement this method. |
boolean |
remove(Widget widget)
Removes a widget from the panel. |
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. |
void |
removeTableListener(TableListener listener)
Removes a previously added listener interface. |
void |
setBorderWidth(int width)
Sets the width of the table's border. |
protected void |
setCellFormatter(HTMLTable.CellFormatter cellFormatter)
Sets the table's CellFormatter. |
void |
setCellPadding(int padding)
Sets the amount of padding to be added around all cells. |
void |
setCellSpacing(int spacing)
Sets the amount of spacing to be added around all cells. |
void |
setHTML(int row,
int column,
String html)
Sets the HTML contents of the specified cell. |
protected void |
setRowFormatter(HTMLTable.RowFormatter rowFormatter)
Sets the table's RowFormatter. |
void |
setText(int row,
int column,
String text)
Sets the text within the specified cell. |
void |
setWidget(int row,
int column,
Widget widget)
Sets the widget within the specified cell. |
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 |
public HTMLTable()
Method Detail |
public boolean add(Widget w)
add
in class Panel
w
- the child widget to be added
true
on success (some panels place restrictions on
how children may be added or inserted)public void addTableListener(TableListener listener)
SourcesTableEvents
addTableListener
in interface SourcesTableEvents
listener
- the listener interface to addpublic void clear()
clear
in class Panel
public boolean clearCell(int row, int column)
row
- the widget's columncolumn
- the widget's column
IndexOutOfBoundsException
public abstract int getCellCount(int row)
row
- the row whose cells are to be counted
public HTMLTable.CellFormatter getCellFormatter()
HTMLTable.CellFormatter
associated with this table.
public int getCellPadding()
public int getCellSpacing()
public String getHTML(int row, int column)
row
- the cell's rowcolumn
- the cell's column
IndexOutOfBoundsException
public abstract int getRowCount()
public HTMLTable.RowFormatter getRowFormatter()
public String getText(int row, int column)
row
- the cell's rowcolumn
- the cell's column
IndexOutOfBoundsException
public Widget getWidget(int row, int column)
row
- the cell's rowcolumn
- the cell's column
null
if none is
present
IndexOutOfBoundsException
public boolean isCellPresent(int row, int column)
row
- the cell's rowcolumn
- the cell's column
true
if the specified cell existspublic Iterator iterator()
HasWidgets
iterator
in interface HasWidgets
public void onBrowserEvent(Event event)
EventListener
onBrowserEvent
in interface EventListener
onBrowserEvent
in class Widget
public boolean remove(Widget widget)
Panel
remove
in class Panel
widget
- the widget to be removed
true
if the widget was presentpublic void removeTableListener(TableListener listener)
SourcesTableEvents
removeTableListener
in interface SourcesTableEvents
listener
- the listener interface to removepublic void setBorderWidth(int width)
width
- the width of the border, in pixelspublic void setCellPadding(int padding)
padding
- the cell padding, in pixelspublic void setCellSpacing(int spacing)
public void setHTML(int row, int column, String html)
row
- the cell's rowcolumn
- the cell's columnhtml
- the cell's HTML contents
IndexOutOfBoundsException
public void setText(int row, int column, String text)
row
- the cell's rowcolumn
- cell's columntext
- the cell's text contents
IndexOutOfBoundsException
public void setWidget(int row, int column, Widget widget)
Inherited implementations may either throw IndexOutOfBounds exception if the cell does not exist, or allocate a new cell to store the content
widget
- The widget to be addedrow
- the cell's rowcolumn
- the cell's column
IndexOutOfBoundsException
protected void checkCellBounds(int row, int column)
row
- cell's rowcolumn
- cell's column
IndexOutOfBoundsException
protected void checkRowBounds(int row)
row
- row index to check
IndexOutOfBoundsException
protected String computeKey(int row, int column)
row
- the cell's rowcolumn
- the cell's column
protected Element createCell()
protected Element getBodyElement()
protected int getDOMCellCount(int row)
row
- the row
protected int getDOMRowCount()
protected void insertCell(int row, int column)
row
- the row into which the new cell will be insertedcolumn
- the column before which the cell will be inserted
IndexOutOfBoundsException
protected void insertCells(int row, int column, int count)
row
- the row into which the new cells will be insertedcolumn
- the column before which the new cells will be insertedcount
- number of cells to be inserted
IndexOutOfBoundsException
protected int insertRow(int beforeRow)
beforeRow
- the index before which the new row will be inserted
IndexOutOfBoundsException
protected boolean internalClearCell(int row, int column, Element td)
protected abstract void prepareCell(int row, int column)
IndexOutOfBoundsException
.
row
- the cell's rowcolumn
- the cell's columnprotected abstract void prepareRow(int row)
IndexOutOfBoundsException
.
row
- the cell's rowprotected void removeCell(int row, int column)
row
- the row of the cell to removecolumn
- the column of cell to remove
IndexOutOfBoundsException
protected void removeRow(int row)
row
- the index of the row to be removed
IndexOutOfBoundsException
protected void setCellFormatter(HTMLTable.CellFormatter cellFormatter)
cellFormatter
- the table's cell formatterprotected void setRowFormatter(HTMLTable.RowFormatter rowFormatter)
rowFormatter
- the table's row formatter
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |