A custom text component that can be used as an immediate search control. This control provides support for displaying an inline prompt, next and previous search buttons and a cancel search button.

It is intended to be used in places where "search as you type" is supported, i.e. the search is performed immediately as the user types the query and they do not have to click a secondary button or press enter to initiate the search.

setAllowEmptySearch(boolean allowEmptySearch)
Sets whether this field will keep the search action enabled (and thus the search button) when the style is SearchField.Style.SEARCH and there is no text to use as search query.

setCategoriesPopup

setAutoFind

Sets whether this field will automatically trigger find next on keyboard presses when the style is SearchField.Style.FIND. The default for auto find is false.

Parameters:

autoFind - if true, this field will fire searchPerformed events on each keypress when the style is SearchField.Style.FIND.

setAllowEmptySearch

public void setAllowEmptySearch(boolean allowEmptySearch)

Sets whether this field will keep the search action enabled (and thus the search button) when the style is SearchField.Style.SEARCH and there is no text to use as search query. The default is to not allow it.

Parameters:

allowEmptySearch - if true, this field will enable the search action even if there is not text on it when the style is set to SearchField.Style.SEARCH.

isAutoFind

public boolean isAutoFind()

Returns true if this field will automatically trigger find next on keyboard presses when the style is SearchField.Style.FIND.

Returns:

true if the field fires find events on keypresses.

isAllowEmptySearch

public boolean isAllowEmptySearch()

Returns true, this field will enable the search action even if there is not text on it when the style is set to SearchField.Style.SEARCH.

Returns:

true, this field will enable the search action even if there is not text on it when the style is set to SearchField.Style.SEARCH.

addCategory

Adds a category to the search field. The category will be available in a drop down list on the search button. Listeners receive notification when the search category changes via the searchCategoryChanged event.

The first category to be added will immediately be set as the currently selected category and an event will be fired to any registered listeners.

Parameters:

category - a category to add. Must not be null.

removeCategory

Removes a category from the search field. If the removed category is the currently selected category, then the first category will be selected. If no more categories are available, then the category will be reset to null.

Parameters:

category - a category to remove from the search field.

clearCategories

public void clearCategories()

Removes all categories from the search field. The category will be reset to null.