|
GWT 2.1.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 |
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)
Get the row value at the specified visible index. |
java.util.List<T> |
getDisplayedItems()
Return the row values that the widget is currently displaying. |
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. |
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. |
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 the correct bounds. |
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 |
onUnload()
This method is called immediately before a widget will be detached from the browser's document. |
protected void |
onUpdateSelection()
Called when selection changes. |
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. |
protected abstract void |
setSelected(Element elem,
boolean selected)
Update an element to reflect its selected state. |
void |
setSelectionModel(SelectionModel<? super T> selectionModel)
Set the SelectionModel used by this HasData. |
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, 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, 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 ElementpageSize - the page sizekeyProvider - the key provider, or null| Method Detail |
|---|
public HandlerRegistration addRangeChangeHandler(RangeChangeEvent.Handler handler)
HasRowsRangeChangeEvent.Handler.
addRangeChangeHandler in interface HasRowshandler - the handler
HandlerRegistration to remove the handlerpublic HandlerRegistration addRowCountChangeHandler(RowCountChangeEvent.Handler handler)
HasRowsRowCountChangeEvent.Handler.
addRowCountChangeHandler in interface HasRowshandler - the handler
HandlerRegistration to remove the handlerpublic char getAccessKey()
setAccessKey(char)public T getDisplayedItem(int indexOnPage)
indexOnPage - the index on the page
public java.util.List<T> getDisplayedItems()
public HasKeyboardPagingPolicy.KeyboardPagingPolicy getKeyboardPagingPolicy()
HasKeyboardPagingPolicyHasKeyboardPagingPolicy.KeyboardPagingPolicy.
getKeyboardPagingPolicy in interface HasKeyboardPagingPolicyHasKeyboardPagingPolicy.setKeyboardPagingPolicy(KeyboardPagingPolicy)public HasKeyboardSelectionPolicy.KeyboardSelectionPolicy getKeyboardSelectionPolicy()
HasKeyboardSelectionPolicyHasKeyboardSelectionPolicy.KeyboardSelectionPolicy.
getKeyboardSelectionPolicy in interface HasKeyboardSelectionPolicyHasKeyboardSelectionPolicy.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 int getRowCount()
HasRows
getRowCount in interface HasRowsHasRows.setRowCount(int)public SelectionModel<? super T> getSelectionModel()
HasDataSelectionModel used by this HasData.
getSelectionModel in interface HasData<T>SelectionModelHasData.setSelectionModel(SelectionModel)public int getTabIndex()
Focusable
getTabIndex in interface Focusablepublic Range getVisibleRange()
HasRows
getVisibleRange in interface HasRowsHasRows.setVisibleRange(Range),
HasRows.setVisibleRange(int, int)public boolean isRowCountExact()
HasRows
isRowCountExact in interface HasRowspublic final void onBrowserEvent(Event event)
onBrowserEvent2(Event) if they want to extend browser event
handling.
onBrowserEvent in interface EventListeneronBrowserEvent in class Widgetevent - the event receivedonBrowserEvent2(Event)public void redraw()
public void setAccessKey(char key)
setAccessKey in interface Focusablekey - the widget's access keygetAccessKey()public void setFocus(boolean focused)
Focusable
setFocus in interface Focusablefocused - whether this widget should take focus or release itpublic void setKeyboardPagingPolicy(HasKeyboardPagingPolicy.KeyboardPagingPolicy policy)
HasKeyboardPagingPolicyHasKeyboardPagingPolicy.KeyboardPagingPolicy.
setKeyboardPagingPolicy in interface HasKeyboardPagingPolicypolicy - the paging policyHasKeyboardPagingPolicy.getKeyboardPagingPolicy()public void setKeyboardSelectionPolicy(HasKeyboardSelectionPolicy.KeyboardSelectionPolicy policy)
HasKeyboardSelectionPolicyHasKeyboardSelectionPolicy.KeyboardSelectionPolicy.
setKeyboardSelectionPolicy in interface HasKeyboardSelectionPolicypolicy - 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)
HasRowsHasRows.setRowCount(int, boolean).
setRowCount in interface HasRowscount - the exact total countHasRows.getRowCount()
public void setRowCount(int size,
boolean isExact)
HasRows
setRowCount in interface HasRowssize - the total countisExact - true if the count is exact, false if an estimateHasRows.getRowCount()
public void setRowData(int start,
java.util.List<? extends T> values)
HasData
setRowData in interface HasData<T>start - the start index of the datavalues - the values within the rangepublic void setSelectionModel(SelectionModel<? super T> selectionModel)
HasDataSelectionModel used by this HasData.
setSelectionModel in interface HasData<T>selectionModel - the SelectionModelHasData.getSelectionModel()public void setTabIndex(int index)
Focusable-1 will cause this widget to
be removed from the tab order.
setTabIndex in interface Focusableindex - the widget's tab index
public final void setVisibleRange(int start,
int length)
HasRowsHasRows.setVisibleRange(Range).
setVisibleRange in interface HasRowsstart - the start indexlength - the lengthHasRows.getVisibleRange()public void setVisibleRange(Range range)
HasRows
setVisibleRange in interface HasRowsrange - the visible rangeHasRows.getVisibleRange()
public void setVisibleRangeAndClearData(Range range,
boolean forceRangeChangeEvent)
HasDataSet 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 RangeforceRangeChangeEvent - true to fire a RangeChangeEvent even
if the Range doesn't change
protected 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.IndexOutOfBoundsExceptionprotected Element convertToElements(SafeHtml html)
html - the HTML to convert
protected abstract boolean dependsOnSelection()
protected abstract Element getChildContainer()
Elementprotected 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 onUnload()
Widget
onUnload in class Widgetprotected void onUpdateSelection()
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 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 child
protected void replaceChildren(java.util.List<T> values,
int start,
SafeHtml html)
values - the values of the new childrenstart - the start index to be replacedhtml - the HTML to convertprotected abstract boolean resetFocusOnCell()
protected void setFocusable(Element elem,
boolean focusable)
elem - the elementfocusable - true to make focusable, false to make unfocusable
protected 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
protected abstract void setSelected(Element elem,
boolean selected)
elem - the element to updateselected - true if selected, false if not
|
GWT 2.1.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||