Bug 162805 [Undo] [IDE] Navigator Undo happens in UI thread with no progress
Build: I20061030-1200 Perform a large copy in a project that takes a few seconds to run Edit > Undo Copy Resources Edit > Redo Copy Resources The "redo" happens in the UI thread so the application stops painting (on Vista the window turns white). This should happen in a modal context thread. 4XESTACKTRACE at org/eclipse/core/internal/resources/Resource.copy(Resource.java:482) 4XESTACKTRACE at org/eclipse/ui/ide/undo/WorkspaceUndoUtil.copy(WorkspaceUndoUtil.java:327) 4XESTACKTRACE at org/eclipse/ui/ide/undo/CopyResourcesOperation.copy(CopyResourcesOperation.java:157) 4XESTACKTRACE at org/eclipse/ui/ide/undo/CopyResourcesOperation.doExecute(CopyResourcesOperation.java:125) 4XESTACKTRACE at org/eclipse/ui/ide/undo/AbstractWorkspaceOperation$2.run(AbstractWorkspaceOperation.java:250) 4XESTACKTRACE at org/eclipse/core/internal/resources/Workspace.run(Workspace.java:1742(Compiled Code)) 4XESTACKTRACE at org/eclipse/ui/ide/undo/AbstractWorkspaceOperation.redo(AbstractWorkspaceOperation.java:248) 4XESTACKTRACE at org/eclipse/core/commands/operations/DefaultOperationHistory.doRedo(DefaultOperationHistory.java:353) 4XESTACKTRACE at org/eclipse/core/commands/operations/DefaultOperationHistory.redo(DefaultOperationHistory.java:1095) 4XESTACKTRACE at org/eclipse/ui/operations/RedoActionHandler.runCommand(RedoActionHandler.java:64) 4XESTACKTRACE at org/eclipse/ui/operations/OperationHistoryActionHandler$4.run(OperationHistoryActionHandler.java:280) 4XESTACKTRACE at org/eclipse/jface/operation/ModalContext.runInCurrentThread(ModalContext.java:369) 4XESTACKTRACE at org/eclipse/jface/operation/ModalContext.run(ModalContext.java:313) 4XESTACKTRACE at org/eclipse/jface/dialogs/ProgressMonitorDialog.run(ProgressMonitorDialog.java:479) 4XESTACKTRACE at org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.access$6(TimeTriggeredProgressMonitorDialog.java:1) 4XESTACKTRACE at org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog$2.run(TimeTriggeredProgressMonitorDialog.java:203) 4XESTACKTRACE at org/eclipse/swt/custom/BusyIndicator.showWhile(BusyIndicator.java:67(Compiled Code)) 4XESTACKTRACE at org/eclipse/ui/internal/operations/TimeTriggeredProgressMonitorDialog.run(TimeTriggeredProgressMonitorDialog.java:216) 4XESTACKTRACE at org/eclipse/ui/operations/OperationHistoryActionHandler.run(OperationHistoryActionHandler.java:290) 4XESTACKTRACE at org/eclipse/jface/action/Action.runWithEvent(Action.java:499) 4XESTACKTRACE at org/eclipse/ui/actions/RetargetAction.runWithEvent(RetargetAction.java:229) 4XESTACKTRACE at org/eclipse/jface/action/ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:539) 4XESTACKTRACE at org/eclipse/jface/action/ActionContributionItem.access$2(ActionContributionItem.java:488) 4XESTACKTRACE at org/eclipse/jface/action/ActionContributionItem$5.handleEvent(ActionContributionItem.java:400) 4XESTACKTRACE at org/eclipse/swt/widgets/EventTable.sendEvent(EventTable.java:66(Compiled Code)) 4XESTACKTRACE at org/eclipse/swt/widgets/Widget.sendEvent(Widget.java:925(Compiled Code)) 4XESTACKTRACE at org/eclipse/swt/widgets/Display.runDeferredEvents(Display.java:3455(Compiled Code)) 4XESTACKTRACE at org/eclipse/swt/widgets/Display.readAndDispatch(Display.java:3072(Compiled Code)) 4XESTACKTRACE at org/eclipse/ui/internal/Workbench.runEventLoop(Workbench.java:1924)
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/actions/CopyFilesAndFoldersOperation.java
return ALL;
				}
				final String returnCode[] = { CANCEL };
				final String msg = NLS
						.bind(
								IDEWorkbenchMessages.CopyFilesAndFoldersOperation_overwriteQuestion,
								pathString);
				final String[] options = { IDialogConstants.YES_LABEL,
						IDialogConstants.YES_TO_ALL_LABEL,
						IDialogConstants.NO_LABEL,
						IDialogConstants.CANCEL_LABEL };
				messageShell.getDisplay().syncExec(new Runnable() {
					public void run() {
						MessageDialog dialog = new MessageDialog(
								messageShell,
								IDEWorkbenchMessages.CopyFilesAndFoldersOperation_question,
								null, msg, MessageDialog.QUESTION, options, 0);
						dialog.open();
						int returnVal = dialog.getReturnCode();
						String[] returnCodes = { YES, ALL, NO, CANCEL };
						returnCode[0] = returnVal == -1 ? CANCEL
								: returnCodes[returnVal];
					}
				});
				if (returnCode[0] == ALL) {
					alwaysOverwrite = true;
				} else if (returnCode[0] == CANCEL) {
					canceled = true;
				}
				return returnCode[0];