com.vaadin.data.
Class HasValue.ValueChangeEvent<V>
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.data.HasValue.ValueChangeEvent<V>
-
Type Parameters:
V
- the value typeAll Implemented Interfaces:
Direct Known Subclasses:
public static class HasValue.ValueChangeEvent<V> extends EventObject implements HasUserOriginated
An event fired when the value of a
HasValue
changes.See Also:
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor Description ValueChangeEvent(Component component, HasValue<V> hasValue, V oldValue, boolean userOriginated)
Creates a new
ValueChange
event containing the given value, originating from the given source component.ValueChangeEvent(COMPONENT component, V oldValue, boolean userOriginated)
Creates a new
ValueChange
event containing the current value of the given value-bearing source component.
-
Method Summary
All Methods Modifier and Type Method Description Component
getComponent()
Returns the component.
V
getOldValue()
Returns the value of the source before this value change event occurred.
HasValue<V>
getSource()
V
getValue()
Returns the new value that triggered this value change event.
boolean
isUserOriginated()
Returns whether this event was triggered by user interaction, on the client side, or programmatically, on the server side.
-
Methods inherited from class java.util.EventObject
toString
-
-
-
-
Constructor Detail
-
ValueChangeEvent
public ValueChangeEvent(COMPONENT component, V oldValue, boolean userOriginated)
Creates a new
ValueChange
event containing the current value of the given value-bearing source component.Type Parameters:
COMPONENT
- the type of the source componentParameters:
component
- the source component bearing the value, not nulloldValue
- the previous value held by the source of this eventuserOriginated
-true
if this event originates from the client,false
otherwise.
-
ValueChangeEvent
public ValueChangeEvent(Component component, HasValue<V> hasValue, V oldValue, boolean userOriginated)
Creates a new
ValueChange
event containing the given value, originating from the given source component.Parameters:
component
- the component, not nullhasValue
- the HasValue instance bearing the value, not nulloldValue
- the previous value held by the source of this eventuserOriginated
-true
if this event originates from the client,false
otherwise.
-
-
Method Detail
-
getOldValue
public V getOldValue()
Returns the value of the source before this value change event occurred.
Returns:
the value previously held by the source of this event
-
getValue
public V getValue()
Returns the new value that triggered this value change event.
Returns:
the new value
-
isUserOriginated
public boolean isUserOriginated()
Description copied from interface:
HasUserOriginated
Returns whether this event was triggered by user interaction, on the client side, or programmatically, on the server side.
Specified by:
isUserOriginated
in interfaceHasUserOriginated
Returns:
true
if this event originates from the client,false
otherwise.
-
getComponent
public Component getComponent()
Returns the component.
Returns:
the component, not null
-
getSource
public HasValue<V> getSource()
Overrides:
getSource
in classEventObject
-
-