I've noticed that during startup of the workbench in 4.2 M5, multiple instances of HandlerServiceImpl are created. I would have thought there is only one. What is the scope of each instance?
I'm trying to manually activate a command via an EHandlerService injected into a JFace dialog but I'm not getting the instance I registered the handler into when I'm debugging through the KeyDownFilter in the KeyBindingDispatcher. How can I debug this?
To answer my own question, I was foiled by the class org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener. It seems every context has their own EHandlerService and the shell activation listener was creating a new context for the dialogs shell. I had to set DIALOG_IGNORE_KEY into my shell's data in order to prevent this. I know this is internal, but I'm dont't know how else to populate the context that the shell activation listener creates; adding a shell listener might not work reliably, becuase I can't be sure that my shell listener will be called AFTER the workbench ShellActivationListener.