Class BindingSupport
java.lang.Object
com._1c.g5.v8.dt.common.databinding.BindingSupport
The binding support. It cares about robust and clear lifecycle of observables, particulary for disposing stage.
It provides access to the
DataBindingContext
, but it support the disposing of all observables bound using
the DataBindingContext
.
For example, in case of using native DataBindingContext SWTObservables get disposed automatically with the control
being observed, but WritableList, WritableValue, EMFObservables, etc need to be disposed manually.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends org.eclipse.core.databinding.observable.IObservable>
Tadd
(T observable) Adds the observable to be managed by the binding support.void
bind
(org.eclipse.core.databinding.observable.list.IObservableList target, org.eclipse.core.databinding.observable.list.IObservableList model) Binds observables lists.void
bind
(org.eclipse.core.databinding.observable.value.IObservableValue target, org.eclipse.core.databinding.observable.value.IObservableValue model) Binds observables value.void
dispose()
Disposes the binding support.org.eclipse.core.databinding.DataBindingContext
Returns theDataBindingContext
instance.
-
Constructor Details
-
BindingSupport
public BindingSupport()
-
-
Method Details
-
getDBContext
public org.eclipse.core.databinding.DataBindingContext getDBContext()Returns theDataBindingContext
instance.- Returns:
- the DataBindingContext instance, never
null
.
-
bind
public void bind(org.eclipse.core.databinding.observable.value.IObservableValue target, org.eclipse.core.databinding.observable.value.IObservableValue model) Binds observables value. It is a shortcut forDataBindingContext.bindValue(IObservableValue, IObservableValue)
.- Parameters:
target
- the target value, cannot benull
.model
- the model value, cannot benull
.
-
bind
public void bind(org.eclipse.core.databinding.observable.list.IObservableList target, org.eclipse.core.databinding.observable.list.IObservableList model) Binds observables lists. It is a shortcut forDataBindingContext.bindList(IObservableList, IObservableList)
.- Parameters:
target
- the target list, cannot benull
.model
- the model list, cannot benull
.
-
add
public <T extends org.eclipse.core.databinding.observable.IObservable> T add(T observable) Adds the observable to be managed by the binding support.- Parameters:
observable
- the observable, cannot benull
.- Returns:
- the observable instance, never
null
.
-
dispose
public void dispose()Disposes the binding support.
-