summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Trimble2012-10-10 14:54:50 (EDT)
committerIan Trimble2012-10-10 14:54:50 (EDT)
commite172355cd7f3acc5f0afdb6429e9b288a839d243 (patch)
tree7e7bfb040cf0a2d36a90c69778899e62be2cf508
parent20c39d07f3e4ed4d4f37495038c66de3df613ead (diff)
downloadwebtools.jsf-e172355cd7f3acc5f0afdb6429e9b288a839d243.zip
webtools.jsf-e172355cd7f3acc5f0afdb6429e9b288a839d243.tar.gz
webtools.jsf-e172355cd7f3acc5f0afdb6429e9b288a839d243.tar.bz2
Bug 387268 - Keybindings seem to be seriously brokenv201210101250
-rw-r--r--jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/SimpleGraphicalEditor.java34
1 files changed, 16 insertions, 18 deletions
diff --git a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/SimpleGraphicalEditor.java b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/SimpleGraphicalEditor.java
index 3813c8e..1797885 100644
--- a/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/SimpleGraphicalEditor.java
+++ b/jsf/plugins/org.eclipse.jst.pagedesigner/src/org/eclipse/jst/pagedesigner/editors/SimpleGraphicalEditor.java
@@ -39,7 +39,6 @@ import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.commands.ActionHandler;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -77,17 +76,17 @@ import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.wst.sse.core.internal.PropagatingAdapter;
import org.eclipse.wst.sse.core.internal.provisional.IModelStateListener;
import org.eclipse.wst.sse.core.internal.provisional.INodeAdapterFactory;
@@ -264,16 +263,15 @@ public class SimpleGraphicalEditor extends GraphicalEditorWithFlyoutPalette impl
((UpdateAction) action).update();
}
- private void activateActionHandler(final IAction action) {
+ private void setGlobalActionHandler(final IAction action) {
if (action != null) {
- final IWorkbenchPartSite site = getSite();
- if (site != null) {
- final IHandlerService service =
- (IHandlerService) site.getService(IHandlerService.class);
- if (service != null) {
- final String commandId = action.getId();
- if (commandId != null) {
- service.activateHandler(commandId, new ActionHandler(action));
+ final String actionId = action.getId();
+ if (actionId != null && actionId.length() > 0) {
+ final IEditorSite site = getEditorSite();
+ if (site != null) {
+ final IActionBars bars = site.getActionBars();
+ if (bars != null) {
+ bars.setGlobalActionHandler(actionId, action);
}
}
}
@@ -300,7 +298,7 @@ public class SimpleGraphicalEditor extends GraphicalEditorWithFlyoutPalette impl
.getImageDescriptor(ISharedImages.IMG_TOOL_UNDO_DISABLED));
action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_UNDO);
action.setId(IWorkbenchCommandConstants.EDIT_UNDO);
- activateActionHandler(action);
+ setGlobalActionHandler(action);
registry.registerAction(action);
action = new DesignerUndoRedoAction(false, this);
@@ -310,7 +308,7 @@ public class SimpleGraphicalEditor extends GraphicalEditorWithFlyoutPalette impl
.getImageDescriptor(ISharedImages.IMG_TOOL_REDO_DISABLED));
action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_REDO);
action.setId(IWorkbenchCommandConstants.EDIT_REDO);
- activateActionHandler(action);
+ setGlobalActionHandler(action);
registry.registerAction(action);
action = new DeleteAction(this);
@@ -320,7 +318,7 @@ public class SimpleGraphicalEditor extends GraphicalEditorWithFlyoutPalette impl
.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_DELETE);
action.setId(IWorkbenchCommandConstants.EDIT_DELETE);
- activateActionHandler(action);
+ setGlobalActionHandler(action);
this.getSelectionActions().add(action.getId());
registry.registerAction(action);
@@ -331,7 +329,7 @@ public class SimpleGraphicalEditor extends GraphicalEditorWithFlyoutPalette impl
.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_COPY);
action.setId(IWorkbenchCommandConstants.EDIT_COPY);
- activateActionHandler(action);
+ setGlobalActionHandler(action);
this.getSelectionActions().add(action.getId());
registry.registerAction(action);
@@ -342,7 +340,7 @@ public class SimpleGraphicalEditor extends GraphicalEditorWithFlyoutPalette impl
.getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED));
action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_CUT);
action.setId(IWorkbenchCommandConstants.EDIT_CUT);
- activateActionHandler(action);
+ setGlobalActionHandler(action);
this.getSelectionActions().add(action.getId());
registry.registerAction(action);
@@ -353,7 +351,7 @@ public class SimpleGraphicalEditor extends GraphicalEditorWithFlyoutPalette impl
.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
action.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_PASTE);
action.setId(IWorkbenchCommandConstants.EDIT_PASTE);
- activateActionHandler(action);
+ setGlobalActionHandler(action);
this.getSelectionActions().add(action.getId());
registry.registerAction(action);
}