Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSarika Sinha2019-04-12 17:07:45 +0000
committerSarika Sinha2019-04-15 05:32:01 +0000
commite51163784860cd978dd09d979afb21f7953157c3 (patch)
tree27577e0bb359e9c16269a1e732f646811f2efd1a
parente23a034baf163e8269235c90ffc766551598cd42 (diff)
downloadeclipse.platform.text-e51163784860cd978dd09d979afb21f7953157c3.tar.gz
eclipse.platform.text-e51163784860cd978dd09d979afb21f7953157c3.tar.xz
eclipse.platform.text-e51163784860cd978dd09d979afb21f7953157c3.zip
Bug 515570 - [api] org.eclipse.ui.editorActions should allow modifiersI20190415-0300
as part of actionID
-rw-r--r--org.eclipse.ui.workbench.texteditor/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.ui.workbench.texteditor/pom.xml4
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java22
3 files changed, 23 insertions, 5 deletions
diff --git a/org.eclipse.ui.workbench.texteditor/META-INF/MANIFEST.MF b/org.eclipse.ui.workbench.texteditor/META-INF/MANIFEST.MF
index 05a9bf0018c..d97b07b8b7d 100644
--- a/org.eclipse.ui.workbench.texteditor/META-INF/MANIFEST.MF
+++ b/org.eclipse.ui.workbench.texteditor/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.ui.workbench.texteditor; singleton:=true
-Bundle-Version: 3.11.300.qualifier
+Bundle-Version: 3.11.400.qualifier
Bundle-Activator: org.eclipse.ui.internal.texteditor.TextEditorPlugin
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
diff --git a/org.eclipse.ui.workbench.texteditor/pom.xml b/org.eclipse.ui.workbench.texteditor/pom.xml
index 601871ca3f2..6b3f8a8d9ac 100644
--- a/org.eclipse.ui.workbench.texteditor/pom.xml
+++ b/org.eclipse.ui.workbench.texteditor/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Copyright (c) 2012, 2018 Eclipse Foundation and others.
+ Copyright (c) 2012, 2019 Eclipse Foundation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Distribution License v1.0
which accompanies this distribution, and is available at
@@ -18,6 +18,6 @@
</parent>
<groupId>org.eclipse.ui</groupId>
<artifactId>org.eclipse.ui.workbench.texteditor</artifactId>
- <version>3.11.300-SNAPSHOT</version>
+ <version>3.11.400-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
index 728c83c2789..65f9467e92c 100644
--- a/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
+++ b/org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2018 IBM Corporation and others.
+ * Copyright (c) 2000, 2019 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -2975,7 +2975,25 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
private long fMouseUpDelta= 0;
private void triggerAction(String actionID, MouseEvent e) {
- IAction action= getAction(actionID);
+ // ActionId can be prefixed with modifiers
+ StringBuffer newActionId = new StringBuffer(""); //$NON-NLS-1$
+ if ((e.stateMask & SWT.MOD1) > 0) {
+ newActionId.append("M1+"); //$NON-NLS-1$
+ }
+ if ((e.stateMask & SWT.MOD2) > 0) {
+ newActionId.append("M2+"); //$NON-NLS-1$
+ }
+ if ((e.stateMask & SWT.MOD3) > 0) {
+ newActionId.append("M3+"); //$NON-NLS-1$
+ }
+ newActionId.append(actionID);
+ IAction action = getAction(newActionId.toString());
+ // If action does not exist with specified
+ // modifiers+actionId, try to retrieve action with only
+ // actionId
+ if (action == null) {
+ action = getAction(actionID);
+ }
if (action != null) {
if (action instanceof IUpdate)
((IUpdate) action).update();

Back to the top