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 TypeMethodDescriptionelemental2.dom.HTMLElementattach()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.voidhide(elemental2.dom.Event event) Hides the overlay.maxTriggerWidth(boolean match) minTriggerWidth(boolean match) onToggle(OverlayHandler handler) Register a handler called after show/hide transitions.static Overlayelemental2.dom.HTMLElementvoidshow()Shows the overlay.voidshow(elemental2.dom.Event event) Shows the overlay.voidtoggle()Toggles the overlay between shown and hidden states.voidtoggle(elemental2.dom.Event event) Toggles the overlay between shown and hidden states.elemental2.dom.HTMLElementtrigger()trigger(elemental2.dom.HTMLElement element) triggerMode(TriggerMode mode) booleanvisible()Returns whether the overlay is currently visible.
-
Method Details
-
overlay
-
triggerMode
-
trigger
-
trigger
-
trigger
-
trigger
-
placement
-
distance
-
entryDelay
-
exitDelay
-
cssPositioning
-
minTriggerWidth
-
maxTriggerWidth
-
onToggle
Register a handler called after show/hide transitions. -
attach
public elemental2.dom.HTMLElement 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
public void show(elemental2.dom.Event event) Shows the overlay. -
hide
public void hide()Hides the overlay. -
hide
public void hide(elemental2.dom.Event event) Hides the overlay. -
toggle
public void toggle()Toggles the overlay between shown and hidden states. -
toggle
public void toggle(elemental2.dom.Event event) Toggles the overlay between shown and hidden states. -
overlayElement
public elemental2.dom.HTMLElement overlayElement() -
trigger
public elemental2.dom.HTMLElement trigger() -
cssPositioning
public boolean cssPositioning() -
distance
public int distance() -
visible
public boolean visible()Returns whether the overlay is currently visible.
-