Bug 246209 [Viewers] OpenStrategy postSelection delay hinders automated testing
Build ID: I20080617-2000 Steps To Reproduce: The initializeHandler method runs the firePostSelectionEvent after the TIME=500 ms, which causes the automated tests to fail unless the thread is made to sleep for 500+ ms after each arrow key pressed, which is cumbersome. More information: Could we have the TIME member public, to set to 0 when testing? Probably that would be a good idea to have some kind of a more global flag (maybe in Display) to turn off optimizations that are hostile to event driven testing?
bundles/org.eclipse.jface/src/org/eclipse/jface/util/OpenStrategy.java
import org.eclipse.swt.custom.TableTreeItem;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.swt.widgets.Widget;
/**
 * Implementation of single-click and double-click strategies.
 * <p>
 * Usage:
 * <pre>
 *	OpenStrategy handler = new OpenStrategy(control);
 *	handler.addOpenListener(new IOpenEventListener() {
 *		public void handleOpen(SelectionEvent e) {
 *			... // code to handle the open event.
 *		}
 *	});
 * </pre>
 * </p>
 */
public class OpenStrategy {
    /** 
     * Default behavior. Double click to open the item.