Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2011-10-11 08:44:20 +0000
committerDani Megert2011-10-11 08:44:20 +0000
commit1e4b8d7f344d37183189f29a90c66f8970a946cf (patch)
tree7cba8c2f4ad4d21a2988e2372571de8c0e17cf6d
parent53acc00120134b42b3d43456552c500c757ac621 (diff)
downloadeclipse.platform.text-1e4b8d7f344d37183189f29a90c66f8970a946cf.tar.gz
eclipse.platform.text-1e4b8d7f344d37183189f29a90c66f8970a946cf.tar.xz
eclipse.platform.text-1e4b8d7f344d37183189f29a90c66f8970a946cf.zip
Fixed bug 357068: [implementation] TextViewer returns null forv20111011-0800
getControl() although this is not spec'd in Viewer's javadoc API
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java
index 8b7e0c52d90..4e9b534e200 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/TextViewer.java
@@ -1682,7 +1682,6 @@ public class TextViewer extends Viewer implements
* @since 3.0
*/
protected FindReplaceDocumentAdapter fFindReplaceDocumentAdapter;
-
/**
* The text viewer's hyperlink detectors.
* @since 3.1
@@ -1719,6 +1718,12 @@ public class TextViewer extends Viewer implements
* @since 3.5
*/
private int fLastEventTime;
+ /**
+ * Pointer to disposed control.
+ *
+ * @since 3.8
+ */
+ private Control fDisposedControl;
//---- Construction and disposal ------------------
@@ -1797,6 +1802,7 @@ public class TextViewer extends Viewer implements
fTextWidget.addDisposeListener(
new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
+ fDisposedControl= getControl();
handleDispose();
}
}
@@ -1841,7 +1847,7 @@ public class TextViewer extends Viewer implements
* @see Viewer#getControl()
*/
public Control getControl() {
- return fTextWidget;
+ return fTextWidget != null ? fTextWidget : fDisposedControl;
}
/*

Back to the top