Search in sources :

Example 1 with SlaveCommandService

use of org.eclipse.ui.internal.commands.SlaveCommandService in project eclipse.platform.ui by eclipse-platform.

the class WorkbenchWindow method initializeDefaultServices.

/**
 * Initializes all of the default command-based services for the workbench
 * window.
 */
private final void initializeDefaultServices() {
    IEclipseContext windowContext = model.getContext();
    serviceLocator.registerService(IWorkbenchLocationService.class, new WorkbenchLocationService(IServiceScopes.WINDOW_SCOPE, getWorkbench(), this, null, null, null, 1));
    // added back for legacy reasons
    serviceLocator.registerService(IWorkbenchWindow.class, this);
    final ActionCommandMappingService mappingService = new ActionCommandMappingService();
    serviceLocator.registerService(IActionCommandMappingService.class, mappingService);
    selectionService = ContextInjectionFactory.make(SelectionService.class, model.getContext());
    serviceLocator.registerService(ISelectionService.class, selectionService);
    LegacyHandlerService hs = new LegacyHandlerService(windowContext);
    windowContext.set(IHandlerService.class.getName(), hs);
    final LegacyActionPersistence actionPersistence = new LegacyActionPersistence(this);
    serviceLocator.registerService(LegacyActionPersistence.class, actionPersistence);
    actionPersistence.read();
    ICommandService cmdService = workbench.getService(ICommandService.class);
    SlaveCommandService slaveCmdService = new SlaveCommandService(cmdService, IServiceScopes.WINDOW_SCOPE, this, model.getContext());
    serviceLocator.registerService(ICommandService.class, slaveCmdService);
    serviceLocator.registerService(IUpdateService.class, slaveCmdService);
    IContextService cxs = ContextInjectionFactory.make(ContextService.class, model.getContext());
    serviceLocator.registerService(IContextService.class, cxs);
    IMenuService parent = getWorkbench().getService(IMenuService.class);
    IMenuService msvs = new SlaveMenuService(parent, model);
    serviceLocator.registerService(IMenuService.class, msvs);
}
Also used : SelectionService(org.eclipse.ui.internal.e4.compatibility.SelectionService) ISelectionService(org.eclipse.ui.ISelectionService) LegacyActionPersistence(org.eclipse.ui.internal.menus.LegacyActionPersistence) LegacyHandlerService(org.eclipse.ui.internal.handlers.LegacyHandlerService) IHandlerService(org.eclipse.ui.handlers.IHandlerService) IMenuService(org.eclipse.ui.menus.IMenuService) IActionCommandMappingService(org.eclipse.ui.internal.handlers.IActionCommandMappingService) ActionCommandMappingService(org.eclipse.ui.internal.handlers.ActionCommandMappingService) IWorkbenchLocationService(org.eclipse.ui.internal.services.IWorkbenchLocationService) WorkbenchLocationService(org.eclipse.ui.internal.services.WorkbenchLocationService) IEclipseContext(org.eclipse.e4.core.contexts.IEclipseContext) IContextService(org.eclipse.ui.contexts.IContextService) ICommandService(org.eclipse.ui.commands.ICommandService) SlaveCommandService(org.eclipse.ui.internal.commands.SlaveCommandService) SlaveMenuService(org.eclipse.ui.internal.menus.SlaveMenuService)

Aggregations

IEclipseContext (org.eclipse.e4.core.contexts.IEclipseContext)1 ISelectionService (org.eclipse.ui.ISelectionService)1 ICommandService (org.eclipse.ui.commands.ICommandService)1 IContextService (org.eclipse.ui.contexts.IContextService)1 IHandlerService (org.eclipse.ui.handlers.IHandlerService)1 SlaveCommandService (org.eclipse.ui.internal.commands.SlaveCommandService)1 SelectionService (org.eclipse.ui.internal.e4.compatibility.SelectionService)1 ActionCommandMappingService (org.eclipse.ui.internal.handlers.ActionCommandMappingService)1 IActionCommandMappingService (org.eclipse.ui.internal.handlers.IActionCommandMappingService)1 LegacyHandlerService (org.eclipse.ui.internal.handlers.LegacyHandlerService)1 LegacyActionPersistence (org.eclipse.ui.internal.menus.LegacyActionPersistence)1 SlaveMenuService (org.eclipse.ui.internal.menus.SlaveMenuService)1 IWorkbenchLocationService (org.eclipse.ui.internal.services.IWorkbenchLocationService)1 WorkbenchLocationService (org.eclipse.ui.internal.services.WorkbenchLocationService)1 IMenuService (org.eclipse.ui.menus.IMenuService)1