TUP-2293: use workbench context for code injection instead of application's one
This commit is contained in:
@@ -45,6 +45,7 @@ import org.eclipse.ui.IWorkbenchPage;
|
||||
import org.eclipse.ui.IWorkbenchWindow;
|
||||
import org.eclipse.ui.PerspectiveAdapter;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.eclipse.ui.WorkbenchException;
|
||||
import org.eclipse.ui.XMLMemento;
|
||||
import org.eclipse.ui.activities.IWorkbenchActivitySupport;
|
||||
import org.eclipse.ui.application.ActionBarAdvisor;
|
||||
@@ -204,12 +205,12 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.ui.application.WorkbenchWindowAdvisor#postWindowCreate()
|
||||
* @see org.eclipse.ui.application.WorkbenchWindowAdvisor#postWindowRestore()
|
||||
*/
|
||||
@Override
|
||||
public void postWindowCreate() {
|
||||
super.postWindowCreate();
|
||||
|
||||
public void postWindowRestore() throws WorkbenchException {
|
||||
super.postWindowRestore();
|
||||
// do not use this; never called : see https://bugs.eclipse.org/bugs/show_bug.cgi?id=450541
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -361,7 +362,6 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
|
||||
}
|
||||
|
||||
menuManager.update(true);
|
||||
|
||||
}
|
||||
|
||||
private void showStarting() {
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
package org.talend.rcp.intro.starting;
|
||||
|
||||
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
|
||||
import org.eclipse.e4.core.contexts.IEclipseContext;
|
||||
import org.eclipse.osgi.service.runnable.StartupMonitor;
|
||||
import org.eclipse.ui.IWorkbench;
|
||||
import org.eclipse.ui.PlatformUI;
|
||||
import org.talend.rcp.intro.PerspectiveReviewUtil;
|
||||
|
||||
@@ -43,9 +45,11 @@ public class WorkbenchSetupStartupMonitor implements StartupMonitor {
|
||||
if (!PlatformUI.isWorkbenchRunning()) { // if not running, nothing to do.
|
||||
return;
|
||||
}
|
||||
org.eclipse.e4.ui.workbench.IWorkbench e4Workbench = (org.eclipse.e4.ui.workbench.IWorkbench) PlatformUI.getWorkbench();
|
||||
IWorkbench workbench = PlatformUI.getWorkbench();
|
||||
PerspectiveReviewUtil perspectiveReviewUtil = new PerspectiveReviewUtil();
|
||||
ContextInjectionFactory.inject(perspectiveReviewUtil, e4Workbench.getApplication().getContext().getActiveLeaf());
|
||||
IEclipseContext activeContext = ((IEclipseContext) workbench.getService(IEclipseContext.class)).getActiveLeaf();
|
||||
ContextInjectionFactory.inject(perspectiveReviewUtil, activeContext);
|
||||
|
||||
perspectiveReviewUtil.checkPerspectiveDisplayItems();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user