Search in sources :

Example 1 with WorkbenchHookFactory

use of eu.esdihumboldt.hale.ui.application.workbench.extension.WorkbenchHookFactory 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();
        }
    }
}
Also used : WorkbenchHookFactory(eu.esdihumboldt.hale.ui.application.workbench.extension.WorkbenchHookFactory) WorkbenchHook(eu.esdihumboldt.hale.ui.application.workbench.WorkbenchHook) WorkbenchHookExtension(eu.esdihumboldt.hale.ui.application.workbench.extension.WorkbenchHookExtension)

Aggregations

WorkbenchHook (eu.esdihumboldt.hale.ui.application.workbench.WorkbenchHook)1 WorkbenchHookExtension (eu.esdihumboldt.hale.ui.application.workbench.extension.WorkbenchHookExtension)1 WorkbenchHookFactory (eu.esdihumboldt.hale.ui.application.workbench.extension.WorkbenchHookFactory)1