/** * Get the count of '\n' (line-feeds) contained in the inserted/removed * text. */ public int getLFCount() { return (getModifyUndoEdit() != null) ? getModifyUndoEdit().getLFCount() : 0; }
/** * Get the offset at which the updating of the syntax stopped so there are * no more changes in the tokens after this point. */ public int getSyntaxUpdateOffset() { return (getModifyUndoEdit() != null) ? getModifyUndoEdit().getSyntaxUpdateOffset() : 0; }
/** Get the text that was inserted/removed or null * for change event. */ public String getText() { return (getModifyUndoEdit() != null) ? getModifyUndoEdit().getUndoRedoText() : null; }
/** * Gets the characters that were inserted/removed or null for change event. * Characters must be used only in readonly mode as the character array is * shared by all listeners and also by modification event itself. */ public char[] getChars() { return (getModifyUndoEdit() != null) ? getModifyUndoEdit().getChars() : null; }
/** * Get the text that was inserted/removed or null for change event. */ public String getText() { return (getModifyUndoEdit() != null) ? getModifyUndoEdit().getText() : null; }
/** Get the line at which the insert/remove occured */ public int getLine() { return (getModifyUndoEdit() != null) ? getModifyUndoEdit().getLine() : 0; }
private boolean isLastModifyUndoEdit() { if (getType() == DocumentEvent.EventType.CHANGE) { return true; // OK in this case } BaseDocument doc = (BaseDocument) getDocument(); doc.extWriteLock(); // lock to sync if ongoing doc change try { // #8692 check last modify undo edit if (doc.lastModifyUndoEdit == null) { return true; // OK in this case } DocOp.ModifyUndoEdit undoEdit = getModifyUndoEdit(); return (undoEdit == doc.lastModifyUndoEdit); } finally { doc.extWriteUnlock(); } }
private boolean isLastModifyUndoEdit() { if (getType() == DocumentEvent.EventType.CHANGE) { return true; // OK in this case } BaseDocument doc = (BaseDocument)getDocument(); doc.extWriteLock(); // lock to sync if ongoing doc change try { // #8692 check last modify undo edit if (doc.lastModifyUndoEdit == null) { return true; // OK in this case } DocumentContent.Edit undoEdit = getModifyUndoEdit(); return (undoEdit == doc.lastModifyUndoEdit); } finally { doc.extWriteUnlock(); } }