synchronized void insertEdit(ModifyUndoEdit undoEdit) throws BadLocationException { int offset = undoEdit.getOffset(); checkEOLMark(offset); if (undoEdit.isTextValid()) { cache.insertString(offset, undoEdit.getText(), null); } else { // chars buffer valid cache.insert(offset, undoEdit.getChars(), null); } insertUpdate(undoEdit); // always done to update line cache }
/** * Get the text that was inserted/removed or null for change event. */ public String getText() { return (getModifyUndoEdit() != null) ? getModifyUndoEdit().getText() : null; }