public interface EntitySearchModel
Searches for entities based on a search text and set of String based condition columns.
Factory for
EntitySearchModel.Builder
instances via builder(EntityType, EntityConnectionProvider)
.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A builder for aEntitySearchModel
.static interface
Column search settings -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PropertyValue<Integer>
Specifies the default search result limit, that is, the maximum number of results, null meaning no limit
Value type: Integer
Default value: null -
Method Summary
Modifier and TypeMethodDescriptionstatic EntitySearchModel.Builder
builder
(EntityType entityType, EntityConnectionProvider connectionProvider) Instantiates a newEntitySearchModel.Builder
, initialized with the search columns for the given entity typecolumns()
Sets the additional search condition supplier to use when performing the next search.entities()
entity()
limit()
void
reset()
Resets the search string so that is represents the selected entitiessearch()
Performs a query based on the current search configuration and returns the result.settings()
boolean
Note that changing this value does not change the search string accordingly.wildcard()
-
Field Details
-
LIMIT
Specifies the default search result limit, that is, the maximum number of results, null meaning no limit
Value type: Integer
Default value: null
-
-
Method Details
-
entityType
EntityType entityType()- Returns:
- the type of the entity this search model is based on
-
connectionProvider
EntityConnectionProvider connectionProvider()- Returns:
- the connection provider used by this search model
-
entity
- Returns:
- a Value controlling the selected entity
-
entities
- Returns:
- a Value controlling the selected entities
-
description
String description()- Returns:
- a string describing this search model, by default a comma separated list of search column names
-
columns
Collection<Column<String>> columns()- Returns:
- the columns used when performing a search
-
reset
void reset()Resets the search string so that is represents the selected entities -
wildcard
- Returns:
- the Value controlling the wildcard character
-
limit
- Returns:
- the value controlling the search result limit
-
search
Performs a query based on the current search configuration and returns the result. Note that the number of search results may be limited vialimit()
.- Returns:
- a list containing the entities fulfilling the current condition
- Throws:
IllegalStateException
- in case no search columns are specified- See Also:
-
condition
Sets the additional search condition supplier to use when performing the next search. This condition is AND'ed to the actual search condition. NOTE, this does not affect the currently selected value(s), if any.- Returns:
- the Value controlling the additional condition supplier
-
stringFunction
Note that changing this value does not change the search string accordingly.- Returns:
- the Value controlling the function providing the
toString()
implementation for the entities displayed by this model - See Also:
-
searchStringModified
StateObserver searchStringModified()- Returns:
- a StateObserver indicating whether the search string represents the selected entities
-
selectionEmpty
StateObserver selectionEmpty()- Returns:
- a StateObserver indicating whether the selection is empty
-
settings
Map<Column<String>,EntitySearchModel.Settings> settings()- Returns:
- the settings associated with each search column
-
searchString
- Returns:
- the Value representing the search string
-
separator
- Returns:
- the Value representing the text used to separate multiple entities
-
singleSelection
boolean singleSelection()- Returns:
- true if single selection is enabled
-
builder
static EntitySearchModel.Builder builder(EntityType entityType, EntityConnectionProvider connectionProvider) Instantiates a newEntitySearchModel.Builder
, initialized with the search columns for the given entity type- Parameters:
entityType
- the type of the entity to searchconnectionProvider
- the EntityConnectionProvider to use when performing the search- Returns:
- a new
EntitySearchModel.Builder
instance - See Also:
-