Lines 11-16
Link Here
|
11 |
*******************************************************************************/ |
11 |
*******************************************************************************/ |
12 |
package org.eclipse.jface.dialogs; |
12 |
package org.eclipse.jface.dialogs; |
13 |
|
13 |
|
|
|
14 |
import org.eclipse.core.runtime.Assert; |
14 |
import org.eclipse.jface.layout.GridDataFactory; |
15 |
import org.eclipse.jface.layout.GridDataFactory; |
15 |
import org.eclipse.jface.layout.GridLayoutFactory; |
16 |
import org.eclipse.jface.layout.GridLayoutFactory; |
16 |
import org.eclipse.jface.layout.LayoutConstants; |
17 |
import org.eclipse.jface.layout.LayoutConstants; |
Lines 267-272
Link Here
|
267 |
* @return image the image |
268 |
* @return image the image |
268 |
*/ |
269 |
*/ |
269 |
private Image getSWTImage(final int imageID) { |
270 |
private Image getSWTImage(final int imageID) { |
|
|
271 |
Assert.isNotNull(Display.getCurrent(), "Invalid access from non-UI thread."); //$NON-NLS-1$ |
272 |
|
270 |
Shell shell = getShell(); |
273 |
Shell shell = getShell(); |
271 |
final Display display; |
274 |
final Display display; |
272 |
if (shell == null || shell.isDisposed()) { |
275 |
if (shell == null || shell.isDisposed()) { |
Lines 277-292
Link Here
|
277 |
} else { |
280 |
} else { |
278 |
display = shell.getDisplay(); |
281 |
display = shell.getDisplay(); |
279 |
} |
282 |
} |
280 |
|
283 |
|
281 |
final Image[] image = new Image[1]; |
284 |
return display.getSystemImage(imageID); |
282 |
display.syncExec(new Runnable() { |
|
|
283 |
public void run() { |
284 |
image[0] = display.getSystemImage(imageID); |
285 |
} |
286 |
}); |
287 |
|
288 |
return image[0]; |
289 |
|
290 |
} |
285 |
} |
291 |
|
286 |
|
292 |
} |
287 |
} |