Package org.eclipse.core.databinding
Class Binding
java.lang.Object
org.eclipse.core.databinding.ValidationStatusProvider
org.eclipse.core.databinding.Binding
- Direct Known Subclasses:
ListBinding,SetBinding
This abstract class represents a binding between a model and a target. Newly
created instances need to be added to a data binding context using
init(DataBindingContext).- Since:
- 1.0
-
Field Summary
FieldsFields inherited from class org.eclipse.core.databinding.ValidationStatusProvider
disposed -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Disposes of this Binding.getModel()Returns the model observableReturns anIObservableListcontaining the model observables (if any) that are being tracked by this validation status provider.Returns the target observableReturns anIObservableListcontaining the target observables (if any) that are being tracked by this validation status provider.final voidinit(DataBindingContext context) Initializes this binding with the given context and adds it to the list of bindings of the context.protected abstract voidpostInit()Called byinit(DataBindingContext)after adding this binding to the context.protected abstract voidpreInit()Called byinit(DataBindingContext)after settingcontextbut before adding this binding to the context.abstract voidUpdates the target's state from the model's state at the next reasonable opportunity.abstract voidUpdates the model's state from the target's state at the next reasonable opportunity.abstract voidValidates the model's state at the next reasonable opportunity.abstract voidValidates the target's state at the next reasonable opportunity.Methods inherited from class org.eclipse.core.databinding.ValidationStatusProvider
getValidationStatus, isDisposed
-
Field Details
-
context
-
-
Constructor Details
-
Binding
Creates a new binding.- Parameters:
target- target observablemodel- model observable
-
-
Method Details
-
init
Initializes this binding with the given context and adds it to the list of bindings of the context.Subclasses may extend, but must call the super implementation.
- Parameters:
context- the data binding context
-
preInit
protected abstract void preInit()Called byinit(DataBindingContext)after settingcontextbut before adding this binding to the context. Subclasses may use this method to perform initialization that could not be done in the constructor. Care should be taken not to cause any events while running this method. -
postInit
protected abstract void postInit()Called byinit(DataBindingContext)after adding this binding to the context. Subclasses may use this method to perform initialization that may cause events to be fired, including BindingEvents that are forwarded to the data binding context. -
updateTargetToModel
public abstract void updateTargetToModel()Updates the model's state from the target's state at the next reasonable opportunity. There is no guarantee that the state will have been updated by the time this call returns. -
updateModelToTarget
public abstract void updateModelToTarget()Updates the target's state from the model's state at the next reasonable opportunity. There is no guarantee that the state will have been updated by the time this call returns. -
validateTargetToModel
public abstract void validateTargetToModel()Validates the target's state at the next reasonable opportunity. There is no guarantee that the validation status will have been updated by the time this call returns. -
validateModelToTarget
public abstract void validateModelToTarget()Validates the model's state at the next reasonable opportunity. There is no guarantee that the validation status will have been updated by the time this call returns. -
dispose
public void dispose()Disposes of this Binding. Subclasses may extend, but must call super.dispose().- Overrides:
disposein classValidationStatusProvider
-
getTarget
Returns the target observable- Returns:
- the target observable
-
getTargets
Description copied from class:ValidationStatusProviderReturns anIObservableListcontaining the target observables (if any) that are being tracked by this validation status provider.- Specified by:
getTargetsin classValidationStatusProvider- Returns:
- an
IObservableList(may be empty)
-
getModel
Returns the model observable- Returns:
- the model observable
-
getModels
Description copied from class:ValidationStatusProviderReturns anIObservableListcontaining the model observables (if any) that are being tracked by this validation status provider.- Specified by:
getModelsin classValidationStatusProvider- Returns:
- an
IObservableList(may be empty)
-