Class AbstractCellTable<T>
- java.lang.Object
-
- com.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>
-
- Type Parameters:
T- the data type of each row
- All Implemented Interfaces:
HasAttachHandlers,HasHandlers,HasKeyboardPagingPolicy,HasKeyboardSelectionPolicy,EventListener,Focusable,HasVisibility,IsRenderable,IsWidget,HasCellPreviewHandlers<T>,HasData<T>,HasKeyProvider<T>,HasRows
public abstract class AbstractCellTable<T> extends AbstractHasData<T>
Abstract base class for tabular views that supports paging and columns.Columns
TheColumnclass defines theCellused to render a column. ImplementColumn.getValue(Object)to retrieve the field value from the row object that will be rendered in theCell.Headers and Footers
AHeadercan be placed at the top (header) or bottom (footer) of theAbstractCellTable. You can specify a header as text usingaddColumn(Column, String), or you can create a customHeaderthat can change with the value of the cells, such as a column total. TheHeaderwill 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
Nested Classes Modifier and Type Class Description static classAbstractCellTable.CellTableKeyboardSelectionHandler<T>Default implementation of a keyboard navigation handler for tables that supports navigation between cells.static interfaceAbstractCellTable.ResourcesA ClientBundle that provides images for this widget.static interfaceAbstractCellTable.StyleStyles used by this widget.protected static interfaceAbstractCellTable.TableSectionChangeHandlerInterface that this class's subclass may implement to get notified with table section change event.(package private) static interfaceAbstractCellTable.Template-
Nested classes/interfaces inherited from class com.google.gwt.user.cellview.client.AbstractHasData
AbstractHasData.DefaultKeyboardSelectionHandler<T>, AbstractHasData.RedrawEvent
-
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.cellview.client.AbstractHasData
isFocused
-
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
-
-
Constructor Summary
Constructors Constructor Description AbstractCellTable(Element elem, int pageSize, AbstractCellTable.Resources resources, ProvidesKey<T> keyProvider)Constructs a table with the given page size, the specifiedAbstractCellTable.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 specifiedAbstractCellTable.Style, and the given key provider.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddColumn(Column<T,?> col)Adds a column to the end of the table.voidaddColumn(Column<T,?> col, SafeHtml headerHtml)Adds a column to the end of the table with an associatedSafeHtmlheader.voidaddColumn(Column<T,?> col, SafeHtml headerHtml, SafeHtml footerHtml)Adds a column to the end of the table with an associatedSafeHtmlheader and footer.voidaddColumn(Column<T,?> col, Header<?> header)Adds a column to the end of the table with an associated header.voidaddColumn(Column<T,?> col, Header<?> header, Header<?> footer)Adds a column to the end of the table with an associated header and footer.voidaddColumn(Column<T,?> col, java.lang.String headerString)Adds a column to the end of the table with an associated String header.voidaddColumn(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.HandlerRegistrationaddColumnSortHandler(ColumnSortEvent.Handler handler)Add a handler to handleColumnSortEvents.abstract voidaddColumnStyleName(int index, java.lang.String styleName)Add a style name to thecolelement at the specified index, creating it if necessary.HandlerRegistrationaddRowHoverHandler(RowHoverEvent.Handler handler)Add a handler to handleRowHoverEvents.voidclearColumnWidth(Column<T,?> column)Clear the width of the specifiedColumn.voidclearColumnWidth(java.lang.Integer column)Clear the width of the specifiedColumn.protected ElementconvertToElements(SafeHtml html)Convert the specified HTML into DOM elements and return the parent of the DOM elements.protected booleandependsOnSelection()Check whether or not the cells in the view depend on the selection state.protected abstract voiddoSetColumnWidth(int column, java.lang.String width)Set the width of a column.protected abstract voiddoSetHeaderVisible(boolean isFooter, boolean isVisible)Show or hide a header section.voidflush()Flush all pending changes to the table and render immediately.protected ElementgetChildContainer()Return the element that holds the rendered cells.protected TableRowElementgetChildElement(int row)Get the element that represents the specified index.Column<T,?>getColumn(int col)Get the column at the specified index.intgetColumnCount()Get the number of columns in the table.intgetColumnIndex(Column<T,?> column)Get the index of the specified column.ColumnSortListgetColumnSortList()Get theColumnSortListthat specifies which columns are sorted.(package private) java.lang.StringgetColumnWidth(int columnIndex)Get the column width.java.lang.StringgetColumnWidth(Column<T,?> column)Get the width of aColumn.WidgetgetEmptyTableWidget()Get the widget displayed when the table has no rows.Header<?>getFooter(int index)FooterBuilder<T>getFooterBuilder()Get theHeaderBuilderused to generate the footer section.Header<?>getHeader(int index)HeaderBuilder<T>getHeaderBuilder()Get theHeaderBuilderused to generate the header section.intgetKeyboardSelectedColumn()Get the index of the column that is currently selected via the keyboard.protected ElementgetKeyboardSelectedElement()Get the element that has keyboard selection.intgetKeyboardSelectedSubRow()Get the index of the sub row that is currently selected via the keyboard.WidgetgetLoadingIndicator()Get the widget displayed when the data is loading.protected intgetRealColumnCount()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.ResourcesgetResources()Get the resources used by this table.TableRowElementgetRowElement(int row)Get theTableRowElementfor the specified row.RowStyles<T>getRowStyles()Gets the object used to determine how a row is styled.protected TableRowElementgetSubRowElement(int absRow, int subrow)Get a subrow element given the index of the row value and the sub row index.protected abstract TableSectionElementgetTableBodyElement()Get the tbody element that contains the render row values.protected abstract TableSectionElementgetTableFootElement()Get the tfoot element that contains the footers.protected abstract TableSectionElementgetTableHeadElement()Get the thead element that contains the headers.voidinsertColumn(int beforeIndex, Column<T,?> col)Inserts a column into the table at the specified index.voidinsertColumn(int beforeIndex, Column<T,?> col, SafeHtml headerHtml)Inserts a column into the table at the specified index with an associatedSafeHtmlheader.voidinsertColumn(int beforeIndex, Column<T,?> col, SafeHtml headerHtml, SafeHtml footerHtml)Inserts a column into the table at the specified index with an associatedSafeHtmlheader and footer.voidinsertColumn(int beforeIndex, Column<T,?> col, Header<?> header)Inserts a column into the table at the specified index with an associated header.voidinsertColumn(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.voidinsertColumn(int beforeIndex, Column<T,?> col, java.lang.String headerString)Inserts a column into the table at the specified index with an associated String header.voidinsertColumn(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.booleanisAutoFooterRefreshDisabled()Check if auto footer refresh is enabled or disabled.booleanisAutoHeaderRefreshDisabled()Check if auto header refresh is enabled or disabled.protected booleanisKeyboardNavigationSuppressed()Check if keyboard navigation is being suppressed, such as when the user is editing a cell.booleanisSkipRowHoverCheck()Gets the skipRowHoverCheck flag.booleanisSkipRowHoverFloatElementCheck()Gets the skipRowHoverFloatElementCheck flag.booleanisSkipRowHoverStyleUpdate()Gets the skipRowHoverStyleUpdate flag.protected voidonBlur()Called when the widget is blurred.protected voidonBrowserEvent2(Event event)Called afterAbstractHasData.onBrowserEvent(Event)completes.protected voidonFocus()Called when the widget is focused.voidredrawFooters()Redraw the table's footers.voidredrawHeaders()Redraw the table's headers.protected voidrefreshColumnWidths()voidremoveColumn(int index)Remove a column.voidremoveColumn(Column<T,?> col)Remove a column.abstract voidremoveColumnStyleName(int index, java.lang.String styleName)Remove a style from thecolelement at the specified index.protected voidrenderRowValues(SafeHtmlBuilder sb, java.util.List<T> values, int start, SelectionModel<? super T> selectionModel)Deprecated.as of GWT 2.5, use aCellTableBuilderto customize the table structure insteadprotected voidrenderRowValuesLegacy(SafeHtmlBuilder sb, java.util.List<T> values, int start, SelectionModel<? super T> selectionModel)Deprecated.as of GWT 2.5, use aCellTableBuilderto customize the table structure insteadprotected voidreplaceAllChildren(java.util.List<T> values, SafeHtml html)Replace all children with the specified html.protected voidreplaceChildren(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 booleanresetFocusOnCell()Reset focus on the currently focused cell.voidsetAutoFooterRefreshDisabled(boolean disabled)Enable or disable auto footer refresh when row data is changed.voidsetAutoHeaderRefreshDisabled(boolean disabled)Enable or disable auto header refresh when row data is changed.voidsetColumnWidth(int column, double width, Style.Unit unit)Set the width of aColumn.voidsetColumnWidth(int column, java.lang.String width)Set the width of aColumn.voidsetColumnWidth(Column<T,?> column, double width, Style.Unit unit)Set the width of aColumn.voidsetColumnWidth(Column<T,?> column, java.lang.String width)Set the width of aColumn.voidsetEmptyTableWidget(Widget widget)Set the widget to display when the table has no rows.voidsetFooterBuilder(FooterBuilder<T> builder)Set theHeaderBuilderused to build the footer section of the table.voidsetHeaderBuilder(HeaderBuilder<T> builder)Set theHeaderBuilderused to build the header section of the table.protected voidsetKeyboardSelected(int index, boolean selected, boolean stealFocus)Update an element to reflect its keyboard selected state.voidsetKeyboardSelectedColumn(int column)Set the keyboard selected column index.voidsetKeyboardSelectedColumn(int column, boolean stealFocus)Set the keyboard selected column index and optionally focus on the new cell.voidsetKeyboardSelectedRow(int row, boolean stealFocus)Set the keyboard selected row and optionally focus on the new row.voidsetKeyboardSelectedRow(int row, int subrow, boolean stealFocus)Set the keyboard selected row and subrow, optionally focus on the new row.voidsetLoadingIndicator(Widget widget)Set the widget to display when the data is loading.voidsetRowStyles(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.voidsetSkipRowHoverCheck(boolean skipRowHoverCheck)Sets the skipRowHoverCheck flag.voidsetSkipRowHoverFloatElementCheck(boolean skipRowHoverFloatElementCheck)Sets the skipRowHoverFloatElementCheck flag.voidsetSkipRowHoverStyleUpdate(boolean skipRowHoverStyleUpdate)Sets the skipRowHoverStyleUpdate flag.voidsetTableBuilder(CellTableBuilder<T> tableBuilder)Specify theCellTableBuilderthat will be used to render the row values into the table.-
Methods inherited from class com.google.gwt.user.cellview.client.AbstractHasData
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
-
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onDetach, render, render, resolvePotentialElement, setWidget
-
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, unsinkEvents
-
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
-
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
-
AbstractCellTable
public AbstractCellTable(Element elem, int pageSize, AbstractCellTable.Resources resources, ProvidesKey<T> keyProvider)
Constructs a table with the given page size, the specifiedAbstractCellTable.Style, and the given key provider.- Parameters:
elem- the parentElementpageSize- the page sizeresources- the resources to apply to the widgetkeyProvider- an instance of ProvidesKey, or null if the record object should act as its own key
-
AbstractCellTable
public AbstractCellTable(Widget widget, int pageSize, AbstractCellTable.Resources resources, ProvidesKey<T> keyProvider)
Constructs a table with the given page size, the specifiedAbstractCellTable.Style, and the given key provider.- Parameters:
widget- the parent widgetpageSize- the page sizeresources- the resources to apply to the widgetkeyProvider- an instance of ProvidesKey, or null if the record object should act as its own key
-
-
Method Detail
-
addColumn
public void addColumn(Column<T,?> col)
Adds a column to the end of the table.- Parameters:
col- the column to be added
-
addColumn
public void addColumn(Column<T,?> col, Header<?> header)
Adds a column to the end of the table with an associated header.- Parameters:
col- the column to be addedheader- the associatedHeader
-
addColumn
public void addColumn(Column<T,?> col, Header<?> header, Header<?> footer)
Adds a column to the end of the table with an associated header and footer.
-
addColumn
public void addColumn(Column<T,?> col, java.lang.String headerString)
Adds a column to the end of the table with an associated String header.- Parameters:
col- the column to be addedheaderString- the associated header text, as a String
-
addColumn
public void addColumn(Column<T,?> col, SafeHtml headerHtml)
Adds a column to the end of the table with an associatedSafeHtmlheader.- Parameters:
col- the column to be addedheaderHtml- the associated header text, as safe HTML
-
addColumn
public 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.- Parameters:
col- the column to be addedheaderString- the associated header text, as a StringfooterString- the associated footer text, as a String
-
addColumn
public void addColumn(Column<T,?> col, SafeHtml headerHtml, SafeHtml footerHtml)
Adds a column to the end of the table with an associatedSafeHtmlheader and footer.- Parameters:
col- the column to be addedheaderHtml- the associated header text, as safe HTMLfooterHtml- the associated footer text, as safe HTML
-
addColumnSortHandler
public HandlerRegistration addColumnSortHandler(ColumnSortEvent.Handler handler)
Add a handler to handleColumnSortEvents.- Parameters:
handler- theColumnSortEvent.Handlerto add- Returns:
- a
HandlerRegistrationto remove the handler
-
addColumnStyleName
public abstract void addColumnStyleName(int index, java.lang.String styleName)Add a style name to thecolelement at the specified index, creating it if necessary.- Parameters:
index- the column indexstyleName- the style name to add
-
addRowHoverHandler
public HandlerRegistration addRowHoverHandler(RowHoverEvent.Handler handler)
Add a handler to handleRowHoverEvents.- Parameters:
handler- theRowHoverEvent.Handlerto add- Returns:
- a
HandlerRegistrationto remove the handler
-
clearColumnWidth
public void clearColumnWidth(Column<T,?> column)
Clear the width of the specifiedColumn.- Parameters:
column- the column
-
clearColumnWidth
public void clearColumnWidth(java.lang.Integer column)
Clear the width of the specifiedColumn.- Parameters:
column- the column index
-
flush
public void flush()
Flush all pending changes to the table and render immediately.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.
-
getColumn
public Column<T,?> getColumn(int col)
Get the column at the specified index.- Parameters:
col- the index of the column to retrieve- Returns:
- the
Columnat the index
-
getColumnCount
public int getColumnCount()
Get the number of columns in the table.- Returns:
- the column count
-
getColumnIndex
public int getColumnIndex(Column<T,?> column)
Get the index of the specified column.- Parameters:
column- the column to search for- Returns:
- the index of the column, or -1 if not found
-
getColumnSortList
public ColumnSortList getColumnSortList()
Get theColumnSortListthat specifies which columns are sorted. Modifications to theColumnSortListwill be reflected in the table header.Note that the implementation may redraw the headers on every modification to the
ColumnSortList.- Returns:
- the
ColumnSortList
-
getColumnWidth
public java.lang.String getColumnWidth(Column<T,?> column)
Get the width of aColumn.- Parameters:
column- the column- Returns:
- the width of the column, or null if not set
- See Also:
setColumnWidth(Column, double, Unit)
-
getEmptyTableWidget
public Widget getEmptyTableWidget()
Get the widget displayed when the table has no rows.- Returns:
- the empty table widget
-
getFooter
public Header<?> getFooter(int index)
-
getFooterBuilder
public FooterBuilder<T> getFooterBuilder()
Get theHeaderBuilderused to generate the footer section.
-
getHeader
public Header<?> getHeader(int index)
-
getHeaderBuilder
public HeaderBuilder<T> getHeaderBuilder()
Get theHeaderBuilderused to generate the header section.
-
getKeyboardSelectedColumn
public int getKeyboardSelectedColumn()
Get the index of the column that is currently selected via the keyboard.- Returns:
- the currently selected column, or -1 if none selected
-
getKeyboardSelectedSubRow
public int getKeyboardSelectedSubRow()
Get the index of the sub row that is currently selected via the keyboard. If the row value maps to one rendered row element, the subrow is 0.- Returns:
- the currently selected subrow, or -1 if none selected
-
getLoadingIndicator
public Widget getLoadingIndicator()
Get the widget displayed when the data is loading.- Returns:
- the loading indicator
-
getResources
public AbstractCellTable.Resources getResources()
Get the resources used by this table.
-
getRowElement
public TableRowElement getRowElement(int row)
Get theTableRowElementfor the specified row. If the row element has not been created, null is returned.- Parameters:
row- the row index- Returns:
- the row element, or null if it doesn't exists
- Throws:
java.lang.IndexOutOfBoundsException- if the row index is outside of the current page
-
getRowStyles
public RowStyles<T> getRowStyles()
Gets the object used to determine how a row is styled.- Returns:
- the
RowStylesobject if set, null if not
-
insertColumn
public void insertColumn(int beforeIndex, Column<T,?> col)Inserts a column into the table at the specified index.- Parameters:
beforeIndex- the index to insert the columncol- the column to be added
-
insertColumn
public void insertColumn(int beforeIndex, Column<T,?> col, Header<?> header)Inserts a column into the table at the specified index with an associated header.- Parameters:
beforeIndex- the index to insert the columncol- the column to be addedheader- the associatedHeader
-
insertColumn
public 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.
-
insertColumn
public 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.- Parameters:
beforeIndex- the index to insert the columncol- the column to be addedheaderString- the associated header text, as a String
-
insertColumn
public void insertColumn(int beforeIndex, Column<T,?> col, SafeHtml headerHtml)Inserts a column into the table at the specified index with an associatedSafeHtmlheader.- Parameters:
beforeIndex- the index to insert the columncol- the column to be addedheaderHtml- the associated header text, as safe HTML
-
insertColumn
public 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.- Parameters:
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 String
-
insertColumn
public void insertColumn(int beforeIndex, Column<T,?> col, SafeHtml headerHtml, SafeHtml footerHtml)Inserts a column into the table at the specified index with an associatedSafeHtmlheader and footer.- Parameters:
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 HTML
-
isAutoFooterRefreshDisabled
public boolean isAutoFooterRefreshDisabled()
Check if auto footer refresh is enabled or disabled.- Returns:
- true if disabled, false if enabled
- See Also:
setAutoFooterRefreshDisabled(boolean)
-
isAutoHeaderRefreshDisabled
public boolean isAutoHeaderRefreshDisabled()
Check if auto header refresh is enabled or disabled.- Returns:
- true if disabled, false if enabled
- See Also:
setAutoHeaderRefreshDisabled(boolean)
-
isSkipRowHoverCheck
public boolean isSkipRowHoverCheck()
Gets the skipRowHoverCheck flag. If true, the CellTable will not check for row-level hover events (MOUSEOVER and MOUSEOUT).- Returns:
- the flag value
-
isSkipRowHoverFloatElementCheck
public boolean isSkipRowHoverFloatElementCheck()
Gets the skipRowHoverFloatElementCheck flag. If true, the CellTable will not check for floating (fixed position) elements over the hovered row.- Returns:
- the flag value
-
isSkipRowHoverStyleUpdate
public boolean isSkipRowHoverStyleUpdate()
Gets the skipRowHoverStyleUpdate flag. If true, the CellTable will not update the row's style on row-level hover events (MOUSEOVER and MOUSEOUT).- Returns:
- the flag value
-
redrawFooters
public void redrawFooters()
Redraw the table's footers. The footers will be re-rendered synchronously.
-
redrawHeaders
public void redrawHeaders()
Redraw the table's headers. The headers will be re-rendered synchronously.
-
removeColumn
public void removeColumn(Column<T,?> col)
Remove a column.- Parameters:
col- the column to remove
-
removeColumn
public void removeColumn(int index)
Remove a column.- Parameters:
index- the column index
-
removeColumnStyleName
public abstract void removeColumnStyleName(int index, java.lang.String styleName)Remove a style from thecolelement at the specified index.- Parameters:
index- the column indexstyleName- the style name to remove
-
setAutoFooterRefreshDisabled
public void setAutoFooterRefreshDisabled(boolean disabled)
Enable or disable auto footer refresh when row data is changed. By default, footers are refreshed every time the row data changes in case the headers depend on the current row data. If the headers do not depend on the current row data, you can disable this feature to improve performance.Note that headers will still refresh when columns are added or removed, regardless of whether or not this feature is enabled.
-
setAutoHeaderRefreshDisabled
public void setAutoHeaderRefreshDisabled(boolean disabled)
Enable or disable auto header refresh when row data is changed. By default, headers are refreshed every time the row data changes in case the footers depend on the current row data. If the footers do not depend on the current row data, you can disable this feature to improve performance.Note that footers will still refresh when columns are added or removed, regardless of whether or not this feature is enabled.
-
setColumnWidth
public void setColumnWidth(Column<T,?> column, java.lang.String width)
Set the width of aColumn. The width will persist with the column and takes precedence of any width set viasetColumnWidth(int, String).- Parameters:
column- the columnwidth- the width of the column
-
setColumnWidth
public void setColumnWidth(Column<T,?> column, double width, Style.Unit unit)
Set the width of aColumn. The width will persist with the column and takes precedence of any width set viasetColumnWidth(int, double, Unit).- Parameters:
column- the columnwidth- the width of the columnunit- theStyle.Unitof measurement
-
setColumnWidth
public void setColumnWidth(int column, double width, Style.Unit unit)Set the width of aColumn.- Parameters:
column- the columnwidth- the width of the columnunit- theStyle.Unitof measurement
-
setColumnWidth
public void setColumnWidth(int column, java.lang.String width)Set the width of aColumn.- Parameters:
column- the columnwidth- the width of the column
-
setEmptyTableWidget
@UiChild(tagname="emptyTableWidget", limit=1) public void setEmptyTableWidget(Widget widget)
Set the widget to display when the table has no rows.- Parameters:
widget- the empty table widget, or null to disable
-
setFooterBuilder
public void setFooterBuilder(FooterBuilder<T> builder)
Set theHeaderBuilderused to build the footer section of the table.
-
setHeaderBuilder
public void setHeaderBuilder(HeaderBuilder<T> builder)
Set theHeaderBuilderused to build the header section of the table.
-
setKeyboardSelectedColumn
public final void setKeyboardSelectedColumn(int column)
Set the keyboard selected column index.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.
- Parameters:
column- the column index, greater than or equal to zero
-
setKeyboardSelectedColumn
public void setKeyboardSelectedColumn(int column, boolean stealFocus)Set the keyboard selected column index and optionally focus on the new cell.- Parameters:
column- the column index, greater than or equal to zerostealFocus- true to focus on the new column- See Also:
setKeyboardSelectedColumn(int)
-
setKeyboardSelectedRow
public void setKeyboardSelectedRow(int row, boolean stealFocus)Description copied from class:AbstractHasDataSet the keyboard selected row and optionally focus on the new row.- Overrides:
setKeyboardSelectedRowin classAbstractHasData<T>- Parameters:
row- the row index relative to the page startstealFocus- true to focus on the new row- See Also:
AbstractHasData.setKeyboardSelectedRow(int)
-
setKeyboardSelectedRow
public void setKeyboardSelectedRow(int row, int subrow, boolean stealFocus)Set the keyboard selected row and subrow, optionally focus on the new row.- Parameters:
row- the row index relative to the page startsubrow- the row index of the child rowstealFocus- true to focus on the new row- See Also:
AbstractHasData.setKeyboardSelectedRow(int)
-
setLoadingIndicator
@UiChild(tagname="loadingIndicator", limit=1) public void setLoadingIndicator(Widget widget)
Set the widget to display when the data is loading.- Parameters:
widget- the loading indicator, or null to disable
-
setRowStyles
public 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.- Parameters:
rowStyles- aRowStylesobject
-
setSkipRowHoverCheck
public void setSkipRowHoverCheck(boolean skipRowHoverCheck)
Sets the skipRowHoverCheck flag. If set, the CellTable will not check for row-level hover events (MOUSEOVER and MOUSEOUT).- Parameters:
skipRowHoverCheck- the new flag value
-
setSkipRowHoverFloatElementCheck
public void setSkipRowHoverFloatElementCheck(boolean skipRowHoverFloatElementCheck)
Sets the skipRowHoverFloatElementCheck flag. If set, the CellTable will not not check for floating (fixed position) elements over the hovered row.- Parameters:
skipRowHoverFloatElementCheck- the new flag value
-
setSkipRowHoverStyleUpdate
public void setSkipRowHoverStyleUpdate(boolean skipRowHoverStyleUpdate)
Sets the skipRowHoverStyleUpdate flag. If set, the CellTable will not update the row's style on row-level hover events (MOUSEOVER and MOUSEOUT).- Parameters:
skipRowHoverCheck- the new flag value
-
setTableBuilder
public void setTableBuilder(CellTableBuilder<T> tableBuilder)
Specify theCellTableBuilderthat will be used to render the row values into the table.
-
convertToElements
protected Element convertToElements(SafeHtml html)
Description copied from class:AbstractHasDataConvert the specified HTML into DOM elements and return the parent of the DOM elements.- Overrides:
convertToElementsin classAbstractHasData<T>- Parameters:
html- the HTML to convert- Returns:
- the parent element
-
dependsOnSelection
protected boolean dependsOnSelection()
Description copied from class:AbstractHasDataCheck whether or not the cells in the view depend on the selection state.- Specified by:
dependsOnSelectionin classAbstractHasData<T>- Returns:
- true if cells depend on selection, false if not
-
doSetColumnWidth
protected abstract void doSetColumnWidth(int column, java.lang.String width)Set the width of a column.- Parameters:
column- the column indexwidth- the width, or null to clear the width
-
doSetHeaderVisible
protected abstract void doSetHeaderVisible(boolean isFooter, boolean isVisible)Show or hide a header section.- Parameters:
isFooter- true for the footer, false for the headerisVisible- true to show, false to hide
-
getChildContainer
protected Element getChildContainer()
Description copied from class:AbstractHasDataReturn the element that holds the rendered cells.- Specified by:
getChildContainerin classAbstractHasData<T>- Returns:
- the container
Element
-
getChildElement
protected TableRowElement getChildElement(int row)
Get the element that represents the specified index.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.
- Overrides:
getChildElementin classAbstractHasData<T>- Parameters:
row- the row index, relative to the page start- Returns:
- the row element, or null if it doesn't exists
- Throws:
java.lang.IndexOutOfBoundsException- if the row index is outside of the current page
-
getKeyboardSelectedElement
protected Element getKeyboardSelectedElement()
Description copied from class:AbstractHasDataGet the element that has keyboard selection.- Specified by:
getKeyboardSelectedElementin classAbstractHasData<T>- Returns:
- the keyboard selected element
-
getRealColumnCount
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.
-
getTableBodyElement
protected abstract TableSectionElement getTableBodyElement()
Get the tbody element that contains the render row values.
-
getTableFootElement
protected abstract TableSectionElement getTableFootElement()
Get the tfoot element that contains the footers.
-
getTableHeadElement
protected abstract TableSectionElement getTableHeadElement()
Get the thead element that contains the headers.
-
isKeyboardNavigationSuppressed
protected boolean isKeyboardNavigationSuppressed()
Description copied from class:AbstractHasDataCheck if keyboard navigation is being suppressed, such as when the user is editing a cell.- Specified by:
isKeyboardNavigationSuppressedin classAbstractHasData<T>- Returns:
- true if suppressed, false if not
-
onBlur
protected void onBlur()
Description copied from class:AbstractHasDataCalled when the widget is blurred.- Overrides:
onBlurin classAbstractHasData<T>
-
onBrowserEvent2
protected void onBrowserEvent2(Event event)
Description copied from class:AbstractHasDataCalled afterAbstractHasData.onBrowserEvent(Event)completes.- Overrides:
onBrowserEvent2in classAbstractHasData<T>- Parameters:
event- the event that was fired
-
onFocus
protected void onFocus()
Description copied from class:AbstractHasDataCalled when the widget is focused.- Overrides:
onFocusin classAbstractHasData<T>
-
refreshColumnWidths
protected void refreshColumnWidths()
-
renderRowValues
@Deprecated protected void renderRowValues(SafeHtmlBuilder sb, java.util.List<T> values, int start, SelectionModel<? super T> selectionModel)
Deprecated.as of GWT 2.5, use aCellTableBuilderto customize the table structure insteadDescription copied from class:AbstractHasDataRender all row values into the specifiedSafeHtmlBuilder.Subclasses can optionally throw an
UnsupportedOperationExceptionif they prefer to render the rows inAbstractHasData.replaceAllChildren(List, SafeHtml)andAbstractHasData.replaceChildren(List, int, SafeHtml). In this case, theSafeHtmlargument will be null. Though a bit hacky, this is designed to supported legacy widgets that useSafeHtmlBuilder, and newer widgets that use other builders, such as the ElementBuilder API.- Specified by:
renderRowValuesin classAbstractHasData<T>- Parameters:
sb- theSafeHtmlBuilderto render intovalues- the row valuesstart- the absolute start index of the valuesselectionModel- theSelectionModel- See Also:
renderRowValuesLegacy(SafeHtmlBuilder, List, int, SelectionModel)
-
renderRowValuesLegacy
@Deprecated protected final void renderRowValuesLegacy(SafeHtmlBuilder sb, java.util.List<T> values, int start, SelectionModel<? super T> selectionModel)
Deprecated.as of GWT 2.5, use aCellTableBuilderto customize the table structure insteadRender all row values into the specifiedSafeHtmlBuilder.This method is here for legacy reasons, to support subclasses that call
renderRowValues(SafeHtmlBuilder, List, int, SelectionModel).- Parameters:
sb- theSafeHtmlBuilderto render intovalues- the row valuesstart- the absolute start index of the valuesselectionModel- theSelectionModel
-
replaceAllChildren
protected void replaceAllChildren(java.util.List<T> values, SafeHtml html)
Description copied from class:AbstractHasDataReplace all children with the specified html.- Overrides:
replaceAllChildrenin classAbstractHasData<T>- Parameters:
values- the values of the new childrenhtml- the html to render, or null ifAbstractHasData.renderRowValues(SafeHtmlBuilder, List, int, SelectionModel)throws anUnsupportedOperationException
-
replaceChildren
protected void replaceChildren(java.util.List<T> values, int start, SafeHtml html)
Description copied from class:AbstractHasDataConvert the specified HTML into DOM elements and replace the existing elements starting at the specified index. If the number of children specified exceeds the existing number of children, the remaining children should be appended.- Overrides:
replaceChildrenin classAbstractHasData<T>- Parameters:
values- the values of the new childrenstart- the start index to be replaced, relative to the page starthtml- the html to render, or null ifAbstractHasData.renderRowValues(SafeHtmlBuilder, List, int, SelectionModel)throws anUnsupportedOperationException
-
resetFocusOnCell
protected boolean resetFocusOnCell()
Description copied from class:AbstractHasDataReset focus on the currently focused cell.- Specified by:
resetFocusOnCellin classAbstractHasData<T>- Returns:
- true if focus is taken, false if not
-
setKeyboardSelected
protected void setKeyboardSelected(int index, boolean selected, boolean stealFocus)Description copied from class:AbstractHasDataUpdate an element to reflect its keyboard selected state.- Specified by:
setKeyboardSelectedin classAbstractHasData<T>- Parameters:
index- the index of the elementselected- true if selected, false if notstealFocus- true if the row should steal focus, false if not
-
getColumnWidth
java.lang.String getColumnWidth(int columnIndex)
Get the column width. Associating a width with aColumntakes precedence over setting the width of a column index.- Parameters:
columnIndex- the column index- Returns:
- the column width, or null if none specified
-
getSubRowElement
protected TableRowElement getSubRowElement(int absRow, int subrow)
Get a subrow element given the index of the row value and the sub row index.- Parameters:
absRow- the absolute row value indexsubrow- the index of the subrow beneath the row.- Returns:
- the row element, or null if not found
-
-