TextEditor: avoid deprecated methods
TextEditor: add missing @Overrides
TextEditor: avoid potential NPE