|
GWT 2.4.0 | |||||||||
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.Composite
com.google.gwt.user.cellview.client.AbstractHasData<T>
com.google.gwt.user.cellview.client.AbstractCellTable<T>
T
- the data type of each rowpublic abstract class AbstractCellTable<T>
Abstract base class for tabular views that supports paging and columns.
Column
class defines the Cell
used to
render a column. Implement Column.getValue(Object)
to retrieve the
field value from the row object that will be rendered in the Cell
.
Header
can be placed at the top
(header) or bottom (footer) of the AbstractCellTable
. You can specify
a header as text using addColumn(Column, String)
, or you can create
a custom Header
that can change with the value of the cells, such as
a column total. The Header
will be rendered every time the row data
changes or the table is redrawn. If you pass the same header instance (==)
into adjacent columns, the header will span the columns.
Nested Class Summary | |
---|---|
static interface |
AbstractCellTable.Resources
A ClientBundle that provides images for this widget. |
static interface |
AbstractCellTable.Style
Styles used by this widget. |
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled |
Nested classes/interfaces inherited from interface com.google.gwt.user.cellview.client.HasKeyboardPagingPolicy |
---|
HasKeyboardPagingPolicy.KeyboardPagingPolicy |
Nested classes/interfaces inherited from interface com.google.gwt.user.cellview.client.HasKeyboardSelectionPolicy |
---|
HasKeyboardSelectionPolicy.KeyboardSelectionPolicy |
Field Summary |
---|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
AbstractCellTable(Element elem,
int pageSize,
AbstractCellTable.Resources resources,
ProvidesKey<T> keyProvider)
Constructs a table with the given page size, the specified AbstractCellTable.Style ,
and the given key provider. |
|
AbstractCellTable(Widget widget,
int pageSize,
AbstractCellTable.Resources resources,
ProvidesKey<T> keyProvider)
Constructs a table with the given page size, the specified AbstractCellTable.Style ,
and the given key provider. |
Method Summary | |
---|---|
void |
addColumn(Column<T,?> col)
Adds a column to the end of the table. |
void |
addColumn(Column<T,?> col,
Header<?> header)
Adds a column to the end of the table with an associated header. |
void |
addColumn(Column<T,?> col,
Header<?> header,
Header<?> footer)
Adds a column to the end of the table with an associated header and footer. |
void |
addColumn(Column<T,?> col,
SafeHtml headerHtml)
Adds a column to the end of the table with an associated SafeHtml
header. |
void |
addColumn(Column<T,?> col,
SafeHtml headerHtml,
SafeHtml footerHtml)
Adds a column to the end of the table with an associated SafeHtml
header and footer. |
void |
addColumn(Column<T,?> col,
java.lang.String headerString)
Adds a column to the end of the table with an associated String header. |
void |
addColumn(Column<T,?> col,
java.lang.String headerString,
java.lang.String footerString)
Adds a column to the end of the table with an associated String header and footer. |
HandlerRegistration |
addColumnSortHandler(ColumnSortEvent.Handler handler)
Add a handler to handle ColumnSortEvent s. |
abstract void |
addColumnStyleName(int index,
java.lang.String styleName)
Add a style name to the col element at the specified index,
creating it if necessary. |
void |
clearColumnWidth(Column<T,?> column)
Clear the width of the specified Column . |
protected Element |
convertToElements(SafeHtml html)
Convert the specified HTML into DOM elements and return the parent of the DOM elements. |
protected boolean |
dependsOnSelection()
Check whether or not the cells in the view depend on the selection state. |
protected void |
doSelection(Event event,
T value,
int row,
int column)
Deprecated. use AbstractHasData.addCellPreviewHandler(com.google.gwt.view.client.CellPreviewEvent.Handler)
instead |
protected abstract void |
doSetColumnWidth(int column,
java.lang.String width)
Set the width of a column. |
protected abstract void |
doSetHeaderVisible(boolean isFooter,
boolean isVisible)
Show or hide a header section. |
void |
flush()
Flush all pending changes to the table and render immediately. |
protected Element |
getChildContainer()
Return the element that holds the rendered cells. |
Column<T,?> |
getColumn(int col)
Get the column at the specified index. |
int |
getColumnCount()
Get the number of columns in the table. |
int |
getColumnIndex(Column<T,?> column)
Get the index of the specified column. |
ColumnSortList |
getColumnSortList()
Get the ColumnSortList that specifies which columns are sorted. |
java.lang.String |
getColumnWidth(Column<T,?> column)
Get the width of a Column . |
Widget |
getEmptyTableWidget()
Get the widget displayed when the table has no rows. |
protected Element |
getKeyboardSelectedElement()
Get the element that has keyboard selection. |
Widget |
getLoadingIndicator()
Get the widget displayed when the data is loading. |
TableRowElement |
getRowElement(int row)
Get the TableRowElement for the specified row. |
protected abstract TableSectionElement |
getTableBodyElement()
Get the tbody element that contains the render row values. |
protected abstract TableSectionElement |
getTableFootElement()
Get the tfoot element that contains the footers. |
protected abstract TableSectionElement |
getTableHeadElement()
Get the thead element that contains theh eaders. |
void |
insertColumn(int beforeIndex,
Column<T,?> col)
Inserts a column into the table at the specified index. |
void |
insertColumn(int beforeIndex,
Column<T,?> col,
Header<?> header)
Inserts a column into the table at the specified index with an associated header. |
void |
insertColumn(int beforeIndex,
Column<T,?> col,
Header<?> header,
Header<?> footer)
Inserts a column into the table at the specified index with an associated header and footer. |
void |
insertColumn(int beforeIndex,
Column<T,?> col,
SafeHtml headerHtml)
Inserts a column into the table at the specified index with an associated SafeHtml header. |
void |
insertColumn(int beforeIndex,
Column<T,?> col,
SafeHtml headerHtml,
SafeHtml footerHtml)
Inserts a column into the table at the specified index with an associated SafeHtml header and footer. |
void |
insertColumn(int beforeIndex,
Column<T,?> col,
java.lang.String headerString)
Inserts a column into the table at the specified index with an associated String header. |
void |
insertColumn(int beforeIndex,
Column<T,?> col,
java.lang.String headerString,
java.lang.String footerString)
Inserts a column into the table at the specified index with an associated String header and footer. |
protected boolean |
isKeyboardNavigationSuppressed()
Check if keyboard navigation is being suppressed, such as when the user is editing a cell. |
protected void |
onBlur()
Called when the widget is blurred. |
protected void |
onBrowserEvent2(Event event)
Called after AbstractHasData.onBrowserEvent(Event) completes. |
protected void |
onFocus()
Called when the widget is focused. |
void |
redraw()
Redraw the widget using the existing data. |
void |
redrawFooters()
Redraw the table's footers. |
void |
redrawHeaders()
Redraw the table's headers. |
protected void |
refreshColumnWidths()
|
void |
removeColumn(Column<T,?> col)
Remove a column. |
void |
removeColumn(int index)
Remove a column. |
abstract void |
removeColumnStyleName(int index,
java.lang.String styleName)
Remove a style from the col element at the specified index. |
protected void |
renderRowValues(SafeHtmlBuilder sb,
java.util.List<T> values,
int start,
SelectionModel<? super T> selectionModel)
Render all row values into the specified SafeHtmlBuilder . |
protected void |
replaceAllChildren(java.util.List<T> values,
SafeHtml html)
Replace all children with the specified html. |
protected boolean |
resetFocusOnCell()
Reset focus on the currently focused cell. |
void |
setColumnWidth(Column<T,?> column,
double width,
Style.Unit unit)
Set the width of a Column . |
void |
setColumnWidth(Column<T,?> column,
java.lang.String width)
Set the width of a Column . |
void |
setEmptyTableWidget(Widget widget)
Set the widget to display when the table has no rows. |
protected void |
setKeyboardSelected(int index,
boolean selected,
boolean stealFocus)
Update an element to reflect its keyboard selected state. |
void |
setLoadingIndicator(Widget widget)
Set the widget to display when the data is loading. |
void |
setRowStyles(RowStyles<T> rowStyles)
Sets the object used to determine how a row is styled; the change will take effect the next time that the table is rendered. |
protected void |
setSelected(Element elem,
boolean selected)
Deprecated. this method is never called by AbstractHasData, render the selected styles in renderRowValues(SafeHtmlBuilder, List, int, SelectionModel) |
Methods inherited from class com.google.gwt.user.client.ui.Composite |
---|
getWidget, initWidget, isAttached, onAttach, onDetach, performDetachedInitialization, render, render, resolvePotentialElement, setWidget, wrapElement |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, removeFromParent, setLayoutData, sinkEvents |
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, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
public AbstractCellTable(Element elem, int pageSize, AbstractCellTable.Resources resources, ProvidesKey<T> keyProvider)
AbstractCellTable.Style
,
and the given key provider.
elem
- the parent Element
pageSize
- the page sizeresources
- the resources to apply to the widgetkeyProvider
- an instance of ProvidesKeypublic AbstractCellTable(Widget widget, int pageSize, AbstractCellTable.Resources resources, ProvidesKey<T> keyProvider)
AbstractCellTable.Style
,
and the given key provider.
widget
- the parent widgetpageSize
- the page sizeresources
- the resources to apply to the widgetkeyProvider
- an instance of ProvidesKeyMethod Detail |
---|
public void addColumn(Column<T,?> col)
col
- the column to be addedpublic void addColumn(Column<T,?> col, Header<?> header)
col
- the column to be addedheader
- the associated Header
public void addColumn(Column<T,?> col, Header<?> header, Header<?> footer)
col
- the column to be addedheader
- the associated Header
footer
- the associated footer (as a Header
object)public void addColumn(Column<T,?> col, java.lang.String headerString)
col
- the column to be addedheaderString
- the associated header text, as a Stringpublic void addColumn(Column<T,?> col, SafeHtml headerHtml)
SafeHtml
header.
col
- the column to be addedheaderHtml
- the associated header text, as safe HTMLpublic void addColumn(Column<T,?> col, java.lang.String headerString, java.lang.String footerString)
col
- the column to be addedheaderString
- the associated header text, as a StringfooterString
- the associated footer text, as a Stringpublic void addColumn(Column<T,?> col, SafeHtml headerHtml, SafeHtml footerHtml)
SafeHtml
header and footer.
col
- the column to be addedheaderHtml
- the associated header text, as safe HTMLfooterHtml
- the associated footer text, as safe HTMLpublic HandlerRegistration addColumnSortHandler(ColumnSortEvent.Handler handler)
ColumnSortEvent
s.
handler
- the ColumnSortEvent.Handler
to add
HandlerRegistration
to remove the handlerpublic abstract void addColumnStyleName(int index, java.lang.String styleName)
col
element at the specified index,
creating it if necessary.
index
- the column indexstyleName
- the style name to addpublic void clearColumnWidth(Column<T,?> column)
Column
.
column
- the columnpublic void flush()
Modifications to the table, such as adding columns or setting data, are not rendered immediately. Instead, changes are coalesced at the end of the current event loop to avoid rendering the table multiple times. Use this method to force the table to render all pending modifications immediately.
public Column<T,?> getColumn(int col)
col
- the index of the column to retrieve
Column
at the indexpublic int getColumnCount()
public int getColumnIndex(Column<T,?> column)
column
- the column to search for
public ColumnSortList getColumnSortList()
ColumnSortList
that specifies which columns are sorted.
Modifications to the ColumnSortList
will be reflected in the table
header.
ColumnSortList
public java.lang.String getColumnWidth(Column<T,?> column)
Column
.
column
- the column
#setColumnWidth(Column, double, Unit)
public Widget getEmptyTableWidget()
public Widget getLoadingIndicator()
public TableRowElement getRowElement(int row)
TableRowElement
for the specified row. If the row element
has not been created, null is returned.
row
- the row index
java.lang.IndexOutOfBoundsException
- if the row index is outside of the
current pagepublic void insertColumn(int beforeIndex, Column<T,?> col)
beforeIndex
- the index to insert the columncol
- the column to be addedpublic void insertColumn(int beforeIndex, Column<T,?> col, Header<?> header)
beforeIndex
- the index to insert the columncol
- the column to be addedheader
- the associated Header
public void insertColumn(int beforeIndex, Column<T,?> col, Header<?> header, Header<?> footer)
beforeIndex
- the index to insert the columncol
- the column to be addedheader
- the associated Header
footer
- the associated footer (as a Header
object)
java.lang.IndexOutOfBoundsException
- if the index is out of rangepublic void insertColumn(int beforeIndex, Column<T,?> col, java.lang.String headerString)
beforeIndex
- the index to insert the columncol
- the column to be addedheaderString
- the associated header text, as a Stringpublic void insertColumn(int beforeIndex, Column<T,?> col, SafeHtml headerHtml)
SafeHtml
header.
beforeIndex
- the index to insert the columncol
- the column to be addedheaderHtml
- the associated header text, as safe HTMLpublic void insertColumn(int beforeIndex, Column<T,?> col, java.lang.String headerString, java.lang.String footerString)
beforeIndex
- the index to insert the columncol
- the column to be addedheaderString
- the associated header text, as a StringfooterString
- the associated footer text, as a Stringpublic void insertColumn(int beforeIndex, Column<T,?> col, SafeHtml headerHtml, SafeHtml footerHtml)
SafeHtml
header and footer.
beforeIndex
- the index to insert the columncol
- the column to be addedheaderHtml
- the associated header text, as safe HTMLfooterHtml
- the associated footer text, as safe HTMLpublic void redraw()
AbstractHasData
redraw
in class AbstractHasData<T>
public void redrawFooters()
public void redrawHeaders()
public void removeColumn(Column<T,?> col)
col
- the column to removepublic void removeColumn(int index)
index
- the column indexpublic abstract void removeColumnStyleName(int index, java.lang.String styleName)
col
element at the specified index.
index
- the column indexstyleName
- the style name to removepublic void setColumnWidth(Column<T,?> column, java.lang.String width)
Column
.
column
- the columnwidth
- the width of the columnpublic void setColumnWidth(Column<T,?> column, double width, Style.Unit unit)
Column
.
column
- the columnwidth
- the width of the columnunit
- the Style.Unit
of measurementpublic void setEmptyTableWidget(Widget widget)
widget
- the empty table widget, or null to disablepublic void setLoadingIndicator(Widget widget)
widget
- the loading indicator, or null to disablepublic void setRowStyles(RowStyles<T> rowStyles)
rowStyles
- a RowStyles
objectprotected Element convertToElements(SafeHtml html)
AbstractHasData
convertToElements
in class AbstractHasData<T>
html
- the HTML to convert
protected boolean dependsOnSelection()
AbstractHasData
dependsOnSelection
in class AbstractHasData<T>
@Deprecated protected void doSelection(Event event, T value, int row, int column)
AbstractHasData.addCellPreviewHandler(com.google.gwt.view.client.CellPreviewEvent.Handler)
instead
event
- the event that triggered selectionvalue
- the value that was selectedrow
- the row index of the value on the pagecolumn
- the column index where the event occurredprotected abstract void doSetColumnWidth(int column, java.lang.String width)
column
- the column indexwidth
- the width, or null to clear the widthprotected abstract void doSetHeaderVisible(boolean isFooter, boolean isVisible)
isFooter
- true for the footer, false for the headerisVisible
- true to show, false to hideprotected Element getChildContainer()
AbstractHasData
getChildContainer
in class AbstractHasData<T>
Element
protected Element getKeyboardSelectedElement()
AbstractHasData
getKeyboardSelectedElement
in class AbstractHasData<T>
protected abstract TableSectionElement getTableBodyElement()
protected abstract TableSectionElement getTableFootElement()
protected abstract TableSectionElement getTableHeadElement()
protected boolean isKeyboardNavigationSuppressed()
AbstractHasData
isKeyboardNavigationSuppressed
in class AbstractHasData<T>
protected void onBlur()
AbstractHasData
onBlur
in class AbstractHasData<T>
protected void onBrowserEvent2(Event event)
AbstractHasData
AbstractHasData.onBrowserEvent(Event)
completes.
onBrowserEvent2
in class AbstractHasData<T>
event
- the event that was firedprotected void onFocus()
AbstractHasData
onFocus
in class AbstractHasData<T>
protected void refreshColumnWidths()
protected void renderRowValues(SafeHtmlBuilder sb, java.util.List<T> values, int start, SelectionModel<? super T> selectionModel)
AbstractHasData
SafeHtmlBuilder
.
renderRowValues
in class AbstractHasData<T>
sb
- the SafeHtmlBuilder
to render intovalues
- the row valuesstart
- the absolute start index of the valuesselectionModel
- the SelectionModel
protected void replaceAllChildren(java.util.List<T> values, SafeHtml html)
AbstractHasData
replaceAllChildren
in class AbstractHasData<T>
values
- the values of the new childrenhtml
- the html to render in the childprotected boolean resetFocusOnCell()
AbstractHasData
resetFocusOnCell
in class AbstractHasData<T>
protected void setKeyboardSelected(int index, boolean selected, boolean stealFocus)
AbstractHasData
setKeyboardSelected
in class AbstractHasData<T>
index
- the index of the elementselected
- true if selected, false if notstealFocus
- true if the row should steal focus, false if not@Deprecated protected void setSelected(Element elem, boolean selected)
renderRowValues(SafeHtmlBuilder, List, int, SelectionModel)
AbstractHasData
setSelected
in class AbstractHasData<T>
elem
- the element to updateselected
- true if selected, false if not
|
GWT 2.4.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |