Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 205209
Collapse All | Expand All

(-)Eclipse UI/org/eclipse/ui/SubActionBars.java (-7 / +16 lines)
Lines 487-495 Link Here
487
487
488
			// Add a mapping from this action id to the command id.
488
			// Add a mapping from this action id to the command id.
489
			if (serviceLocator != null) {
489
			if (serviceLocator != null) {
490
				String commandId = null;
490
				final IActionCommandMappingService mappingService = (IActionCommandMappingService) serviceLocator
491
				final IActionCommandMappingService mappingService = (IActionCommandMappingService) serviceLocator
491
						.getService(IActionCommandMappingService.class);
492
						.getService(IActionCommandMappingService.class);
492
				String commandId = mappingService.getCommandId(actionID);
493
				if (mappingService != null) {
494
					commandId = mappingService.getCommandId(actionID);
495
				}
493
				if (commandId == null) {
496
				if (commandId == null) {
494
					commandId = handler.getActionDefinitionId();
497
					commandId = handler.getActionDefinitionId();
495
				}
498
				}
Lines 516-522 Link Here
516
						if (value instanceof IHandlerActivation) {
519
						if (value instanceof IHandlerActivation) {
517
							final IHandlerActivation activation = (IHandlerActivation) value;
520
							final IHandlerActivation activation = (IHandlerActivation) value;
518
							actionIdByCommandId.remove(activation.getCommandId());
521
							actionIdByCommandId.remove(activation.getCommandId());
519
							service.deactivateHandler(activation);
522
							if (service != null) {
523
								service.deactivateHandler(activation);
524
							}
520
							activation.getHandler().dispose();
525
							activation.getHandler().dispose();
521
						}
526
						}
522
					} else if (commandId != null
527
					} else if (commandId != null
Lines 525-531 Link Here
525
								.remove(actionIdByCommandId.remove(commandId));
530
								.remove(actionIdByCommandId.remove(commandId));
526
						if (value instanceof IHandlerActivation) {
531
						if (value instanceof IHandlerActivation) {
527
							final IHandlerActivation activation = (IHandlerActivation) value;
532
							final IHandlerActivation activation = (IHandlerActivation) value;
528
							service.deactivateHandler(activation);
533
							if (service != null) {
534
								service.deactivateHandler(activation);
535
							}
529
							activation.getHandler().dispose();
536
							activation.getHandler().dispose();
530
						}
537
						}
531
					}
538
					}
Lines 542-551 Link Here
542
					if (this instanceof EditorActionBars) {
549
					if (this instanceof EditorActionBars) {
543
						handlerExpression = ((EditorActionBars)this).getHandlerExpression();
550
						handlerExpression = ((EditorActionBars)this).getHandlerExpression();
544
					}
551
					}
545
					final IHandlerActivation activation = service
552
					if (service != null) {
546
							.activateHandler(commandId, actionHandler,
553
						final IHandlerActivation activation = service
547
									handlerExpression);
554
								.activateHandler(commandId, actionHandler,
548
					activationsByActionId.put(actionID, activation);
555
										handlerExpression);
556
						activationsByActionId.put(actionID, activation);
557
					}
549
				}
558
				}
550
			}
559
			}
551
560

Return to bug 205209