Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/RedoHandler.java')
-rw-r--r--plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/RedoHandler.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/RedoHandler.java b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/RedoHandler.java
index c24f5432f14..98b3ccdbd01 100644
--- a/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/RedoHandler.java
+++ b/plugins/views/modelexplorer/org.eclipse.papyrus.views.modelexplorer/src/org/eclipse/papyrus/views/modelexplorer/handler/RedoHandler.java
@@ -16,7 +16,9 @@ package org.eclipse.papyrus.views.modelexplorer.handler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.expressions.IEvaluationContext;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.papyrus.infra.ui.command.AbstractPapyrusHandler;
/**
* Handler for the Redo Action
@@ -24,7 +26,7 @@ import org.eclipse.emf.edit.domain.EditingDomain;
*
*
*/
-public class RedoHandler extends AbstractModelExplorerHandler {
+public class RedoHandler extends AbstractPapyrusHandler {
/**
@@ -36,7 +38,7 @@ public class RedoHandler extends AbstractModelExplorerHandler {
* @throws ExecutionException
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
- EditingDomain domain = getEditingDomain();
+ EditingDomain domain = getEditingDomain(event);
if (domain != null) {
domain.getCommandStack().redo();
}
@@ -50,8 +52,14 @@ public class RedoHandler extends AbstractModelExplorerHandler {
*/
@Override
public void setEnabled(Object evaluationContext) {
- EditingDomain domain = getEditingDomain();
- if (domain != null) {
+ EditingDomain domain;
+ if (evaluationContext instanceof IEvaluationContext) {
+ domain = getEditingDomain((IEvaluationContext) evaluationContext);
+ } else {
+ domain = getEditingDomain((IEvaluationContext) null);
+ }
+
+ if (null != domain) {
setBaseEnabled(domain.getCommandStack().canRedo());
} else {
setBaseEnabled(false);

Back to the top