summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorRemy Suen2013-01-11 14:27:06 (EST)
committer Paul Webster2013-01-11 14:27:06 (EST)
commit5d63a0b5b571e79ed856062b517739b09a88470e (patch)
treea5d131f7eb8b2ac691220d0ac0202eb1b1ef5b55
parentd4866fb6a161a3970141e6faa2510147a77e3e05 (diff)
downloadeclipse.platform.ui-5d63a0b5b571e79ed856062b517739b09a88470e.zip
eclipse.platform.ui-5d63a0b5b571e79ed856062b517739b09a88470e.tar.gz
eclipse.platform.ui-5d63a0b5b571e79ed856062b517739b09a88470e.tar.bz2
Bug 370590 - [Compatibility] In CDT, the buttons inside the macrov20130111-192706
explorer are disabled Notify our CCIs that there's a new handler in town.
-rw-r--r--bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java
index 854c748..98ee6ba 100644
--- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java
+++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/handlers/LegacyHandlerService.java
@@ -23,6 +23,7 @@ import javax.inject.Named;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.HandlerEvent;
import org.eclipse.core.commands.IHandler;
import org.eclipse.core.commands.NotEnabledException;
import org.eclipse.core.commands.NotHandledException;
@@ -217,12 +218,23 @@ public class LegacyHandlerService implements IHandlerService {
}
ECommandService cs = (ECommandService) context.get(ECommandService.class.getName());
Command command = cs.getCommand(cmdId);
+ boolean handled = command.isHandled();
+ boolean enabled = command.isEnabled();
E4HandlerProxy handlerProxy = new E4HandlerProxy(command, handler);
HandlerActivation activation = new HandlerActivation(context, cmdId, handler, handlerProxy,
activeWhen);
addHandlerActivation(activation);
EHandlerService hs = context.get(EHandlerService.class);
hs.activateHandler(cmdId, new HandlerSelectionFunction(cmdId));
+ boolean handledChanged = handled != command.isHandled();
+ boolean enabledChanged = enabled != command.isEnabled();
+ if (handledChanged || enabledChanged) {
+ IHandler proxy = command.getHandler();
+ if (proxy instanceof MakeHandlersGo) {
+ ((MakeHandlersGo) proxy).fireHandlerChanged(new HandlerEvent(proxy, enabledChanged,
+ handledChanged));
+ }
+ }
return activation;
}