public class SearchBar
extends java.lang.Object
| Constructor and Description |
|---|
SearchBar(java.lang.String defaultText,
java.lang.String tooltip,
java.awt.Component defaultComponent)
Contructs a new search bar.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSearchableContainer(SearchableContainer searchable)
Adds a searchable to the set of searchables queried by this search bar.
|
javax.swing.JComponent |
getComponent()
Returns the Swing component representation of the search bar.
|
java.lang.Iterable<SearchableElement> |
getSearchResults(SearchableContainer container)
Returns a set of elements representing the search results for a particular
container.
|
void |
removeSearchableContainer(SearchableContainer searchable)
Removes a searchable container from the set of searchables queried by this search bar.
|
void |
reset()
Clears all the internal data of this.
|
public SearchBar(java.lang.String defaultText,
java.lang.String tooltip,
java.awt.Component defaultComponent)
defaultText - the text to show when the user is not using the search bar,
such as "Search blocks"tooltip - the text to show as a tooltip for the search bar when the user hovers the mouse
over the search bar.defaultComponent - the component for which focus should be requested if the user
presses the Escape key while using the search bar.public javax.swing.JComponent getComponent()
public java.lang.Iterable<SearchableElement> getSearchResults(SearchableContainer container)
container - the returned search elements will be from this search containerpublic void addSearchableContainer(SearchableContainer searchable)
searchable - the container to addpublic void removeSearchableContainer(SearchableContainer searchable)
searchable - the container to removepublic void reset()