* The activation; must not be <code>null</code>.
*/
final void activateHandler(final IHandlerActivation activation) {
// First we update the handlerActivationsByCommandId map.
final String commandId = activation.getCommandId();
MultiStatus conflicts = new MultiStatus("org.eclipse.ui.workbench", 0, //$NON-NLS-1$
"A handler conflict occurred. This may disable some commands.", //$NON-NLS-1$
null);
final Object value = handlerActivationsByCommandId.get(commandId);
if (value instanceof SortedSet) {
final SortedSet handlerActivations = (SortedSet) value;
if (!handlerActivations.contains(activation)) {
handlerActivations.add(activation);
updateCommand(commandId, resolveConflicts(commandId,
handlerActivations, conflicts));
}
} else if (value instanceof IHandlerActivation) {
if (value != activation) {
final SortedSet handlerActivations = new TreeSet(
new EvaluationResultCacheComparator());
handlerActivations.add(value);
handlerActivations.add(activation);
handlerActivationsByCommandId
.put(commandId, handlerActivations);
updateCommand(commandId, resolveConflicts(commandId,
handlerActivations, conflicts));
}
} else {
handlerActivationsByCommandId.put(commandId, activation);
updateCommand(commandId, (evaluate(activation) ? activation : null));
}
if (conflicts.getSeverity()!=IStatus.OK) {
WorkbenchPlugin.log(conflicts);
}
// Next we update the source priority bucket sort of activations.
final int sourcePriority = activation.getSourcePriority();