# Class ValueChangingEvent<T>

java.lang.Object
java.util.EventObject
org.eclipse.core.databinding.observable.ObservableEvent
org.eclipse.core.databinding.observable.value.ValueChangingEvent<T>

Type Parameters:
  `T` - the type of value being observed

All Implemented Interfaces:
  `Serializable`

public class ValueChangingEvent<T> extends ObservableEvent
Value changing event describing a pending change of an `IObservableValue` object's current value. Listeners can veto the pending change by setting `veto` to `true`.

Since:
  1.0
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`ValueDiff<T>`
`diff`
Description of the change to the source observable value.
`boolean`
`veto`
Flag for vetoing this change.

### Fields inherited from class EventObject

`source`

## Constructor Summary

Constructors
Constructor
Description
`ValueChangingEvent(IObservableValue<T> source, ValueDiff<T> diff)`
Creates a new value changing event.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`dispatch(IObservablesListener listener)`
Dispatch this event to the given listener.
`protected Object`
`getListenerType()`
Returns a unique object used for distinguishing this event type from others.
`IObservableValue<T>`
`getObservableValue()`

### Methods inherited from class ObservableEvent

`getObservable`

### Methods inherited from class EventObject

`getSource, toString`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### diff

public ValueDiff<T> diff
Description of the change to the source observable value. Listeners must not change this field.

### veto

public boolean veto
Flag for vetoing this change. Default value is `false`, can be set to `true` by listeners to veto this change.

## Constructor Details

### ValueChangingEvent

public ValueChangingEvent(IObservableValue<T> source, ValueDiff<T> diff)
Creates a new value changing event.

Parameters:
  `source` - the source observable value
  `diff` - the value change

## Method Details

### getObservableValue

public IObservableValue<T> getObservableValue()

Returns:
  the observable value from which this event originated

### dispatch

protected void dispatch(IObservablesListener listener)
Description copied from class: `ObservableEvent`
Dispatch this event to the given listener. Subclasses must implement this method by calling the appropriate type-safe event handling method on the given listener according to the type of this event.

Specified by:
  `dispatch` in class `ObservableEvent`
Parameters:
  `listener` - the listener that should handle the event

### getListenerType

protected Object getListenerType()
Description copied from class: `ObservableEvent`
Returns a unique object used for distinguishing this event type from others.

Specified by:
  `getListenerType` in class `ObservableEvent`
Returns:
  a unique object representing the concrete type of this event.