if (commandId != null) {
final Object value = globalActionHandlersByCommandId.get(commandId);
if (value instanceof ActionHandler) {
// This handler is about to get clobbered, so dispose it.
final ActionHandler handler = (ActionHandler) value;
handler.dispose();
}
if (globalAction instanceof CommandAction) {
final String actionId = globalAction.getId();
if (actionId != null) {