Project: Eclipse_Platform_UI
Bug 158876 [OpenModes] Synchronizer execs OpenStrategy Runnable mulitple times for one selection
Reported: 2006-09-26 17:48:15 | Status: verified fixed

So for the OpenStrategy I'm seeing mixed results for the call to display.asyncExec, where the SWT widgets Synchonizer will execute the runnable multiple times, although passed to asyncExec only once. See below code sample and debug output - any thoughts on why the synchronizer would execute the same runnable again and again? For context of the situation, this is in a TableViewer, with a content provider going against a server, leading to delays in scrolling when holding down the arrow key. Here's the code in OpenStrategy(for the places where the System.out.printlns are called to relate to the output listed below): System.out.println("Open Strategy Handling Event..."); ... ... display.asyncExec(new Runnable() { public void run() { if (arrowKeyDown) { System.out.println("Starting job: "+count[0]); display.timerExec(TIME, new Runnable() { int id = count[0]; public void run() { System.out.println("Trying to run job: "+id); if (id == count[0]) { System.out.println("Firing post selection: After 500 ms delay"); firePostSelectionEvent(new SelectionEvent( e)); if ((CURRENT_METHOD & ARROW_KEYS_OPEN) != 0) { System.out.println("Firing Open Event: After 500 ms delay"); fireOpenEvent(new SelectionEvent( e)); } } } }); } else { System.out.println("Firing post selection: Immediately "); firePostSelectionEvent(new SelectionEvent(e)); } } }); Then here's the output Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Trying to run job: 807 Trying to run job: 806 Trying to run job: 805 Trying to run job: 805 Trying to run job: 805 Trying to run job: 805 Trying to run job: 805 Trying to run job: 800 Trying to run job: 799 Trying to run job: 799 Trying to run job: 799 Starting job: 818 Starting job: 818 Starting job: 818 Starting job: 818 Starting job: 818 Starting job: 818 Starting job: 818 Starting job: 818 Starting job: 818 Starting job: 818 Starting job: 818 Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Open Strategy Handling Event... Keydown handled from widget Trying to run job: 818 Firing post selection: After 500 ms delay selectionChangedEvent Trying to run job: 818 Firing post selection: After 500 ms delay selectionChangedEvent Trying to run job: 818 Firing post selection: After 500 ms delay selectionChangedEvent Trying to run job: 818 Firing post selection: After 500 ms delay selectionChangedEvent Trying to run job: 818 Firing post selection: After 500 ms delay selectionChangedEvent Trying to run job: 818 Firing post selection: After 500 ms delay selectionChangedEvent Open Strategy Handling Event... Keydown handled from widget Trying to run job: 818 Firing post selection: After 500 ms delay selectionChangedEvent Trying to run job: 818 Firing post selection: After 500 ms delay selectionChangedEvent Trying to run job: 818 Firing post selection: After 500 ms delay selectionChangedEvent Trying to run job: 818 Firing post selection: After 500 ms delay selectionChangedEvent Trying to run job: 818 Firing post selection: After 500 ms delay selectionChangedEvent

Files changed in fix:
bundles/org.eclipse.jface/src/org/eclipse/jface/util/OpenStrategy.java