extracted reusable code to TextSelectionUtil
Allow users to enabled/disable textToDiagram and diagramToText selection