Bug 293512 [Workbench] Make IWorkbench into an OSGi service
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 Build Identifier: I would like to be when the IWorkbench is available for use. I am currently being started before the IWorkbench is ready and it is causing severe problems. If IWorkbench was a OSGi service, then I could use a ServiceTracker to acquire the initialized IWorkbench when it is available. Reproducible: Always
tests/org.eclipse.ui.tests.harness/src/org/eclipse/ui/tests/harness/util/UITestCase.java
* @param condition
	 *            , or null if this should only wait
	 * @param timeout
	 *            , -1 if forever
	 * @return true if successful, false if time out or interrupted
	 */
	protected boolean processEventsUntil(Condition condition, long timeout) {
		long startTime = System.currentTimeMillis();
		Display display = getWorkbench().getDisplay();
		while (condition == null || !condition.compute()) {
			if (timeout != -1
					&& System.currentTimeMillis() - startTime > timeout) {
				return false;
			}
			while (display.readAndDispatch())
				;
			try {
				Thread.sleep(20);
			} catch (InterruptedException e) {
				Thread.currentThread().interrupt();
				return false;
			}
		}
		return true;
	}
    
    /** 
     * Open a test window with the empty perspective.
     */
    public IWorkbenchWindow openTestWindow() {