Class ObservablesManager


  • public class ObservablesManager
    extends Object
    An observables manager can be used for lifecycle management of IObservable objects.
    Since:
    1.0
    Restriction:
    This class is not intended to be subclassed by clients.
    • Constructor Detail

      • ObservablesManager

        public ObservablesManager()
        Create a new observables manager.
    • Method Detail

      • addObservable

        public void addObservable​(IObservable observable)
        Adds the given observable to this manager.
        Parameters:
        observable - the observable
      • excludeObservable

        public void excludeObservable​(IObservable observable)
        Adds the given observable to this manager's exclusion list. The given observable will not be disposed of by this manager.
        Parameters:
        observable - the observable
      • addObservablesFromContext

        public void addObservablesFromContext​(DataBindingContext context,
                                              boolean trackTargets,
                                              boolean trackModels)
        Adds the given data binding context's target and/or model observables to be disposed by this manager.

        Prefer the addContext(org.eclipse.core.databinding.DataBindingContext, boolean, boolean) method if the context argument should also be disposed.

        Note: The context argument must NOT be disposed before this manager itself is disposed. If it is then its contents will not be disposed by this manager.

        Parameters:
        context - the data binding context
        trackTargets - true if the target observables of the context should be managed
        trackModels - true if the model observables of the context should be managed
      • addContext

        public void addContext​(DataBindingContext context,
                               boolean trackTargets,
                               boolean trackModels)
        Adds the databinding context to be disposed by this manager. Identical to addObservablesFromContext(org.eclipse.core.databinding.DataBindingContext, boolean, boolean) except that the binding context itself is also disposed.

        Note: The context argument must NOT be disposed before this manager itself is disposed. (There is no reason to dispose context manually when using this method.)

        Parameters:
        context - the data binding context to add
        trackTargets - true if the target observables of the context should be managed
        trackModels - true if the model observables of the context should be managed
        Since:
        1.10