use of eu.esdihumboldt.hale.ui.application.workbench.extension.WorkbenchHookExtension in project hale by halestudio.
the class ApplicationWorkbenchAdvisor method preStartup.
@Override
public void preStartup() {
super.preStartup();
try {
ProxySettings.install();
} catch (Exception ex) {
// $NON-NLS-1$
_log.warn("Setting the Proxy configuration failed: " + ex.getMessage());
}
/*
* Initialize RecentResources so they are not loaded when the first
* import dialog is opened.
*
* TODO instead use a workbench hook?!
*/
PlatformUI.getWorkbench().getService(RecentResources.class);
// initialize workbench hooks
Builder<WorkbenchHook> builder = ImmutableList.builder();
WorkbenchHookExtension ext = new WorkbenchHookExtension();
for (WorkbenchHookFactory fact : ext.getFactories()) {
try {
builder.add(fact.createExtensionObject());
} catch (Exception e) {
// ignore
e.printStackTrace();
}
}
hooks = builder.build();
// call workbench hooks
for (WorkbenchHook hook : hooks) {
try {
hook.preStartup(getWorkbenchConfigurer().getWorkbench());
} catch (Exception e) {
e.printStackTrace();
}
}
}
Aggregations