Modifier and Type | Method and Description |
---|---|
void |
beginEdit()
Used to instruct a model to start a compound edit
such that all the changes made between this point and when the
endEdit() is called should be combined into a single
UndoableEdit record. |
javax.swing.undo.UndoableEdit |
commitEdit()
Used to indicate to the text buffer to end an in progress
compound edit.
|
void |
rollbackEdit()
Used to indicate to the text buffer to end an in progress
compound edit without commiting the changes.
|
void |
write(java.lang.Runnable runnable)
This allows the model to be safely updated.
|
void beginEdit() throws java.io.IOException
endEdit()
is called should be combined into a single
UndoableEdit record. This guarantees to the client that the
buffer will be locked for the duration between
beginEdit()
and endEdit()
for data
consistency. This also takes care of locking the buffer, and
collecting the individual UndoableEdit
objects into
a larger compound one.
Note that compound edits may not be nested - it is illegal
to call beginEdit()
twice in a row without calling
endEdit()
in between.
ReadOnlyException
- if the buffer is in read only modejava.io.IOException
javax.swing.undo.UndoableEdit commitEdit()
UndoableEdit
representing all of the
changes made between the calls to beginEdit()
and
endEdit()
. If no modifications were made to the
buffer since beginEdit()
was called, null will be
returned.void rollbackEdit()
beginEdit
was made.void write(java.lang.Runnable runnable)
runnable
- a Runnable
used to write to the model.