Class ToggleEvent


public class ToggleEvent extends ClientEvent<ToggleListener>
Represents a toggle event that occurs when a popover or details element is toggled.

This event provides the old and new states of the toggled element (e.g., "open" and "closed").

Since:
2026
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • ToggleEvent

      public ToggleEvent(String oldState, String newState)
      Constructs a new ToggleEvent with the specified old and new states.
      Parameters:
      oldState - the previous state of the element (e.g., "closed")
      newState - the new state of the element (e.g., "open")
  • Method Details

    • getOldState

      public String getOldState()
      Returns the previous state of the toggled element.
      Returns:
      the old state
    • getNewState

      public String getNewState()
      Returns the new state of the toggled element.
      Returns:
      the new state
    • dispatchTo

      public void dispatchTo(ToggleListener listener)
      Dispatches this event to the specified listener for processing.
      Specified by:
      dispatchTo in class Event<ToggleListener>
      Parameters:
      listener - the listener to which this event should be dispatched