public class DefaultEntityTableConditionModel extends java.lang.Object implements EntityTableConditionModel
FilterCondition.AcceptAllCondition<T>, FilterCondition.RejectAllCondition<T>
Constructor and Description |
---|
DefaultEntityTableConditionModel(java.lang.String entityId,
EntityConnectionProvider connectionProvider,
PropertyFilterModelProvider filterModelProvider,
PropertyConditionModelProvider conditionModelProvider)
Instantiates a new DefaultEntityTableConditionModel
|
Modifier and Type | Method and Description |
---|---|
void |
addConditionStateListener(EventListener listener) |
void |
addSimpleConditionListener(EventListener listener) |
void |
clear()
Clears all data from this refreshable instance
|
void |
clearPropertyConditionModels()
Clears the search state of all PropertyConditionModels, disables them and
resets the search type to
ConditionType.LIKE |
boolean |
containsPropertyConditionModel(java.lang.String propertyId) |
Condition.Provider |
getAdditionalConditionProvider() |
FilterCondition<Entity> |
getAdditionalFilterCondition() |
Condition |
getCondition() |
StateObserver |
getConditionStateObserver() |
Conjunction |
getConjunction() |
java.lang.String |
getEntityId() |
PropertyConditionModel<? extends Property> |
getPropertyConditionModel(java.lang.String propertyId) |
java.util.Collection<PropertyConditionModel<? extends Property>> |
getPropertyConditionModels() |
ColumnConditionModel<Property> |
getPropertyFilterModel(java.lang.String propertyId)
The PropertyFilterModel associated with the property identified by
propertyId |
java.util.Collection<ColumnConditionModel<Property>> |
getPropertyFilterModels() |
java.lang.String |
getSimpleConditionString() |
EventObserver<java.lang.String> |
getSimpleConditionStringObserver() |
boolean |
hasConditionStateChanged() |
boolean |
include(Entity item) |
boolean |
isEnabled() |
boolean |
isEnabled(java.lang.String propertyId) |
boolean |
isFilterEnabled(java.lang.String propertyId) |
void |
performSimpleSearch()
Uses the simpleSearchText as a basis for a wildcard search on all String based condition models,
or the condition models representing the search properties for the underlying entity
|
void |
refresh()
Performs a refresh, reloading the relevant data
|
void |
rememberCurrentConditionState()
Remembers the current condition model state, any subsequent changes to condition
parameters or operators are notified via the conditionStateChanged observer.
|
void |
removeConditionStateListener(EventListener listener) |
void |
removeSimpleConditionListener(EventListener listener) |
EntityTableConditionModel |
setAdditionalConditionProvider(Condition.Provider conditionProvider)
Sets the additional condition provider, one not based on any individual property condition
|
EntityTableConditionModel |
setAdditionalFilterCondition(FilterCondition<Entity> filterCondition)
Sets the additional filter condition, one not based on any individual property condition
|
boolean |
setConditionValues(java.lang.String propertyId,
java.util.Collection values)
Sets the search condition values of the condition model associated with the property identified by
propertyId |
void |
setConjunction(Conjunction conjunction) |
void |
setEnabled(java.lang.String propertyId,
boolean enabled)
Enables/disables the search for the given property
|
void |
setFilterValue(java.lang.String propertyId,
java.lang.Comparable value)
Sets the condition value of the PropertyFilterModel associated with the property identified by
propertyId . |
void |
setSimpleConditionString(java.lang.String simpleConditionString)
Note that calling this method may (and probably will) change the automatic prefix and case sensetivity settings of
the underlying
ColumnConditionModel s |
public DefaultEntityTableConditionModel(java.lang.String entityId, EntityConnectionProvider connectionProvider, PropertyFilterModelProvider filterModelProvider, PropertyConditionModelProvider conditionModelProvider)
entityId
- the ID of the underlying entityconnectionProvider
- a EntityConnectionProvider instance, required if the searchable properties include
foreign key propertiesfilterModelProvider
- provides the column filter models for this table condition modelconditionModelProvider
- provides the column condition models for this table condition modelpublic final java.lang.String getEntityId()
getEntityId
in interface EntityTableConditionModel
public final void rememberCurrentConditionState()
rememberCurrentConditionState
in interface EntityTableConditionModel
EntityTableConditionModel.getConditionStateObserver()
public final boolean hasConditionStateChanged()
hasConditionStateChanged
in interface EntityTableConditionModel
EntityTableConditionModel.rememberCurrentConditionState()
public final ColumnConditionModel<Property> getPropertyFilterModel(java.lang.String propertyId)
propertyId
getPropertyFilterModel
in interface EntityTableConditionModel
propertyId
- the id of the property for which to retrieve the PropertyFilterModelpropertyId
, null if none is foundpublic final java.util.Collection<ColumnConditionModel<Property>> getPropertyFilterModels()
getPropertyFilterModels
in interface EntityTableConditionModel
public final boolean include(Entity item)
include
in interface FilterCondition<Entity>
item
- the itemitem
should be included, false if it should be filteredpublic final void refresh()
refresh
in interface Refreshable
public final void clear()
clear
in interface Refreshable
public final void clearPropertyConditionModels()
ConditionType.LIKE
clearPropertyConditionModels
in interface EntityTableConditionModel
public final java.util.Collection<PropertyConditionModel<? extends Property>> getPropertyConditionModels()
getPropertyConditionModels
in interface EntityTableConditionModel
public final boolean containsPropertyConditionModel(java.lang.String propertyId)
containsPropertyConditionModel
in interface EntityTableConditionModel
propertyId
- the id of the property for which to check for the PropertyConditionModelpropertyId
public final PropertyConditionModel<? extends Property> getPropertyConditionModel(java.lang.String propertyId)
getPropertyConditionModel
in interface EntityTableConditionModel
propertyId
- the id of the property for which to retrieve the PropertyConditionModelpropertyId
EntityTableConditionModel.containsPropertyConditionModel(String)
public final boolean isEnabled()
isEnabled
in interface EntityTableConditionModel
public final boolean isEnabled(java.lang.String propertyId)
isEnabled
in interface EntityTableConditionModel
propertyId
- the column propertyIdcolumnIndex
is enabledpublic final boolean isFilterEnabled(java.lang.String propertyId)
isFilterEnabled
in interface EntityTableConditionModel
propertyId
- column propertyIdcolumnIndex
is enabledpublic final boolean setConditionValues(java.lang.String propertyId, java.util.Collection values)
propertyId
setConditionValues
in interface EntityTableConditionModel
propertyId
- the id of the propertyvalues
- the search condition valuespublic final void setFilterValue(java.lang.String propertyId, java.lang.Comparable value)
propertyId
.setFilterValue
in interface EntityTableConditionModel
propertyId
- the id of the propertyvalue
- the condition valuepublic final Condition getCondition()
getCondition
in interface EntityTableConditionModel
public final Condition.Provider getAdditionalConditionProvider()
getAdditionalConditionProvider
in interface EntityTableConditionModel
public final EntityTableConditionModel setAdditionalConditionProvider(Condition.Provider conditionProvider)
setAdditionalConditionProvider
in interface EntityTableConditionModel
conditionProvider
- the condition providerpublic final FilterCondition<Entity> getAdditionalFilterCondition()
getAdditionalFilterCondition
in interface EntityTableConditionModel
public final EntityTableConditionModel setAdditionalFilterCondition(FilterCondition<Entity> filterCondition)
setAdditionalFilterCondition
in interface EntityTableConditionModel
filterCondition
- the conditionpublic final java.lang.String getSimpleConditionString()
getSimpleConditionString
in interface EntityTableConditionModel
EntityTableConditionModel.performSimpleSearch()
public final void setSimpleConditionString(java.lang.String simpleConditionString)
ColumnConditionModel
ssetSimpleConditionString
in interface EntityTableConditionModel
simpleConditionString
- the text to use next time a simple search is performedEntityTableConditionModel.performSimpleSearch()
,
ColumnConditionModel.setCaseSensitive(boolean)
,
ColumnConditionModel.setAutomaticWildcard(ColumnConditionModel.AutomaticWildcard)
public final void performSimpleSearch()
performSimpleSearch
in interface EntityTableConditionModel
Entity.Definition#getSearchProperties()
public final Conjunction getConjunction()
getConjunction
in interface EntityTableConditionModel
Conjunction.AND
Conjunction
public final void setConjunction(Conjunction conjunction)
setConjunction
in interface EntityTableConditionModel
conjunction
- the conjunction to be used when more than one column search condition is activeConjunction
public final void setEnabled(java.lang.String propertyId, boolean enabled)
setEnabled
in interface EntityTableConditionModel
propertyId
- the id of the property for which to enable/disable the searchenabled
- if true the search is enabled, otherwise it is disabledpublic final EventObserver<java.lang.String> getSimpleConditionStringObserver()
getSimpleConditionStringObserver
in interface EntityTableConditionModel
public final StateObserver getConditionStateObserver()
getConditionStateObserver
in interface EntityTableConditionModel
EntityTableConditionModel.rememberCurrentConditionState()
public final void addConditionStateListener(EventListener listener)
addConditionStateListener
in interface EntityTableConditionModel
listener
- a listener notified each time the search state changespublic final void removeConditionStateListener(EventListener listener)
removeConditionStateListener
in interface EntityTableConditionModel
listener
- the listener to removepublic final void addSimpleConditionListener(EventListener listener)
addSimpleConditionListener
in interface EntityTableConditionModel
listener
- a listener notified each time a simple search is performedpublic final void removeSimpleConditionListener(EventListener listener)
removeSimpleConditionListener
in interface EntityTableConditionModel
listener
- the listener to remove