String (boolean addToHistory, boolean preserveMarkup, boolean clearInput) { EditorEx editor = getCurrentEditor(); Document document = editor.getDocument(); String text = document.getText(); TextRange range = new TextRange(0, document.getTextLength()); if (!clearInput) { editor.getSelectionModel().setSelection(range.getStartOffset(), range.getEndOffset()); } if (addToHistory) { addToHistoryInner(range, editor, clearInput, preserveMarkup); } else if (clearInput) { setInputText(""); } return text; }