Class Overlay
java.lang.Object
org.patternfly.overlay.Overlay
Centralized controller for native popover management. Combines CSS anchor positioning, event listener registration,
entry/exit delay timers, and show/hide lifecycle management into a single reusable unit.
Components such as Tooltip and Popover delegate all overlay behavior to this class, keeping their own code focused on component-specific concerns (DOM structure, ARIA, content).
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionattach()Resolves the trigger element, sets up CSS anchor positioning, and registers event listeners based on the configuredTriggerMode.booleancssPositioning(boolean enabled) voiddetach()Removes all event listeners, cancels pending timers, hides the overlay if visible, and tears down CSS anchor positioning.intdistance()distance(int distance) entryDelay(int delay) exitDelay(int delay) voidhide()Hides the overlay.voidHides the overlay.matchTriggerWidth(boolean match) onToggle(OverlayHandler handler) Register a handler called after show/hide transitions.static Overlayoverlay(HTMLElement overlayElement, Placement placement) voidshow()Shows the overlay.voidShows the overlay.voidtoggle()Toggles the overlay between shown and hidden states.voidToggles the overlay between shown and hidden states.trigger()trigger(HTMLElement element) trigger(Supplier<HTMLElement> supplier) triggerMode(TriggerMode mode) booleanvisible()Returns whether the overlay is currently visible.
-
Method Details
-
overlay
-
triggerMode
-
trigger
-
trigger
-
trigger
-
trigger
-
placement
-
distance
-
entryDelay
-
exitDelay
-
cssPositioning
-
matchTriggerWidth
-
onToggle
Register a handler called after show/hide transitions. -
attach
Resolves the trigger element, sets up CSS anchor positioning, and registers event listeners based on the configuredTriggerMode. Returns the resolved trigger element ornull. -
detach
public void detach()Removes all event listeners, cancels pending timers, hides the overlay if visible, and tears down CSS anchor positioning. -
show
public void show()Shows the overlay. -
show
Shows the overlay. -
hide
public void hide()Hides the overlay. -
hide
Hides the overlay. -
toggle
public void toggle()Toggles the overlay between shown and hidden states. -
toggle
Toggles the overlay between shown and hidden states. -
overlayElement
-
trigger
-
cssPositioning
public boolean cssPositioning() -
distance
public int distance() -
visible
public boolean visible()Returns whether the overlay is currently visible.
-