Interface SingleSelector<T>
public interface SingleSelector<T>
Lets the user manually select single entities of a given type.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a change listener that will be notified when the selection has changed.void
addLoadListener
(Consumer<SingleSelector.LoadState> loadListener) Adds a load listener to this selector.default void
Clears the selectionReturns a representative icon for the type of entity being selected.Returns the selected content, ornull
if no content was selected.Returns the selector UI.Returns the optionally selected content when selecting a single entity.Returns a representative icon for the type of entity being selected.boolean
Returns true if the user has actively chosen content and the UI should be closed.boolean
Returns true if any content is selected.void
Removes a change listener.void
removeLoadListener
(Consumer<SingleSelector.LoadState> loadListener) Removes a load listener from this selector.
-
Method Details
-
addChangeListener
Adds a change listener that will be notified when the selection has changed. -
removeChangeListener
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
Returns the selected content, ornull
if no content was selected. -
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
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
Removes a load listener from this selector.- Parameters:
loadListener
- The load listener to remove.
-
clearSelection
default void clearSelection()Clears the selection
-