T
- the data type of each rowpublic abstract class AbstractCellTable<T> extends AbstractHasData<T>
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.
Modifier and Type | Class and Description |
---|---|
static class |
AbstractCellTable.CellTableKeyboardSelectionHandler<T>
Default implementation of a keyboard navigation handler for tables that
supports navigation between cells.
|
static interface |
AbstractCellTable.Resources
A ClientBundle that provides images for this widget.
|
static interface |
AbstractCellTable.Style
Styles used by this widget.
|
protected static interface |
AbstractCellTable.TableSectionChangeHandler
Interface that this class's subclass may implement to get notified with table section change
event.
|
(package private) static interface |
AbstractCellTable.Template |
AbstractHasData.DefaultKeyboardSelectionHandler<T>, AbstractHasData.RedrawEvent
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasKeyboardPagingPolicy.KeyboardPagingPolicy
HasKeyboardSelectionPolicy.KeyboardSelectionPolicy
isFocused
DEBUG_ID_PREFIX
Constructor and Description |
---|
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. |
Modifier and Type | Method and Description |
---|---|
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. |
HandlerRegistration |
addRowHoverHandler(RowHoverEvent.Handler handler)
Add a handler to handle
RowHoverEvent s. |
void |
clearColumnWidth(Column<T,?> column)
Clear the width of the specified
Column . |
void |
clearColumnWidth(java.lang.Integer 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 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.
|
protected TableRowElement |
getChildElement(int row)
Get the element that represents the specified index.
|
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 . |
(package private) java.lang.String |
getColumnWidth(int columnIndex)
Get the column width.
|
Widget |
getEmptyTableWidget()
Get the widget displayed when the table has no rows.
|
Header<?> |
getFooter(int index)
|
FooterBuilder<T> |
getFooterBuilder()
Get the
HeaderBuilder used to generate the footer section. |
Header<?> |
getHeader(int index)
|
HeaderBuilder<T> |
getHeaderBuilder()
Get the
HeaderBuilder used to generate the header section. |
int |
getKeyboardSelectedColumn()
Get the index of the column that is currently selected via the keyboard.
|
protected Element |
getKeyboardSelectedElement()
Get the element that has keyboard selection.
|
int |
getKeyboardSelectedSubRow()
Get the index of the sub row that is currently selected via the keyboard.
|
Widget |
getLoadingIndicator()
Get the widget displayed when the data is loading.
|
protected int |
getRealColumnCount()
Get the real column count, which is the greater of the number of Columns or
the maximum index of a column with a defined column width.
|
AbstractCellTable.Resources |
getResources()
Get the resources used by this table.
|
TableRowElement |
getRowElement(int row)
Get the
TableRowElement for the specified row. |
RowStyles<T> |
getRowStyles()
Gets the object used to determine how a row is styled.
|
protected TableRowElement |
getSubRowElement(int absRow,
int subrow)
Get a subrow element given the index of the row value and the sub row
index.
|
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 the headers.
|
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.
|
boolean |
isAutoFooterRefreshDisabled()
Check if auto footer refresh is enabled or disabled.
|
boolean |
isAutoHeaderRefreshDisabled()
Check if auto header refresh is enabled or disabled.
|
protected boolean |
isKeyboardNavigationSuppressed()
Check if keyboard navigation is being suppressed, such as when the user is
editing a cell.
|
boolean |
isSkipRowHoverCheck()
Gets the skipRowHoverCheck flag.
|
boolean |
isSkipRowHoverFloatElementCheck()
Gets the skipRowHoverFloatElementCheck flag.
|
boolean |
isSkipRowHoverStyleUpdate()
Gets the skipRowHoverStyleUpdate flag.
|
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 |
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)
Deprecated.
as of GWT 2.5, use a
CellTableBuilder to customize the
table structure instead |
protected void |
renderRowValuesLegacy(SafeHtmlBuilder sb,
java.util.List<T> values,
int start,
SelectionModel<? super T> selectionModel)
Deprecated.
as of GWT 2.5, use a
CellTableBuilder to customize the
table structure instead |
protected void |
replaceAllChildren(java.util.List<T> values,
SafeHtml html)
Replace all children with the specified html.
|
protected void |
replaceChildren(java.util.List<T> values,
int start,
SafeHtml html)
Convert the specified HTML into DOM elements and replace the existing
elements starting at the specified index.
|
protected boolean |
resetFocusOnCell()
Reset focus on the currently focused cell.
|
void |
setAutoFooterRefreshDisabled(boolean disabled)
Enable or disable auto footer refresh when row data is changed.
|
void |
setAutoHeaderRefreshDisabled(boolean disabled)
Enable or disable auto header refresh when row data is changed.
|
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 |
setColumnWidth(int column,
double width,
Style.Unit unit)
Set the width of a
Column . |
void |
setColumnWidth(int 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.
|
void |
setFooterBuilder(FooterBuilder<T> builder)
Set the
HeaderBuilder used to build the footer section of the
table. |
void |
setHeaderBuilder(HeaderBuilder<T> builder)
Set the
HeaderBuilder used to build the header section of the
table. |
protected void |
setKeyboardSelected(int index,
boolean selected,
boolean stealFocus)
Update an element to reflect its keyboard selected state.
|
void |
setKeyboardSelectedColumn(int column)
Set the keyboard selected column index.
|
void |
setKeyboardSelectedColumn(int column,
boolean stealFocus)
Set the keyboard selected column index and optionally focus on the new
cell.
|
void |
setKeyboardSelectedRow(int row,
boolean stealFocus)
Set the keyboard selected row and optionally focus on the new row.
|
void |
setKeyboardSelectedRow(int row,
int subrow,
boolean stealFocus)
Set the keyboard selected row and subrow, optionally focus on the new row.
|
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.
|
void |
setSkipRowHoverCheck(boolean skipRowHoverCheck)
Sets the skipRowHoverCheck flag.
|
void |
setSkipRowHoverFloatElementCheck(boolean skipRowHoverFloatElementCheck)
Sets the skipRowHoverFloatElementCheck flag.
|
void |
setSkipRowHoverStyleUpdate(boolean skipRowHoverStyleUpdate)
Sets the skipRowHoverStyleUpdate flag.
|
void |
setTableBuilder(CellTableBuilder<T> tableBuilder)
Specify the
CellTableBuilder that will be used to render the row
values into the table. |
addCellPreviewHandler, addLoadingStateChangeHandler, addRangeChangeHandler, addRedrawHandler, addRowCountChangeHandler, addValueChangeHandler, adopt, cellConsumesEventType, checkRowBounds, convertToElements, doAttach, doDetach, getAccessKey, getDisplayedItem, getDisplayedItems, getKeyboardPagingPolicy, getKeyboardSelectedRow, getKeyboardSelectionPolicy, getKeyProvider, getPageSize, getPageStart, getPresenter, getRowContainer, getRowCount, getSelectionModel, getTabIndex, getValueKey, getVisibleItem, getVisibleItemCount, getVisibleItems, getVisibleRange, isRowCountExact, isRowWithinBounds, onBrowserEvent, onLoadingStateChanged, onUnload, redraw, redrawRow, replaceAllChildren, replaceChildren, setAccessKey, setFocus, setFocusable, setKeyboardPagingPolicy, setKeyboardSelectedRow, setKeyboardSelectionHandler, setKeyboardSelectionPolicy, setPageSize, setPageStart, setRowCount, setRowCount, setRowData, setRowData, setSelected, setSelectionModel, setSelectionModel, setTabIndex, setVisibleRange, setVisibleRange, setVisibleRangeAndClearData, showOrHide
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
fireEvent
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 ProvidesKeypublic 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)
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 addHandlerRegistration
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 HandlerRegistration addRowHoverHandler(RowHoverEvent.Handler handler)
RowHoverEvent
s.handler
- the RowHoverEvent.Handler
to addHandlerRegistration
to remove the handlerpublic void clearColumnWidth(Column<T,?> column)
Column
.column
- the columnpublic void clearColumnWidth(java.lang.Integer column)
Column
.column
- the column indexpublic 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 retrieveColumn
at the indexpublic int getColumnCount()
public int getColumnIndex(Column<T,?> column)
column
- the column to search forpublic ColumnSortList getColumnSortList()
ColumnSortList
that specifies which columns are sorted.
Modifications to the ColumnSortList
will be reflected in the table
header.
Note that the implementation may redraw the headers on every modification
to the ColumnSortList
.
ColumnSortList
public java.lang.String getColumnWidth(Column<T,?> column)
Column
.column
- the column#setColumnWidth(Column, double, Unit)
public Widget getEmptyTableWidget()
public Header<?> getFooter(int index)
public FooterBuilder<T> getFooterBuilder()
HeaderBuilder
used to generate the footer section.public Header<?> getHeader(int index)
public HeaderBuilder<T> getHeaderBuilder()
HeaderBuilder
used to generate the header section.public int getKeyboardSelectedColumn()
public int getKeyboardSelectedSubRow()
public Widget getLoadingIndicator()
public AbstractCellTable.Resources getResources()
public TableRowElement getRowElement(int row)
TableRowElement
for the specified row. If the row element
has not been created, null is returned.row
- the row indexjava.lang.IndexOutOfBoundsException
- if the row index is outside of the
current pagepublic RowStyles<T> getRowStyles()
RowStyles
object if set, null if notpublic 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)
public 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 boolean isAutoFooterRefreshDisabled()
setAutoFooterRefreshDisabled(boolean)
public boolean isAutoHeaderRefreshDisabled()
setAutoHeaderRefreshDisabled(boolean)
public boolean isSkipRowHoverCheck()
public boolean isSkipRowHoverFloatElementCheck()
public boolean isSkipRowHoverStyleUpdate()
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 setAutoFooterRefreshDisabled(boolean disabled)
Note that headers will still refresh when columns are added or removed, regardless of whether or not this feature is enabled.
public void setAutoHeaderRefreshDisabled(boolean disabled)
Note that footers will still refresh when columns are added or removed, regardless of whether or not this feature is enabled.
public void setColumnWidth(Column<T,?> column, java.lang.String width)
Column
. The width will persist with the column
and takes precedence of any width set via
setColumnWidth(int, String)
.column
- the columnwidth
- the width of the columnpublic void setColumnWidth(Column<T,?> column, double width, Style.Unit unit)
Column
. The width will persist with the column
and takes precedence of any width set via
#setColumnWidth(int, double, Unit)
.column
- the columnwidth
- the width of the columnunit
- the Style.Unit
of measurementpublic void setColumnWidth(int column, double width, Style.Unit unit)
Column
.column
- the columnwidth
- the width of the columnunit
- the Style.Unit
of measurementpublic void setColumnWidth(int column, java.lang.String width)
Column
.column
- the columnwidth
- the width of the column@UiChild(tagname="emptyTableWidget", limit=1) public void setEmptyTableWidget(Widget widget)
widget
- the empty table widget, or null to disablepublic void setFooterBuilder(FooterBuilder<T> builder)
HeaderBuilder
used to build the footer section of the
table.public void setHeaderBuilder(HeaderBuilder<T> builder)
HeaderBuilder
used to build the header section of the
table.public final void setKeyboardSelectedColumn(int column)
If keyboard selection is disabled, this method does nothing.
If the keyboard selected column is greater than the number of columns in the keyboard selected row, the last column in the row is selected, but the column index is remembered.
column
- the column index, greater than or equal to zeropublic void setKeyboardSelectedColumn(int column, boolean stealFocus)
column
- the column index, greater than or equal to zerostealFocus
- true to focus on the new columnsetKeyboardSelectedColumn(int)
public void setKeyboardSelectedRow(int row, boolean stealFocus)
AbstractHasData
setKeyboardSelectedRow
in class AbstractHasData<T>
row
- the row index relative to the page startstealFocus
- true to focus on the new rowAbstractHasData.setKeyboardSelectedRow(int)
public void setKeyboardSelectedRow(int row, int subrow, boolean stealFocus)
row
- the row index relative to the page startsubrow
- the row index of the child rowstealFocus
- true to focus on the new rowAbstractHasData.setKeyboardSelectedRow(int)
@UiChild(tagname="loadingIndicator", limit=1) public void setLoadingIndicator(Widget widget)
widget
- the loading indicator, or null to disablepublic void setRowStyles(RowStyles<T> rowStyles)
rowStyles
- a RowStyles
objectpublic void setSkipRowHoverCheck(boolean skipRowHoverCheck)
skipRowHoverCheck
- the new flag valuepublic void setSkipRowHoverFloatElementCheck(boolean skipRowHoverFloatElementCheck)
skipRowHoverFloatElementCheck
- the new flag valuepublic void setSkipRowHoverStyleUpdate(boolean skipRowHoverStyleUpdate)
skipRowHoverCheck
- the new flag valuepublic void setTableBuilder(CellTableBuilder<T> tableBuilder)
CellTableBuilder
that will be used to render the row
values into the table.protected Element convertToElements(SafeHtml html)
AbstractHasData
convertToElements
in class AbstractHasData<T>
html
- the HTML to convertprotected boolean dependsOnSelection()
AbstractHasData
dependsOnSelection
in class AbstractHasData<T>
protected 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 TableRowElement getChildElement(int row)
The row element may not be the same as the TR element at the specified index if some row values are rendered with additional rows.
getChildElement
in class AbstractHasData<T>
row
- the row index, relative to the page startjava.lang.IndexOutOfBoundsException
- if the row index is outside of the
current pageprotected Element getKeyboardSelectedElement()
AbstractHasData
getKeyboardSelectedElement
in class AbstractHasData<T>
protected int getRealColumnCount()
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()
@Deprecated protected void renderRowValues(SafeHtmlBuilder sb, java.util.List<T> values, int start, SelectionModel<? super T> selectionModel)
CellTableBuilder
to customize the
table structure insteadAbstractHasData
SafeHtmlBuilder
.
Subclasses can optionally throw an UnsupportedOperationException
if
they prefer to render the rows in
AbstractHasData.replaceAllChildren(List, SafeHtml)
and
AbstractHasData.replaceChildren(List, int, SafeHtml)
. In this case, the
SafeHtml
argument will be null. Though a bit hacky, this is
designed to supported legacy widgets that use SafeHtmlBuilder
, and
newer widgets that use other builders, such as the ElementBuilder API.
renderRowValues
in class AbstractHasData<T>
sb
- the SafeHtmlBuilder
to render intovalues
- the row valuesstart
- the absolute start index of the valuesselectionModel
- the SelectionModel
renderRowValuesLegacy(SafeHtmlBuilder, List, int, SelectionModel)
@Deprecated protected final void renderRowValuesLegacy(SafeHtmlBuilder sb, java.util.List<T> values, int start, SelectionModel<? super T> selectionModel)
CellTableBuilder
to customize the
table structure insteadSafeHtmlBuilder
.
This method is here for legacy reasons, to support subclasses that call
renderRowValues(SafeHtmlBuilder, List, int, SelectionModel)
.
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, or null if
AbstractHasData.renderRowValues(SafeHtmlBuilder, List, int, SelectionModel)
throws an UnsupportedOperationException
protected void replaceChildren(java.util.List<T> values, int start, SafeHtml html)
AbstractHasData
replaceChildren
in class AbstractHasData<T>
values
- the values of the new childrenstart
- the start index to be replaced, relative to the page starthtml
- the html to render, or null if
AbstractHasData.renderRowValues(SafeHtmlBuilder, List, int, SelectionModel)
throws an UnsupportedOperationException
protected 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 notjava.lang.String getColumnWidth(int columnIndex)
Column
takes
precedence over setting the width of a column index.columnIndex
- the column indexprotected TableRowElement getSubRowElement(int absRow, int subrow)
absRow
- the absolute row value indexsubrow
- the index of the subrow beneath the row.