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 |
|