Package org.eclipse.core.databinding
Class ObservablesManager
- java.lang.Object
-
- org.eclipse.core.databinding.ObservablesManager
-
public class ObservablesManager extends Object
An observables manager can be used for lifecycle management ofIObservableobjects.- Since:
- 1.0
- Restriction:
- This class is not intended to be subclassed by clients.
-
-
Constructor Summary
Constructors Constructor Description ObservablesManager()Create a new observables manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddObservable(IObservable observable)Adds the given observable to this manager.voidaddObservablesFromContext(DataBindingContext context, boolean trackTargets, boolean trackModels)Adds the given data binding context's target and/or model observables to this manager.voiddispose()Disposes of this manager and all observables that it manages.voidexcludeObservable(IObservable observable)Adds the given observable to this manager's exclusion list.voidrunAndCollect(Runnable runnable)Executes the specified runnable and adds to this manager all observables created while executing the runnable.
-
-
-
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 this manager.Note: The
contextargument must NOT be disposed before this object itself is disposed. If it is then its contents will not be disposed by this object.- Parameters:
context- the data binding contexttrackTargets-trueif the target observables of the context should be managedtrackModels-trueif the model observables of the context should be managed
-
runAndCollect
public void runAndCollect(Runnable runnable)
Executes the specified runnable and adds to this manager all observables created while executing the runnable.NOTE: As of 1.2 (Eclipse 3.5), there are unresolved problems with this API, see bug 278550. If we cannot find a way to make this API work, it will be deprecated as of 3.6.
- Parameters:
runnable- the runnable to execute- Since:
- 1.2
-
dispose
public void dispose()
Disposes of this manager and all observables that it manages.Note: If
addObservablesFromContext(org.eclipse.core.databinding.DataBindingContext, boolean, boolean)is used then itscontextargument must NOT be disposed before this object itself is disposed. If it is then its contents will not be disposed by this object.
-
-