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) |