Package org.patternfly.component.menu
Class MenuSearchInput
java.lang.Object
org.patternfly.component.SubComponent<HTMLElement,MenuSearchInput>
org.patternfly.component.menu.MenuSearchInput
- All Implemented Interfaces:
Attachable,ElementAttributeMethods<HTMLElement,,MenuSearchInput> ElementClassListMethods<HTMLElement,,MenuSearchInput> ElementConsumerMethods<HTMLElement,,MenuSearchInput> ElementContainerMethods<HTMLElement,,MenuSearchInput> ElementEventMethods<HTMLElement,,MenuSearchInput> ElementIdMethods<HTMLElement,,MenuSearchInput> ElementQueryMethods<HTMLElement>,HTMLElementAttributeMethods<HTMLElement,,MenuSearchInput> HTMLElementDataMethods<HTMLElement,,MenuSearchInput> HTMLElementStyleMethods<HTMLElement,,MenuSearchInput> HTMLElementVisibilityMethods<HTMLElement,,MenuSearchInput> IsElement<HTMLElement>,TypedBuilder<HTMLElement,MenuSearchInput>
public class MenuSearchInput
extends SubComponent<HTMLElement,MenuSearchInput>
implements Attachable
-
Method Summary
Modifier and TypeMethodDescriptionaddSearchInput(TextInputGroup textInputGroup) voidattach(MutationRecord mutationRecord) static MenuSearchInputonNoResults(Function<String, MenuItem> noResults) onSearch(BiPredicate<MenuItem, String> searchFilter) Configures the search behavior for the search input you have added withaddSearchInput(TextInputGroup).that()Methods inherited from class org.patternfly.component.SubComponent
elementMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jboss.elemento.Attachable
detachMethods inherited from interface org.jboss.elemento.ElementAttributeMethods
aria, aria, aria, attr, attr, attr, role, roleMethods inherited from interface org.jboss.elemento.ElementClassListMethods
classList, classList, css, toggle, toggle, toggleMethods inherited from interface org.jboss.elemento.ElementConsumerMethods
apply, runMethods inherited from interface org.jboss.elemento.ElementContainerMethods
add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAllMethods inherited from interface org.jboss.elemento.ElementEventMethods
on, on, onMethods inherited from interface org.jboss.elemento.ElementIdMethods
id, uniqueIdMethods inherited from interface org.jboss.elemento.ElementQueryMethods
closest, querySelector, querySelectorAllMethods inherited from interface org.jboss.elemento.HTMLElementAttributeMethods
titleMethods inherited from interface org.jboss.elemento.HTMLElementDataMethods
dataMethods inherited from interface org.jboss.elemento.HTMLElementStyleMethods
style, style, style, style, style, styleMethods inherited from interface org.jboss.elemento.HTMLElementVisibilityMethods
hidden
-
Method Details
-
attach
- Specified by:
attachin interfaceAttachable
-
onSearch
Configures the search behavior for the search input you have added withaddSearchInput(TextInputGroup).Menu menu = menu(MenuType.menu, click) .addSearch(menuSearch() .addSearchInput(menuSearchInput() .addSearchInput(searchInputGroup()) .onSearch((menuItem, value) -> menuItem.text().toLowerCase().contains(value.toLowerCase())) .onNoResults(value -> menuItem(Id.unique("no-results"), "No results found for \"" + value + "\"") .disabled()))) .addDivider() .addContent(menuContent() .addList(menuList() .addItem(menuItem("item-0", "Action 1")) .addItem(menuItem("item-1", "Action 2")) .addItem(menuItem("item-2", "Action 3"))));- Parameters:
searchFilter- aBiPredicatethat defines the search logic. The first parameter is aMenuItemrepresenting a menu item, and the second parameter is aStringrepresenting the search query. The predicate should returntruefor items matching the search.- Returns:
- the
MenuSearchInputinstance for method chaining.
-
onNoResults
-
that
- Specified by:
thatin interfaceTypedBuilder<HTMLElement,MenuSearchInput>
-
addSearchInput