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 byComponentObserver.- Since:
- 2020-04-28
- Author:
- miki
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description ComponentObservationEvent(ComponentObserver source, com.vaadin.flow.component.Component observedComponent, double visibilityRange)Constructs a prototypical Event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.vaadin.flow.component.ComponentgetObservedComponent()Returns the component that has been observed.doublegetVisibilityRange()Returns the visibility range that happened to the observed component.booleanisFullyVisible()Helper method for checking if the observed component is fully visible.booleanisNotVisible()Helper method for checking if the observed component is no longer visible.-
Methods inherited from class com.vaadin.flow.component.ComponentEvent
getSource, isFromClient, unregisterListener
-
Methods inherited from class java.util.EventObject
toString
-
-
-
-
Constructor Detail
-
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 Detail
-
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
-
-