public class InfiniteDataView<T> extends AbstractDataView<T> implements HasLoader
DYNAMIC_VIEW
.DataSource
implementation.Modifier and Type | Field and Description |
---|---|
protected InfiniteDataCache<T> |
dataCache |
static int |
DYNAMIC_VIEW
Dynamic view will detect available space for the row views.
|
protected int |
lastScrollTop |
protected int |
viewIndex |
$table, attachHandler, autoSortColumn, categories, categoryFactory, categoryHeight, columns, container, dataSource, display, headerRow, headers, height, id, keyProvider, longPressDuration, maskElement, maskHtml, ORPHAN_PATTERN, pendingRows, progressWidget, range, redraw, redrawCategories, renderer, rendering, rowFactory, rows, sortContext, subheaderLib, table, tableBody, tbody, thead, topPanel, totalRows, transitionEvents
Constructor and Description |
---|
InfiniteDataView(int totalRows,
DataSource<T> dataSource) |
InfiniteDataView(int totalRows,
int viewSize,
DataSource<T> dataSource) |
InfiniteDataView(String name,
int totalRows,
DataSource<T> dataSource) |
InfiniteDataView(String name,
int totalRows,
int viewSize,
DataSource<T> dataSource) |
InfiniteDataView(String name,
int totalRows,
int viewSize,
com.google.gwt.view.client.ProvidesKey<T> keyProvider,
DataSource<T> dataSource) |
InfiniteDataView(String name,
int totalRows,
com.google.gwt.view.client.ProvidesKey<T> keyProvider,
DataSource<T> dataSource) |
Modifier and Type | Method and Description |
---|---|
void |
addCategory(CategoryComponent category)
Explicitly add a
CategoryComponent , which will be drawn to the table. |
protected void |
doLoad() |
protected boolean |
doSort(SortContext<T> sortContext,
Components<RowComponent<T>> rows)
Perform a sort on the a set of
RowComponent 's. |
int |
getLoaderBuffer() |
int |
getLoaderDelay() |
List<T> |
getSelectedRowModels(boolean visibleOnly)
Get all the selected row models.
|
double |
getVisibleHeight() |
int |
getVisibleRowCapacity()
Returns the total number of rows that are visible given
the current grid height.
|
boolean |
isDynamicView() |
boolean |
isLoading()
Is the loader loading.
|
void |
loaded(int startIndex,
List<T> data)
Data views loader has loaded data for use.
|
void |
loaded(int startIndex,
List<T> data,
boolean cacheData)
Provide the option to load data with a cache parameter.
|
void |
loaded(int startIndex,
List<T> data,
int totalRows,
boolean cacheData)
With infinite data loading it is often required to
change the total rows, upon loading of new data.
|
protected void |
onConstructed()
Called after the data view is constructed.
|
protected void |
onSetup(TableScaffolding scaffolding) |
protected Object |
onVerticalScroll() |
void |
refresh()
Invoke a view refresh.
|
void |
render(Components<Component<?>> components)
Render the data view components to DOM.
|
boolean |
renderRows(Components<RowComponent<T>> rows)
Compile list of
RowComponent 's and invoke a render. |
protected void |
requestData(int index,
boolean checkCache) |
void |
setDisplay(DataDisplay<T> display)
Set the data views display view.
|
void |
setLoaderBuffer(int loaderBuffer)
The amount of data that will buffer your start index and view size.
|
void |
setLoaderDelay(int loaderDelay) |
void |
setLoadMask(boolean loadMask)
Set the data views loading mask.
|
void |
setRowHeight(int rowHeight)
Set maximum row height.
|
protected void |
setViewSize(int viewSize) |
protected void |
updateRows(int newIndex,
boolean reload) |
addCategory, addColumn, addColumn, addHeader, bindCategoryEvents, buildCategoryComponent, buildCategoryComponent, buildRowComponent, clearCategories, clearExpansions, clearRows, clearRowsAndCategories, closeCategory, closeCategory, deselectRow, destroy, disableCategory, enableCategory, fireEvent, getAutoSortColumn, getCalculatedRowHeight, getCategories, getCategory, getCategoryFactory, getCategoryHeight, getCategoryRowCount, getColumnCount, getColumnOffset, getColumns, getContainer, getData, getDataSource, getHeaders, getHeight, getHiddenCategories, getId, getKeyProvider, getLongPressDuration, getModelByRowElement, getModelsByRowElements, getOpenCategories, getOrphansCategory, getPassedCategories, getProgressWidget, getRenderer, getRow, getRow, getRowByModel, getRowCount, getRowElementByModel, getRowFactory, getRowHeight, getRowIndexByElement, getRows, getRowsByCategory, getSelectionType, getSortContext, getSubheaderLib, getTableSubHeader, getTableSubHeader, getTotalRows, getValueKey, getVisibleCategories, getVisibleItemCount, getVisibleRange, hasCategory, hasDeselectedRows, hasSelectedRows, insertColumn, isCategoryEmpty, isHeaderVisible, isLoadMask, isRedraw, isRendering, isSetup, isShiftDown, isUseCategories, isUseLoadOverlay, isUseRowExpansion, isUseStickyHeader, isWithinView, isWithinView, maybeApplyAutoSortColumn, openCategory, openCategory, prepareRows, reindexColumns, removeColumn, removeColumn, removeColumns, removeHeader, renderCategory, renderColumn, renderColumns, renderComponent, selectAllRows, selectAllRows, selectRow, setCategoryFactory, setDataSource, setHeight, setLongPressDuration, setRedraw, setRedrawCategories, setRenderer, setRowData, setRowFactory, setSelectionType, setTotalRows, setup, setupHeaderSelectionBox, setupShiftDetection, setupStickyHeader, setupSubHeaders, setUseCategories, setUseLoadOverlay, setUseRowExpansion, setUseStickyHeader, setVisibleRange, setVisibleRange, setVisibleRange, sort, sort, sort, sort, sort, sort, sort, sort, toggleRowSelect, toggleRowSelect, updateCheckAllInputState, updateCheckAllInputState, updateRow, updateSortContext, updateSortContext
public static final int DYNAMIC_VIEW
protected int viewIndex
protected int lastScrollTop
protected InfiniteDataCache<T> dataCache
public InfiniteDataView(int totalRows, DataSource<T> dataSource)
public InfiniteDataView(int totalRows, int viewSize, DataSource<T> dataSource)
public InfiniteDataView(String name, int totalRows, DataSource<T> dataSource)
public InfiniteDataView(String name, int totalRows, com.google.gwt.view.client.ProvidesKey<T> keyProvider, DataSource<T> dataSource)
public InfiniteDataView(String name, int totalRows, int viewSize, DataSource<T> dataSource)
public InfiniteDataView(String name, int totalRows, int viewSize, com.google.gwt.view.client.ProvidesKey<T> keyProvider, DataSource<T> dataSource)
protected void onConstructed()
AbstractDataView
AbstractDataView.setup(TableScaffolding)
.onConstructed
in class AbstractDataView<T>
protected void onSetup(TableScaffolding scaffolding)
onSetup
in class AbstractDataView<T>
public void setDisplay(DataDisplay<T> display)
DataView
setDisplay
in interface DataView<T>
setDisplay
in class AbstractDataView<T>
public void render(Components<Component<?>> components)
DataView
public boolean renderRows(Components<RowComponent<T>> rows)
AbstractDataView
RowComponent
's and invoke a render.
Controls the building of category components and custom components.
Which then AbstractDataView.render(Components)
is invoked to perform DOM render.
Rows which are already rendered are reprocessed based on their equals method.
If the data is equal to the row in the same index it use the existing row.renderRows
in class AbstractDataView<T>
rows
- list of rows to be rendered against the existing rows.protected boolean doSort(SortContext<T> sortContext, Components<RowComponent<T>> rows)
AbstractDataView
RowComponent
's.
Sorting will check for each components category and sort per category if found.doSort
in class AbstractDataView<T>
protected void setViewSize(int viewSize)
public void addCategory(CategoryComponent category)
HasCategories
CategoryComponent
, which will be drawn to the table.
If the category already exists then it will be ignored.addCategory
in interface HasCategories
addCategory
in class AbstractDataView<T>
category
- The category data defined.public double getVisibleHeight()
protected Object onVerticalScroll()
protected void updateRows(int newIndex, boolean reload)
protected void requestData(int index, boolean checkCache)
protected void doLoad()
public void setLoadMask(boolean loadMask)
DataView
setLoadMask
in interface DataView<T>
setLoadMask
in class AbstractDataView<T>
public void loaded(int startIndex, List<T> data)
HasDataSource
loaded
in interface HasDataSource<T>
loaded
in class AbstractDataView<T>
public void loaded(int startIndex, List<T> data, boolean cacheData)
public void loaded(int startIndex, List<T> data, int totalRows, boolean cacheData)
loaded(int, List)
for standard use.startIndex
- the new start indexdata
- the new list of data loadedtotalRows
- the new total row countpublic int getVisibleRowCapacity()
public void setRowHeight(int rowHeight)
HasRows
setRowHeight
in interface HasRows<T>
setRowHeight
in class AbstractDataView<T>
public List<T> getSelectedRowModels(boolean visibleOnly)
HasRows
getSelectedRowModels
in interface HasRows<T>
getSelectedRowModels
in class AbstractDataView<T>
visibleOnly
- should we restrict this check to visible rows only.public int getLoaderDelay()
getLoaderDelay
in interface HasLoader
public void setLoaderDelay(int loaderDelay)
setLoaderDelay
in interface HasLoader
public int getLoaderBuffer()
getLoaderBuffer
in interface HasLoader
public void setLoaderBuffer(int loaderBuffer)
HasLoader
setLoaderBuffer
in interface HasLoader
public boolean isLoading()
HasLoader
public boolean isDynamicView()
Copyright © 2018. All rights reserved.