Interface ContentSelector<T>
public interface ContentSelector<T>
An UI for selecting content of a given type.
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a change listener that will be notified when the selection has changed.getMediumIcon(boolean inverted) Returns a representative icon for the type of entity being selected.Returns the selected content, ornullif no content was selected.Returns a string representation for the selected content.Returns the selector UI.getTinyIcon(boolean inverted) Returns a representative icon for the type of entity being selected.getTitle()Returns the title of the selector, e.g.booleanReturns true if any content is selected.voidRemoves a change listener.voidSets the selector to select all entities.default voidsetAlwaysSelected(Predicate alwaysSelected) voidSets the selector to select no entities.default voidsetSelectionContext(String context) Set an optional context string for the selected entities.
-
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. -
getTitle
String getTitle()Returns the title of the selector, e.g. "Models" for models etc. -
getTinyIcon
Returns a representative icon for the type of entity being selected. -
getMediumIcon
Returns a representative icon for the type of entity being selected. -
setAllSelected
void setAllSelected()Sets the selector to select all entities. -
setNoneSelected
void setNoneSelected()Sets the selector to select no entities. -
getSelectedContentRepresentation
String getSelectedContentRepresentation()Returns a string representation for the selected content. -
isContentSelected
boolean isContentSelected()Returns true if any content is selected. -
getSelectedContent
T getSelectedContent()Returns the selected content, ornullif no content was selected. -
setSelectionContext
Set an optional context string for the selected entities. The default string will be for example "5 models". Adding a context string will change the message to "5 models {context}", e.g. "5 models will be published".- Parameters:
context-
-
setAlwaysSelected
-