Class BindingSupport

  • public class BindingSupport
    extends Object
    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

      Constructor Description
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T extends org.eclipse.core.databinding.observable.IObservable>
      add​(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 getDBContext()
      Returns the DataBindingContext instance.
    • Constructor Detail

      • BindingSupport

        public BindingSupport()
    • Method Detail

      • getDBContext

        public org.eclipse.core.databinding.DataBindingContext getDBContext()
        Returns the DataBindingContext instance.
        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 for DataBindingContext.bindValue(IObservableValue, IObservableValue).
        target - the target value, cannot be null.
        model - the model value, cannot be null.
      • 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 for DataBindingContext.bindList(IObservableList, IObservableList).
        target - the target list, cannot be null.
        model - the model list, cannot be null.
      • add

        public <T extends org.eclipse.core.databinding.observable.IObservable> T add​(T observable)
        Adds the observable to be managed by the binding support.
        observable - the observable, cannot be null.
        the observable instance, never null.
      • dispose

        public void dispose()
        Disposes the binding support.