aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpschonbac2009-07-08 08:16:54 (EDT)
committersefftinge2009-07-08 08:16:54 (EDT)
commit650c0f38b199adff92e2f4fe7261c5983ae2169b (patch)
tree7b1188b449b9dae05d27ac22289089254d98b157
parentfa00f9fcad2f3efc58db74d02b7a7ae181bcbf39 (diff)
downloadorg.eclipse.xtext-650c0f38b199adff92e2f4fe7261c5983ae2169b.zip
org.eclipse.xtext-650c0f38b199adff92e2f4fe7261c5983ae2169b.tar.gz
org.eclipse.xtext-650c0f38b199adff92e2f4fe7261c5983ae2169b.tar.bz2
bug 282033: [UI Accessibility] Display problem marker info in hover and in status line
https://bugs.eclipse.org/bugs/show_bug.cgi?id=282033 Patch by Michael Clay applied
-rw-r--r--plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextEditor.java15
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextEditor.java b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextEditor.java
index 8c6a9d7..110207d 100644
--- a/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextEditor.java
+++ b/plugins/org.eclipse.xtext.ui.core/src/org/eclipse/xtext/ui/core/editor/XtextEditor.java
@@ -67,6 +67,7 @@ import com.google.inject.name.Named;
* @author Dennis Huebner - Initial contribution and API
* @author Peter Friese - Initial contribution and API
* @author Sven Efftinge
+ * @author Michael Clay
* @author Dan Stefanescu - Fix for bug 278279
*/
public class XtextEditor extends TextEditor {
@@ -290,6 +291,10 @@ public class XtextEditor extends TextEditor {
// TODO Folding stuff
installHighlightingHelper();
+ installSelectionChangedListener();
+ }
+
+ private void installSelectionChangedListener() {
selectionChangedListener = new ISelectionChangedListener() {
public void selectionChanged(final SelectionChangedEvent event) {
updateStatusLine();
@@ -325,14 +330,18 @@ public class XtextEditor extends TextEditor {
outlinePage = null;
}
uninstallHighlightingHelper();
- if (selectionChangedListener != null) {
- final ISelectionProvider selectionProvider = getSelectionProvider();
+ uninstallSelectionChangedListener();
+ }
+
+ private void uninstallSelectionChangedListener() {
+ ISelectionProvider selectionProvider = getSelectionProvider();
+ if (selectionProvider != null) {
if (selectionProvider instanceof IPostSelectionProvider) {
final IPostSelectionProvider postSelectionProvider = (IPostSelectionProvider) selectionProvider;
postSelectionProvider.removePostSelectionChangedListener(selectionChangedListener);
}
else {
- getSelectionProvider().removeSelectionChangedListener(selectionChangedListener);
+ selectionProvider.removeSelectionChangedListener(selectionChangedListener);
}
}
}