Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeo Denault2014-04-04 11:54:14 -0400
committerPaul Webster2014-04-04 15:04:27 -0400
commit324e4d99200fa18b3f2924d33640db0e98fef87e (patch)
tree8552c7d52be6a9def42770aefb838e5564cd9a23
parentf79e437c43614529a38436f9b139a0bcaa753300 (diff)
downloadorg.eclipse.e4.tools-324e4d99200fa18b3f2924d33640db0e98fef87e.tar.gz
org.eclipse.e4.tools-324e4d99200fa18b3f2924d33640db0e98fef87e.tar.xz
org.eclipse.e4.tools-324e4d99200fa18b3f2924d33640db0e98fef87e.zip
Bug 426397 - Provide an eclipse editor based on OrionEditorControlI20140406-2200I20140405-2200I20140404-2200
Fixed focus problem where the OrionEditorControl wouldn't gain focus upon clicking within it. Change-Id: Icee28646768b216676f25687222cdfa021057661 Signed-off-by: Leo Denault <ldena023@uottawa.ca>
-rw-r--r--bundles/org.eclipse.e4.tools.orion.editor/src/org/eclipse/e4/tools/orion/editor/swt/OrionEditorControl.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.tools.orion.editor/src/org/eclipse/e4/tools/orion/editor/swt/OrionEditorControl.java b/bundles/org.eclipse.e4.tools.orion.editor/src/org/eclipse/e4/tools/orion/editor/swt/OrionEditorControl.java
index 9961a918..dd0de770 100644
--- a/bundles/org.eclipse.e4.tools.orion.editor/src/org/eclipse/e4/tools/orion/editor/swt/OrionEditorControl.java
+++ b/bundles/org.eclipse.e4.tools.orion.editor/src/org/eclipse/e4/tools/orion/editor/swt/OrionEditorControl.java
@@ -97,6 +97,13 @@ public class OrionEditorControl extends Composite {
return null;
}
};
+ // focus function
+ new BrowserFunction(browser, "orion_focus") {
+ public Object function(Object[] arguments) {
+ setFocus();
+ return null;
+ }
+ };
}
/**
@@ -135,6 +142,8 @@ public class OrionEditorControl extends Composite {
}
// add dirty event listener.
browser.evaluate("window.editor.addEventListener('DirtyChanged', function() {orion_dirty();}, true)");
+ // add focus event listener.
+ browser.evaluate("window.editor.getTextView().addEventListener('Focus', function() {orion_focus();}, true)");
// Set dirty if need
if (dirtyToBeSet != null) {
setDirty(dirtyToBeSet);

Back to the top