Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarsten Thoms2018-03-16 04:05:40 -0400
committerDani Megert2018-03-16 09:17:45 -0400
commit5e9451f731437c846f40d7bc2638205aa362f1e9 (patch)
tree0fb5b65527e365529df771a25a0353f2d090c2c1 /org.eclipse.ui.workbench.texteditor
parent5aa443d1c8617c2c4dad20368a6f6afa7e9354b0 (diff)
downloadeclipse.platform.text-5e9451f731437c846f40d7bc2638205aa362f1e9.tar.gz
eclipse.platform.text-5e9451f731437c846f40d7bc2638205aa362f1e9.tar.xz
eclipse.platform.text-5e9451f731437c846f40d7bc2638205aa362f1e9.zip
Bug 532514 - setFocus: Added disposal checkI20180316-2000
Change-Id: Ie219d6f951beec8858bbb24503fcad3430ba5504 Signed-off-by: Karsten Thoms <karsten.thoms@itemis.de>
Diffstat (limited to 'org.eclipse.ui.workbench.texteditor')
-rw-r--r--org.eclipse.ui.workbench.texteditor/src/org/eclipse/ui/texteditor/AbstractTextEditor.java8
1 files changed, 6 insertions, 2 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 a455dc855..3078a2464 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
@@ -6215,8 +6215,12 @@ public abstract class AbstractTextEditor extends EditorPart implements ITextEdit
@Override
public void setFocus() {
- if (fSourceViewer != null && fSourceViewer.getTextWidget() != null)
- fSourceViewer.getTextWidget().setFocus();
+ if (fSourceViewer != null) {
+ StyledText widget= fSourceViewer.getTextWidget();
+ if (widget != null && !widget.isDisposed()) {
+ widget.setFocus();
+ }
+ }
}
@Override

Back to the top