当前页面:
在线文档首页 >
NetBeans API Javadoc (Current Development Version)
AtomicLockDocument (Editor Library) - NetBeans API Javadoc (Current Development Version)
org.netbeans.editor
Interface AtomicLockDocument
- All Superinterfaces:
- Document
- All Known Implementing Classes:
- BaseDocument, GuardedDocument
public interface AtomicLockDocument
- extends Document
Document that supports atomic locking allows
for transactional modifications.
The document is write-locked during the whole atomic
operation. All the operations since
the begining of the atomic operation
can be undone by using atomicUndo().
Typical scenario of the operation
is the following:
doc.atomicLock();
try {
...
modification1
modification2
...
} catch (BadLocationException e) {
// something went wrong - undo till begining
doc.atomicUndo();
} finally {
doc.atomicUnlock();
}
The external clients can watch for atomic operations
by registering an listener through
addAtomicLockListener(AtomicLockListener)
Methods inherited from interface javax.swing.text.Document |
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render |
atomicLock
void atomicLock()
atomicUnlock
void atomicUnlock()
atomicUndo
void atomicUndo()
addAtomicLockListener
void addAtomicLockListener(AtomicLockListener l)
removeAtomicLockListener
void removeAtomicLockListener(AtomicLockListener l)