public class AbstractDocument.DefaultDocumentEvent extends CompoundEditimplements DocumentEvent
DocumentEvent.ElementChange , DocumentEvent.EventType editsRedoName, UndoName| Constructor and Description |
|---|
DefaultDocumentEvent(int offs, int len, DocumentEvent
Constructs a change record.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addEdit(UndoableEdit
Adds a document edit.
|
DocumentEvent |
getChange(Element
Gets the changes for an element.
|
Document |
getDocument()
Gets the document that sourced the change event.
|
int |
getLength()
Returns the length of the change.
|
int |
getOffset()
Returns the offset within the document of the start of the change.
|
String |
getPresentationName()
Provides a localized, human readable description of this edit suitable for use in, say, a change log.
|
String |
getRedoPresentationName()
Provides a localized, human readable description of the redoable form of this edit, e.g.
|
DocumentEvent |
getType()
Returns the type of event.
|
String |
getUndoPresentationName()
Provides a localized, human readable description of the undoable form of this edit, e.g.
|
boolean |
isSignificant()
DefaultDocument events are significant.
|
void |
redo()
Redoes a change.
|
String |
toString()
Returns a string description of the change event.
|
void |
undo()
Undoes a change.
|
canRedo, canUndo, die, end, isInProgress, lastEditreplaceEditpublic DefaultDocumentEvent(int offs,
int len,
DocumentEvent.EventType type)
offs - the offset into the document of the change >= 0
len - the length of the change >= 0
type - the type of event (DocumentEvent.EventType)
public StringtoString()
toString in class
CompoundEdit
public boolean addEdit(UndoableEditanEdit)
addEdit in interface
UndoableEdit
addEdit in class
CompoundEdit
anEdit - a document edit record
UndoableEdit.addEdit(javax.swing.undo.UndoableEdit)
public void redo()
throws CannotRedoException
redo in interface
UndoableEdit
redo in class
CompoundEdit
CannotRedoException - if the change cannot be redone
AbstractUndoableEdit.canRedo()
public void undo()
throws CannotUndoException
undo in interface
UndoableEdit
undo in class
CompoundEdit
CannotUndoException - if the change cannot be undone
AbstractUndoableEdit.canUndo()
public boolean isSignificant()
isSignificant in interface
UndoableEdit
isSignificant in class
CompoundEdit
UndoableEdit.isSignificant()
public StringgetPresentationName()
getPresentationName in interface
UndoableEdit
getPresentationName in class
CompoundEdit
AbstractUndoableEdit.getUndoPresentationName() ,
AbstractUndoableEdit.getRedoPresentationName()
public StringgetUndoPresentationName()
getUndoPresentationName in interface
UndoableEdit
getUndoPresentationName in class
CompoundEdit
AbstractUndoableEdit.getPresentationName()
public StringgetRedoPresentationName()
getRedoPresentationName in interface
UndoableEdit
getRedoPresentationName in class
CompoundEdit
AbstractUndoableEdit.getPresentationName()
public DocumentEvent.EventType getType()
getType in interface
DocumentEvent
DocumentEvent.getType()
public int getOffset()
getOffset in interface
DocumentEvent
DocumentEvent.getOffset()
public int getLength()
getLength in interface
DocumentEvent
DocumentEvent.getLength()
public DocumentgetDocument()
getDocument in interface
DocumentEvent
DocumentEvent.getDocument()
public DocumentEvent.ElementChange getChange(Element elem)
getChange in interface
DocumentEvent
elem - the element