public class TaskSearchContentProvider extends SelectableListTableContentProvider implements ITaskSearchContentProvider
getSearchQuery()
terms and call refresh()
method. Most of the time this provider
is extended when implementing custom task inbox by adding new search terms.SelectableListTableContentProvider.Row, SelectableListTableContentProvider.RowComparator
Modifier and Type | Field and Description |
---|---|
protected boolean |
m_includeTaskData
Flag that indicates if search result should include task business data
|
protected boolean |
m_isAutoRefresh
Flag if provider is auto-refreshable
|
protected boolean |
m_needRefresh
Flag to indicate if provider should be refreshed
|
protected ITask[] |
m_results
Search results
|
protected int |
m_resultsTotalCount |
protected boolean |
m_searchInbox
Flag to indicate if provider should search for current user's inbox tasks only
|
protected TaskSearchQuery |
m_searchQuery
Task Search Query object
|
static String |
PROPERTY_TASKDATA |
m_autoIdCounter, m_map, m_originalList, m_selectableHelper
m_array, m_canTemplateRow, m_index, m_list, m_onCreateRow, m_onDeleteRow, m_rowId, m_rowType, m_sort, m_templateRow, m_var
fExpireWithPageFlow
Constructor and Description |
---|
TaskSearchContentProvider()
Default constructor
|
TaskSearchContentProvider(TaskSearchQuery searchQuery)
Default constructor from search query
|
Modifier and Type | Method and Description |
---|---|
protected String |
calculateRowId(int index,
Object data)
Return
data.getTaskInfo().getTaskID() as RowId |
boolean |
getNeedRefresh()
Returns
true when IRefreshable.isAutoRefresh() is on and the result properties need to be refreshed from
the data source by executing IRefreshable.refresh() method. |
Object[] |
getPropertyKeys()
Returns property keys for the current row object which is an element of
the wrapped array or the list by
ListTableContentProvider.getRowIndex() index. |
ITask[] |
getResults()
Returns results of the search
|
protected int |
getResultsTotalCount() |
boolean |
getSearchInbox()
Returns boolean value indicates whether to search current user inbox or full task list
return true if search current user inbox only
|
TaskSearchQuery |
getSearchQuery()
Returns task search query
|
ITaskInfo |
getTaskInfo()
Returns task info for the current row of the provider
|
protected TaskSearchQueryV2 |
getTaskSearchQueryV2(TaskSearchQuery value) |
int |
getTotalCount() |
Class<?> |
getType(Object propertyKey)
Returns java type of the given property
|
Object |
getValue(Object propertyKey)
Returns value of the given property
|
boolean |
hasProperty(Object propertyKey)
Checks if the given property is supported by this content provider
|
boolean |
isAutoRefresh()
Returns false
|
void |
refresh()
Should be called by the clients when the wrapped list
objects gets changed outside this provider.
|
void |
refreshTotalCount() |
void |
refreshTotalCount(boolean businessDataField) |
void |
setAutoRefresh(boolean autoRefresh)
Sets auto refresh mode on.
|
void |
setNeedRefresh(boolean needRefresh)
Tells the provider that the input parameters have changed and the output results need to be refreshed the next time any
output property is requested via
IContentProvider.getValue(Object) . |
void |
setSearchInbox(boolean value)
Setting whether to search current user inbox or full task list
|
boolean |
supportsAutoRefresh()
Returns
false |
createRow, deleteRow, getCurrentRow, getList, getRowId, getRowSelectedCount, getRowSelectedIds, getRowUnselectedIds, getSelectedRows, getUseUnselectedModel, isAddressable, isRowSelected, moveTo, setCurrentRow, setList, setRowById, setRowSelected, setRowSelectedIds, setRowUnselectedIds, setRowVariable, setTemplateRow, sort, updateOriginalList
calculateRowId, getArray, getCanTemplateRow, getOnCreateRow, getOnCreateRowExpression, getOnDeleteRow, getOnDeleteRowExpression, getRowCount, getRowIdBinding, getRowIdExpression, getRowIndex, getRowType, getRowVariable, getSort, isReadOnly, isReorderable, isRowAvailable, isTemplateRow, newRow, setArray, setCanTemplateRow, setOnCreateRow, setOnCreateRowExpression, setOnDeleteRow, setOnDeleteRowExpression, setRowId, setRowIdBinding, setRowIdExpression, setRowIndex, setRowType, setSort, setValue, toString
getExpireWithPageFlow, setExpireWithPageFlow
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCurrentRow, getRowCount, getRowIndex, getRowVariable, isRowAvailable, setRowIndex, setRowVariable
toString
public static final String PROPERTY_TASKDATA
protected boolean m_isAutoRefresh
protected boolean m_needRefresh
protected boolean m_searchInbox
protected boolean m_includeTaskData
protected TaskSearchQuery m_searchQuery
protected ITask[] m_results
protected int m_resultsTotalCount
public TaskSearchContentProvider()
public TaskSearchContentProvider(TaskSearchQuery searchQuery)
searchQuery
- task search querypublic TaskSearchQuery getSearchQuery()
protected String calculateRowId(int index, Object data)
data.getTaskInfo().getTaskID()
as RowIdcalculateRowId
in class ListTableContentProvider
index
- row indexdata
- row data objectpublic boolean getSearchInbox()
ITaskSearchContentProvider
getSearchInbox
in interface ITaskSearchContentProvider
public void setSearchInbox(boolean value)
ITaskSearchContentProvider
setSearchInbox
in interface ITaskSearchContentProvider
public ITask[] getResults() throws Exception
getResults
in interface ITaskSearchContentProvider
Exception
public ITaskInfo getTaskInfo()
public void refresh()
SelectableListTableContentProvider
refresh
in interface IRefreshable
refresh
in class SelectableListTableContentProvider
public void refreshTotalCount()
public void refreshTotalCount(boolean businessDataField)
protected TaskSearchQueryV2 getTaskSearchQueryV2(TaskSearchQuery value)
public boolean supportsAutoRefresh()
SelectableListTableContentProvider
false
supportsAutoRefresh
in interface IRefreshable
supportsAutoRefresh
in class SelectableListTableContentProvider
IRefreshable.setAutoRefresh(boolean)
public void setAutoRefresh(boolean autoRefresh) throws ContentProviderException
IRefreshable
Sets auto refresh mode on. When auto refresh mode is on, the provider calls IRefreshable.getNeedRefresh()
to determine whether the refresh needs to be done before returning any result properties. If it returns
true
, the provider calls IRefreshable.refresh()
method to updated the result properties.
setAutoRefresh
in interface IRefreshable
setAutoRefresh
in class SelectableListTableContentProvider
autoRefresh
- true to turn it onContentProviderException
- if autorefresh is trueIRefreshable.supportsAutoRefresh()
,
IRefreshable.getNeedRefresh()
,
IRefreshable.setNeedRefresh(boolean)
public boolean isAutoRefresh()
SelectableListTableContentProvider
isAutoRefresh
in interface IRefreshable
isAutoRefresh
in class SelectableListTableContentProvider
public boolean getNeedRefresh()
IRefreshable
Returns true
when IRefreshable.isAutoRefresh()
is on and the result properties need to be refreshed from
the data source by executing IRefreshable.refresh()
method.
Implementations may return an accurate value from this method if they can track the changes to the input parameter
properties or they may require the clients to call IRefreshable.setNeedRefresh(boolean)
explicitely.
getNeedRefresh
in interface IRefreshable
getNeedRefresh
in class SelectableListTableContentProvider
true
when the output properties are not up-to-date with the current input parameters, i.e. IRefreshable.refresh()
needs to be executed manually or automatically.public void setNeedRefresh(boolean needRefresh)
IRefreshable
IContentProvider.getValue(Object)
.setNeedRefresh
in interface IRefreshable
setNeedRefresh
in class SelectableListTableContentProvider
needRefresh
- true
if the input parameters have changedpublic Object[] getPropertyKeys()
ListTableContentProvider
ListTableContentProvider.getRowIndex()
index.getPropertyKeys
in interface IContentProvider
getPropertyKeys
in class ListTableContentProvider
String
or Integer
property keyspublic boolean hasProperty(Object propertyKey)
IContentProvider
hasProperty
in interface IContentProvider
hasProperty
in class ListTableContentProvider
propertyKey
- property key of type String
or Integer
true
if property is supportedpublic Object getValue(Object propertyKey) throws ELException, PropertyNotFoundException
IContentProvider
getValue
in interface IContentProvider
getValue
in class ListTableContentProvider
propertyKey
- the property key of type String
or Integer
null
PropertyNotFoundException
- if property is not supportedELException
public Class<?> getType(Object propertyKey) throws PropertyNotFoundException
IContentProvider
getType
in interface IContentProvider
getType
in class ListTableContentProvider
propertyKey
- the property key of type String
or Integer
Class
PropertyNotFoundException
- if property is not supported