Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Richard2013-10-03 11:29:36 -0400
committerAxel Richard2013-10-03 11:29:59 -0400
commit261b06af0e353528dbbc0e916b1d021ce27bd2f0 (patch)
tree25e391d78cd52540766548de8949f05068486227 /plugins/org.eclipse.emf.compare.ide.ui/src
parentdf454c2a36084c805510b5f7ae3ed1694ab62b10 (diff)
downloadorg.eclipse.emf.compare-261b06af0e353528dbbc0e916b1d021ce27bd2f0.tar.gz
org.eclipse.emf.compare-261b06af0e353528dbbc0e916b1d021ce27bd2f0.tar.xz
org.eclipse.emf.compare-261b06af0e353528dbbc0e916b1d021ce27bd2f0.zip
[418600] Fix Undo/Redo menu items not available
Diffstat (limited to 'plugins/org.eclipse.emf.compare.ide.ui/src')
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java7
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/RedoAction.java5
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/UndoAction.java6
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/ide_ui_messages.properties3
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java14
5 files changed, 22 insertions, 13 deletions
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java
index 78fd1bc2a..0f4b4ba5f 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/EMFCompareContentMergeViewer.java
@@ -76,7 +76,6 @@ import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.menus.IMenuService;
import org.eclipse.ui.part.IPage;
import org.eclipse.ui.services.IServiceLocator;
@@ -325,12 +324,6 @@ public abstract class EMFCompareContentMergeViewer extends ContentMergeViewer im
"toolbar:org.eclipse.emf.compare.contentmergeviewer.toolbar");
}
- undoAction = new UndoAction(getEMFCompareConfiguration().getEditingDomain());
- redoAction = new RedoAction(getEMFCompareConfiguration().getEditingDomain());
-
- getHandlerService().setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
- getHandlerService().setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
-
}
public void commandStackChanged(EventObject event) {
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/RedoAction.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/RedoAction.java
index 2aa36cb67..ab125e2e1 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/RedoAction.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/RedoAction.java
@@ -12,6 +12,7 @@ package org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.compare.domain.ICompareEditingDomain;
+import org.eclipse.emf.compare.ide.ui.internal.EMFCompareIDEUIMessages;
import org.eclipse.emf.edit.ui.EMFEditUIPlugin;
import org.eclipse.jface.action.Action;
@@ -66,8 +67,8 @@ public class RedoAction extends Action {
Command redoCommand = domain.getCommandStack().getRedoCommand();
if (redoCommand != null && redoCommand.getLabel() != null) {
- setText(EMFEditUIPlugin.INSTANCE.getString("_UI_Redo_menu_item", new Object[] {redoCommand //$NON-NLS-1$
- .getLabel() }));
+ setText(EMFEditUIPlugin.INSTANCE.getString("_UI_Redo_menu_item", //$NON-NLS-1$
+ new Object[] {EMFCompareIDEUIMessages.getString("redo.menu.item.text") })); //$NON-NLS-1$
} else {
setText(EMFEditUIPlugin.INSTANCE.getString("_UI_Redo_menu_item", new Object[] {"" })); //$NON-NLS-1$ //$NON-NLS-2$
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/UndoAction.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/UndoAction.java
index cec44f164..50413e244 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/UndoAction.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/contentmergeviewer/util/UndoAction.java
@@ -12,6 +12,7 @@ package org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util;
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.compare.domain.ICompareEditingDomain;
+import org.eclipse.emf.compare.ide.ui.internal.EMFCompareIDEUIMessages;
import org.eclipse.emf.edit.ui.EMFEditUIPlugin;
import org.eclipse.jface.action.Action;
@@ -66,8 +67,9 @@ public class UndoAction extends Action {
Command undoCommand = domain.getCommandStack().getUndoCommand();
if (undoCommand != null && undoCommand.getLabel() != null) {
- setText(EMFEditUIPlugin.INSTANCE.getString("_UI_Undo_menu_item", new Object[] {undoCommand //$NON-NLS-1$
- .getLabel() }));
+ setText(EMFEditUIPlugin.INSTANCE
+ .getString(
+ "_UI_Undo_menu_item", new Object[] {EMFCompareIDEUIMessages.getString("undo.menu.item.text") })); //$NON-NLS-1$//$NON-NLS-2$
} else {
setText(EMFEditUIPlugin.INSTANCE.getString("_UI_Undo_menu_item", new Object[] {"" })); //$NON-NLS-1$ //$NON-NLS-2$
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/ide_ui_messages.properties b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/ide_ui_messages.properties
index d2acdf6ca..bead3fbbb 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/ide_ui_messages.properties
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/ide_ui_messages.properties
@@ -35,3 +35,6 @@ dropdown.left.to.right.tooltip = Show consequences of merging from left to right
dropdown.right.to.left.tooltip = Show consequences of merging from right to left
dropdown.accept.tooltip = Show consequences of accepting change
dropdown.reject.tooltip = Show consequences of rejecting change
+
+undo.menu.item.text = Merge
+redo.menu.item.text = Merge \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
index c53e9ec5c..7a7361857 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
@@ -427,8 +427,18 @@ public class EMFCompareStructureMergeViewer extends AbstractViewerWrapper implem
undoAction = new UndoAction(editingDomain);
redoAction = new RedoAction(editingDomain);
- fHandlerService.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
- fHandlerService.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
+ SWTUtil.safeAsyncExec(new Runnable() {
+ public void run() {
+ fHandlerService.updatePaneActionHandlers(new Runnable() {
+ public void run() {
+ fHandlerService.setGlobalActionHandler(ActionFactory.UNDO.getId(), undoAction);
+ fHandlerService.setGlobalActionHandler(ActionFactory.REDO.getId(), redoAction);
+
+ }
+ });
+ }
+ });
+
}
}

Back to the top