Constantized getter methods of the the TextEditorWidget.
Moved some code from the header to the source file