Community
Participate
Working Groups
/** * Returns the primary control associated with this viewer. * * @return the SWT control which displays this viewer's content */ public abstract Control getControl(); ComboViewer, ListViewer, TableViewer, and TreeViewer all return the control in its getControl() implementation even if the control is disposed. TextViewer does not do this and will return null. Sounds to me like it should a) not return null or b) define that it will in its javadoc. I noticed this problem while looking at the cause behind bug 357065.
Has been like this since day 0. > should a) not return null +1 > b) define that it will [return null] in its javadoc That would still violate the inherited contract of Viewer#getControl(). Note that we can't just remove the "fTextWidget= null;", since the class uses a lot of "if (fTextWidget == null ..." tests and ITextViewer#getTextWidget() specifies the current behavior.
Fixed in master: 1e4b8d7f344d37183189f29a90c66f8970a946cf
Verified through code inspection.