public class SimpleSearchModel<T> extends TableListModelBase<T> implements IKeyedTableModel<T>, ITruncateableDataModel, ISortableTableModel, IShelvedListener
| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleSearchModel.ByComparatorSortHelper<T>
Implementation of ISortHelper that can be used when sort is specified by sort column comparator.
|
static interface |
SimpleSearchModel.IQuery<T>
Functor interface to create some abstract query result.
|
static class |
SimpleSearchModel.SortHelper<T> |
DEFAULT_MAX_SIZE, IN_MEMORY_FILTER_OR_SORT_MAX_SIZE| Constructor and Description |
|---|
SimpleSearchModel(IQueryHandler<T> ss,
QCriteria<T> qc) |
SimpleSearchModel(NodeBase contextSourceNode,
QCriteria<T> qc)
EXPERIMENTAL INTERFACE
|
SimpleSearchModel(NodeBase contextSource,
SimpleSearchModel.IQuery<T> q) |
SimpleSearchModel(QDataContextFactory ss,
QCriteria<T> qc)
Use {@link SimpleSearchModel#SimpleSearchModel(IQueryHandler, QCriteria) instead!
|
SimpleSearchModel(QDataContextFactory f,
SimpleSearchModel.IQuery<T> q) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
T |
findRowObject(String key) |
QCriteria<T> |
getCriteria()
Return a criteria for this search which can then be manipulated for sorting.
|
List<T> |
getItems(int start,
int end) |
protected List<T> |
getList() |
int |
getMaxRowCount()
Return the current result row limit.
|
QCriteria<T> |
getQuery() |
String |
getRowKey(int row) |
String |
getSortKey()
DO NOT USE: Whomever uses the model should define sorting and remember it.
|
protected void |
handleQuerySorting(QCriteria<T> qc) |
protected void |
initResult() |
boolean |
isRefreshAfterShelve() |
boolean |
isSortDescending()
DO NOT USE: Whomever uses the model should define sorting and remember it.
|
boolean |
isTruncated()
Return true if the result is truncated.
|
void |
onShelve()
When the component is shelved we discard all results.
|
void |
onUnshelve() |
void |
refresh() |
void |
setCriteria(QCriteria<T> query) |
void |
setMaxRowCount(int maxRowCount)
Set the current result row limit.
|
void |
setRefreshAfterShelve(boolean refreshAfterShelve) |
void |
sortOn(Comparator<T> sortComparator,
String sortComparatorKey,
boolean descending)
When called, this does a re-query using the specified sortComparator.
|
void |
sortOn(String key,
boolean descending)
When called this does a re-query using the specified sort property.
|
add, add, delete, delete, getComparator, getItem, getRows, indexOf, modified, modified, move, setComparatoraddChangeListener, fireAdded, fireDeleted, fireModelChanged, fireModified, getListeners, removeChangeListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddChangeListener, getRows, removeChangeListenerpublic SimpleSearchModel(@Nonnull NodeBase contextSourceNode, @Nonnull QCriteria<T> qc)
contextSourceNode - qc - public SimpleSearchModel(@Nonnull QDataContextFactory ss, @Nonnull QCriteria<T> qc)
ss - qc - public SimpleSearchModel(@Nonnull QDataContextFactory f, @Nonnull SimpleSearchModel.IQuery<T> q)
public SimpleSearchModel(@Nonnull NodeBase contextSource, @Nonnull SimpleSearchModel.IQuery<T> q)
public void setRefreshAfterShelve(boolean refreshAfterShelve)
refreshAfterShelve - public boolean isRefreshAfterShelve()
public int getMaxRowCount()
public void setMaxRowCount(int maxRowCount)
@Nonnull public QCriteria<T> getCriteria()
setCriteria(QCriteria).
FIXME This urgently needs to duplicate the query instead of messing around with the original!public boolean isTruncated()
ITruncateableDataModelisTruncated in interface ITruncateableDataModel@Nonnull protected List<T> getList() throws Exception
getList in class TableListModelBase<T>Exception@Nonnull public List<T> getItems(int start, int end) throws Exception
getItems in interface ITableModel<T>getItems in class TableListModelBase<T>Exceptionpublic T findRowObject(String key) throws Exception
findRowObject in interface IKeyedTableModel<T>Exceptionpublic String getRowKey(int row) throws Exception
getRowKey in interface IKeyedTableModel<T>Exceptionpublic void clear()
public void sortOn(String key, boolean descending) throws Exception
sortOn in interface ISortableTableModelExceptionpublic void sortOn(Comparator<T> sortComparator, String sortComparatorKey, boolean descending) throws Exception
Exception@Nullable public String getSortKey()
ISortableTableModelgetSortKey in interface ISortableTableModelpublic boolean isSortDescending()
ISortableTableModelisSortDescending in interface ISortableTableModelpublic void onShelve()
throws Exception
onShelve in interface IShelvedListenerExceptionIShelvedListener.onShelve()public void onUnshelve()
throws Exception
onUnshelve in interface IShelvedListenerExceptionpublic void refresh()
refresh in interface ITableModel<T>refresh in class TableModelBase<T>Copyright © 2017 etc.to. All rights reserved.