Community
Participate
Working Groups
I20110124-1800 1. File > New > Untitled Text File 2. Make it dirty. 3. Ctrl+Shift+E 4. Select the file. 5. Click 'Close Selected Editors'. 6. Pick 'Yes'. 7. Click 'Cancel'. 8. The save dialog is closed and the focus is now granted to the workbench window but you can't do anything because of the modal dialog. The focus should be granted to the modal dialog.
The text editor directly calls getSite().getShell(). It seems to me that IWorkbench's getModalDialogShellProvider() should be used instead so that we don't parent the dialog off of the workbench window's shell. Thread [main] (Suspended (breakpoint at line 1466 in AbstractDecoratedTextEditor)) TextEditor(AbstractDecoratedTextEditor).performSaveAs(IProgressMonitor) line: 1466 TextEditor(AbstractTextEditor).doSave(IProgressMonitor) line: 4823 AbstractTextEditor$TextEditorSavable.doSave(IProgressMonitor) line: 7176 AbstractTextEditor$TextEditorSavable(Saveable).doSave(IProgressMonitor, IShellProvider) line: 214 SaveableHelper.doSaveModel(Saveable, IProgressMonitor, IShellProvider, boolean) line: 349 SaveablesList$4.run(IProgressMonitor) line: 621 SaveableHelper$5.run(IProgressMonitor) line: 277 ModalContext.runInCurrentThread(IRunnableWithProgress, IProgressMonitor) line: 464 ModalContext.run(IRunnableWithProgress, boolean, IProgressMonitor, Display) line: 372 ApplicationWindow$1.run() line: 759 BusyIndicator.showWhile(Display, Runnable) line: 70 WorkbenchWindow(ApplicationWindow).run(boolean, boolean, IRunnableWithProgress) line: 756 WorkbenchWindow.run(boolean, boolean, IRunnableWithProgress) line: 2642 SaveableHelper.runProgressMonitorOperation(String, IRunnableWithProgress, IRunnableContext, IShellProvider) line: 285 SaveablesList.saveModels(List, IShellProvider, IRunnableContext) line: 630 SaveablesList.promptForSaving(List, IShellProvider, IRunnableContext, boolean, boolean) line: 594 SaveablesList.promptForSavingIfNecessary(IShellProvider, IWorkbenchWindow, Set, Map, boolean) line: 433 SaveablesList.preCloseParts(List, boolean, IShellProvider, IWorkbenchWindow) line: 388 WorkbenchEditorsDialog.closeItems(TableItem[]) line: 454
>IWorkbench's getModalDialogShellProvider() Nice new method. It would be good if one would announce such things in the porting guide. Fixed in HEAD (AbstractDecoratedTextEditor.java, rev. 1.148). Available in builds >= I20110201-0800.
(In reply to comment #2) > >IWorkbench's getModalDialogShellProvider() > Nice new method. It would be good if one would announce such things in the > porting guide. Good point, Dani. I have opened bug 335949 for this.