Package org.eclipse.e4.core.contexts
Class RunAndTrack
- java.lang.Object
-
- org.eclipse.e4.core.contexts.RunAndTrack
-
public abstract class RunAndTrack extends Object
Instances of this class contain behavior that is executed within anIEclipseContext
. The context records all values accessed by this object, and will re-evaluate this runnable whenever any accessed value changes.- Since:
- 1.3
- See Also:
IEclipseContext.runAndTrack(RunAndTrack)
-
-
Constructor Summary
Constructors Constructor Description RunAndTrack()
Creates a new instance of trackable computation
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
changed(IEclipseContext context)
This method is initially called by the framework when an instance of this class is associated with the context viaIEclipseContext.runAndTrack(RunAndTrack)
.protected void
runExternalCode(Runnable runnable)
Use this method to wrap calls to external code.
-
-
-
Method Detail
-
changed
public abstract boolean changed(IEclipseContext context)
This method is initially called by the framework when an instance of this class is associated with the context viaIEclipseContext.runAndTrack(RunAndTrack)
.After the initial call this method is executed when one or more values it retrieved from the context change.
- Parameters:
context
- modified context- Returns:
true
to continue to be called on updates;false
otherwise
-
runExternalCode
protected void runExternalCode(Runnable runnable)
Use this method to wrap calls to external code. For instance, while inchanged(IEclipseContext)
. consider calling listeners from this method. This wrapper will pause dependency recording while in the 3rd party code, reducing potential dependency circularity issues.- Parameters:
runnable
-
-
-