public class UndoRedoManager
extends javax.swing.undo.UndoManager
Modifier and Type | Field and Description |
---|---|
static javax.swing.undo.UndoableEdit |
DISCARD_ALL_EDITS
Sending this UndoableEdit event to the UndoRedoManager
disables the Undo and Redo functions of the manager.
|
protected java.beans.PropertyChangeSupport |
propertySupport |
Constructor and Description |
---|
UndoRedoManager()
Creates new UndoRedoManager
|
Modifier and Type | Method and Description |
---|---|
boolean |
addEdit(javax.swing.undo.UndoableEdit anEdit)
If inProgress, inserts anEdit at indexOfNextAdd, and removes
any old edits that were at indexOfNextAdd or later.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener) |
void |
discardAllEdits()
Discards all edits.
|
protected void |
firePropertyChange(java.lang.String propertyName,
boolean oldValue,
boolean newValue) |
protected void |
firePropertyChange(java.lang.String propertyName,
int oldValue,
int newValue) |
protected void |
firePropertyChange(java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue) |
static ResourceBundleUtil |
getLabels() |
javax.swing.Action |
getRedoAction()
Gets the redo action for use as a Redo menu item.
|
javax.swing.Action |
getUndoAction()
Gets the undo action for use as an Undo menu item.
|
boolean |
hasSignificantEdits()
Returns true if at least one significant UndoableEdit
has been added since the last call to discardAllEdits.
|
void |
redo()
Redoes the last undone edit event.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener) |
void |
setHasSignificantEdits(boolean newValue) |
void |
setLocale(java.util.Locale l) |
void |
undo()
Undoes the last edit event.
|
void |
undoOrRedo()
Undoes or redoes the last edit event.
|
canRedo, canUndo, canUndoOrRedo, editToBeRedone, editToBeUndone, end, getLimit, getRedoPresentationName, getUndoOrRedoPresentationName, getUndoPresentationName, redoTo, setLimit, toString, trimEdits, trimForLimit, undoableEditHappened, undoTo
protected java.beans.PropertyChangeSupport propertySupport
public static final javax.swing.undo.UndoableEdit DISCARD_ALL_EDITS
public static ResourceBundleUtil getLabels()
public void setLocale(java.util.Locale l)
public void discardAllEdits()
discardAllEdits
in class javax.swing.undo.UndoManager
public void setHasSignificantEdits(boolean newValue)
public boolean hasSignificantEdits()
public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
If not inProgress, acts as a CompoundEdit
Regardless of inProgress, if undoOrRedoInProgress, calls die on each edit that is sent.
addEdit
in interface javax.swing.undo.UndoableEdit
addEdit
in class javax.swing.undo.UndoManager
CompoundEdit.end()
,
CompoundEdit.addEdit(javax.swing.undo.UndoableEdit)
public javax.swing.Action getUndoAction()
public javax.swing.Action getRedoAction()
public void undo() throws javax.swing.undo.CannotUndoException
undo
in interface javax.swing.undo.UndoableEdit
undo
in class javax.swing.undo.UndoManager
javax.swing.undo.CannotUndoException
public void redo() throws javax.swing.undo.CannotUndoException
redo
in interface javax.swing.undo.UndoableEdit
redo
in class javax.swing.undo.UndoManager
javax.swing.undo.CannotUndoException
public void undoOrRedo() throws javax.swing.undo.CannotUndoException, javax.swing.undo.CannotRedoException
undoOrRedo
in class javax.swing.undo.UndoManager
javax.swing.undo.CannotUndoException
javax.swing.undo.CannotRedoException
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
protected void firePropertyChange(java.lang.String propertyName, boolean oldValue, boolean newValue)
protected void firePropertyChange(java.lang.String propertyName, int oldValue, int newValue)
protected void firePropertyChange(java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)