Package Summary  Overview Summary

class:AbstractUndoableEdit [NONE]

All Implemented Interfaces:
Serializable, UndoableEdit
Direct Known Subclasses:
AbstractDocument.ElementEdit, CompoundEdit, DefaultStyledDocument.AttributeUndoableEdit, StateEdit

public class AbstractUndoableEditextends Object implements UndoableEdit, Serializable
An abstract implementation of UndoableEdit, implementing simple responses to all boolean methods in that interface.

field:UndoName [NONE]

  • UndoName

    protected static final  String UndoName
    String returned by getUndoPresentationName; as of Java 2 platform v1.3.1 this field is no longer used. This value is now localized and comes from the defaults table with key AbstractUndoableEdit.undoText.
    See Also:
  • field:RedoName [NONE]

    RedoName

    protected static final  String RedoName
    String returned by getRedoPresentationName; as of Java 2 platform v1.3.1 this field is no longer used. This value is now localized and comes from the defaults table with key AbstractUndoableEdit.redoText.
    See Also:

    constructor:AbstractUndoableEdit() [NONE]

    • AbstractUndoableEdit

      public AbstractUndoableEdit()
      Creates an AbstractUndoableEdit which defaults hasBeenDone and alive to true.

    method:die() [NONE]

  • die

    public void die()
    Sets alive to false. Note that this is a one way operation; dead edits cannot be resurrected. Sending undo or redo to a dead edit results in an exception being thrown.

    Typically an edit is killed when it is consolidated by another edit's addEdit or replaceEdit method, or when it is dequeued from an UndoManager.

    Specified by:
    die in interface UndoableEdit
    See Also:
  • method:undo() [NONE]

    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.
    Specified by:
    undo in interface UndoableEdit
    Throws:
    CannotUndoException - if canUndo returns false
    See Also:

    method:canUndo() [NONE]

    canUndo

    public boolean canUndo()
    Returns true if this edit is alive and hasBeenDone is true.
    Specified by:
    canUndo in interface UndoableEdit
    Returns:
    true if this edit is alive and hasBeenDone is true
    See Also:

    method:redo() [NONE]

    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.
    Specified by:
    redo in interface UndoableEdit
    Throws:
    CannotRedoException - if canRedo returns false
    See Also:

    method:canRedo() [NONE]

    canRedo

    public boolean canRedo()
    Returns true if this edit is alive and hasBeenDone is false.
    Specified by:
    canRedo in interface UndoableEdit
    Returns:
    true if this edit is alive and hasBeenDone is false
    See Also:

    method:addEdit(javax.swing.undo.UndoableEdit) [NONE]

    addEdit

    public boolean addEdit (UndoableEdit anEdit)
    This default implementation returns false.
    Specified by:
    addEdit in interface UndoableEdit
    Parameters:
    anEdit - the edit to be added
    Returns:
    false
    See Also:

    method:replaceEdit(javax.swing.undo.UndoableEdit) [NONE]

    replaceEdit

    public boolean replaceEdit (UndoableEdit anEdit)
    This default implementation returns false.
    Specified by:
    replaceEdit in interface UndoableEdit
    Parameters:
    anEdit - the edit to replace
    Returns:
    false
    See Also:

    method:isSignificant() [NONE]

    isSignificant

    public boolean isSignificant()
    This default implementation returns true.
    Specified by:
    isSignificant in interface UndoableEdit
    Returns:
    true
    See Also:

    method:getPresentationName() [NONE]

    getPresentationName

    public String getPresentationName()
    This default implementation returns "". Used by getUndoPresentationName and getRedoPresentationName to construct the strings they return. Subclasses should override to return an appropriate description of the operation this edit represents.
    Specified by:
    getPresentationName in interface UndoableEdit
    Returns:
    the empty string ""
    See Also:

    method:getUndoPresentationName() [CHANGED]

    getUndoPresentationName

    public String getUndoPresentationName()
    RetreivesRetrieves the value from the defaults table with key AbstractUndoableEdit.undoText and returns that value followed by a space, followed by getPresentationName. If getPresentationName returns "", then the defaults value is returned alone.
    Specified by:
    getUndoPresentationName in interface UndoableEdit
    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.
    See Also:

    getUndoPresentationName

    public String getUndoPresentationName()
    Retreives the value from the defaults table with key AbstractUndoableEdit.undoText and returns that value followed by a space, followed by getPresentationName. If getPresentationName returns "", then the defaults value is returned alone.
    Specified by:
    getUndoPresentationName in interface UndoableEdit
    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.
    See Also:

    getUndoPresentationName

    public String getUndoPresentationName()
    Retrieves the value from the defaults table with key AbstractUndoableEdit.undoText and returns that value followed by a space, followed by getPresentationName. If getPresentationName returns "", then the defaults value is returned alone.
    Specified by:
    getUndoPresentationName in interface UndoableEdit
    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.
    See Also:

    method:getRedoPresentationName() [CHANGED]

    getRedoPresentationName

    public String getRedoPresentationName()
    RetreivesRetrieves the value from the defaults table with key AbstractUndoableEdit.redoText and returns that value followed by a space, followed by getPresentationName. If getPresentationName returns "", then the defaults value is returned alone.
    Specified by:
    getRedoPresentationName in interface UndoableEdit
    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.
    See Also:

    getRedoPresentationName

    public String getRedoPresentationName()
    Retreives the value from the defaults table with key AbstractUndoableEdit.redoText and returns that value followed by a space, followed by getPresentationName. If getPresentationName returns "", then the defaults value is returned alone.
    Specified by:
    getRedoPresentationName in interface UndoableEdit
    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.
    See Also:

    getRedoPresentationName

    public String getRedoPresentationName()
    Retrieves the value from the defaults table with key AbstractUndoableEdit.redoText and returns that value followed by a space, followed by getPresentationName. If getPresentationName returns "", then the defaults value is returned alone.
    Specified by:
    getRedoPresentationName in interface UndoableEdit
    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.
    See Also:

    method:toString() [NONE]

    toString

    public String toString()
    Returns a string that displays and identifies this object's properties.
    Overrides:
    toString in class Object
    Returns:
    a String representation of this object

    © 2023 Oracle Corporation and/or its affiliates