Permalink
Browse files

Fix #16: NullPointerException occurs after a while

  • Loading branch information...
ystrot committed May 20, 2012
1 parent cb7c277 commit 122448c473cfb4588f94d19f1c308966354d746c
@@ -13,22 +13,24 @@
import org.eclipse.jface.text.Region;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.text.TextViewer;
-import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.custom.StyledText;
import com.xored.glance.ui.controls.text.styled.TextSelector;
public class ViewerSelector extends TextSelector {
private final TextViewer viewer;
+ private final StyledText control;
public ViewerSelector(TextViewer viewer) {
this.viewer = viewer;
+ this.control = viewer.getTextWidget();
init();
}
@Override
- protected Control getControl() {
- return viewer.getTextWidget();
+ protected StyledText getControl() {
+ return control;
}
@Override

0 comments on commit 122448c

Please sign in to comment.