public class CompositeEdit
extends javax.swing.undo.CompoundEdit
For example:
// fire CompositeEdit at start of sequence CompositeEdit ce = new CompositeEdit(); fireUndoableEditEvent(ce); ...fire edits which shall compounded here... // fire CompositeEdit at end of sequence again, to end it. fireUndoableEditEvent(ce);
Constructor and Description |
---|
CompositeEdit()
Creates a new
CompositeEdit which uses CompoundEdit#getPresentationName()
and is significant.. |
CompositeEdit(boolean isSignificant)
Creates a new
CompositeEdit which uses the specified significance. |
CompositeEdit(java.lang.String presentationName)
Creates a new
CompositeEdit which uses the specified
presentation name. |
CompositeEdit(java.lang.String presentationName,
boolean isSignificant)
Creates a new
CompositeEdit which uses the given presentation name
and significance. |
Modifier and Type | Method and Description |
---|---|
boolean |
addEdit(javax.swing.undo.UndoableEdit anEdit)
If this edit is inProgress, accepts anEdit and returns
true.
|
java.lang.String |
getPresentationName()
Returns the presentation name.
|
java.lang.String |
getRedoPresentationName()
Returns the redo presentation name.
|
java.lang.String |
getUndoPresentationName()
Returns the undo presentation name.
|
boolean |
isSignificant()
Returns false if this edit is insignificant - for example one
that maintains the user's selection, but does not change
any model state.
|
void |
setSignificant(boolean newValue) |
void |
setVerbose(boolean b) |
public CompositeEdit()
CompositeEdit
which uses CompoundEdit#getPresentationName()
and is significant..CompoundEdit.getPresentationName()
public CompositeEdit(boolean isSignificant)
CompositeEdit
which uses the specified significance.
The presentation name is used from CompoundEdit#getPresentationName().
CompoundEdit.getPresentationName()
public CompositeEdit(java.lang.String presentationName)
CompositeEdit
which uses the specified
presentation name.
If the presentation name is null, then CompoundEdit.getPresentatioName is used.
CompoundEdit.getPresentationName()
public CompositeEdit(java.lang.String presentationName, boolean isSignificant)
CompositeEdit
which uses the given presentation name
and significance.
If the presentation name is null, then CompoundEdit.getPresentatioName is used.
CompoundEdit.getPresentationName()
public void setVerbose(boolean b)
public java.lang.String getPresentationName()
getPresentationName
in interface javax.swing.undo.UndoableEdit
getPresentationName
in class javax.swing.undo.CompoundEdit
CompoundEdit.getPresentationName()
public java.lang.String getUndoPresentationName()
getUndoPresentationName
in interface javax.swing.undo.UndoableEdit
getUndoPresentationName
in class javax.swing.undo.CompoundEdit
CompoundEdit.getUndoPresentationName()
public java.lang.String getRedoPresentationName()
getRedoPresentationName
in interface javax.swing.undo.UndoableEdit
getRedoPresentationName
in class javax.swing.undo.CompoundEdit
CompoundEdit.getRedoPresentationName()
public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
The last edit added to this CompositeEdit is given a chance to addEdit(anEdit). If it refuses (returns false), anEdit is given a chance to replaceEdit the last edit. If anEdit returns false here, it is added to edits.
If the CompositeEdit is added to itself, then method end() is called, and true is returned.
addEdit
in interface javax.swing.undo.UndoableEdit
addEdit
in class javax.swing.undo.CompoundEdit
public boolean isSignificant()
isSignificant
in interface javax.swing.undo.UndoableEdit
isSignificant
in class javax.swing.undo.CompoundEdit
public void setSignificant(boolean newValue)