com.borland.primetime.editor
Class JBUndoManager.UndoSegment

java.lang.Object
  |
  +--javax.swing.undo.AbstractUndoableEdit
        |
        +--javax.swing.undo.CompoundEdit
              |
              +--com.borland.primetime.editor.JBUndoManager.UndoGroup
                    |
                    +--com.borland.primetime.editor.JBUndoManager.UndoSegment
Enclosing class:
JBUndoManager

protected class JBUndoManager.UndoSegment
extends JBUndoManager.UndoGroup

An UndoSegment is a special subclass of UndoGroup which is able to coalesce subsequent edits of the same type.

See Also:
Serialized Form

Fields inherited from class com.borland.primetime.editor.JBUndoManager.UndoGroup
endMark, endPoint, startMark, startPoint
 
Fields inherited from class javax.swing.undo.CompoundEdit
edits
 
Fields inherited from class javax.swing.undo.AbstractUndoableEdit
RedoName, UndoName
 
Constructor Summary
JBUndoManager.UndoSegment(int point, int mark, int type)
          Create a new UndoSegment, with the specified caret state, and edit type.
 
Method Summary
 boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
          Attempt to add an edit to this undo segment.
 boolean canChain(JBUndoManager.UndoSegment seg)
          Determine if an UndoSegment can be chained to the current segment.
 int getType()
          Return the type of this UndoSegment.
 
Methods inherited from class com.borland.primetime.editor.JBUndoManager.UndoGroup
getEndMark, getEndPoint, getStartMark, getStartPoint, hashCode, setEndOffsets, setStartOffsets
 
Methods inherited from class javax.swing.undo.CompoundEdit
canRedo, canUndo, die, end, getPresentationName, getRedoPresentationName, getUndoPresentationName, isInProgress, isSignificant, lastEdit, redo, toString, undo
 
Methods inherited from class javax.swing.undo.AbstractUndoableEdit
replaceEdit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JBUndoManager.UndoSegment

public JBUndoManager.UndoSegment(int point,
                                 int mark,
                                 int type)
Create a new UndoSegment, with the specified caret state, and edit type.
Parameters:
point - The position of the caret dot at the start of this edit.
mark - The position of the caret mark at the start of this edit.
type - The type of edit this UndoSegment represents.
Method Detail

getType

public int getType()
Return the type of this UndoSegment.

addEdit

public boolean addEdit(javax.swing.undo.UndoableEdit anEdit)
Attempt to add an edit to this undo segment. If anEdit is an instance of AbstractDocument.DefaultDocumentEvent, it will simply be added. If anEdit is an instance of UndoSegment, it will be added only if the two segments can be chained together. If it is added, then the endPoint and endMark of this Segment are updated to reflect the information in the newly appended edit.
Overrides:
addEdit in class javax.swing.undo.CompoundEdit
Parameters:
anEdit - The UndoableEdit to try to add.
Returns:
True if anEdit was added to this UndoSegment.
See Also:
canChain(com.borland.primetime.editor.JBUndoManager.UndoSegment)

canChain

public boolean canChain(JBUndoManager.UndoSegment seg)
Determine if an UndoSegment can be chained to the current segment.
Parameters:
seg - The UndoableSegment to check for chaining.
Returns:
True if seg can be appended to this UndoSegment.
See Also:
canChain(com.borland.primetime.editor.JBUndoManager.UndoSegment)