Package org.eclipse.e4.core.contexts
Class RunAndTrack
java.lang.Object
org.eclipse.e4.core.contexts.RunAndTrack
Instances of this class contain behavior that is executed within an
IEclipseContext
. 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:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract 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.
-
Constructor Details
-
RunAndTrack
public RunAndTrack()Creates a new instance of trackable computation
-
-
Method Details
-
changed
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
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
- the runnable to execute
-