org.jminor.framework.client.model
Interface EntityTableSearchModel

All Superinterfaces:
FilterCriteria<Entity>, Refreshable
All Known Implementing Classes:
DefaultEntityTableSearchModel

public interface EntityTableSearchModel
extends FilterCriteria<Entity>, Refreshable

This interface defines filtering functionality, which refers to showing/hiding entities already available in a table model and searching functionality, which refers to configuring the underlying query, which then needs to be re-run.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jminor.common.model.FilterCriteria
FilterCriteria.AcceptAllCriteria<T>, FilterCriteria.RejectAllCriteria<T>
 
Method Summary
 void addFilterStateListener(ActionListener listener)
           
 void clearPropertySearchModels()
          Clears the state of all PropertySearchModels
 boolean containsPropertySearchModel(String propertyID)
           
 Criteria<Property.ColumnProperty> getAdditionalSearchCriteria()
           
 String getEntityID()
           
 ColumnSearchModel<Property> getPropertyFilterModel(String propertyID)
          The PropertyFilterModel associated with the property identified by propertyID
 Collection<ColumnSearchModel<Property>> getPropertyFilterModels()
           
 List<ColumnSearchModel<Property>> getPropertyFilterModelsOrdered()
           
 PropertySearchModel<? extends Property.SearchableProperty> getPropertySearchModel(String propertyID)
           
 Collection<PropertySearchModel<? extends Property.SearchableProperty>> getPropertySearchModels()
           
 List<Property.SearchableProperty> getSearchableProperties()
           
 Conjunction getSearchConjunction()
           
 Criteria<Property.ColumnProperty> getSearchCriteria()
           
 StateObserver getSearchStateChangedState()
           
 boolean isFilterEnabled(String propertyID)
           
 boolean isSearchEnabled(String propertyID)
           
 boolean isSimpleSearch()
           
 void removeFilterStateListener(ActionListener listener)
           
 EntityTableSearchModel setAdditionalSearchCriteria(Criteria<Property.ColumnProperty> criteria)
          Sets the additional search criteria, one not based on any individual property criteria
 void setFilterValue(String propertyID, Comparable value)
          Sets the criteria value of the PropertyFilterModel associated with the property identified by propertyID.
 void setSearchConjunction(Conjunction conjunction)
           
 void setSearchEnabled(String propertyID, boolean enabled)
          Enables/disables the search for the given property
 void setSearchModelState()
          Sets the current search model state
 boolean setSearchValues(String propertyID, Collection<?> values)
          Sets the search criteria values of the search model associated with the property identified by propertyID
 
Methods inherited from interface org.jminor.common.model.FilterCriteria
include
 
Methods inherited from interface org.jminor.common.model.Refreshable
clear, refresh
 

Method Detail

getEntityID

String getEntityID()
Returns:
the ID of the entity this table searcher is based on

getSearchableProperties

List<Property.SearchableProperty> getSearchableProperties()
Returns:
the properties that are searchable via this searcher

setSearchValues

boolean setSearchValues(String propertyID,
                        Collection<?> values)
Sets the search criteria values of the search model associated with the property identified by propertyID

Parameters:
propertyID - the ID of the property
values - the search criteria values
Returns:
true if the search state changed as a result of this method call, false otherwise

setFilterValue

void setFilterValue(String propertyID,
                    Comparable value)
Sets the criteria value of the PropertyFilterModel associated with the property identified by propertyID.

Parameters:
propertyID - the id of the property
value - the criteria value

getSearchCriteria

Criteria<Property.ColumnProperty> getSearchCriteria()
Returns:
the current criteria based on the state of the search models

getAdditionalSearchCriteria

Criteria<Property.ColumnProperty> getAdditionalSearchCriteria()
Returns:
any additional search criteria, not based on any individual property criteria

setAdditionalSearchCriteria

EntityTableSearchModel setAdditionalSearchCriteria(Criteria<Property.ColumnProperty> criteria)
Sets the additional search criteria, one not based on any individual property criteria

Parameters:
criteria - the criteria
Returns:
this EntityTableSearchModel instance

isSearchEnabled

boolean isSearchEnabled(String propertyID)
Parameters:
propertyID - the column propertyID
Returns:
true if the PropertySearchModel behind column with index columnIndex is enabled

setSearchEnabled

void setSearchEnabled(String propertyID,
                      boolean enabled)
Enables/disables the search for the given property

Parameters:
propertyID - the ID of the property for which to enable/disable the search
enabled - if true the search is enabled, otherwise it is disabled

setSearchModelState

void setSearchModelState()
Sets the current search model state

See Also:
getSearchStateChangedState()

isSimpleSearch

boolean isSimpleSearch()
Returns:
true if simple search should be activated

getSearchConjunction

Conjunction getSearchConjunction()
Returns:
the conjunction to be used when more than one column search criteria is active, the default is Conjunction.AND
See Also:
Conjunction

setSearchConjunction

void setSearchConjunction(Conjunction conjunction)
Parameters:
conjunction - the conjunction to be used when more than one column search criteria is active
See Also:
Conjunction

containsPropertySearchModel

boolean containsPropertySearchModel(String propertyID)
Parameters:
propertyID - the id of the property for which to check for the PropertySearchModel
Returns:
true if this EntityTableSearchModel contains a PropertySearchModel associated with the property identified by propertyID

getPropertySearchModels

Collection<PropertySearchModel<? extends Property.SearchableProperty>> getPropertySearchModels()
Returns:
a list containing the PropertySearchModels configured in this table search model

getPropertySearchModel

PropertySearchModel<? extends Property.SearchableProperty> getPropertySearchModel(String propertyID)
Parameters:
propertyID - the id of the property for which to retrieve the PropertySearchModel
Returns:
the PropertySearchModel associated with the property identified by propertyID

clearPropertySearchModels

void clearPropertySearchModels()
Clears the state of all PropertySearchModels


getPropertyFilterModels

Collection<ColumnSearchModel<Property>> getPropertyFilterModels()
Returns:
the property filters configured in this table search model

getPropertyFilterModelsOrdered

List<ColumnSearchModel<Property>> getPropertyFilterModelsOrdered()
Returns:
the PropertyFilterModels in the same order as the columns they represent

getPropertyFilterModel

ColumnSearchModel<Property> getPropertyFilterModel(String propertyID)
The PropertyFilterModel associated with the property identified by propertyID

Parameters:
propertyID - the id of the property for which to retrieve the PropertyFilterModel
Returns:
the PropertyFilterModel for the property with id propertyID

isFilterEnabled

boolean isFilterEnabled(String propertyID)
Parameters:
propertyID - column propertyID
Returns:
true if the PropertyFilterModel behind column with index columnIndex is enabled

getSearchStateChangedState

StateObserver getSearchStateChangedState()
Returns:
a State activated each time the search state differs from the state at last reset
See Also:
setSearchModelState()

addFilterStateListener

void addFilterStateListener(ActionListener listener)
Parameters:
listener - a listener notified each time the filter state changes

removeFilterStateListener

void removeFilterStateListener(ActionListener listener)
Parameters:
listener - the listener to remove