| package org.eclipse.osbp.vaaclipse.addons.common.selection; |
| |
| import org.eclipse.e4.core.contexts.ContextFunction; |
| import org.eclipse.e4.core.contexts.ContextInjectionFactory; |
| import org.eclipse.e4.core.contexts.IEclipseContext; |
| import org.eclipse.e4.ui.internal.workbench.SelectionServiceImpl; |
| import org.eclipse.e4.ui.workbench.modeling.ESelectionService; |
| import org.osgi.service.component.annotations.Component; |
| |
| @Component(service = org.eclipse.e4.core.contexts.IContextFunction.class, property = { "service.context.key=org.eclipse.e4.ui.workbench.modeling.ESelectionService" }) |
| public class ESelectionServiceFactory extends ContextFunction { |
| @Override |
| public Object compute(IEclipseContext context, String contextKey) { |
| ESelectionService selectionService = ContextInjectionFactory.make(SelectionServiceImpl.class, context); |
| context.set(ESelectionService.class, selectionService); |
| return selectionService; |
| } |
| } |