Interface EntitySearchModel

    • Method Detail

      • 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
      • getSelectedEntities

        List<Entity> getSelectedEntities()
        Returns:
        an unmodifiable view of the selected entities
      • setSelectedEntity

        void setSelectedEntity​(Entity entity)
        Sets the given entity as the selected entity
        Parameters:
        entity - the entity to set as the selected entity
      • setSelectedEntities

        void setSelectedEntities​(List<Entity> entities)
        Sets the selected entities
        Parameters:
        entities - the entities to set as selected
        Throws:
        IllegalArgumentException - if this search model does not allow multiple selections and entities.size() is larger than 1
      • getDescription

        String getDescription()
        Returns:
        a string describing this search model, by default a comma separated list of search attribute names
      • setDescription

        void setDescription​(String description)
        Parameters:
        description - a string describing this search model
      • setResultSorter

        void setResultSorter​(Comparator<Entity> resultSorter)
        Parameters:
        resultSorter - the comparator used to sort the search result, null if the result should not be sorted
      • refreshSearchText

        void refreshSearchText()
        Refreshes the search text so that is represents the selected entities
      • setSearchString

        void setSearchString​(String searchString)
        Sets the search string to use when performing the next search
        Parameters:
        searchString - the search string
      • getSearchString

        String getSearchString()
        Returns:
        the current search string value
      • wildcardValue

        Value<Character> wildcardValue()
        Returns:
        the Value controlling the wildcard character
      • searchStringRepresentsSelected

        boolean searchStringRepresentsSelected()
        Returns:
        true if the current search string represents the selected entities
      • performQuery

        List<Entity> performQuery()
        Performs a query based on the select condition
        Returns:
        a list containing the entities fulfilling the current condition
        Throws:
        IllegalStateException - in case no search attributes are specified
      • setAdditionalConditionSupplier

        void setAdditionalConditionSupplier​(Supplier<Condition> additionalConditionSupplier)
        Sets the additional search condition provider 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.
        Parameters:
        additionalConditionSupplier - the additional search condition provider
      • setToStringProvider

        void setToStringProvider​(Function<Entity,​String> toStringProvider)
        Override the default toString() for search elements when displayed in a field based on this model
        Parameters:
        toStringProvider - provides string representations
      • getToStringProvider

        Function<Entity,​String> getToStringProvider()
        Returns:
        the toString provider, null if none is specified
      • addSelectedEntitiesListener

        void addSelectedEntitiesListener​(EventDataListener<List<Entity>> listener)
        Parameters:
        listener - a listener to be notified each time the selected entities are changed
      • searchStringRepresentsSelectedObserver

        StateObserver searchStringRepresentsSelectedObserver()
        Returns:
        a StateObserver indicating whether the search string represents the selected entities
      • searchStringValue

        Value<String> searchStringValue()
        Returns:
        the Value representing the search string
      • multipleItemSeparatorValue

        Value<String> multipleItemSeparatorValue()
        Returns:
        the Value representing the multiple item separator setting
      • multipleSelectionEnabledState

        State multipleSelectionEnabledState()
        Returns:
        the State representing the multiple selection enabled setting