mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 09:46:02 +02:00
allow init in non-ui thread
This commit is contained in:
parent
4f2e35fcde
commit
7d0d12f449
1 changed files with 15 additions and 2 deletions
|
@ -282,6 +282,14 @@ public class CPlugin extends AbstractUIPlugin {
|
|||
super.shutdown();
|
||||
}
|
||||
|
||||
public static Display getStandardDisplay() {
|
||||
Display display;
|
||||
display= Display.getCurrent();
|
||||
if (display == null)
|
||||
display= Display.getDefault();
|
||||
return display;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see Plugin#startup
|
||||
*/
|
||||
|
@ -290,8 +298,13 @@ public class CPlugin extends AbstractUIPlugin {
|
|||
IAdapterManager manager= Platform.getAdapterManager();
|
||||
manager.registerAdapters(new ResourceAdapterFactory(), IResource.class);
|
||||
manager.registerAdapters(new CElementAdapterFactory(), ICElement.class);
|
||||
CPluginImages.initialize();
|
||||
|
||||
getStandardDisplay().asyncExec(
|
||||
new Runnable() {
|
||||
public void run() {
|
||||
CPluginImages.initialize();
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue