Interface EntitySearchModel


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).
  • Field Details

    • DEFAULT_LIMIT

      static final PropertyValue<Integer> DEFAULT_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
    • selection

      Returns:
      the selection
    • 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
    • limit

      Value<Integer> limit()
      Returns:
      the Value controlling the search result limit
    • search

      List<Entity> search()
      Performs a query based on the current search configuration and returns the result. Note that the number of search results may be limited via limit().
      Returns:
      a list containing the entities fulfilling the current condition
      Throws:
      IllegalStateException - in case no search columns are specified
      See Also:
    • condition

      Value<Supplier<Condition>> 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

      Value<Function<Entity,String>> 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
    • settings

      Returns:
      the settings associated with each search column
    • searchString

      Value<String> searchString()
      Returns:
      the Value representing the search string
    • separator

      Value<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 new EntitySearchModel.Builder, initialized with the search columns for the given entity type
      Parameters:
      entityType - the type of the entity to search
      connectionProvider - the EntityConnectionProvider to use when performing the search
      Returns:
      a new EntitySearchModel.Builder instance
      See Also: