Bug 162916 [Undo] [IDE] Invalid thread access from new file wizard
Build: I20061031-0656 1) Create a simple project 2) In the file system, add file "a.txt" to the project 3) Back in Eclipse, do File > New > File, select the project and enter a name of "a.txt". An internal error occurs because it is trying to open an error dialog from a modal context thread: org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:3407) at org.eclipse.swt.SWT.error(SWT.java:3330) at org.eclipse.swt.SWT.error(SWT.java:3301) at org.eclipse.swt.widgets.Widget.error(Widget.java:432) at org.eclipse.swt.widgets.Shell.<init>(Shell.java:271) at org.eclipse.swt.widgets.Shell.<init>(Shell.java:357) at org.eclipse.jface.window.Window.createShell(Window.java:482) at org.eclipse.jface.window.Window.create(Window.java:425) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1111) at org.eclipse.jface.window.Window.open(Window.java:785) at org.eclipse.jface.dialogs.ErrorDialog.open(ErrorDialog.java:296) at org.eclipse.jface.dialogs.ErrorDialog.openError(ErrorDialog.java:360) at org.eclipse.jface.dialogs.ErrorDialog.openError(ErrorDialog.java:325) at org.eclipse.ui.dialogs.WizardNewFileCreationPage$4.run(WizardNewFileCreationPage.java:343) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:113)
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/WizardNewFolderMainPage.java
public IFolder createNewFolder() {
		if (newFolder != null) {
			return newFolder;
		}
		
		final IPath containerPath = resourceGroup.getContainerFullPath();
		IPath newFolderPath = containerPath.append(resourceGroup.getResource());
		final IFolder newFolderHandle = createFolderHandle(newFolderPath);
		createLinkTarget();
		IRunnableWithProgress op = new IRunnableWithProgress() {
			public void run(IProgressMonitor monitor) throws InvocationTargetException {
				CreateFolderOperation op = new CreateFolderOperation(
						newFolderHandle, linkTargetPath,
						IDEWorkbenchMessages.WizardNewFolderCreationPage_title);
				try {
					PlatformUI.getWorkbench().getOperationSupport()
							.getOperationHistory().execute(op, monitor,
									WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
				} catch (ExecutionException e) {
					if (e.getCause() instanceof CoreException) {
		                ErrorDialog
		                        .openError(
		                                getContainer().getShell(), 
		                                IDEWorkbenchMessages.WizardNewFolderCreationPage_errorTitle,
		                                null, 
		                                ((CoreException) e.getCause())
		                                        .getStatus());
					} else {
						throw new InvocationTargetException(e);
					}