|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectworkspace.SearchBar
public class SearchBar
Contributes a search bar component to the CodeBlocks GUI, which allows the user to find Searchables such as blocks in the drawers and workspace with a query by name.
Constructor Summary | |
---|---|
SearchBar(java.lang.String defaultText,
java.lang.String tooltip,
java.awt.Component defaultComponent)
Contructs a new search bar. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
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.Method Detail |
---|
public javax.swing.JComponent getComponent()
public java.lang.Iterable<SearchableElement> getSearchResults(SearchableContainer container)
container
- the returned search elements will be from this search container
public void addSearchableContainer(SearchableContainer searchable)
searchable
- the container to addpublic void removeSearchableContainer(SearchableContainer searchable)
searchable
- the container to removepublic void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |