Package com.vaadin.data
Class HasValue.ValueChangeEvent<V>
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.data.HasValue.ValueChangeEvent<V>
-
- Type Parameters:
V- the value type
- All Implemented Interfaces:
HasUserOriginated,Serializable
- Direct Known Subclasses:
MultiSelectionEvent,SingleSelectionEvent
public static class HasValue.ValueChangeEvent<V> extends EventObject implements HasUserOriginated
An event fired when the value of aHasValuechanges.- See Also:
- Serialized Form
-
-
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 newValueChangeevent containing the given value, originating from the given source component.ValueChangeEvent(COMPONENT component, V oldValue, boolean userOriginated)Creates a newValueChangeevent containing the current value of the given value-bearing source component.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ComponentgetComponent()Returns the component.VgetOldValue()Returns the value of the source before this value change event occurred.HasValue<V>getSource()VgetValue()Returns the new value that triggered this value change event.booleanisUserOriginated()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 newValueChangeevent containing the current value of the given value-bearing source component.- Type Parameters:
COMPONENT- the type of the source component- Parameters:
component- the source component bearing the value, not nulloldValue- the previous value held by the source of this eventuserOriginated-trueif this event originates from the client,falseotherwise.
-
ValueChangeEvent
public ValueChangeEvent(Component component, HasValue<V> hasValue, V oldValue, boolean userOriginated)
Creates a newValueChangeevent 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-trueif this event originates from the client,falseotherwise.
-
-
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:HasUserOriginatedReturns whether this event was triggered by user interaction, on the client side, or programmatically, on the server side.- Specified by:
isUserOriginatedin interfaceHasUserOriginated- Returns:
trueif this event originates from the client,falseotherwise.
-
getComponent
public Component getComponent()
Returns the component.- Returns:
- the component, not null
-
getSource
public HasValue<V> getSource()
- Overrides:
getSourcein classEventObject
-
-