Interface SingleSelector<T>


public interface SingleSelector<T>
Lets the user manually select single entities of a given type.
  • Method Details

    • addChangeListener

      void addChangeListener(ChangeListener l)
      Adds a change listener that will be notified when the selection has changed.
    • removeChangeListener

      void removeChangeListener(ChangeListener l)
      Removes a change listener.
    • getSelectorUI

      JPanel getSelectorUI()
      Returns the selector UI.
    • getTinyIcon

      Icon getTinyIcon()
      Returns a representative icon for the type of entity being selected.
    • getMediumIcon

      Icon getMediumIcon()
      Returns a representative icon for the type of entity being selected.
    • isContentChosen

      boolean isContentChosen()
      Returns true if the user has actively chosen content and the UI should be closed.
    • isContentSelected

      boolean isContentSelected()
      Returns true if any content is selected.
    • getSelectedContent

      List<T> getSelectedContent()
      Returns the selected content, or null if no content was selected.
    • getSingleSelectedContent

      Optional<T> getSingleSelectedContent()
      Returns the optionally selected content when selecting a single entity. This is equivalent to calling getSelectedContent, checking if it is empty and fetching the first element of the list.
    • addLoadListener

      void addLoadListener(Consumer<SingleSelector.LoadState> loadListener)
      Adds a load listener to this selector. The load listener will be informed when the selector starts loading and when it is done loading.
      Parameters:
      loadListener - The load listener to add.
    • removeLoadListener

      void removeLoadListener(Consumer<SingleSelector.LoadState> loadListener)
      Removes a load listener from this selector.
      Parameters:
      loadListener - The load listener to remove.
    • clearSelection

      default void clearSelection()
      Clears the selection