All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.undo.JUndoableEdit
java.lang.Object
|
+----com.sun.java.swing.undo.JUndoableEdit
- public class JUndoableEdit
- extends Object
- implements UndoableEdit
An abstract implementation of UndoableEdit, implementing simple
responses to all boolean methods in that interface. Adds notion of
a change being "in progress".
-
RedoName
- String returned by getRedoPresentationName()
-
UndoName
- String returned by getUndoPresentationName()
-
JUndoableEdit()
-
-
addEdit(UndoableEdit)
- This default implementation returns false.
-
canRedo()
- Returns true if this edit is enabled and hasBeenDone is true.
-
canUndo()
- Returns true if this edit is enabled and hasBeenDone is false.
-
disable()
- Sets enabled to false.
-
end()
- Sets inProgress to false and hasBeenDone to true.
-
getPresentationName()
- This default implementation returns "".
-
getRedoPresentationName()
- If getPresentationName() returns "", returns
JUndoableEdit.RedoName.
-
getUndoPresentationName()
- If getPresentationName() returns "", returns
JUndoableEdit.UndoName.
-
init()
- Designated initializer.
-
isInProgress()
- Returns true if this edit is in progress--that is, if it is
still being constructed, before it has been announced to
listeners via an UndoableEditEvent
-
isSignificant()
- This default implementation returns true.
-
redo()
- Throws CannotRedoException if canRedo() returns false.
-
replaceEdit(UndoableEdit)
- This default implementation returns false.
-
toString()
-
-
undo()
- Throws CannotUndoException if canUndo() returns false.
UndoName
protected final String UndoName
- String returned by getUndoPresentationName()
RedoName
protected final String RedoName
- String returned by getRedoPresentationName()
JUndoableEdit
public JUndoableEdit()
init
protected void init()
- Designated initializer. All constructors call this method to
initialize ivars. Sets inProgress to true and hasBeenDone to false.
end
public void end()
- Sets inProgress to false and hasBeenDone to true.
- See Also:
- canUndo, canRedo
disable
public void disable()
- Sets enabled to false. Note that this is a one way operation:
disabled edits cannot be reenabled. Typically this is sent
when this edit is absorbed by another one via its addEdit() or
replaceEdit() method.
- See Also:
- addEdit, replaceEdit
isInProgress
public boolean isInProgress()
- Returns true if this edit is in progress--that is, if it is
still being constructed, before it has been announced to
listeners via an UndoableEditEvent
- See Also:
- end
undo
public void undo() throws CannotUndoException
- Throws CannotUndoException if canUndo() returns false. Sets
hasBeenDone to false. Subclasses should override to undo the
operation represented by this edit. Override should begin with
a call to super.
- See Also:
- canUndo
canUndo
public boolean canUndo()
- Returns true if this edit is enabled and hasBeenDone is false.
- See Also:
- disable, undo, redo
redo
public void redo() throws CannotRedoException
- Throws CannotRedoException if canRedo() returns false. Sets
hasBeenDone to true. Subclasses should override to redo the
operation represented by this edit. Override should begin with
a call to super.
- See Also:
- canRedo
canRedo
public boolean canRedo()
- Returns true if this edit is enabled and hasBeenDone is true.
- See Also:
- disable, undo, redo
addEdit
public boolean addEdit(UndoableEdit anEdit)
- This default implementation returns false.
- See Also:
- addEdit
replaceEdit
public boolean replaceEdit(UndoableEdit anEdit)
- This default implementation returns false.
- See Also:
- replaceEdit
isSignificant
public boolean isSignificant()
- This default implementation returns true.
- See Also:
- isSignificant
getPresentationName
public String getPresentationName()
- This default implementation returns "". Used by
getUndoPresentationName() and getRedoPresentationName() to
construct the strings they return. Subclasses shoul override to
return an appropriate description of the operation this edit
represents.
- See Also:
- getUndoPresentationName, getRedoPresentationName
getUndoPresentationName
public String getUndoPresentationName()
- If getPresentationName() returns "", returns
JUndoableEdit.UndoName. Otherwise returns
JUndoableEdit.UndoName followed by a space and
getPresentationName()
- See Also:
- getPresentationName
getRedoPresentationName
public String getRedoPresentationName()
- If getPresentationName() returns "", returns
JUndoableEdit.RedoName. Otherwise returns
JUndoableEdit.RedoName followed by a space and
getPresentationName()
- See Also:
- getPresentationName
toString
public String toString()
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index