com.vaadin.flow.component.accordion.
Class Accordion.OpenedChangeEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.flow.component.ComponentEvent<Accordion>
-
- com.vaadin.flow.component.accordion.Accordion.OpenedChangeEvent
-
All Implemented Interfaces:
Enclosing class:
@DomEvent("opened-changed") public static class Accordion.OpenedChangeEvent extends ComponentEvent<Accordion>
An event fired when an Accordion is opened or closed.
See Also:
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description OpenedChangeEvent​(Accordion source, boolean fromClient, Integer index)
Creates a new event using the given source and indicator whether the event originated from the client side or the server side.
-
Method Summary
All Methods Modifier and Type Method Description OptionalInt
getOpenedIndex()
Gets the index of the opened panel or null if the accordion is closed.
Optional<AccordionPanel>
getOpenedPanel()
Gets the opened panel.
-
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListener
-
Methods inherited from class java.util.EventObject
toString
-
-
-
-
Constructor Detail
-
OpenedChangeEvent
public OpenedChangeEvent​(Accordion source, boolean fromClient, @EventData("event.detail.value") Integer index)
Creates a new event using the given source and indicator whether the event originated from the client side or the server side.
Parameters:
source
- the source componentfromClient
-true
if the event originated from the clientindex
- the index of the opened panel or null if the accordion is closed
-
-
Method Detail
-
getOpenedIndex
public OptionalInt getOpenedIndex()
Gets the index of the opened panel or null if the accordion is closed.
Returns:
the index of the opened panel or null if closed
-
getOpenedPanel
public Optional<AccordionPanel> getOpenedPanel()
Gets the opened panel. Caution should be exercised when using this method with an Accordion which along with its panels were created in a template. Such template children would by default not be children of the Accordion Flow component, thus making it possible for this method to return the wrong panel in such cases.
Returns:
the opened panel.
-
-