Class ComponentObservationEvent
java.lang.Object
java.util.EventObject
com.vaadin.flow.component.ComponentEvent<ComponentObserver>
org.vaadin.miki.superfields.lazyload.ComponentObservationEvent
- All Implemented Interfaces:
Serializable
public class ComponentObservationEvent
extends com.vaadin.flow.component.ComponentEvent<ComponentObserver>
Information about the component being observed by
ComponentObserver.- Since:
- 2020-04-28
- Author:
- miki
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionComponentObservationEvent(ComponentObserver source, com.vaadin.flow.component.Component observedComponent, double visibilityRange) Constructs a prototypical Event. -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.component.ComponentReturns the component that has been observed.doubleReturns the visibility range that happened to the observed component.final booleanHelper method for checking if the observed component is fully visible.final booleanHelper method for checking if the observed component is no longer visible.Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListenerMethods inherited from class java.util.EventObject
toString
-
Constructor Details
-
ComponentObservationEvent
public ComponentObservationEvent(ComponentObserver source, com.vaadin.flow.component.Component observedComponent, double visibilityRange) Constructs a prototypical Event.- Parameters:
source- The object on which the Event initially occurredobservedComponent- Component that was observed.visibilityRange- Visibility range when the event happened.- Throws:
IllegalArgumentException- if source is null
-
-
Method Details
-
getObservedComponent
public com.vaadin.flow.component.Component getObservedComponent()Returns the component that has been observed.- Returns:
- A
Component.
-
getVisibilityRange
public double getVisibilityRange()Returns the visibility range that happened to the observed component.- Returns:
- A number between
0and1, close to one of the registered visibility ranges.
-
isNotVisible
public final boolean isNotVisible()Helper method for checking if the observed component is no longer visible.- Returns:
getVisibilityRange() == 0.0d
-
isFullyVisible
public final boolean isFullyVisible()Helper method for checking if the observed component is fully visible.- Returns:
getVisibilityRange() == 1.0d
-