Bug 87198 Unable to create a MessageDialog instance outside of SWT thread
Version: 3.1.0 Build id: I20050301-1230 You used to be able to create an instance of a MessageDialog outside the UI thead so long as open was called from inside the UI thread. It looks like change a change introduced in 1.28 (or thereabouts) of org.eclipse.jface.window.Window has caused this to no longer work. Was this intentional? I can easily update our code to create the dialog in the UI thread. org.eclipse.swt.SWTException: Invalid thread access at org.eclipse.swt.SWT.error(SWT.java:2849) at org.eclipse.swt.SWT.error(SWT.java:2772) at org.eclipse.swt.SWT.error(SWT.java:2743) at org.eclipse.swt.widgets.Widget.error(Widget.java:393) at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:296) at org.eclipse.swt.widgets.Shell.getShell(Shell.java:701) at org.eclipse.jface.window.SameShellProvider.getShell(SameShellProvider.java:42) at org.eclipse.jface.window.Window.getParentShell(Window.java:613) at org.eclipse.jface.dialogs.IconAndMessageDialog.getSWTImage(IconAndMessageDialog.java:216) at org.eclipse.jface.dialogs.IconAndMessageDialog.getQuestionImage(IconAndMessageDialog.java:202) at org.eclipse.jface.dialogs.MessageDialog.<init>(MessageDialog.java:149) at org.tigris.subversion.subclipse.ui.util.PromptingDialog.confirmOverwrite(PromptingDialog.java:91) at org.tigris.subversion.subclipse.ui.util.PromptingDialog.promptForMultiple(PromptingDialog.java:73) at org.tigris.subversion.subclipse.ui.actions.CheckoutAsProjectAction$1.execute(CheckoutAsProjectAction.java:79) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:98) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1702) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:110) at org.tigris.subversion.subclipse.ui.repository.RepositoryManager.run(RepositoryManager.java:366) at org.tigris.subversion.subclipse.ui.actions.SVNAction$1.run(SVNAction.java:228) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:111)
bundles/org.eclipse.jface/src/org/eclipse/jface/window/SameShellProvider.java
private Control targetControl;
    
    /**
     * Returns a shell provider that always returns the current
     * shell for the given control.
     * 
     * @param targetControl control whose shell will be tracked, or null if getShell() should always
     * return null
     */
    public SameShellProvider(Control targetControl) {
        this.targetControl = targetControl;
    }
    
    /* (non-javadoc)
     * @see IShellProvider#getShell()
     */
    public Shell getShell() {
        return targetControl == null? null :targetControl.getShell();
    }
}