@Override public Object compute(IEclipseContext context, String contextKey) { if (service == null) { IEclipseContext root = getRootContext(context); manager = new CommandManager(); root.set(CommandManager.class.getName(), manager); service = ContextInjectionFactory.make(CommandServiceImpl.class, root); } return service; }
@PostConstruct void init(IEclipseContext context) { // global command service. There can be only one ... per application :-) CommandManager manager = context.get(CommandManager.class); if (manager == null) { manager = new CommandManager(); context.set(CommandManager.class, manager); } CommandServiceImpl service = ContextInjectionFactory.make(CommandServiceImpl.class, context); context.set(ECommandService.class, service); // handler service context.set(EHandlerService.class.getName(), new HandlerServiceCreationFunction()); // provide the initial application context, just in case. HandlerServiceImpl.push(context, null); }
.getService(IBindingService.class); BindingManager bindingManager = new BindingManager( new ContextManager(), new CommandManager()); final Scheme[] definedSchemes = bindingService.getDefinedSchemes(); try {
@Execute void process(MApplication application, IEclipseContext context, EModelService modelService) { this.modelService = modelService; for (MCategory catModel : application.getCategories()) { categories.put(catModel.getElementId(), catModel); } for (MCommand cmdModel : application.getCommands()) { commands.put(cmdModel.getElementId(), cmdModel); } CommandManager commandManager = context.get(CommandManager.class); if (commandManager == null) { HandlerServiceImpl.handlerGenerator = new ContextFunction() { @Override public Object compute(IEclipseContext context, String contextKey) { return new WorkbenchHandlerServiceHandler(contextKey); } }; commandManager = new CommandManager(); // setCommandFireEvents(commandManager, false); context.set(CommandManager.class, commandManager); } CommandPersistence cp = new CommandPersistence(commandManager); cp.reRead(); generateCategories(application, commandManager); generateCommands(application, commandManager); cp.dispose(); }
BindingManager localBindingManager= new BindingManager(new ContextManager(), new CommandManager()); final Scheme[] definedSchemes= bindingService.getDefinedSchemes(); if (definedSchemes != null) {
BindingManager localBindingManager= new BindingManager(new ContextManager(), new CommandManager()); final Scheme[] definedSchemes= bindingService.getDefinedSchemes(); if (definedSchemes != null) {