Project: Eclipse_Platform_UI
Bug 109639 [KeyBindings] keybinding service is deactivated but not reactivated when unregister action
Reported: 2005-09-15 13:14:43 | Status: verified fixed

3.1 org.eclipse.ui.internal.KeyBindingService#unregisterAction If an already unregistered action is unregistered, the keybinding service is deactivated but never reactivated. This is because the keybinding service is deactivated when unregistering the action, but if the unregister did not work (ie handlerSubmission == null) the keybinding service is never reactivated. The "if (handlerSubmission != null) {" check should be moved lower. This is what registerAction and setScopes does. Corrected code: if ((parent != null) && (parent.activeService == this)) { active = true; parent.deactivateNestedService(); } // Remove the current submission, if any. HandlerSubmission handlerSubmission = (HandlerSubmission) handlerSubmissionsByCommandId.remove(commandId); /* * Either activate this service again, or remove the submission * myself. */ if (parent != null) { if (active) { parent.activateNestedService(this); } } else { if (handlerSubmission != null) { Workbench.getInstance().getCommandSupport().removeHandlerSubmission (handlerSubmission); handlerSubmission.getHandler().dispose(); } }

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/KeyBindingService.java