Search in sources :

Example 1 with WorkbenchActivitySupport

use of org.eclipse.ui.internal.activities.ws.WorkbenchActivitySupport in project eclipse.platform.ui by eclipse-platform.

the class Workbench method initializeLazyServices.

private void initializeLazyServices() {
    e4Context.set(IExtensionTracker.class.getName(), new ContextFunction() {

        @Override
        public Object compute(IEclipseContext context, String contextKey) {
            if (tracker == null) {
                tracker = new UIExtensionTracker(getDisplay());
            }
            return tracker;
        }
    });
    e4Context.set(IWorkbenchActivitySupport.class.getName(), new ContextFunction() {

        @Override
        public Object compute(IEclipseContext context, String contextKey) {
            if (workbenchActivitySupport == null) {
                workbenchActivitySupport = new WorkbenchActivitySupport();
            }
            return workbenchActivitySupport;
        }
    });
    e4Context.set(IProgressService.class.getName(), new ContextFunction() {

        @Override
        public Object compute(IEclipseContext context, String contextKey) {
            return ProgressManager.getInstance();
        }
    });
    WorkbenchPlugin.getDefault().initializeContext(e4Context);
}
Also used : IExtensionTracker(org.eclipse.core.runtime.dynamichelpers.IExtensionTracker) UIExtensionTracker(org.eclipse.ui.internal.registry.UIExtensionTracker) ContextFunction(org.eclipse.e4.core.contexts.ContextFunction) IProgressService(org.eclipse.ui.progress.IProgressService) IEclipseContext(org.eclipse.e4.core.contexts.IEclipseContext) EObject(org.eclipse.emf.ecore.EObject) UIExtensionTracker(org.eclipse.ui.internal.registry.UIExtensionTracker) IWorkbenchActivitySupport(org.eclipse.ui.activities.IWorkbenchActivitySupport) WorkbenchActivitySupport(org.eclipse.ui.internal.activities.ws.WorkbenchActivitySupport) IWorkbenchActivitySupport(org.eclipse.ui.activities.IWorkbenchActivitySupport)

Aggregations

IExtensionTracker (org.eclipse.core.runtime.dynamichelpers.IExtensionTracker)1 ContextFunction (org.eclipse.e4.core.contexts.ContextFunction)1 IEclipseContext (org.eclipse.e4.core.contexts.IEclipseContext)1 EObject (org.eclipse.emf.ecore.EObject)1 IWorkbenchActivitySupport (org.eclipse.ui.activities.IWorkbenchActivitySupport)1 WorkbenchActivitySupport (org.eclipse.ui.internal.activities.ws.WorkbenchActivitySupport)1 UIExtensionTracker (org.eclipse.ui.internal.registry.UIExtensionTracker)1 IProgressService (org.eclipse.ui.progress.IProgressService)1