Known Direct Subclasses
|
Class Overview
A concrete subclass of AbstractUndoableEdit, used to assemble little
UndoableEdits into great big ones.
Summary
Fields |
protected
Vector<UndoableEdit> |
edits |
The collection of UndoableEdit s
undone/redone en masse by this CompoundEdit . |
Public Methods |
boolean
|
addEdit(UndoableEdit anEdit)
If this edit is inProgress ,
accepts anEdit and returns true.
|
boolean
|
canRedo()
Returns false if isInProgress or if super
returns false.
|
boolean
|
canUndo()
Returns false if isInProgress or if super
returns false.
|
void
|
die()
Sends die to each subedit,
in the reverse of the order that they were added.
|
void
|
end()
Sets inProgress to false.
|
String
|
getPresentationName()
Returns getPresentationName from the
last UndoableEdit added to
edits .
|
String
|
getRedoPresentationName()
Returns getRedoPresentationName
from the last UndoableEdit
added to edits .
|
String
|
getUndoPresentationName()
Returns getUndoPresentationName
from the last UndoableEdit
added to edits .
|
boolean
|
isInProgress()
Returns true if this edit is in progress--that is, it has not
received end.
|
boolean
|
isSignificant()
Returns true if any of the UndoableEdit s
in edits do.
|
void
|
redo()
Sends redo to all contained
UndoableEdit s in the order in
which they were added.
|
String
|
toString()
Returns a string that displays and identifies this
object's properties.
|
void
|
undo()
Sends undo to all contained
UndoableEdits in the reverse of
the order in which they were added.
|
Protected Methods |
UndoableEdit
|
lastEdit()
Returns the last UndoableEdit in
edits , or null
if edits is empty.
|
[Expand]
Inherited Methods |
From class
javax.swing.undo.AbstractUndoableEdit
boolean
|
addEdit(UndoableEdit anEdit)
This default implementation returns false.
|
boolean
|
canRedo()
Returns true if this edit is alive
and hasBeenDone is false .
|
boolean
|
canUndo()
Returns true if this edit is alive
and hasBeenDone is true .
|
void
|
die()
Sets alive to false.
|
String
|
getPresentationName()
This default implementation returns "".
|
String
|
getRedoPresentationName()
Retreives the value from the defaults table with key
AbstractUndoableEdit.redoText and returns
that value followed by a space, followed by
getPresentationName .
|
String
|
getUndoPresentationName()
Retreives the value from the defaults table with key
AbstractUndoableEdit.undoText and returns
that value followed by a space, followed by
getPresentationName .
|
boolean
|
isSignificant()
This default implementation returns true.
|
void
|
redo()
Throws CannotRedoException if canRedo
returns false.
|
boolean
|
replaceEdit(UndoableEdit anEdit)
This default implementation returns false.
|
String
|
toString()
Returns a string that displays and identifies this
object's properties.
|
void
|
undo()
Throws CannotUndoException if canUndo
returns false .
|
|
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
final
void
|
wait(long timeout, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long timeout)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
|
From interface
javax.swing.undo.UndoableEdit
abstract
boolean
|
addEdit(UndoableEdit anEdit)
Adds an UndoableEdit to this UndoableEdit .
|
abstract
boolean
|
canRedo()
Returns true if this edit may be redone.
|
abstract
boolean
|
canUndo()
Returns true if this edit may be undone.
|
abstract
void
|
die()
Informs the edit that it should no longer be used.
|
abstract
String
|
getPresentationName()
Returns a localized, human-readable description of this edit, suitable
for use in a change log, for example.
|
abstract
String
|
getRedoPresentationName()
Returns a localized, human-readable description of the redoable form of
this edit, suitable for use as a Redo menu item, for example.
|
abstract
String
|
getUndoPresentationName()
Returns a localized, human-readable description of the undoable form of
this edit, suitable for use as an Undo menu item, for example.
|
abstract
boolean
|
isSignificant()
Returns true if this edit is considered significant.
|
abstract
void
|
redo()
Re-applies the edit.
|
abstract
boolean
|
replaceEdit(UndoableEdit anEdit)
Returns true if this UndoableEdit should replace
anEdit .
|
abstract
void
|
undo()
Undo the edit.
|
|
Fields
The collection of UndoableEdit
s
undone/redone en masse by this CompoundEdit
.
Public Constructors
Public Methods
public
boolean
addEdit
(UndoableEdit anEdit)
If this edit is inProgress
,
accepts anEdit
and returns true.
The last edit added to this CompoundEdit
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
.
Parameters
anEdit
| the edit to be added |
Returns
- true if the edit is
inProgress
;
otherwise returns false
public
boolean
canRedo
()
Returns false if isInProgress
or if super
returns false.
Returns
true
if this edit is alive
and hasBeenDone
is false
public
boolean
canUndo
()
Returns false if isInProgress
or if super
returns false.
Returns
- true if this edit is
alive
and hasBeenDone
is true
public
void
die
()
Sends die
to each subedit,
in the reverse of the order that they were added.
public
void
end
()
Sets inProgress
to false.
public
String
getPresentationName
()
Returns getPresentationName
from the
last UndoableEdit
added to
edits
. If edits
is empty,
calls super.
public
String
getRedoPresentationName
()
Returns getRedoPresentationName
from the last UndoableEdit
added to edits
.
If edits
is empty, calls super.
Returns
- the value from the defaults table with key
AbstractUndoableEdit.redoText
, followed
by a space, followed by getPresentationName
unless getPresentationName
is "" in which
case, the defaults value is returned alone.
public
String
getUndoPresentationName
()
Returns getUndoPresentationName
from the last UndoableEdit
added to edits
.
If edits
is empty, calls super.
Returns
- the value from the defaults table with key
AbstractUndoableEdit.undoText
, followed
by a space, followed by getPresentationName
unless getPresentationName
is "" in which
case, the defaults value is returned alone.
public
boolean
isInProgress
()
Returns true if this edit is in progress--that is, it has not
received end. This generally means that edits are still being
added to it.
public
boolean
isSignificant
()
Returns true if any of the UndoableEdit
s
in edits
do.
Returns false if they all return false.
public
void
redo
()
Sends redo
to all contained
UndoableEdit
s in the order in
which they were added.
public
String
toString
()
Returns a string that displays and identifies this
object's properties.
Returns
- a String representation of this object
public
void
undo
()
Sends undo
to all contained
UndoableEdits
in the reverse of
the order in which they were added.
Protected Methods
Returns the last UndoableEdit
in
edits
, or null
if edits
is empty.