Class Dropdown
java.lang.Object
org.patternfly.component.ComponentDelegate<HTMLElement, Dropdown>
org.patternfly.component.menu.Dropdown
- All Implemented Interfaces:
Attachable, ElementAttributeMethods<HTMLElement, Dropdown>, ElementClassListMethods<HTMLElement, Dropdown>, ElementConsumerMethods<HTMLElement, Dropdown>, ElementContainerMethods<HTMLElement, Dropdown>, ElementEventMethods<HTMLElement, Dropdown>, ElementIdMethods<HTMLElement, Dropdown>, ElementQueryMethods<HTMLElement>, HTMLElementAttributeMethods<HTMLElement, Dropdown>, HTMLElementDataMethods<HTMLElement, Dropdown>, HTMLElementStyleMethods<HTMLElement, Dropdown>, HTMLElementVisibilityMethods<HTMLElement, Dropdown>, IsElement<HTMLElement>, TypedBuilder<HTMLElement, Dropdown>, Component, Expandable<HTMLElement, Dropdown>, Modifiers.Disabled<HTMLElement, Dropdown>
A dropdown presents a menu of actions or links in a constrained space that will trigger a process or navigate to a new
location.
This implementation uses the Popover API and CSS anchor positioning instead of Popper.js. The dropdown uses the browser's
top-layer rendering for correct stacking, eliminating z-index issues. CSS position-try-fallbacks handles menu
flipping when there is not enough space.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionapplyToMenuList(Consumer<MenuList> consumer) applyToMenuToggle(Consumer<MenuToggle> consumer) Provides access to the underlying menu toggle using a fluent API stylevoidattach(MutationRecord mutationRecord) voidcollapse(boolean fireEvent) voiddetach(MutationRecord mutationRecord) disabled(boolean disabled) Adds/removes modifier(disabled)static Dropdownstatic Dropdowndropdown(MenuToggle menuToggle) static Dropdowndropdown(PredefinedIcon icon, String label) voidexpand(boolean fireEvent) booleanmenu()onLoaded(ComponentHandler<Dropdown> loadedHandler) onToggle(ToggleHandler<Dropdown> toggleHandler) stayOpen(StayOpenPredicate stayOpen) Specifies a condition that determines whether the menu should remain open when the menu-toggle or the menu is clicked.that()Methods inherited from class ComponentDelegate
componentType, elementMethods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ElementAttributeMethods
aria, aria, aria, attr, attr, attr, role, roleMethods inherited from interface ElementClassListMethods
classList, classList, css, toggle, toggle, toggleMethods inherited from interface ElementConsumerMethods
apply, runMethods inherited from interface ElementContainerMethods
add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAllMethods inherited from interface ElementEventMethods
on, on, onMethods inherited from interface ElementIdMethods
id, uniqueIdMethods inherited from interface ElementQueryMethods
closest, querySelector, querySelectorAllMethods inherited from interface HTMLElementAttributeMethods
titleMethods inherited from interface HTMLElementDataMethods
data, dataMethods inherited from interface HTMLElementVisibilityMethods
hiddenMethods inherited from interface Modifiers.Disabled
disabled
-
Method Details
-
dropdown
-
dropdown
-
applyToMenuList
Applies the providedConsumerto theMenuListassociated with thisDropdown. If the menu, menu content, or menu list is not yet initialized, they will be created as part of this method.This method simplifies the process of adding menu items to the component. It is a shortcut for creating and adding a
DropdownMenu,MenuContent, andMenuListin a single step. Don't use this method if you need to us another menu type, want to customize the menu, content or list or if you want to useMenuGroups. -
that
-
attach
- Specified by:
attachin interfaceAttachable
-
detach
- Specified by:
detachin interfaceAttachable
-
applyToMenuToggle
Provides access to the underlying menu toggle using a fluent API style -
disabled
Description copied from interface:Modifiers.DisabledAdds/removes modifier(disabled)- Specified by:
disabledin interfaceModifiers.Disabled<HTMLElement, B extends TypedBuilder<HTMLElement, B>>
-
isDisabled
public boolean isDisabled()- Specified by:
isDisabledin interfaceModifiers.Disabled<HTMLElement, B extends TypedBuilder<HTMLElement, B>>
-
placement
-
ariaLabel
-
onLoaded
-
onToggle
-
collapse
public void collapse(boolean fireEvent) - Specified by:
collapsein interfaceExpandable<HTMLElement, B extends TypedBuilder<HTMLElement, B>>
-
expand
public void expand(boolean fireEvent) - Specified by:
expandin interfaceExpandable<HTMLElement, B extends TypedBuilder<HTMLElement, B>>
-