From 392ba48cd214dff27f4229d6d63a63acb640c69d Mon Sep 17 00:00:00 2001 From: Oleg Besedin Date: Fri, 24 Feb 2012 11:33:17 -0500 Subject: Bug 371289 - Add "active" context variables --- .../eclipse/e4/core/contexts/IEclipseContext.java | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/IEclipseContext.java b/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/IEclipseContext.java index 50015f3c6..8a6a19e8f 100644 --- a/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/IEclipseContext.java +++ b/bundles/org.eclipse.e4.core.contexts/src/org/eclipse/e4/core/contexts/IEclipseContext.java @@ -286,8 +286,17 @@ public interface IEclipseContext { public void dispose(); /** - * EXPERIMENTAL, DO NOT USE * Returns the value stored on the active leaf node of the context's tree. + *

+ * This method is similar to getActiveLeaf().get(clazz) but optimized + * for a large number of repeat invocations. + *

+ *

Use this method in code paths that are going to receive a large number + * of repeat calls, such as inside {@link RunAndTrack#changed(IEclipseContext)}. + *

+ *

In the code paths that won't be cycled through large number of times, + * consider using getActiveLeaf().get(clazz). + *

* @param clazz the class that needs to be found in the active context * @return an object corresponding to the given class, or null * @see IEclipseContext#getActiveLeaf() @@ -295,8 +304,17 @@ public interface IEclipseContext { public T getActive(Class clazz); /** - * EXPERIMENTAL, DO NOT USE * Returns the named value stored on the active leaf node of the context's tree. + *

+ * This method is similar to getActiveLeaf().get(name) but optimized + * for a large number of repeat invocations. + *

+ *

Use this method in code paths that are going to receive a large number + * of repeat calls, such as inside {@link RunAndTrack#changed(IEclipseContext)}. + *

+ *

In the code paths that won't be cycled through large number of times, + * consider using getActiveLeaf().get(name). + *

* @param name the name of the value to return * @return an object corresponding to the given name, or null * @see IEclipseContext#getActiveLeaf() -- cgit v1.2.3