Bug 12871 JUnit view keeps focus even after clicking somewhere else.
Here are the scenarios I tested. Scenario 1 - Bug is revealed 1. Highlight a JUnit test in the packages view. 2. Click the "Run" button. 3. Highlight another test in the packages view. 4. BUG...JUnit still has focus. Scenario 2 - Bug is not present 1. Highlight a JUnit test in the packages view. 2. Click the "Run" button. 3. Click on any other window, besided packages view. 4. JUnit correctly gives up focus. It seems that when JUnit is run, it won't give up the focus to view you just came from. This seems to be a problem for me because I'll run my test, test is successful, then I'll try to run the next test or write some code. Can't do either because JUnit still has focus. Now, if I click on the title bar first, I don't have a problem, but I don't always remember to do that, nor do I want to have to remember...(old age).
org.eclipse.jdt.junit.core/src/org/eclipse/jdt/internal/junit/JUnitCorePlugin.java
* @see Plugin#startup()
	 */
	public void startup() throws CoreException {
		super.startup();
		ILaunchManager launchManager= DebugPlugin.getDefault().getLaunchManager();
		launchManager.addLaunchListener(this);	
		ProgressImages.load();
	}
	/*
	 * @see Plugin#shutdown()
	 */
	public void shutdown() throws CoreException {
		super.shutdown();
		ILaunchManager launchManager= DebugPlugin.getDefault().getLaunchManager();
		launchManager.removeLaunchListener(this);
		ProgressImages.dispose();
	}
	public static Display getDisplay() {
		Shell shell= getActiveWorkbenchShell();
		if (shell != null) {
			return shell.getDisplay();
		}
		Display display= Display.getCurrent();
		if (display == null) {
			display= Display.getDefault();
		}
		return display;
	}		
}