mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
handle non-ui startup
This commit is contained in:
parent
6761b638e7
commit
de3813f5f2
1 changed files with 18 additions and 13 deletions
|
@ -282,12 +282,15 @@ public class CPlugin extends AbstractUIPlugin {
|
||||||
super.shutdown();
|
super.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Display getStandardDisplay() {
|
private void runUI(Runnable run) {
|
||||||
Display display;
|
Display display;
|
||||||
display= Display.getCurrent();
|
display= Display.getCurrent();
|
||||||
if (display == null)
|
if (display == null) {
|
||||||
display= Display.getDefault();
|
display= Display.getDefault();
|
||||||
return display;
|
display.asyncExec(run);
|
||||||
|
} else {
|
||||||
|
run.run();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -298,24 +301,26 @@ 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(
|
runUI(new Runnable() {
|
||||||
new Runnable() {
|
|
||||||
public void run() {
|
public void run() {
|
||||||
CPluginImages.initialize();
|
CPluginImages.initialize();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see AbstractUIPlugin#initializeDefaultPreferences
|
* @see AbstractUIPlugin#initializeDefaultPreferences
|
||||||
*/
|
*/
|
||||||
protected void initializeDefaultPreferences(IPreferenceStore store) {
|
protected void initializeDefaultPreferences(final IPreferenceStore store) {
|
||||||
super.initializeDefaultPreferences(store);
|
super.initializeDefaultPreferences(store);
|
||||||
|
runUI(new Runnable() {
|
||||||
|
public void run() {
|
||||||
CPluginPreferencePage.initDefaults(store);
|
CPluginPreferencePage.initDefaults(store);
|
||||||
CEditorPreferencePage.initDefaults(store);
|
CEditorPreferencePage.initDefaults(store);
|
||||||
CView.initDefaults(store);
|
CView.initDefaults(store);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
public IConsole getConsole() {
|
public IConsole getConsole() {
|
||||||
return fConsoleDocument;
|
return fConsoleDocument;
|
||||||
|
|
Loading…
Add table
Reference in a new issue