private void endCurrentCompoundEdit() { if (currentCompoundEdit != null) { currentCompoundEdit.end(); currentCompoundEdit = null; } }
public void startNewCompoundEdit() { if (compoundEdit != null) { compoundEdit.end(); compoundEdit = null; } }
public void finishCurrentEdit() { if (compoundEdit != null) { compoundEdit.end(); compoundEdit = null; } } }
private void processDocumentChange(JTextComponent component) { boolean endEdit = lastOffset == 0; if (!endEdit) { try { String lastChar = component.getDocument().getText(lastOffset - 1, 1); endEdit = DELIMITER_PATTERN.matcher(lastChar).matches(); } catch (BadLocationException ex) { } } if (endEdit) { // ending the current compound edit, next will be started edit.end(); edit = null; } }
void endOnSaveTasks() { if (onSaveTasksEdit != null) { onSaveTasksEdit.end(); } awaitingOnSaveTasks = false; checkLogOp(" endSaveActions(): saveActionsEdit", onSaveTasksEdit); // NOI18N }
@Override public void undo() throws CannotUndoException { // End the edit so future edits don't get absorbed by this edit if (compoundEdit != null) { compoundEdit.end(); } super.undo(); // Always start a new compound edit after an undo compoundEdit = null; } }
@Override public void undo() throws CannotUndoException { // End the edit so future edits don't get absorbed by this edit if (compoundEdit != null) { compoundEdit.end(); } super.undo(); // Always start a new compound edit after an undo compoundEdit = null; } }
@Override public void undo() { // End the edit so future edits don't get absorbed by this edit if (compoundEdit != null) compoundEdit.end(); super.undo(); // Always start a new compound edit after an undo compoundEdit = null; }
@Override public void undo() throws CannotUndoException { // End the edit so future edits don't get absorbed by this edit if (compoundEdit != null) { compoundEdit.end(); } super.undo(); // Always start a new compound edit after an undo compoundEdit = null; } }
/** * Stops capturing actions on graph and adds an entry to history */ protected void stopHistoryCapture() { if (this.currentCapturedEdit == null) return; this.currentCapturedEdit.end(); this.undoManager.addEdit(this.currentCapturedEdit); this.currentCapturedEdit = null; }
@Override public void undo() throws CannotUndoException { if (edit != null) { edit.end(); } super.undo(); edit = null; } }
@Override public void undo() { // End the edit so future edits don't get absorbed by this edit if (compoundEdit != null) compoundEdit.end(); super.undo(); // Always start a new compound edit after an undo compoundEdit = null; }
public synchronized void end() { super.end(); trimEdits(m_indexOfNextAdd, edits.size() - 1); }
/** * Commits the cached edit. */ public synchronized void commitCache() { if (_cache != null) { _cache.end(); addEditWithoutCaching(); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Commit cache: " + _cache); } _cache = null; } }
/** * Break the atomic lock so that doc is no longer in atomic mode. All the * performed changes are rolled back automatically. Even after calling this * method, the atomicUnlock() must still be called. This method is not * synced as it must be called only from writer thread. */ public final void breakAtomicLock() { atomicDepth = 0; if (atomicEdits != null) { atomicEdits.end(); atomicEdits.undo(); atomicEdits = null; } }
private void undoPending() { synchronized( pendingEdits ) { if( pendingEditCount > 0 ) { pendingEdits.end(); pendingEdits.undo(); pendingEdits = new CompoundEdit(); pendingEditCount = 0; } } }
/** * See beginCompoundEdit(). */ public void endCompoundEdit() { if (compoundEdit != null) { compoundEdit.end(); if (compoundEdit.canUndo()) undo.addEdit(compoundEdit); compoundEdit = null; } }
/** * See beginCompoundEdit(). */ public void endCompoundEdit() { if (compoundEdit != null) { compoundEdit.end(); if (compoundEdit.canUndo()) undo.addEdit(compoundEdit); compoundEdit = null; } }
private void startNewEdit (JTextComponent component, UndoableEdit atomicEdit) { if (edit != null) { // finish the last edit edit.end(); } edit = new MyCompoundEdit(); edit.addEdit(atomicEdit); super.undoableEditHappened(new UndoableEditEvent(component, edit)); lastOffset = component.getCaretPosition(); lastLength = component.getDocument().getLength(); }
public synchronized final void atomicUnlock() { extWriteUnlock(); if (atomicDepth == 0) { return; } if (--atomicDepth == 0) { // must fire possible undo event if (atomicEdits != null) { atomicEdits.end(); fireUndoableEditUpdate(new UndoableEditEvent(this, atomicEdits)); atomicEdits = null; } } }