|
GWT 2.3.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.cellview.client.AbstractHasData<T>
T
- the data type of each rowpublic abstract class AbstractHasData<T>
An abstract Widget
that implements HasData
.
Nested Class Summary |
---|
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 | |
---|---|
AbstractHasData(Element elem,
int pageSize,
ProvidesKey<T> keyProvider)
Constructs an AbstractHasData with the given page size. |
Method Summary | |
---|---|
HandlerRegistration |
addCellPreviewHandler(CellPreviewEvent.Handler<T> handler)
Adds a CellPreviewEvent handler. |
HandlerRegistration |
addLoadingStateChangeHandler(LoadingStateChangeEvent.Handler handler)
Add a LoadingStateChangeEvent.Handler to be notified of changes in
the loading state. |
HandlerRegistration |
addRangeChangeHandler(RangeChangeEvent.Handler handler)
Add a RangeChangeEvent.Handler . |
HandlerRegistration |
addRowCountChangeHandler(RowCountChangeEvent.Handler handler)
Add a RowCountChangeEvent.Handler . |
protected boolean |
cellConsumesEventType(Cell<?> cell,
java.lang.String eventType)
Check if a cell consumes the specified event type. |
protected void |
checkRowBounds(int row)
Check that the row is within the correct bounds. |
protected Element |
convertToElements(SafeHtml html)
Convert the specified HTML into DOM elements and return the parent of the DOM elements. |
protected abstract boolean |
dependsOnSelection()
Check whether or not the cells in the view depend on the selection state. |
char |
getAccessKey()
Get the access key. |
protected abstract Element |
getChildContainer()
Return the element that holds the rendered cells. |
T |
getDisplayedItem(int indexOnPage)
Deprecated. use getVisibleItem(int) instead |
java.util.List<T> |
getDisplayedItems()
Deprecated. use getVisibleItems() instead |
HasKeyboardPagingPolicy.KeyboardPagingPolicy |
getKeyboardPagingPolicy()
Get the HasKeyboardPagingPolicy.KeyboardPagingPolicy . |
protected abstract Element |
getKeyboardSelectedElement()
Get the element that has keyboard selection. |
protected int |
getKeyboardSelectedRow()
Get the row index of the keyboard selected row. |
HasKeyboardSelectionPolicy.KeyboardSelectionPolicy |
getKeyboardSelectionPolicy()
Get the HasKeyboardSelectionPolicy.KeyboardSelectionPolicy . |
ProvidesKey<T> |
getKeyProvider()
Return the key provider. |
int |
getPageSize()
Return the range size. |
int |
getPageStart()
Return the range start. |
Element |
getRowContainer()
Return the outer element that contains all of the rendered row values. |
int |
getRowCount()
Get the total count of all rows. |
SelectionModel<? super T> |
getSelectionModel()
Get the SelectionModel used by this HasData . |
int |
getTabIndex()
Gets the widget's position in the tab index. |
protected java.lang.Object |
getValueKey(T value)
Get the key for the specified value. |
T |
getVisibleItem(int indexOnPage)
Get the row value at the specified visible index. |
int |
getVisibleItemCount()
Get the number of visible items being displayed. |
java.util.List<T> |
getVisibleItems()
Return the row values that the widget is currently displaying as an immutable list. |
Range |
getVisibleRange()
Get the range of visible rows. |
protected abstract boolean |
isKeyboardNavigationSuppressed()
Check if keyboard navigation is being suppressed, such as when the user is editing a cell. |
boolean |
isRowCountExact()
Check if the total row count is exact, or an estimate. |
protected boolean |
isRowWithinBounds(int row)
Checks that the row is within bounds of the view. |
protected void |
onBlur()
Called when the widget is blurred. |
void |
onBrowserEvent(Event event)
Handle browser events. |
protected void |
onBrowserEvent2(Event event)
Called after onBrowserEvent(Event) completes. |
protected void |
onFocus()
Called when the widget is focused. |
protected void |
onLoadingStateChanged(LoadingStateChangeEvent.LoadingState state)
Called when the loading state changes. |
protected void |
onUnload()
This method is called immediately before a widget will be detached from the browser's document. |
protected void |
onUpdateSelection()
Deprecated. this method is never called by AbstractHasData, render the selected styles in renderRowValues(SafeHtmlBuilder, List, int, SelectionModel) |
void |
redraw()
Redraw the widget using the existing data. |
protected abstract 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 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 abstract boolean |
resetFocusOnCell()
Reset focus on the currently focused cell. |
void |
setAccessKey(char key)
Sets the widget's 'access key'. |
void |
setFocus(boolean focused)
Explicitly focus/unfocus this widget. |
protected void |
setFocusable(Element elem,
boolean focusable)
Make an element focusable or not. |
void |
setKeyboardPagingPolicy(HasKeyboardPagingPolicy.KeyboardPagingPolicy policy)
Set the HasKeyboardPagingPolicy.KeyboardPagingPolicy . |
protected abstract void |
setKeyboardSelected(int index,
boolean selected,
boolean stealFocus)
Update an element to reflect its keyboard selected state. |
void |
setKeyboardSelectionPolicy(HasKeyboardSelectionPolicy.KeyboardSelectionPolicy policy)
Set the HasKeyboardSelectionPolicy.KeyboardSelectionPolicy . |
void |
setPageSize(int pageSize)
Set the number of rows per page and refresh the view. |
void |
setPageStart(int pageStart)
Set the starting index of the current visible page. |
void |
setRowCount(int count)
Set the exact total count of all rows. |
void |
setRowCount(int size,
boolean isExact)
Set the total count of all rows, specifying whether the count is exact or an estimate. |
void |
setRowData(int start,
java.util.List<? extends T> values)
Set a values associated with the rows in the visible range. |
void |
setRowData(java.util.List<? extends T> values)
Set the complete list of values to display on one page. |
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 |
setSelectionModel(SelectionModel<? super T> selectionModel)
Set the SelectionModel used by this HasData . |
void |
setSelectionModel(SelectionModel<? super T> selectionModel,
CellPreviewEvent.Handler<T> selectionEventManager)
Set the SelectionModel that defines which items are selected and
the CellPreviewEvent.Handler that
controls how user selection is handled. |
void |
setTabIndex(int index)
Sets the widget's position in the tab index. |
void |
setVisibleRange(int start,
int length)
Set the visible range or rows. |
void |
setVisibleRange(Range range)
Set the visible range or rows. |
void |
setVisibleRangeAndClearData(Range range,
boolean forceRangeChangeEvent)
Set the visible range and clear the current visible data. |
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, isAttached, isOrWasAttached, onAttach, onDetach, 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 AbstractHasData(Element elem, int pageSize, ProvidesKey<T> keyProvider)
AbstractHasData
with the given page size.
elem
- the parent Element
pageSize
- the page sizekeyProvider
- the key provider, or nullMethod Detail |
---|
public HandlerRegistration addCellPreviewHandler(CellPreviewEvent.Handler<T> handler)
HasCellPreviewHandlers
CellPreviewEvent
handler.
addCellPreviewHandler
in interface HasCellPreviewHandlers<T>
handler
- the handler
public HandlerRegistration addLoadingStateChangeHandler(LoadingStateChangeEvent.Handler handler)
LoadingStateChangeEvent.Handler
to be notified of changes in
the loading state.
handler
- the handle
public HandlerRegistration addRangeChangeHandler(RangeChangeEvent.Handler handler)
HasRows
RangeChangeEvent.Handler
.
addRangeChangeHandler
in interface HasRows
handler
- the handler
HandlerRegistration
to remove the handlerpublic HandlerRegistration addRowCountChangeHandler(RowCountChangeEvent.Handler handler)
HasRows
RowCountChangeEvent.Handler
.
addRowCountChangeHandler
in interface HasRows
handler
- the handler
HandlerRegistration
to remove the handlerpublic char getAccessKey()
setAccessKey(char)
@Deprecated public T getDisplayedItem(int indexOnPage)
getVisibleItem(int)
instead
indexOnPage
- the index on the page
@Deprecated public java.util.List<T> getDisplayedItems()
getVisibleItems()
instead
public HasKeyboardPagingPolicy.KeyboardPagingPolicy getKeyboardPagingPolicy()
HasKeyboardPagingPolicy
HasKeyboardPagingPolicy.KeyboardPagingPolicy
.
getKeyboardPagingPolicy
in interface HasKeyboardPagingPolicy
HasKeyboardPagingPolicy.setKeyboardPagingPolicy(KeyboardPagingPolicy)
public HasKeyboardSelectionPolicy.KeyboardSelectionPolicy getKeyboardSelectionPolicy()
HasKeyboardSelectionPolicy
HasKeyboardSelectionPolicy.KeyboardSelectionPolicy
.
getKeyboardSelectionPolicy
in interface HasKeyboardSelectionPolicy
HasKeyboardSelectionPolicy.setKeyboardSelectionPolicy(KeyboardSelectionPolicy)
public ProvidesKey<T> getKeyProvider()
HasKeyProvider
getKeyProvider
in interface HasKeyProvider<T>
ProvidesKey
instancepublic final int getPageSize()
getVisibleRange()
,
setPageSize(int)
public final int getPageStart()
getVisibleRange()
,
setPageStart(int)
public Element getRowContainer()
getChildContainer()
;
Element
that contains the rendered row valuespublic int getRowCount()
HasRows
getRowCount
in interface HasRows
HasRows.setRowCount(int)
public SelectionModel<? super T> getSelectionModel()
HasData
SelectionModel
used by this HasData
.
getSelectionModel
in interface HasData<T>
SelectionModel
HasData.setSelectionModel(SelectionModel)
public int getTabIndex()
Focusable
getTabIndex
in interface Focusable
public T getVisibleItem(int indexOnPage)
HasData
getVisibleItem
in interface HasData<T>
indexOnPage
- the index on the page
public int getVisibleItemCount()
HasData
getVisibleItemCount
in interface HasData<T>
public java.util.List<T> getVisibleItems()
getVisibleItems
in interface HasData<T>
public Range getVisibleRange()
HasRows
getVisibleRange
in interface HasRows
HasRows.setVisibleRange(Range)
,
HasRows.setVisibleRange(int, int)
public boolean isRowCountExact()
HasRows
isRowCountExact
in interface HasRows
public final void onBrowserEvent(Event event)
onBrowserEvent2(Event)
if they want to extend browser event
handling.
onBrowserEvent
in interface EventListener
onBrowserEvent
in class Widget
event
- the event receivedonBrowserEvent2(Event)
public void redraw()
public void setAccessKey(char key)
setAccessKey
in interface Focusable
key
- the widget's access keygetAccessKey()
public void setFocus(boolean focused)
Focusable
setFocus
in interface Focusable
focused
- whether this widget should take focus or release itpublic void setKeyboardPagingPolicy(HasKeyboardPagingPolicy.KeyboardPagingPolicy policy)
HasKeyboardPagingPolicy
HasKeyboardPagingPolicy.KeyboardPagingPolicy
.
setKeyboardPagingPolicy
in interface HasKeyboardPagingPolicy
policy
- the paging policyHasKeyboardPagingPolicy.getKeyboardPagingPolicy()
public void setKeyboardSelectionPolicy(HasKeyboardSelectionPolicy.KeyboardSelectionPolicy policy)
HasKeyboardSelectionPolicy
HasKeyboardSelectionPolicy.KeyboardSelectionPolicy
.
setKeyboardSelectionPolicy
in interface HasKeyboardSelectionPolicy
policy
- the selection policyHasKeyboardSelectionPolicy.getKeyboardSelectionPolicy()
public final void setPageSize(int pageSize)
pageSize
- the page sizesetVisibleRange(Range)
,
getPageSize()
public final void setPageStart(int pageStart)
pageStart
- the index of the row that should appear at the start of
the pagesetVisibleRange(Range)
,
getPageStart()
public final void setRowCount(int count)
HasRows
HasRows.setRowCount(int, boolean)
.
setRowCount
in interface HasRows
count
- the exact total countHasRows.getRowCount()
public void setRowCount(int size, boolean isExact)
HasRows
setRowCount
in interface HasRows
size
- the total countisExact
- true if the count is exact, false if an estimateHasRows.getRowCount()
public final void setRowData(java.util.List<? extends T> values)
Set the complete list of values to display on one page.
Equivalent to calling setRowCount(int)
with the length of the list
of values, setVisibleRange(Range)
from 0 to the size of the list
of values, and setRowData(int, List)
with a start of 0 and the
specified list of values.
values
- public void setRowData(int start, java.util.List<? extends T> values)
HasData
Set a values associated with the rows in the visible range.
This method does not replace all rows in the display; it replaces
the row values starting at the specified start index through the length of
the the specified values. You must call HasRows.setRowCount(int)
to set
the total number of rows in the display. You should also use
HasRows.setRowCount(int)
to remove rows when the total number of rows
decreases.
setRowData
in interface HasData<T>
start
- the start index of the datavalues
- the values within the rangepublic void setSelectionModel(SelectionModel<? super T> selectionModel)
SelectionModel
used by this HasData
.
By default, selection occurs when the user clicks on a Cell or presses the
spacebar. If you need finer control over selection, you can specify a
DefaultSelectionEventManager
using
setSelectionModel(SelectionModel, com.google.gwt.view.client.CellPreviewEvent.Handler)
.
DefaultSelectionEventManager
provides some default
implementations to handle checkbox based selection, as well as a blacklist
or whitelist of columns to prevent or allow selection.
setSelectionModel
in interface HasData<T>
selectionModel
- the SelectionModel
setSelectionModel(SelectionModel,
com.google.gwt.view.client.CellPreviewEvent.Handler)
,
getSelectionModel()
public void setSelectionModel(SelectionModel<? super T> selectionModel, CellPreviewEvent.Handler<T> selectionEventManager)
SelectionModel
that defines which items are selected and
the CellPreviewEvent.Handler
that
controls how user selection is handled.
selectionModel
- the SelectionModel
that defines selectionselectionEventManager
- the handler that controls user selectionpublic void setTabIndex(int index)
Focusable
-1
will cause this widget to
be removed from the tab order.
setTabIndex
in interface Focusable
index
- the widget's tab indexpublic final void setVisibleRange(int start, int length)
HasRows
HasRows.setVisibleRange(Range)
.
setVisibleRange
in interface HasRows
start
- the start indexlength
- the lengthHasRows.getVisibleRange()
public void setVisibleRange(Range range)
HasRows
setVisibleRange
in interface HasRows
range
- the visible rangeHasRows.getVisibleRange()
public void setVisibleRangeAndClearData(Range range, boolean forceRangeChangeEvent)
HasData
Set the visible range and clear the current visible data.
If the second argument forceRangeChangeEvent
is true, a
RangeChangeEvent
will be fired even if the range does not change.
If false, a RangeChangeEvent
will only be fired if the range
changes.
setVisibleRangeAndClearData
in interface HasData<T>
range
- the new Range
forceRangeChangeEvent
- true to fire a RangeChangeEvent
even
if the Range
doesn't changeprotected boolean cellConsumesEventType(Cell<?> cell, java.lang.String eventType)
cell
- the celleventType
- the event type to check
protected void checkRowBounds(int row)
row
- row index to check
java.lang.IndexOutOfBoundsException
protected Element convertToElements(SafeHtml html)
html
- the HTML to convert
protected abstract boolean dependsOnSelection()
protected abstract Element getChildContainer()
Element
protected abstract Element getKeyboardSelectedElement()
protected int getKeyboardSelectedRow()
protected java.lang.Object getValueKey(T value)
value
- the value
protected abstract boolean isKeyboardNavigationSuppressed()
protected boolean isRowWithinBounds(int row)
row
- row index to check
protected void onBlur()
protected void onBrowserEvent2(Event event)
onBrowserEvent(Event)
completes.
event
- the event that was firedprotected void onFocus()
protected void onLoadingStateChanged(LoadingStateChangeEvent.LoadingState state)
LoadingStateChangeEvent
.
state
- the new loading stateprotected void onUnload()
Widget
onUnload
in class Widget
@Deprecated protected void onUpdateSelection()
renderRowValues(SafeHtmlBuilder, List, int, SelectionModel)
protected abstract void renderRowValues(SafeHtmlBuilder sb, java.util.List<T> values, int start, SelectionModel<? super T> selectionModel)
SafeHtmlBuilder
.
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)
values
- the values of the new childrenhtml
- the html to render in the childprotected void replaceChildren(java.util.List<T> values, int start, SafeHtml html)
values
- the values of the new childrenstart
- the start index to be replaced, relative to the page starthtml
- the HTML to convertprotected abstract boolean resetFocusOnCell()
protected void setFocusable(Element elem, boolean focusable)
elem
- the elementfocusable
- true to make focusable, false to make unfocusableprotected abstract void setKeyboardSelected(int index, boolean selected, boolean stealFocus)
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)
elem
- the element to updateselected
- true if selected, false if not
|
GWT 2.3.0 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |