mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +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();
|
super.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Display getStandardDisplay() {
|
||||||
|
Display display;
|
||||||
|
display= Display.getCurrent();
|
||||||
|
if (display == null)
|
||||||
|
display= Display.getDefault();
|
||||||
|
return display;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see Plugin#startup
|
* @see Plugin#startup
|
||||||
*/
|
*/
|
||||||
|
@ -290,8 +298,13 @@ public class CPlugin extends AbstractUIPlugin {
|
||||||
IAdapterManager manager= Platform.getAdapterManager();
|
IAdapterManager manager= Platform.getAdapterManager();
|
||||||
manager.registerAdapters(new ResourceAdapterFactory(), IResource.class);
|
manager.registerAdapters(new ResourceAdapterFactory(), IResource.class);
|
||||||
manager.registerAdapters(new CElementAdapterFactory(), ICElement.class);
|
manager.registerAdapters(new CElementAdapterFactory(), ICElement.class);
|
||||||
|
getStandardDisplay().asyncExec(
|
||||||
|
new Runnable() {
|
||||||
|
public void run() {
|
||||||
CPluginImages.initialize();
|
CPluginImages.initialize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue