T
- the data type of list itemspublic class CellList<T> extends AbstractHasData<T>
List
)Modifier and Type | Class and Description |
---|---|
static interface |
CellList.Resources
A ClientBundle that provides images for this widget.
|
static interface |
CellList.Style
Styles used by this widget.
|
AbstractHasData.DefaultKeyboardSelectionHandler<T>, AbstractHasData.RedrawEvent
UIObject.DebugIdImpl, UIObject.DebugIdImplEnabled
HasKeyboardPagingPolicy.KeyboardPagingPolicy
HasKeyboardSelectionPolicy.KeyboardSelectionPolicy
DEBUG_ID_PREFIX
Constructor and Description |
---|
CellList(Cell<T> cell)
Construct a new
CellList . |
CellList(Cell<T> cell,
CellList.Resources resources)
Construct a new
CellList with the specified CellList.Resources . |
CellList(Cell<T> cell,
CellList.Resources resources,
ProvidesKey<T> keyProvider)
|
CellList(Cell<T> cell,
ProvidesKey<T> keyProvider)
Construct a new
CellList with the specified key
provider . |
Modifier and Type | Method and Description |
---|---|
protected boolean |
dependsOnSelection()
Check whether or not the cells in the view depend on the selection state.
|
protected void |
doAttachChildren()
If a widget contains one or more child widgets that are not in the logical
widget hierarchy (the child is physically connected only on the DOM level),
it must override this method and call
Widget.onAttach() for each of its
child widgets. |
protected void |
doDetachChildren()
If a widget contains one or more child widgets that are not in the logical
widget hierarchy (the child is physically connected only on the DOM level),
it must override this method and call
Widget.onDetach() for each of its
child widgets. |
protected void |
fireEventToCell(Cell.Context context,
Event event,
Element parent,
T value)
Fire an event to the cell.
|
protected Cell<T> |
getCell()
Return the cell used to render each item.
|
protected Element |
getCellParent(Element item)
Get the parent element that wraps the cell from the list item.
|
protected Element |
getChildContainer()
Return the element that holds the rendered cells.
|
SafeHtml |
getEmptyListMessage()
Deprecated.
as of GWT 2.3, use
getEmptyListWidget() instead |
Widget |
getEmptyListWidget()
Get the widget displayed when the list has no rows.
|
protected Element |
getKeyboardSelectedElement()
Get the element that has keyboard selection.
|
Widget |
getLoadingIndicator()
Get the widget displayed when the data is loading.
|
Element |
getRowElement(int indexOnPage)
Get the
Element for the specified index. |
protected boolean |
isKeyboardNavigationSuppressed()
Check if keyboard navigation is being suppressed, such as when the user is
editing a cell.
|
protected void |
onBrowserEvent2(Event event)
Called after
AbstractHasData.onBrowserEvent(Event) completes. |
protected void |
onLoadingStateChanged(LoadingStateChangeEvent.LoadingState state)
Called when the loading state changes.
|
protected void |
renderRowValues(SafeHtmlBuilder sb,
List<T> values,
int start,
SelectionModel<? super T> selectionModel)
Render all row values into the specified
SafeHtmlBuilder . |
protected boolean |
resetFocusOnCell()
Reset focus on the currently focused cell.
|
void |
setEmptyListMessage(SafeHtml html)
Deprecated.
as of GWT 2.3, use
setEmptyListWidget(com.google.gwt.user.client.ui.Widget)
instead |
void |
setEmptyListWidget(Widget widget)
Set the widget to display when the list 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.
|
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) |
void |
setValueUpdater(ValueUpdater<T> valueUpdater)
Set the value updater to use when cells modify items.
|
addCellPreviewHandler, addLoadingStateChangeHandler, addRangeChangeHandler, addRedrawHandler, addRowCountChangeHandler, cellConsumesEventType, checkRowBounds, convertToElements, getAccessKey, getChildElement, getDisplayedItem, getDisplayedItems, getKeyboardPagingPolicy, getKeyboardSelectedRow, getKeyboardSelectionPolicy, getKeyProvider, getPageSize, getPageStart, getRowContainer, getRowCount, getSelectionModel, getTabIndex, getValueKey, getVisibleItem, getVisibleItemCount, getVisibleItems, getVisibleRange, isRowCountExact, isRowWithinBounds, onBlur, onBrowserEvent, onFocus, onUnload, redraw, redrawRow, replaceAllChildren, replaceChildren, setAccessKey, setFocus, setFocusable, setKeyboardPagingPolicy, setKeyboardSelectedRow, setKeyboardSelectedRow, setKeyboardSelectionHandler, setKeyboardSelectionPolicy, setPageSize, setPageStart, setRowCount, setRowCount, setRowData, setRowData, setSelectionModel, setSelectionModel, setTabIndex, setVisibleRange, setVisibleRange, setVisibleRangeAndClearData
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onDetach, render, render, resolvePotentialElement, setWidget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, 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
fireEvent
public CellList(Cell<T> cell)
CellList
.cell
- the cell used to render each itempublic CellList(Cell<T> cell, CellList.Resources resources)
CellList
with the specified CellList.Resources
.cell
- the cell used to render each itemresources
- the resources used for this widgetpublic CellList(Cell<T> cell, ProvidesKey<T> keyProvider)
CellList
with the specified key
provider
.cell
- the cell used to render each itemkeyProvider
- an instance of ProvidesKeypublic CellList(Cell<T> cell, CellList.Resources resources, ProvidesKey<T> keyProvider)
cell
- the cell used to render each itemresources
- the resources used for this widgetkeyProvider
- an instance of ProvidesKey@Deprecated public SafeHtml getEmptyListMessage()
getEmptyListWidget()
insteadsetEmptyListMessage(SafeHtml)
public Widget getEmptyListWidget()
public Widget getLoadingIndicator()
public Element getRowElement(int indexOnPage)
Element
for the specified index. If the element has not
been created, null is returned.indexOnPage
- the index on the pageIndexOutOfBoundsException
- if the index is outside of the current
page@Deprecated public void setEmptyListMessage(SafeHtml html)
setEmptyListWidget(com.google.gwt.user.client.ui.Widget)
insteadhtml
- the message to display when there are no resultsgetEmptyListMessage()
public void setEmptyListWidget(Widget widget)
widget
- the empty data widgetpublic void setLoadingIndicator(Widget widget)
widget
- the loading indicatorpublic void setValueUpdater(ValueUpdater<T> valueUpdater)
valueUpdater
- the ValueUpdater
protected boolean dependsOnSelection()
AbstractHasData
dependsOnSelection
in class AbstractHasData<T>
protected void doAttachChildren()
Widget
Widget.onAttach()
for each of its
child widgets.doAttachChildren
in class Widget
Widget.onAttach()
protected void doDetachChildren()
Widget
Widget.onDetach()
for each of its
child widgets.doDetachChildren
in class Widget
Widget.onDetach()
protected void fireEventToCell(Cell.Context context, Event event, Element parent, T value)
context
- the Cell.Context
of the cellevent
- the event that was firedparent
- the parent of the cellvalue
- the value of the cellprotected Element getCellParent(Element item)
item
- the row element that wraps the list itemprotected Element getChildContainer()
AbstractHasData
getChildContainer
in class AbstractHasData<T>
Element
protected Element getKeyboardSelectedElement()
AbstractHasData
getKeyboardSelectedElement
in class AbstractHasData<T>
protected boolean isKeyboardNavigationSuppressed()
AbstractHasData
isKeyboardNavigationSuppressed
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 onLoadingStateChanged(LoadingStateChangeEvent.LoadingState state)
onLoadingStateChanged
in class AbstractHasData<T>
state
- the new loading stateprotected void renderRowValues(SafeHtmlBuilder sb, List<T> values, int start, SelectionModel<? super T> selectionModel)
AbstractHasData
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
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 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 notCopyright © 2016. All rights reserved.