String () { try { Document document = MyEditorPane.this.getDocument(); String result = document.getText(0, document.getLength()); @NlsSafe String resultWithPunctuation = AccessibleContextUtil.replaceLineSeparatorsWithPunctuation(result); return resultWithPunctuation; } catch (BadLocationException e) { return super.getAccessibleName(); } }