Package org.eclipse.core.databinding
Class SetBinding<M,T>
- java.lang.Object
-
- org.eclipse.core.databinding.ValidationStatusProvider
-
- org.eclipse.core.databinding.Binding
-
- org.eclipse.core.databinding.SetBinding<M,T>
-
- Type Parameters:
T- the type of the elements in the set on the target sideM- the type of the elements in the set on the model side
public class SetBinding<M,T> extends Binding
- Since:
- 1.1
-
-
Field Summary
-
Fields inherited from class org.eclipse.core.databinding.ValidationStatusProvider
disposed
-
-
Constructor Summary
Constructors Constructor Description SetBinding(IObservableSet<T> target, IObservableSet<M> model, UpdateSetStrategy<? super T,? extends M> targetToModelStrategy, UpdateSetStrategy<? super M,? extends T> modelToTargetStrategy)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Disposes of this Binding.IObservableValue<IStatus>getValidationStatus()protected voidpostInit()Called byBinding.init(DataBindingContext)after adding this binding to the context.protected voidpreInit()Called byBinding.init(DataBindingContext)after settingBinding.contextbut before adding this binding to the context.voidupdateModelToTarget()Updates the target's state from the model's state at the next reasonable opportunity.voidupdateTargetToModel()Updates the model's state from the target's state at the next reasonable opportunity.voidvalidateModelToTarget()Validates the model's state at the next reasonable opportunity.voidvalidateTargetToModel()Validates the target's state at the next reasonable opportunity.-
Methods inherited from class org.eclipse.core.databinding.Binding
getModel, getModels, getTarget, getTargets, init
-
Methods inherited from class org.eclipse.core.databinding.ValidationStatusProvider
isDisposed
-
-
-
-
Constructor Detail
-
SetBinding
public SetBinding(IObservableSet<T> target, IObservableSet<M> model, UpdateSetStrategy<? super T,? extends M> targetToModelStrategy, UpdateSetStrategy<? super M,? extends T> modelToTargetStrategy)
- Parameters:
target- the target side setmodel- the model side setmodelToTargetStrategy- strategy to copy model to target elementstargetToModelStrategy- strategy to copy target to model elements
-
-
Method Detail
-
getValidationStatus
public IObservableValue<IStatus> getValidationStatus()
- Specified by:
getValidationStatusin classValidationStatusProvider- Returns:
- an
IObservableValuecontaining the current validation status
-
preInit
protected void preInit()
Description copied from class:BindingCalled byBinding.init(DataBindingContext)after settingBinding.contextbut 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 void postInit()
Description copied from class:BindingCalled byBinding.init(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.
-
updateModelToTarget
public void updateModelToTarget()
Description copied from class:BindingUpdates 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.- Specified by:
updateModelToTargetin classBinding
-
updateTargetToModel
public void updateTargetToModel()
Description copied from class:BindingUpdates 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.- Specified by:
updateTargetToModelin classBinding
-
validateModelToTarget
public void validateModelToTarget()
Description copied from class:BindingValidates 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.- Specified by:
validateModelToTargetin classBinding
-
validateTargetToModel
public void validateTargetToModel()
Description copied from class:BindingValidates 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.- Specified by:
validateTargetToModelin classBinding
-
-