Class EntitySearchField

    • Method Detail

      • model

        public EntitySearchModel model()
        Returns:
        the search model this search field is based on
      • setSelectionProvider

        public void setSelectionProvider​(EntitySearchField.SelectionProvider selectionProvider)
        Sets the SelectionProvider, that is, the object responsible for providing the component used for selecting items from the search result.
        Parameters:
        selectionProvider - the EntitySearchField.SelectionProvider implementation to use when presenting a selection dialog to the user
        Throws:
        NullPointerException - in case selectionProvider is null
      • lookupEntity

        public static Optional<Entity> lookupEntity​(EntityType entityType,
                                                    EntityConnectionProvider connectionProvider,
                                                    JComponent dialogParent,
                                                    String dialogTitle)
        Performs a search for the given entity type, using a EntitySearchField displayed in a dialog, using the default search attributes for the given entityType.
        Parameters:
        entityType - the entityType of the entity to perform a search for
        connectionProvider - the connection provider
        dialogParent - the component serving as the dialog parent
        dialogTitle - the title to display on the dialog
        Returns:
        the selected entity, an empty Optional in case none was selected
        Throws:
        CancelException - in case the user cancelled
        See Also:
        EntityDefinition.searchAttributes()
      • lookupEntities

        public static List<Entity> lookupEntities​(EntityType entityType,
                                                  EntityConnectionProvider connectionProvider,
                                                  JComponent dialogParent,
                                                  String dialogTitle)
        Performs a search for the given entity type, using a EntitySearchField displayed in a dialog, using the default search attributes for the given entityType.
        Parameters:
        entityType - the entityType of the entity to perform a search for
        connectionProvider - the connection provider
        dialogParent - the component serving as the dialog parent
        dialogTitle - the title to display on the dialog
        Returns:
        the selected entities
        Throws:
        CancelException - in case the user cancelled
        See Also:
        EntityDefinition.searchAttributes()