|
||||||||||
| 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
public abstract class HTMLTable
HTMLTable contains the common table algorithms for
Grid and
FlexTable.
| Nested Class Summary | |
|---|---|
class |
HTMLTable.Cell
Return value for getCellForEvent(com.google.gwt.event.dom.client.ClickEvent). |
class |
HTMLTable.CellFormatter
This class contains methods used to format a table's cells. |
class |
HTMLTable.ColumnFormatter
This class contains methods used to format a table's columns. |
class |
HTMLTable.RowFormatter
This class contains methods used to format a table's rows. |
| 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 | |
|---|---|
HTMLTable()
Create a new empty HTML Table. |
|
| Method Summary | |
|---|---|
HandlerRegistration |
addClickHandler(ClickHandler handler)
Adds a ClickEvent handler. |
void |
addTableListener(TableListener listener)
Deprecated. add a click handler instead and use getCellForEvent(ClickEvent) to get the cell
information (remember to check for a null return value) |
void |
clear()
Removes all widgets from this table, but does not remove other HTML or text contents of cells. |
void |
clear(boolean clearInnerHTML)
Removes all widgets from this table, optionally clearing the inner HTML of each cell. |
boolean |
clearCell(int row,
int column)
Clears the cell at the given row and column. |
abstract int |
getCellCount(int row)
Gets the number of cells in a given row. |
HTMLTable.Cell |
getCellForEvent(ClickEvent event)
Given a click event, return the Cell that was clicked, or null if the event did not hit this table. |
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. |
HTMLTable.ColumnFormatter |
getColumnFormatter()
Gets the column formatter. |
java.lang.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. |
java.lang.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. |
boolean |
isCellPresent(int row,
int column)
Determines whether the specified cell exists. |
java.util.Iterator<Widget> |
iterator()
Returns an iterator containing all the widgets in this table. |
boolean |
remove(Widget widget)
Remove the specified widget from the table. |
void |
removeTableListener(TableListener listener)
Deprecated. Use the HandlerRegistration.removeHandler()
method on the object returned by an add*Handler method instead |
void |
setBorderWidth(int width)
Sets the width of the table's border. |
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,
java.lang.String html)
Sets the HTML contents of the specified cell. |
void |
setText(int row,
int column,
java.lang.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 |
|---|
add |
| Methods inherited from class com.google.gwt.user.client.ui.Widget |
|---|
fireEvent, getLayoutData, getParent, isAttached, onBrowserEvent, removeFromParent, setLayoutData, sinkEvents |
| Methods inherited from class com.google.gwt.user.client.ui.UIObject |
|---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStylePrimaryName, getTitle, isVisible, isVisible, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
public HTMLTable()
| Method Detail |
|---|
public HandlerRegistration addClickHandler(ClickHandler handler)
HasClickHandlersClickEvent handler.
addClickHandler in interface HasClickHandlershandler - the click handler
HandlerRegistration used to remove this handler@Deprecated public void addTableListener(TableListener listener)
getCellForEvent(ClickEvent) to get the cell
information (remember to check for a null return value)
addTableListener in interface SourcesTableEventslistener - listener to addpublic void clear()
clear in interface HasWidgetsclear in class Panelpublic void clear(boolean clearInnerHTML)
clearInnerHTML - should the cell's inner html be cleared?
public boolean clearCell(int row,
int column)
row - the widget's rowcolumn - the widget's column
java.lang.IndexOutOfBoundsExceptionpublic abstract int getCellCount(int row)
row - the row whose cells are to be counted
public HTMLTable.Cell getCellForEvent(ClickEvent event)
event - A click event of indeterminate origin
public HTMLTable.CellFormatter getCellFormatter()
HTMLTable.CellFormatter associated with this table. Use casting to
get subclass-specific functionality
public int getCellPadding()
public int getCellSpacing()
public HTMLTable.ColumnFormatter getColumnFormatter()
public java.lang.String getHTML(int row,
int column)
row - the cell's rowcolumn - the cell's column
java.lang.IndexOutOfBoundsExceptionpublic abstract int getRowCount()
public HTMLTable.RowFormatter getRowFormatter()
public java.lang.String getText(int row,
int column)
row - the cell's rowcolumn - the cell's column
java.lang.IndexOutOfBoundsException
public Widget getWidget(int row,
int column)
row - the cell's rowcolumn - the cell's column
null if none is
present
java.lang.IndexOutOfBoundsException
public boolean isCellPresent(int row,
int column)
row - the cell's rowcolumn - the cell's column
true if the specified cell existspublic java.util.Iterator<Widget> iterator()
iterator in interface HasWidgetsiterator in interface java.lang.Iterable<Widget>public boolean remove(Widget widget)
remove in interface HasWidgetsremove in class Panelwidget - widget to remove
@Deprecated public void removeTableListener(TableListener listener)
HandlerRegistration.removeHandler()
method on the object returned by an add*Handler method instead
removeTableListener in interface SourcesTableEventslistener - listener 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)
spacing - the cell spacing, in pixels
public void setHTML(int row,
int column,
java.lang.String html)
row - the cell's rowcolumn - the cell's columnhtml - the cell's HTML contents
java.lang.IndexOutOfBoundsException
public void setText(int row,
int column,
java.lang.String text)
row - the cell's rowcolumn - cell's columntext - the cell's text contents
java.lang.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.
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.
widget - The widget to be addedrow - the cell's rowcolumn - the cell's column
java.lang.IndexOutOfBoundsException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||