View | Details | Raw Unified | Return to bug 241244 | Differences between
and this patch

Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/statushandlers/WorkbenchStatusDialogManager.java (-1 / +2 lines)
Lines 1656-1662 Link Here
1656
	/**
1656
	/**
1657
	 * Returns the shell of the dialog.
1657
	 * Returns the shell of the dialog.
1658
	 */
1658
	 */
1659
	private Shell getShell() {
1659
	public Shell getShell() {
1660
		if (this.dialog == null) return null;
1660
		return this.dialog.getShell();
1661
		return this.dialog.getShell();
1661
	}
1662
	}
1662
1663
(-)Eclipse UI/org/eclipse/ui/statushandlers/WorkbenchErrorHandler.java (-9 / +33 lines)
Lines 62-79 Link Here
62
			final boolean modal = ((style & StatusManager.BLOCK) == StatusManager.BLOCK);
62
			final boolean modal = ((style & StatusManager.BLOCK) == StatusManager.BLOCK);
63
			if (Display.getCurrent() != null) {
63
			if (Display.getCurrent() != null) {
64
				getStatusDialogManager().addStatusAdapter(statusAdapter, modal);
64
				getStatusDialogManager().addStatusAdapter(statusAdapter, modal);
65
				if (modal) {
66
					Display display = Display.getCurrent();
67
					while (getStatusDialogManager().getShell() != null
68
							&& !getStatusDialogManager().getShell()
69
									.isDisposed()) {
70
						if (!display.readAndDispatch()) {
71
							display.sleep();
72
						}
73
					}
74
				}
65
			} else {
75
			} else {
66
				Display.getDefault().asyncExec(new Runnable() {
76
				if (!modal) {
67
					public void run() {
77
					Display.getDefault().asyncExec(new Runnable() {
68
						if (!PlatformUI.isWorkbenchRunning()) {
78
						public void run() {
69
							// we are shutting down, so just log
79
							if (!PlatformUI.isWorkbenchRunning()) {
70
							WorkbenchPlugin.log(statusAdapter.getStatus());
80
								// we are shutting down, so just log
71
							return;
81
								WorkbenchPlugin.log(statusAdapter.getStatus());
82
								return;
83
							}
84
							getStatusDialogManager().addStatusAdapter(
85
									statusAdapter, modal);
86
						}
87
					});
88
				} else {
89
					Display.getDefault().asyncExec(new Runnable() {
90
						public void run() {
91
							getStatusDialogManager().addStatusAdapter(
92
									statusAdapter, modal);
72
						}
93
						}
73
						getStatusDialogManager().addStatusAdapter(
94
					});
74
								statusAdapter, modal);
95
					while (getStatusDialogManager().getShell() != null
96
							&& !getStatusDialogManager().getShell()
97
									.isDisposed()) {
98
						// do nothing but wait
75
					}
99
					}
76
				});
100
				}
77
			}
101
			}
78
		}
102
		}
79
103
(-)Eclipse UI/org/eclipse/ui/statushandlers/StatusManager.java (-1 / +1 lines)
Lines 94-100 Link Here
94
	public static final int SHOW = 0x02;
94
	public static final int SHOW = 0x02;
95
95
96
	/**
96
	/**
97
	 * A style indicating that the handling should block the calling method
97
	 * A style indicating that the handling should block the calling thread
98
	 * until the user has responded. This is generally done using a modal window
98
	 * until the user has responded. This is generally done using a modal window
99
	 * such as a {@link Dialog}.
99
	 * such as a {@link Dialog}.
100
	 */
100
	 */

Return to bug 241244