public static class UndoRedo.Manager extends UndoManager implements UndoRedo
UndoRedo.Empty, UndoRedo.Manager, UndoRedo.Provider
edits
RedoName, UndoName
Constructor and Description |
---|
Manager() |
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener l)
Add a change listener.
|
boolean |
addEdit(UndoableEdit anEdit) |
boolean |
canRedo()
Test whether the component currently has undone edits which may be redone.
|
boolean |
canUndo()
Test whether the component currently has edits which may be undone.
|
boolean |
canUndoOrRedo() |
void |
die() |
void |
discardAllEdits() |
protected UndoableEdit |
editToBeRedone() |
protected UndoableEdit |
editToBeUndone() |
void |
end() |
int |
getLimit() |
String |
getPresentationName() |
String |
getRedoPresentationName()
Get a human-presentable name describing the
redo operation.
|
String |
getUndoOrRedoPresentationName() |
String |
getUndoPresentationName()
Get a human-presentable name describing the
undo operation.
|
boolean |
isInProgress() |
boolean |
isSignificant() |
protected UndoableEdit |
lastEdit() |
void |
redo()
Redo a previously undone edit.
|
protected void |
redoTo(UndoableEdit edit) |
void |
removeChangeListener(ChangeListener l)
Remove a change listener.
|
boolean |
replaceEdit(UndoableEdit anEdit) |
void |
setLimit(int l) |
String |
toString() |
protected void |
trimEdits(int from,
int to) |
protected void |
trimForLimit() |
void |
undo()
Undo an edit.
|
void |
undoableEditHappened(UndoableEditEvent ue)
Consume an undoable edit.
|
void |
undoOrRedo() |
protected void |
undoTo(UndoableEdit edit) |
public void die()
die
in interface UndoableEdit
die
in class CompoundEdit
public boolean isInProgress()
isInProgress
in class CompoundEdit
public void end()
end
in class UndoManager
public void undo() throws CannotUndoException
UndoRedo
undo
in interface UndoableEdit
undo
in interface UndoRedo
undo
in class UndoManager
CannotUndoException
- if it failsprotected void undoTo(UndoableEdit edit) throws CannotUndoException
undoTo
in class UndoManager
CannotUndoException
public boolean canUndo()
UndoRedo
canUndo
in interface UndoableEdit
canUndo
in interface UndoRedo
canUndo
in class UndoManager
true
if undo is allowedpublic void redo() throws CannotRedoException
UndoRedo
redo
in interface UndoableEdit
redo
in interface UndoRedo
redo
in class UndoManager
CannotRedoException
- if it failsprotected void redoTo(UndoableEdit edit) throws CannotRedoException
redoTo
in class UndoManager
CannotRedoException
public boolean canRedo()
UndoRedo
canRedo
in interface UndoableEdit
canRedo
in interface UndoRedo
canRedo
in class UndoManager
true
if redo is allowedpublic void undoOrRedo() throws CannotRedoException, CannotUndoException
undoOrRedo
in class UndoManager
CannotRedoException
CannotUndoException
public boolean canUndoOrRedo()
canUndoOrRedo
in class UndoManager
public int getLimit()
getLimit
in class UndoManager
public void setLimit(int l)
setLimit
in class UndoManager
protected void trimForLimit()
trimForLimit
in class UndoManager
protected void trimEdits(int from, int to)
trimEdits
in class UndoManager
public void discardAllEdits()
discardAllEdits
in class UndoManager
protected UndoableEdit lastEdit()
lastEdit
in class CompoundEdit
protected UndoableEdit editToBeUndone()
editToBeUndone
in class UndoManager
protected UndoableEdit editToBeRedone()
editToBeRedone
in class UndoManager
public void undoableEditHappened(UndoableEditEvent ue)
undoableEditHappened
in interface UndoableEditListener
undoableEditHappened
in class UndoManager
ue
- the editpublic boolean addEdit(UndoableEdit anEdit)
addEdit
in interface UndoableEdit
addEdit
in class UndoManager
public boolean replaceEdit(UndoableEdit anEdit)
replaceEdit
in interface UndoableEdit
replaceEdit
in class AbstractUndoableEdit
public boolean isSignificant()
isSignificant
in interface UndoableEdit
isSignificant
in class CompoundEdit
public String getPresentationName()
getPresentationName
in interface UndoableEdit
getPresentationName
in class CompoundEdit
public String getUndoPresentationName()
UndoRedo
getUndoPresentationName
in interface UndoableEdit
getUndoPresentationName
in interface UndoRedo
getUndoPresentationName
in class UndoManager
public String getRedoPresentationName()
UndoRedo
getRedoPresentationName
in interface UndoableEdit
getRedoPresentationName
in interface UndoRedo
getRedoPresentationName
in class UndoManager
public String getUndoOrRedoPresentationName()
getUndoOrRedoPresentationName
in class UndoManager
public String toString()
toString
in class UndoManager
public void addChangeListener(ChangeListener l)
UndoRedo
addChangeListener
in interface UndoRedo
l
- the listener to addpublic void removeChangeListener(ChangeListener l)
UndoRedo
removeChangeListener
in interface UndoRedo
l
- the listener to removeUndoRedo.addChangeListener(javax.swing.event.ChangeListener)