|
Eclipse Platform Release 3.4 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.databinding.DataBindingContext
A DataBindingContext is the point of contact for the creation and management
of bindings
, and aggregates validation statuses of its
bindings, or more generally, its validation status providers.
A DataBindingContext provides the following abilities:
observable values
.observable lists
.
Multiple contexts can be used at any point in time. One strategy for the
management of contexts is the aggregation of validation statuses. For example
an IWizardPage
could use a single context and the statuses
could be aggregated to set the page status and fulfillment. Each page in the
IWizard
would have its own context instance.
Constructor Summary | |
DataBindingContext()
Creates a data binding context, using the current default realm for the validation observables. |
|
DataBindingContext(Realm validationRealm)
Creates a data binding context using the given realm for the validation observables. |
Method Summary | |
void |
addBinding(Binding binding)
Adds the given binding to this data binding context. |
void |
addValidationStatusProvider(ValidationStatusProvider validationStatusProvider)
Adds the given validation status provider to this data binding context. |
Binding |
bindList(IObservableList targetObservableList,
IObservableList modelObservableList,
UpdateListStrategy targetToModel,
UpdateListStrategy modelToTarget)
Creates a Binding to synchronize the values of two
observable lists . |
Binding |
bindSet(IObservableSet targetObservableSet,
IObservableSet modelObservableSet,
UpdateSetStrategy targetToModel,
UpdateSetStrategy modelToTarget)
Creates a Binding to synchronize the values of two
observable sets . |
Binding |
bindValue(IObservableValue targetObservableValue,
IObservableValue modelObservableValue,
UpdateValueStrategy targetToModel,
UpdateValueStrategy modelToTarget)
Creates a Binding to synchronize the values of two
observable values . |
protected UpdateListStrategy |
createModelToTargetUpdateListStrategy(IObservableList modelObservableList,
IObservableList targetObservableList)
|
protected UpdateSetStrategy |
createModelToTargetUpdateSetStrategy(IObservableSet modelObservableSet,
IObservableSet targetObservableSet)
|
protected UpdateValueStrategy |
createModelToTargetUpdateValueStrategy(IObservableValue fromValue,
IObservableValue toValue)
Returns an update value strategy to be used for copying values from the from value to the to value. |
protected UpdateListStrategy |
createTargetToModelUpdateListStrategy(IObservableList targetObservableList,
IObservableList modelObservableList)
|
protected UpdateSetStrategy |
createTargetToModelUpdateSetStrategy(IObservableSet targetObservableSet,
IObservableSet modelObservableSet)
|
protected UpdateValueStrategy |
createTargetToModelUpdateValueStrategy(IObservableValue fromValue,
IObservableValue toValue)
Returns an update value strategy to be used for copying values from the from value to the to value. |
void |
dispose()
Disposes of this data binding context and all bindings and validation status providers that were added to this context. |
IObservableList |
getBindings()
Returns an unmodifiable observable list with elements of type Binding , ordered by time of addition. |
Realm |
getValidationRealm()
Returns the validation realm. |
IObservableMap |
getValidationStatusMap()
Deprecated. as of 1.1, please use getValidationStatusProviders() |
IObservableList |
getValidationStatusProviders()
Returns an unmodifiable observable list with elements of type ValidationStatusProvider , ordered by time of addition. |
boolean |
removeBinding(Binding binding)
Removes the given binding. |
boolean |
removeValidationStatusProvider(ValidationStatusProvider validationStatusProvider)
Removes the validation status provider. |
void |
updateModels()
Updates all model observable objects to reflect the current state of the target observable objects. |
void |
updateTargets()
Updates all target observable objects to reflect the current state of the model observable objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public DataBindingContext()
Realm
public DataBindingContext(Realm validationRealm)
validationRealm
- the realm to be used for the validation observablesRealm
Method Detail |
public final Binding bindValue(IObservableValue targetObservableValue, IObservableValue modelObservableValue, UpdateValueStrategy targetToModel, UpdateValueStrategy modelToTarget)
Binding
to synchronize the values of two
observable values
. During synchronization
validation and conversion can be employed to customize the process. For
specifics on the customization of the process see
UpdateValueStrategy
.
targetObservableValue
- target value, commonly a UI widgetmodelObservableValue
- model valuetargetToModel
- strategy to employ when the target is the source of the change
and the model is the destinationmodelToTarget
- strategy to employ when the model is the source of the change
and the target is the destination
UpdateValueStrategy
protected UpdateValueStrategy createModelToTargetUpdateValueStrategy(IObservableValue fromValue, IObservableValue toValue)
fromValue
- toValue
-
protected UpdateValueStrategy createTargetToModelUpdateValueStrategy(IObservableValue fromValue, IObservableValue toValue)
fromValue
- toValue
-
public final Binding bindList(IObservableList targetObservableList, IObservableList modelObservableList, UpdateListStrategy targetToModel, UpdateListStrategy modelToTarget)
Binding
to synchronize the values of two
observable lists
. During synchronization
validation and conversion can be employed to customize the process. For
specifics on the customization of the process see
UpdateListStrategy
.
targetObservableList
- target list, commonly a list representing a list in the UImodelObservableList
- model listtargetToModel
- strategy to employ when the target is the source of the change
and the model is the destinationmodelToTarget
- strategy to employ when the model is the source of the change
and the target is the destination
UpdateListStrategy
protected UpdateListStrategy createModelToTargetUpdateListStrategy(IObservableList modelObservableList, IObservableList targetObservableList)
modelObservableList
- targetObservableList
-
protected UpdateListStrategy createTargetToModelUpdateListStrategy(IObservableList targetObservableList, IObservableList modelObservableList)
targetObservableList
- modelObservableList
-
public final Binding bindSet(IObservableSet targetObservableSet, IObservableSet modelObservableSet, UpdateSetStrategy targetToModel, UpdateSetStrategy modelToTarget)
Binding
to synchronize the values of two
observable sets
. During synchronization
validation and conversion can be employed to customize the process. For
specifics on the customization of the process see
UpdateSetStrategy
.
targetObservableSet
- target set, commonly a set representing a set in the UImodelObservableSet
- model settargetToModel
- strategy to employ when the target is the source of the change
and the model is the destinationmodelToTarget
- strategy to employ when the model is the source of the change
and the target is the destination
protected UpdateSetStrategy createTargetToModelUpdateSetStrategy(IObservableSet targetObservableSet, IObservableSet modelObservableSet)
targetObservableSet
- modelObservableSet
-
protected UpdateSetStrategy createModelToTargetUpdateSetStrategy(IObservableSet modelObservableSet, IObservableSet targetObservableSet)
modelObservableSet
- targetObservableSet
-
public final void dispose()
public final IObservableList getBindings()
Binding
, ordered by time of addition.
public final IObservableList getValidationStatusProviders()
ValidationStatusProvider
, ordered by time of addition.
public final IObservableMap getValidationStatusMap()
getValidationStatusProviders()
Binding
) to
statuses (type: IStatus
). The keys of the map are the bindings
returned by getBindings()
, and the values are the current
validaion status objects for each binding.
public void addBinding(Binding binding)
binding
- The binding to add.addValidationStatusProvider(ValidationStatusProvider)
,
getValidationStatusProviders()
public void addValidationStatusProvider(ValidationStatusProvider validationStatusProvider)
validationStatusProvider
- The validation status provider to add.public final void updateModels()
public final void updateTargets()
public boolean removeBinding(Binding binding)
binding
-
true
if was associated with the context,
false
if notpublic boolean removeValidationStatusProvider(ValidationStatusProvider validationStatusProvider)
validationStatusProvider
-
true
if was associated with the context,
false
if notpublic final Realm getValidationRealm()
Realm
|
Eclipse Platform Release 3.4 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.