public abstract class AbstractDocumentEdit extends Object implements UndoableEdit
Constructor and Description |
---|
AbstractDocumentEdit() |
Modifier and Type | Method and Description |
---|---|
boolean |
addEdit(UndoableEdit edit) |
boolean |
canRedo() |
boolean |
canUndo() |
void |
die() |
boolean |
getIsSubedit() |
String |
getRedoPresentationName() |
String |
getUndoPresentationName() |
boolean |
isSignificant() |
void |
redo()
Default implementation that just calls
registerDocumentChange() if this edit is not a subedit. |
protected abstract void |
registerDocumentChange()
Inheriting classes should e.g.
|
boolean |
replaceEdit(UndoableEdit edit) |
void |
setIsSubedit(boolean isSubedit)
Indicates whether this edit is independent or part of another edit.
|
void |
undo()
Default implementation that just calls
registerDocumentChange() if this edit is not a subedit. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPresentationName
public AbstractDocumentEdit()
public boolean getIsSubedit()
public void setIsSubedit(boolean isSubedit)
public boolean addEdit(UndoableEdit edit)
addEdit
in interface UndoableEdit
public boolean canRedo()
canRedo
in interface UndoableEdit
public boolean canUndo()
canUndo
in interface UndoableEdit
public void die()
die
in interface UndoableEdit
public String getRedoPresentationName()
getRedoPresentationName
in interface UndoableEdit
public String getUndoPresentationName()
getUndoPresentationName
in interface UndoableEdit
public boolean isSignificant()
isSignificant
in interface UndoableEdit
public boolean replaceEdit(UndoableEdit edit)
replaceEdit
in interface UndoableEdit
protected abstract void registerDocumentChange()
public void redo() throws CannotRedoException
registerDocumentChange()
if this edit is not a subedit.
Inheriting classes would have to overwrite this method to perform there document changes but should
call the inherited methods at the end of the implementation.redo
in interface UndoableEdit
CannotRedoException
public void undo() throws CannotUndoException
registerDocumentChange()
if this edit is not a subedit.
Inheriting classes would have to overwrite this method to undo there document changes but should
call the inherited methods at the end of the implementation.undo
in interface UndoableEdit
CannotUndoException