[269281] Refactor org.eclipse.jem.util plugin contents
diff --git a/plugins/org.eclipse.jem.util/META-INF/MANIFEST.MF b/plugins/org.eclipse.jem.util/META-INF/MANIFEST.MF
index 821388e..08b51f6 100644
--- a/plugins/org.eclipse.jem.util/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.jem.util/META-INF/MANIFEST.MF
@@ -20,7 +20,8 @@
  org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
  org.eclipse.emf.ecore;bundle-version="[2.4.0,3.0.0)",
  org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)",
- com.ibm.icu;bundle-version="[3.8.1.1,4.1.0)"
+ com.ibm.icu;bundle-version="[3.8.1.1,4.1.0)",
+ org.eclipse.wst.common.core;bundle-version="[1.1.201,2.0.0)";visibility:=reexport
 Eclipse-LazyStart: true
 Bundle-RequiredExecutionEnvironment: J2SE-1.5
 Bundle-ActivationPolicy: lazy
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/RegistryReader.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/RegistryReader.java
index 37e8277..7a9f937 100644
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/RegistryReader.java
+++ b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/RegistryReader.java
@@ -10,120 +10,35 @@
  *******************************************************************************/
 /*
  *  $$RCSfile: RegistryReader.java,v $$
- *  $$Revision: 1.5 $$  $$Date: 2006/05/17 20:13:45 $$ 
+ *  $$Revision: 1.6 $$  $$Date: 2009/07/30 22:11:24 $$ 
  */
 package org.eclipse.jem.util;
 import org.eclipse.core.runtime.*;
 import org.osgi.framework.Bundle;
 
-import org.eclipse.jem.util.logger.proxy.Logger;
-
 
 /**
  * Class to read a registry. It is meant to be subclassed to provide specific function.
  * 
+ * @deprecated Replaced by {@link org.eclipse.wst.common.core.util.RegistryReader)
  * @since 1.0.0
  */
-public abstract class RegistryReader {
+public abstract class RegistryReader extends org.eclipse.wst.common.core.util.RegistryReader {
 
-	String pluginId;
-
-	String extensionPointId;
-
-	private static Bundle systemBundle;
+	public RegistryReader(String pluginID, String extensionPoint) {
+		super(pluginID, extensionPoint);
+	}
 
 	/**
 	 * Utility method to get the plugin id of a configuation element
 	 * 
 	 * @param configurationElement
 	 * @return plugin id of configuration element
+	 * @deprecated Replaced by (@link org.eclipse.wst.common.core.util.RegistryReader.getPluginId())
 	 * @since 1.0.0
 	 */
 	public static String getPluginId(IConfigurationElement configurationElement) {
-		String pluginId = null;
-
-		if (configurationElement != null) {
-			IExtension extension = configurationElement.getDeclaringExtension();
-
-			if (extension != null)
-				pluginId = extension.getContributor().getName();
-		}
-
-		return pluginId;
-	}
-
-	/**
-	 * Constructor for RegistryReader taking a registry, plugin id, and extension point id.
-	 * 
-	 * @param registry
-	 * @param pluginID
-	 * @param extensionPoint
-	 * 
-	 * @deprecated Use RegistryReader(plugin, extensionPoint) instead. The registry passed in is ignored.
-	 * @since 1.0.0
-	 */
-	public RegistryReader(IPluginRegistry registry, String pluginID, String extensionPoint) {
-		this(pluginID, extensionPoint);
-	}
-
-	/**
-	 * Constructor for RegistryReader taking the plugin id and extension point id.
-	 * 
-	 * @param pluginID
-	 * @param extensionPoint
-	 * 
-	 * @since 1.0.0
-	 */
-	public RegistryReader(String pluginID, String extensionPoint) {
-		super();
-		this.pluginId = pluginID;
-		extensionPointId = extensionPoint;
-	}
-
-	private void internalReadElement(IConfigurationElement element) {
-		boolean recognized = this.readElement(element);
-		if (!recognized) {
-			logError(element, "Error processing extension: " + element); //$NON-NLS-1$
-		}
-	}
-
-	/*
-	 * Logs the error in the desktop log using the provided text and the information in the configuration element.
-	 */
-	protected void logError(IConfigurationElement element, String text) {
-		IExtension extension = element.getDeclaringExtension();
-		StringBuffer buf = new StringBuffer();
-		buf.append("Plugin " + extension.getContributor().getName() + ", extension " + extension.getExtensionPointUniqueIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
-		buf.append("\n" + text); //$NON-NLS-1$
-		Logger.getLogger().logError(buf.toString());
-	}
-
-	/*
-	 * Logs a very common registry error when a required attribute is missing.
-	 */
-	protected void logMissingAttribute(IConfigurationElement element, String attributeName) {
-		logError(element, "Required attribute '" + attributeName + "' not defined"); //$NON-NLS-1$ //$NON-NLS-2$
-	}
-
-	/*
-	 * Implement this method to read element attributes. If this element has subelements, the reader will recursively cycle through them and call this
-	 * method so don't do it here.
-	 */
-	public abstract boolean readElement(IConfigurationElement element);
-
-	/**
-	 * Read the extension point and parse it.
-	 * 
-	 * @since 1.0.0
-	 */
-	public void readRegistry() {
-		IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(pluginId, extensionPointId);
-		if (point == null)
-			return;
-		IConfigurationElement[] elements = point.getConfigurationElements();
-		for (int i = 0; i < elements.length; i++) {
-			internalReadElement(elements[i]);
-		}
+		return org.eclipse.wst.common.core.util.RegistryReader.getPluginId(configurationElement);
 	}
 
 	/**
@@ -133,12 +48,11 @@
 	 * @param element
 	 * @return <code>true</code> if it is valid point to create an executable extension.
 	 * 
+	 * @deprecated Replaced by (@link org.eclipse.wst.common.core.util.RegistryReader.canCreateExecutableExtension())
 	 * @since 1.0.0
 	 */
 	public static boolean canCreateExecutableExtension(IConfigurationElement element) {
-		if (Platform.isRunning() && getSystemBundle().getState() != Bundle.STOPPING)
-			return true;
-		return false;
+		return org.eclipse.wst.common.core.util.RegistryReader.canCreateExecutableExtension(element);
 	}
 
 	/**
@@ -149,8 +63,6 @@
 	 * @since 1.0.0
 	 */
 	protected static Bundle getSystemBundle() {
-		if (systemBundle == null)
-			systemBundle = Platform.getBundle("org.eclipse.osgi"); //$NON-NLS-1$
-		return systemBundle;
+		return org.eclipse.wst.common.core.util.RegistryReader.getSystemBundle();
 	}
 }
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UIContextDetermination.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UIContextDetermination.java
index 8955882..cccd662 100644
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UIContextDetermination.java
+++ b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UIContextDetermination.java
@@ -10,41 +10,27 @@
  *******************************************************************************/
 /*
  *  $$RCSfile: UIContextDetermination.java,v $$
- *  $$Revision: 1.5 $$  $$Date: 2007/04/10 01:09:36 $$ 
+ *  $$Revision: 1.6 $$  $$Date: 2009/07/30 22:11:23 $$ 
  */
 package org.eclipse.jem.util;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.*;
-
-import org.eclipse.jem.util.logger.proxy.Logger;
-import org.eclipse.jem.util.plugin.JEMUtilPlugin;
-
 
 /**
  * Static utility class for UIContext determination.
  * 
+ * @deprecated Replaced by (@link org.eclipse.wst.common.core.util.UIContextDetermination)
  * @since 1.0.0
  */
-public class UIContextDetermination {
+public class UIContextDetermination extends org.eclipse.wst.common.core.util.UIContextDetermination {
 
-	private static final int UNKNOWN = 100;
+	public static final String HEADLESS_CONTEXT_LITERAL = org.eclipse.wst.common.core.util.UIContextDetermination.HEADLESS_CONTEXT_LITERAL;
 
-	public static final String HEADLESS_CONTEXT_LITERAL = "Headless"; //$NON-NLS-1$
+	public static final String UI_CONTEXT_LITERAL = org.eclipse.wst.common.core.util.UIContextDetermination.UI_CONTEXT_LITERAL;
 
-	public static final String UI_CONTEXT_LITERAL = "UI"; //$NON-NLS-1$
+	public static final int HEADLESS_CONTEXT = org.eclipse.wst.common.core.util.UIContextDetermination.HEADLESS_CONTEXT;
 
-	public static final int HEADLESS_CONTEXT = 102;
+	public static final int UI_CONTEXT = org.eclipse.wst.common.core.util.UIContextDetermination.UI_CONTEXT;
 
-	public static final int UI_CONTEXT = 101;
-
-	private static Map cachedExtensions = null;
-
-	private static int currentContext = UNKNOWN;
-
-	private UIContextDetermination() {
-	}
+	private UIContextDetermination(){}
 
 	/**
 	 * Returns an instance of a given class based on the UI or Headless context.
@@ -53,23 +39,10 @@
 	 * @return new class instance for the given key.
 	 * @throws IllegalArgumentException
 	 *             If the key is invalid (e.g. no extension is found for the key)
+	 * @deprecated Replaced by (@link org.eclipse.wst.common.core.util.UIContextDetermination.createInstance())
 	 */
 	public static Object createInstance(String key) {
-		Object result = null;
-		if (cachedExtensions == null)
-			initExtensions();
-		IConfigurationElement contextSensitiveClass = (IConfigurationElement) cachedExtensions.get(key);
-		try {
-			if (contextSensitiveClass != null)
-				result = contextSensitiveClass
-						.createExecutableExtension(UIContextDeterminationRegistryReader.UI_CONTEXT_SENSTIVE_CLASS_CLASSNAME_ATTR);
-		} catch (CoreException e) {
-			Logger.getLogger().logError("Problem loading extension not found for key \"" + key + "\"."); //$NON-NLS-1$ //$NON-NLS-2$
-			Logger.getLogger().logError(e);
-		}
-		if (result == null)
-			Logger.getLogger().logError("Extension not found for key \"" + key + "\"."); //$NON-NLS-1$ //$NON-NLS-2$
-		return result;
+		return org.eclipse.wst.common.core.util.UIContextDetermination.createInstance(key);
 	}
 
 	/**
@@ -78,113 +51,9 @@
 	 * @return current context
 	 * @see #HEADLESS_CONTEXT
 	 * @see #UI_CONTEXT
+	 * @deprecated Replaced by (@link org.eclipse.wst.common.core.util.UIContextDetermination.getCurrentContext())
 	 */
 	public static int getCurrentContext() {
-		if (currentContext == UNKNOWN) {
-			currentContext = HEADLESS_CONTEXT;
-			new UITesterRegistryReader().readRegistry();
-		}
-		return currentContext;
-	}
-
-	/*
-	 * Invokes the UIContextDeterminationRegistryReader to cache all of the extensions, if necessary.
-	 *  
-	 */
-	private static void initExtensions() {
-		if (cachedExtensions == null) {
-			cachedExtensions = new HashMap();
-			new UIContextDeterminationRegistryReader().readRegistry();
-		}
-	}
-
-	/*
-	 * Converts the input to one of UI_CONTEXT or HEADLESS_CONTEXT. Defaults to HEADLESS on invalid input
-	 * 
-	 * @param literal @return
-	 */
-	private static int convertLiteral(String literal) {
-		return (UI_CONTEXT_LITERAL.equals(literal)) ? UI_CONTEXT : HEADLESS_CONTEXT;
-	}
-
-	/*
-	 * Reads the registration of UI Context-sensitive class extensions and initializes the cache of the UIContextDetermination object.
-	 * 
-	 * @author mdelder
-	 */
-	private static class UIContextDeterminationRegistryReader extends RegistryReader {
-
-		public static final String UI_CONTEXT_SENSTIVE_CLASS_ELEMENT = "uiContextSensitiveClass"; //$NON-NLS-1$
-
-		public static final String UI_CONTEXT_SENSTIVE_CLASS_KEY_ATTR = "key"; //$NON-NLS-1$
-
-		public static final String UI_CONTEXT_SENSTIVE_CLASS_CLASSNAME_ATTR = "className"; //$NON-NLS-1$
-
-		public static final String UI_CONTEXT_SENSTIVE_CLASS_CONTEXT_ATTR = "context"; //$NON-NLS-1$
-
-		public UIContextDeterminationRegistryReader() {
-			super(JEMUtilPlugin.PLUGIN_ID, JEMUtilPlugin.UI_CONTEXT_EXTENSION_POINT);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see org.eclipse.jem.util.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
-		 */
-		public boolean readElement(IConfigurationElement element) {
-			boolean result = false;
-			if (element.getName().equals(UI_CONTEXT_SENSTIVE_CLASS_ELEMENT)) {
-
-				String key = element.getAttribute(UI_CONTEXT_SENSTIVE_CLASS_KEY_ATTR);
-				String context = element.getAttribute(UI_CONTEXT_SENSTIVE_CLASS_CONTEXT_ATTR);
-
-				if (!cachedExtensions.containsKey(key) || getCurrentContext() == convertLiteral(context))
-					cachedExtensions.put(key, element);
-				result = true;
-			}
-			return result;
-		}
-	}
-
-	/*
-	 * Reads the uiTester extension and instantiate the any of the UITester classes it finds.
-	 * 
-	 * The implementation has the side effect that if multiple UITesters are registered, any of them can trip the currentContext into the UI_CONTEXT
-	 * state.
-	 * 
-	 * @author mdelder
-	 */
-	private static class UITesterRegistryReader extends RegistryReader {
-
-		public static final String UI_TESTER_ELEMENT = "uiTester"; //$NON-NLS-1$
-
-		public static final String UI_TESTER_CLASSNAME_ATTR = "className"; //$NON-NLS-1$
-
-		public UITesterRegistryReader() {
-			super(JEMUtilPlugin.PLUGIN_ID, JEMUtilPlugin.UI_TESTER_EXTENSION_POINT);
-		}
-
-		/*
-		 * (non-Javadoc)
-		 * 
-		 * @see com.ibm.etools.emf.workbench.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
-		 */
-		public boolean readElement(IConfigurationElement element) {
-			boolean result = false;
-			if (element.getName().equals(UI_TESTER_ELEMENT)) {
-				result = true;
-				try {
-					// Don't bother running tester it if we already processed one extension that returned true.
-					if (currentContext != UI_CONTEXT && canCreateExecutableExtension(element)) {
-						UITester tester = (UITester) element.createExecutableExtension(UI_TESTER_CLASSNAME_ATTR);
-						if (tester.isCurrentContextUI())
-							currentContext = UI_CONTEXT;
-					}
-				} catch (Exception t) {
-					Logger.getLogger().log("UIContextDetermination is proceeding in HEADLESS mode"); //$NON-NLS-1$
-				}
-			}
-			return result;
-		}
+		return org.eclipse.wst.common.core.util.UIContextDetermination.getCurrentContext();
 	}
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UITester.java b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UITester.java
index 54517e8..cd1b235 100644
--- a/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UITester.java
+++ b/plugins/org.eclipse.jem.util/jemutil/org/eclipse/jem/util/UITester.java
@@ -9,23 +9,13 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/
-/*
- *  $$RCSfile: UITester.java,v $$
- *  $$Revision: 1.2 $$  $$Date: 2005/02/15 23:04:14 $$ 
- */
+
 /**
  * Interface for a UITester. The "classname" attribute on the "uiTester" extension point should implement this class.
- * 
+ *
+ * @deprecated Replaced by {@link org.eclipse.wst.common.core.util.UITester)
  * @since 1.0.0
  */
-public interface UITester {
+public interface UITester extends org.eclipse.wst.common.core.util.UITester {
 
-	/**
-	 * Answer if the current context is an UI context.
-	 * 
-	 * @return <code>true</code> if an UI context.
-	 * 
-	 * @since 1.0.0
-	 */
-	public boolean isCurrentContextUI();
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.wst.common.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.wst.common.core/META-INF/MANIFEST.MF
index 34db84c..7c79533 100644
--- a/plugins/org.eclipse.wst.common.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.wst.common.core/META-INF/MANIFEST.MF
@@ -10,7 +10,8 @@
  org.eclipse.wst.common.core.search.internal;x-internal:=true,
  org.eclipse.wst.common.core.search.pattern,
  org.eclipse.wst.common.core.search.scope,
- org.eclipse.wst.common.core.search.util
+ org.eclipse.wst.common.core.search.util,
+ org.eclipse.wst.common.core.util
 Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
  org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
  org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)"
diff --git a/plugins/org.eclipse.wst.common.core/plugin.xml b/plugins/org.eclipse.wst.common.core/plugin.xml
index c82f6a0..5d2a621 100644
--- a/plugins/org.eclipse.wst.common.core/plugin.xml
+++ b/plugins/org.eclipse.wst.common.core/plugin.xml
@@ -1,7 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.0"?>
 <plugin>
-   <extension-point id="searchParticipants" name="%searchParticipants" />      
+   <extension-point id="searchParticipants" name="%searchParticipants" />
+   <extension-point id="uiTester" name="UI Tester" schema="schema/uiTester.exsd"/>
+   <extension-point id="uiContextSensitiveClass" name="UI Context Sensitive Class" schema="schema/uiContextSensitiveClass.exsd"/>
 </plugin>
 
 
diff --git a/plugins/org.eclipse.wst.common.core/schema/uiContextSensitiveClass.exsd b/plugins/org.eclipse.wst.common.core/schema/uiContextSensitiveClass.exsd
new file mode 100644
index 0000000..c18cf1a
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.core/schema/uiContextSensitiveClass.exsd
@@ -0,0 +1,165 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.common.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.eclipse.wst.common.core" id="uiContextSensitiveClass" name="UI Context Sensitive Class"/>
+      </appinfo>
+      <documentation>
+         Components are often designed in such a way that the &quot;Headless&quot; or non-graphical portions are separate from the Graphical User Interface (GUI) portions. Sometimes this is done to follow good design principles, other times there is a specific use case for doing so. When plugins follow this practice because they must vary their behavior based on whether they are running in a headless environment or a graphical environment, they often need to choose the correct implementation of a particular type. The org.eclipse.wst.common.core.uiContextSensitiveClass extension point provided by the WST component solves exactly this problem.
+&lt;p&gt;    
+To use the extension point, you must provide two extensions that are linked by a key. The key is a unique String-based value that you will later use to instanitate your class.
+&lt;p&gt;
+The first usage of the extension specifies your key, and the Headless context, and the class that should be instantiated for this (key, context) pair. This means in the headless environment this class will be instantiated when requested.
+&lt;p&gt;
+The second extension specifies the UI context and the same key, but a different implementation designed for graphical environments. This means in the UI environment this other class will be instantiated when requested.
+&lt;p&gt;
+The actual request is done in your code via:
+&lt;pre&gt;
+IMyInterface instance = (IMyInterface) UIContextDetermination.createInstance(&quot;myKey&quot;);
+&lt;/pre&gt;
+where &lt;code&gt;&quot;myKey&quot;&lt;/code&gt; is the key used on both extensions. It will then choose either the UI or the Headless extension depending upon the context.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="uiContextSensitiveClass" minOccurs="1" maxOccurs="unbounded"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="uiContextSensitiveClass">
+      <annotation>
+         <documentation>
+            An extension point that defines an instance of a class and its appropriate context (UI or Headless)
+         </documentation>
+      </annotation>
+      <complexType>
+         <attribute name="key" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The key that should be used to create an instance of the Context Sensitive super class/interface.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="className" type="string" use="required">
+            <annotation>
+               <documentation>
+                  A concrete implementation for either a UI or Headless context.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="context" use="required">
+            <annotation>
+               <documentation>
+                  One of &quot;UI&quot; or &quot;Headless&quot; This is case-sensitive. It must match exactly as shown here.
+               </documentation>
+            </annotation>
+            <simpleType>
+               <restriction base="string">
+                  <enumeration value="UI">
+                  </enumeration>
+                  <enumeration value="Headless">
+                  </enumeration>
+               </restriction>
+            </simpleType>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="apiInfo"/>
+      </appinfo>
+      <documentation>
+         See &lt;code&gt;org.eclipse.wst.common.core.util.UIContextDetermination&lt;/code&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="since"/>
+      </appinfo>
+      <documentation>
+         6.0
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="examples"/>
+      </appinfo>
+      <documentation>
+         Usage for the UI context:
+&lt;pre&gt;
+   &lt;extension
+       id=&quot;context.Sensitive.Class.workingCopyManager&quot;
+       name=&quot;Working Copy Manager - UI Context Class&quot;
+       point=&quot;org.eclipse.wst.common.core.ContextSensitiveClass&quot;&gt;
+     &lt;uiContextSensitiveClass
+       context=&quot;UI&quot;
+       key=&quot;workingCopyManager&quot;
+       className=&quot;com.ibm.wtp.common.ui.WTPUIWorkingCopyManager&quot;/&gt;
+   &lt;/extension&gt;
+&lt;/pre&gt;
+&lt;br&gt;
+Usage for the Headless context:
+&lt;pre&gt;
+   &lt;extension
+       id=&quot;context.Sensitive.Class.workingCopyManager&quot;
+       name=&quot;Working Copy Manager - Headless Context Class&quot;
+       point=&quot;org.eclipse.wst.common.core.ContextSensitiveClass&quot;&gt;
+     &lt;uiContextSensitiveClass
+         context=&quot;Headless&quot;
+         key=&quot;workingCopyManager&quot;
+         className=&quot;com.ibm.wtp.common.ui.WTPHeadlessWorkingCopyManager&quot;/&gt;
+   &lt;/extension&gt;
+&lt;/pre&gt;
+&lt;br&gt;
+And finally the retrieval of the class for the current context:
+
+&lt;pre&gt;
+IWorkingCopyManager manager = (IWorkingCopyManager) UIContextDetermination.createInstance(&quot;workingCopyManager&quot;);
+&lt;/pre&gt;
+      </documentation>
+   </annotation>
+
+
+   <annotation>
+      <appinfo>
+         <meta.section type="copyright"/>
+      </appinfo>
+      <documentation>
+         Copyright (c) IBM 2003.
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.wst.common.core/schema/uiTester.exsd b/plugins/org.eclipse.wst.common.core/schema/uiTester.exsd
new file mode 100644
index 0000000..df8bb48
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.core/schema/uiTester.exsd
@@ -0,0 +1,133 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.common.core" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+      <appinfo>
+         <meta.schema plugin="org.eclipse.wst.common.core" id="uiTester" name="UI Tester"/>
+      </appinfo>
+      <documentation>
+         This is used to tell WST that it is running in a non-HEADLESS environment. Typically UI environment is non-HEADLESS. The default if there are no implementers of this extension point that return true is HEADLESS.
+&lt;p&gt;
+A HEADLESS environment is typically a batch situation where there is no UI and the workspace is used for one operation and then terminated. Most headless tasks are done under one operation and the JavaReflectionSynchronizer may not have a chance to flush a bad reflection before the real type needs to be found and can be found. So what would happen is if a class was created during this one operation it would not be found because the notifications had not yet gone out. 
+&lt;p&gt;
+In a UI environment the operations are typically short and do only a few things and the results aren&apos;t needed until after the operation has completed. In that case it is more efficient to not keep checking if a class has appeared everytime a request is made, instead it will wait for the notification of the added class to appear before resetting the definition to allow checking again later.
+&lt;p&gt;
+If there is more than one implementer of this interface in the application, then it will go through each of them once until one returns true. As soon as one returns true it will stop and mark the application as being non-HEADLESS. This will be done only once for the application. It will not be again until the next session of the application.
+&lt;p&gt;
+This is typically an internal extension point only. The WST UI plugin will provide an implementation that will return true if the Platform UI is active. So this will normally not be needed to be implemented by most customers.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <annotation>
+         <appinfo>
+            <meta.element />
+         </appinfo>
+      </annotation>
+      <complexType>
+         <sequence>
+            <element ref="uiTester"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="uiTester">
+      <annotation>
+         <documentation>
+            The uiTester definition element.
+         </documentation>
+      </annotation>
+      <complexType>
+         <attribute name="className" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The class name of the UITester for this extension. It must implement &lt;samp&gt;org.eclipse.wst.common.core.util.UITester&lt;/samp&gt;.
+               </documentation>
+               <appinfo>
+                  <meta.attribute kind="java" basedOn="org.eclipse.wst.common.core.util.UITester"/>
+               </appinfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="apiInfo"/>
+      </appinfo>
+      <documentation>
+         The &lt;samp&gt;className&lt;/samp&gt; attribute must be a fully-qualified class that implements the &lt;samp&gt;org.eclipse.wst.common.core.util.UITester&lt;/samp&gt; interface for the tester.
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="since"/>
+      </appinfo>
+      <documentation>
+         1.0.0
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="examples"/>
+      </appinfo>
+      <documentation>
+         The following is an example of an implementer: 
+
+&lt;p&gt;
+&lt;pre&gt;
+ &lt;extension point=&quot;org.eclipse.wst.common.core.uiTester&quot;&gt;
+  &lt;uiTester
+   className=&quot;com.example.UITesterImplementation&quot;/&gt;
+ &lt;/extension&gt;
+&lt;/pre&gt;
+&lt;/p&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="implementation"/>
+      </appinfo>
+      <documentation>
+         There is no default implementation for this class.
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appinfo>
+         <meta.section type="copyright"/>
+      </appinfo>
+      <documentation>
+         Copyright (c) 2004, 2006 IBM Corporation and others.&lt;br&gt;
+All rights reserved. This program and the accompanying materials are made 
+available under the terms of the Eclipse Public License v1.0 which accompanies 
+this distribution, and is available at 
+&lt;a href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/search/SearchPlugin.java b/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/search/SearchPlugin.java
index cf7a9fc..5d8c303 100644
--- a/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/search/SearchPlugin.java
+++ b/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/search/SearchPlugin.java
@@ -13,7 +13,11 @@
 
 import java.util.Map;
 
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
 import org.eclipse.core.runtime.Plugin;
+import org.eclipse.core.runtime.Status;
 import org.eclipse.wst.common.core.search.internal.SearchParticipantRegistry;
 import org.eclipse.wst.common.core.search.internal.SearchParticipantRegistryReader;
 import org.eclipse.wst.common.core.search.pattern.SearchPattern;
@@ -30,6 +34,21 @@
  */
 public class SearchPlugin extends Plugin implements ISearchOptions
 {
+	//the ID for this plugin (added automatically by logging quickfix)
+	public static final String PLUGIN_ID = "org.eclipse.wst.common.core"; //$NON-NLS-1$
+
+	/**
+	 * UI Context extension point.
+	 * 
+	 * @since 1.0.0
+	 */
+	public static final String UI_CONTEXT_EXTENSION_POINT = "uiContextSensitiveClass"; //$NON-NLS-1$
+	/**
+	 * UITester element name.
+	 * 
+	 * @since 1.0.0
+	 */
+	public static final String UI_TESTER_EXTENSION_POINT = "uiTester"; //$NON-NLS-1$
 
 	private SearchParticipantRegistry searchParticipantRegistry;
 
@@ -100,4 +119,31 @@
 		return getSearchParticipantRegistry().getParticipants(pattern, searchOptions);
 	}
 
+	public static IStatus createStatus(int severity, String message, Throwable exception) {
+		return new Status(severity, PLUGIN_ID, message, exception);
+	}
+
+	public static IStatus createStatus(int severity, String message) {
+		return createStatus(severity, message, null);
+	}
+
+	public static void logError(Throwable exception) {
+		Platform.getLog(Platform.getBundle(PLUGIN_ID)).log( createStatus(IStatus.ERROR, exception.getMessage(), exception));
+	}
+
+	public static void logError(CoreException exception) {
+		Platform.getLog(Platform.getBundle(PLUGIN_ID)).log( exception.getStatus() );
+	}
+
+	public static void logWarning(String message) {
+		Platform.getLog(Platform.getBundle(PLUGIN_ID)).log(createStatus(IStatus.WARNING, message));
+	}
+
+	public static void logWarning(Throwable exception) {
+		Platform.getLog(Platform.getBundle(PLUGIN_ID)).log( createStatus(IStatus.WARNING, exception.getMessage(), exception));
+	}
+
+	public static void logError(String message) {
+		Platform.getLog(Platform.getBundle(PLUGIN_ID)).log( createStatus(IStatus.ERROR, message));
+	}
 }
diff --git a/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/util/RegistryReader.java b/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/util/RegistryReader.java
new file mode 100644
index 0000000..abf3e2b
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/util/RegistryReader.java
@@ -0,0 +1,166 @@
+/*******************************************************************************
+ * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.common.core.util;
+import org.eclipse.core.runtime.*;
+import org.eclipse.wst.common.core.search.SearchPlugin;
+import org.osgi.framework.Bundle;
+
+
+/**
+ * Class to read a registry. It is meant to be subclassed to provide specific function.
+ * 
+ * @since 1.0.0
+ */
+public abstract class RegistryReader {
+
+	private static final String JEM_PLUGIN_ID = "org.eclipse.jem.util"; //$NON-NLS-1$
+	
+	String pluginId;
+
+	String extensionPointId;
+
+	private static Bundle systemBundle;
+
+	/**
+	 * Utility method to get the plugin id of a configuation element
+	 * 
+	 * @param configurationElement
+	 * @return plugin id of configuration element
+	 * @since 1.0.0
+	 */
+	public static String getPluginId(IConfigurationElement configurationElement) {
+		String pluginId = null;
+
+		if (configurationElement != null) {
+			IExtension extension = configurationElement.getDeclaringExtension();
+
+			if (extension != null)
+				pluginId = extension.getContributor().getName();
+		}
+
+		return pluginId;
+	}
+
+	/**
+	 * Constructor for RegistryReader taking a registry, plugin id, and extension point id.
+	 * 
+	 * @param registry
+	 * @param pluginID
+	 * @param extensionPoint
+	 * 
+	 * @deprecated Use RegistryReader(plugin, extensionPoint) instead. The registry passed in is ignored.
+	 * @since 1.0.0
+	 */
+	public RegistryReader(IPluginRegistry registry, String pluginID, String extensionPoint) {
+		this(pluginID, extensionPoint);
+	}
+
+	/**
+	 * Constructor for RegistryReader taking the plugin id and extension point id.
+	 * 
+	 * @param pluginID
+	 * @param extensionPoint
+	 * 
+	 * @since 1.0.0
+	 */
+	public RegistryReader(String pluginID, String extensionPoint) {
+		super();
+		this.pluginId = pluginID;
+		extensionPointId = extensionPoint;
+	}
+
+	private void internalReadElement(IConfigurationElement element) {
+		boolean recognized = this.readElement(element);
+		if (!recognized) {
+			logError(element, "Error processing extension: " + element); //$NON-NLS-1$
+		}
+	}
+
+	/*
+	 * Logs the error in the desktop log using the provided text and the information in the configuration element.
+	 */
+	protected void logError(IConfigurationElement element, String text) {
+		IExtension extension = element.getDeclaringExtension();
+		StringBuffer buf = new StringBuffer();
+		buf.append("Plugin " + extension.getContributor().getName() + ", extension " + extension.getExtensionPointUniqueIdentifier()); //$NON-NLS-1$ //$NON-NLS-2$
+		buf.append("\n" + text); //$NON-NLS-1$
+		SearchPlugin.logError(buf.toString());
+	}
+
+	/*
+	 * Logs a very common registry error when a required attribute is missing.
+	 */
+	protected void logMissingAttribute(IConfigurationElement element, String attributeName) {
+		logError(element, "Required attribute '" + attributeName + "' not defined"); //$NON-NLS-1$ //$NON-NLS-2$
+	}
+
+	/*
+	 * Implement this method to read element attributes. If this element has subelements, the reader will recursively cycle through them and call this
+	 * method so don't do it here.
+	 */
+	public abstract boolean readElement(IConfigurationElement element);
+
+	/**
+	 * Read the extension point and parse it.
+	 * 
+	 * @since 1.0.0
+	 */
+	public void readRegistry() {
+		IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(pluginId, extensionPointId);
+		if (point != null)
+		{
+			IConfigurationElement[] elements = point.getConfigurationElements();
+			for (int i = 0; i < elements.length; i++) {
+				internalReadElement(elements[i]);
+			}
+		}
+		// the following code is to handle the contributions to the deprecated org.eclipse.jem.util extensions
+		if (!JEM_PLUGIN_ID.equals(pluginId))
+		{
+			point = Platform.getExtensionRegistry().getExtensionPoint(JEM_PLUGIN_ID, extensionPointId);
+			if (point != null)
+			{
+				IConfigurationElement[] elements = point.getConfigurationElements();
+				for (int i = 0; i < elements.length; i++) {
+					internalReadElement(elements[i]);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Tests to see if it is valid at this point in time to create an executable extension. A valid reason not to would be that the workspace is
+	 * shutting donw.
+	 * 
+	 * @param element
+	 * @return <code>true</code> if it is valid point to create an executable extension.
+	 * 
+	 * @since 1.0.0
+	 */
+	public static boolean canCreateExecutableExtension(IConfigurationElement element) {
+		if (Platform.isRunning() && getSystemBundle().getState() != Bundle.STOPPING)
+			return true;
+		return false;
+	}
+
+	/**
+	 * Get the system bundle
+	 * 
+	 * @return system bundle.
+	 * 
+	 * @since 1.0.0
+	 */
+	protected static Bundle getSystemBundle() {
+		if (systemBundle == null)
+			systemBundle = Platform.getBundle("org.eclipse.osgi"); //$NON-NLS-1$
+		return systemBundle;
+	}
+}
diff --git a/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/util/UIContextDetermination.java b/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/util/UIContextDetermination.java
new file mode 100644
index 0000000..69c0bbc
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/util/UIContextDetermination.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.common.core.util;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.*;
+import org.eclipse.wst.common.core.search.SearchPlugin;
+
+
+/**
+ * Static utility class for UIContext determination.
+ * 
+ * @since 1.0.0
+ */
+public class UIContextDetermination {
+
+	private static final int UNKNOWN = 100;
+
+	public static final String HEADLESS_CONTEXT_LITERAL = "Headless"; //$NON-NLS-1$
+
+	public static final String UI_CONTEXT_LITERAL = "UI"; //$NON-NLS-1$
+
+	public static final int HEADLESS_CONTEXT = 102;
+
+	public static final int UI_CONTEXT = 101;
+
+	private static Map cachedExtensions = null;
+
+	private static int currentContext = UNKNOWN;
+
+	/**
+	 * Do not use- this class should not be instantiated, but should be accessed via its static methods only.
+	 */
+	protected UIContextDetermination() {
+	}
+
+	/**
+	 * Returns an instance of a given class based on the UI or Headless context.
+	 * 
+	 * @param key
+	 * @return new class instance for the given key.
+	 * @throws IllegalArgumentException
+	 *             If the key is invalid (e.g. no extension is found for the key)
+	 */
+	public static Object createInstance(String key) {
+		Object result = null;
+		if (cachedExtensions == null)
+			initExtensions();
+		IConfigurationElement contextSensitiveClass = (IConfigurationElement) cachedExtensions.get(key);
+		try {
+			if (contextSensitiveClass != null)
+				result = contextSensitiveClass
+						.createExecutableExtension(UIContextDeterminationRegistryReader.UI_CONTEXT_SENSTIVE_CLASS_CLASSNAME_ATTR);
+		} catch (CoreException e) {
+			SearchPlugin.logError("Problem loading extension not found for key \"" + key + "\"."); //$NON-NLS-1$ //$NON-NLS-2$
+			SearchPlugin.logError(e);
+		}
+		if (result == null)
+			SearchPlugin.logError("Extension not found for key \"" + key + "\"."); //$NON-NLS-1$ //$NON-NLS-2$
+		return result;
+	}
+
+	/**
+	 * Returns the current context -- determines the value if necessary.
+	 * 
+	 * @return current context
+	 * @see #HEADLESS_CONTEXT
+	 * @see #UI_CONTEXT
+	 */
+	public static int getCurrentContext() {
+		if (currentContext == UNKNOWN) {
+			currentContext = HEADLESS_CONTEXT;
+			new UITesterRegistryReader().readRegistry();
+		}
+		return currentContext;
+	}
+
+	/*
+	 * Invokes the UIContextDeterminationRegistryReader to cache all of the extensions, if necessary.
+	 *  
+	 */
+	private static void initExtensions() {
+		if (cachedExtensions == null) {
+			cachedExtensions = new HashMap();
+			new UIContextDeterminationRegistryReader().readRegistry();
+		}
+	}
+
+	/*
+	 * Converts the input to one of UI_CONTEXT or HEADLESS_CONTEXT. Defaults to HEADLESS on invalid input
+	 * 
+	 * @param literal @return
+	 */
+	private static int convertLiteral(String literal) {
+		return (UI_CONTEXT_LITERAL.equals(literal)) ? UI_CONTEXT : HEADLESS_CONTEXT;
+	}
+
+	/*
+	 * Reads the registration of UI Context-sensitive class extensions and initializes the cache of the UIContextDetermination object.
+	 * 
+	 * @author mdelder
+	 */
+	private static class UIContextDeterminationRegistryReader extends RegistryReader {
+
+		public static final String UI_CONTEXT_SENSTIVE_CLASS_ELEMENT = "uiContextSensitiveClass"; //$NON-NLS-1$
+
+		public static final String UI_CONTEXT_SENSTIVE_CLASS_KEY_ATTR = "key"; //$NON-NLS-1$
+
+		public static final String UI_CONTEXT_SENSTIVE_CLASS_CLASSNAME_ATTR = "className"; //$NON-NLS-1$
+
+		public static final String UI_CONTEXT_SENSTIVE_CLASS_CONTEXT_ATTR = "context"; //$NON-NLS-1$
+
+		public UIContextDeterminationRegistryReader() {
+			super(SearchPlugin.PLUGIN_ID, SearchPlugin.UI_CONTEXT_EXTENSION_POINT);
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see org.eclipse.jem.util.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
+		 */
+		public boolean readElement(IConfigurationElement element) {
+			boolean result = false;
+			if (element.getName().equals(UI_CONTEXT_SENSTIVE_CLASS_ELEMENT)) {
+
+				String key = element.getAttribute(UI_CONTEXT_SENSTIVE_CLASS_KEY_ATTR);
+				String context = element.getAttribute(UI_CONTEXT_SENSTIVE_CLASS_CONTEXT_ATTR);
+
+				if (!cachedExtensions.containsKey(key) || getCurrentContext() == convertLiteral(context))
+					cachedExtensions.put(key, element);
+				result = true;
+			}
+			return result;
+		}
+	}
+
+	/*
+	 * Reads the uiTester extension and instantiate the any of the UITester classes it finds.
+	 * 
+	 * The implementation has the side effect that if multiple UITesters are registered, any of them can trip the currentContext into the UI_CONTEXT
+	 * state.
+	 * 
+	 * @author mdelder
+	 */
+	private static class UITesterRegistryReader extends RegistryReader {
+
+		public static final String UI_TESTER_ELEMENT = "uiTester"; //$NON-NLS-1$
+
+		public static final String UI_TESTER_CLASSNAME_ATTR = "className"; //$NON-NLS-1$
+
+		public UITesterRegistryReader() {
+			super(SearchPlugin.PLUGIN_ID, SearchPlugin.UI_TESTER_EXTENSION_POINT);
+		}
+
+		/*
+		 * (non-Javadoc)
+		 * 
+		 * @see com.ibm.etools.emf.workbench.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
+		 */
+		public boolean readElement(IConfigurationElement element) {
+			boolean result = false;
+			if (element.getName().equals(UI_TESTER_ELEMENT)) {
+				result = true;
+				try {
+					// Don't bother running tester it if we already processed one extension that returned true.
+					if (currentContext != UI_CONTEXT && canCreateExecutableExtension(element)) {
+						UITester tester = (UITester) element.createExecutableExtension(UI_TESTER_CLASSNAME_ATTR);
+						if (tester.isCurrentContextUI())
+							currentContext = UI_CONTEXT;
+					}
+				} catch (Exception t) {
+					SearchPlugin.logWarning("UIContextDetermination is proceeding in HEADLESS mode"); //$NON-NLS-1$
+				}
+			}
+			return result;
+		}
+
+		public void readRegistry() {
+			super.readRegistry();
+			IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint("org.eclipse.jem.util", extensionPointId);
+			if (point == null)
+				return;
+			IConfigurationElement[] elements = point.getConfigurationElements();
+			for (int i = 0; i < elements.length; i++) {
+				boolean recognized = this.readElement(elements[i]);
+				if (!recognized) {
+					logError(elements[i], "Error processing extension: " + elements[i]); //$NON-NLS-1$
+				}
+			}
+		}
+	}
+}
diff --git a/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/util/UITester.java b/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/util/UITester.java
new file mode 100644
index 0000000..768ed10
--- /dev/null
+++ b/plugins/org.eclipse.wst.common.core/src-search/org/eclipse/wst/common/core/util/UITester.java
@@ -0,0 +1,28 @@
+package org.eclipse.wst.common.core.util;
+/*******************************************************************************
+ * Copyright (c) 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials 
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+/**
+ * Interface for a UITester. The "classname" attribute on the "uiTester" extension point should implement this class.
+ * 
+ * @since 1.0.0
+ */
+public interface UITester {
+
+	/**
+	 * Answer if the current context is an UI context.
+	 * 
+	 * @return <code>true</code> if an UI context.
+	 * 
+	 * @since 1.0.0
+	 */
+	public boolean isCurrentContextUI();
+}