Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2012-01-23 15:01:25 +0000
committerMarkus Keller2012-01-23 15:01:25 +0000
commit2950f3b6ea5816ee027b081bddb27f7c24b54b4c (patch)
treec43e34f21c04b441ca589e75cdf7c30aa10e6528
parent230b765f74e2d2c46d5f8344528fe31e0254260f (diff)
downloadeclipse.platform.text-2950f3b6ea5816ee027b081bddb27f7c24b54b4c.tar.gz
eclipse.platform.text-2950f3b6ea5816ee027b081bddb27f7c24b54b4c.tar.xz
eclipse.platform.text-2950f3b6ea5816ee027b081bddb27f7c24b54b4c.zip
Bug 71406: [rulers] request for click & event modifiers from rulerv20120123-1501
annotations
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java23
1 files changed, 17 insertions, 6 deletions
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 40f60079c15..dae96550e42 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, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -3057,13 +3057,24 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
private final int fDoubleClickTime= getSite().getShell().getDisplay().getDoubleClickTime();
private long fMouseUpDelta= 0;
- private void triggerAction(String actionID) {
+ private void triggerAction(String actionID, MouseEvent e) {
IAction action= getAction(actionID);
if (action != null) {
if (action instanceof IUpdate)
((IUpdate) action).update();
- if (action.isEnabled())
- action.run();
+ if (action.isEnabled()) {
+ Event event= new Event();
+ event.display= e.display;
+ event.widget= e.widget;
+ event.time= e.time;
+ event.data= e.data;
+ event.x= e.x;
+ event.y= e.y;
+ event.button= e.button;
+ event.stateMask= e.stateMask;
+ event.count= e.count;
+ action.runWithEvent(event);
+ }
}
}
@@ -3076,7 +3087,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
Runnable runnable= new Runnable() {
public void run() {
if (!fDoubleClicked)
- triggerAction(ITextEditorActionConstants.RULER_CLICK);
+ triggerAction(ITextEditorActionConstants.RULER_CLICK, e);
}
};
if (delay <= 0)
@@ -3088,7 +3099,7 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
public void mouseDoubleClick(MouseEvent e) {
if (1 == e.button) {
fDoubleClicked= true;
- triggerAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK);
+ triggerAction(ITextEditorActionConstants.RULER_DOUBLE_CLICK, e);
}
}

Back to the top