public class BaseDocumentEvent extends AbstractDocument.DefaultDocumentEvent
DocumentEvent.ElementChange, DocumentEvent.EventType
edits
RedoName, UndoName
Constructor and Description |
---|
BaseDocumentEvent(BaseDocument doc,
int offset,
int length,
DocumentEvent.EventType type)
Construct document event instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addEdit(UndoableEdit anEdit) |
boolean |
canMerge(BaseDocumentEvent evt)
Returns true if this event can be merged by the previous
one (given as parameter) in the undo-manager queue.
|
boolean |
canRedo()
Returns false if isInProgress or if super does.
|
boolean |
canUndo() |
void |
die() |
void |
end() |
protected UndoableEdit |
findEdit(Class editClass) |
DocumentEvent.ElementChange |
getChange(Element elem) |
AttributeSet |
getChangeAttributes()
Gets the attributes associated with the change that caused this event.
|
char[] |
getChars()
Deprecated.
|
int |
getLFCount()
Get the count of '\n' (line-feeds) contained in the inserted/removed text.
|
int |
getLine()
Deprecated.
|
String |
getRedoPresentationName() |
int |
getSyntaxUpdateOffset()
Get the offset at which the updating of the syntax stopped so there
are no more changes in the tokens after this point.
|
String |
getText()
Get the text that was inserted/removed or null
for change event.
|
String |
getUndoPresentationName() |
boolean |
isInProgress() |
boolean |
isInRedo()
Whether this event is being fired because it's being redone.
|
boolean |
isInUndo()
Whether this event is being fired because it's being undone.
|
void |
redo() |
boolean |
replaceEdit(UndoableEdit anEdit)
Try to determine whether this event can replace the old one.
|
String |
toString() |
void |
undo() |
getDocument, getLength, getOffset, getPresentationName, getType, isSignificant
lastEdit
public BaseDocumentEvent(BaseDocument doc, int offset, int length, DocumentEvent.EventType type)
offset
- position in the document where the insert/remove/change
occuredlength
- number of the characters affected by the eventtype
- type of the event - INSERT/REMOVE/CHANGEpublic final AttributeSet getChangeAttributes()
null
;AttributeSet
associated with the document
change or null
.protected UndoableEdit findEdit(Class editClass)
@Deprecated public char[] getChars()
public String getText()
@Deprecated public int getLine()
public int getLFCount()
public int getSyntaxUpdateOffset()
public boolean isInUndo()
public boolean isInRedo()
public void undo() throws CannotUndoException
undo
in interface UndoableEdit
undo
in class AbstractDocument.DefaultDocumentEvent
CannotUndoException
public void redo() throws CannotRedoException
redo
in interface UndoableEdit
redo
in class AbstractDocument.DefaultDocumentEvent
CannotRedoException
public boolean addEdit(UndoableEdit anEdit)
addEdit
in interface UndoableEdit
addEdit
in class AbstractDocument.DefaultDocumentEvent
public boolean canUndo()
canUndo
in interface UndoableEdit
canUndo
in class CompoundEdit
public boolean canRedo()
canRedo
in interface UndoableEdit
canRedo
in class CompoundEdit
BaseDocumentEvent.isInProgress()
public boolean isInProgress()
isInProgress
in class CompoundEdit
public String getUndoPresentationName()
getUndoPresentationName
in interface UndoableEdit
getUndoPresentationName
in class AbstractDocument.DefaultDocumentEvent
public String getRedoPresentationName()
getRedoPresentationName
in interface UndoableEdit
getRedoPresentationName
in class AbstractDocument.DefaultDocumentEvent
public boolean canMerge(BaseDocumentEvent evt)
public boolean replaceEdit(UndoableEdit anEdit)
replaceEdit
in interface UndoableEdit
replaceEdit
in class AbstractUndoableEdit
public void die()
die
in interface UndoableEdit
die
in class CompoundEdit
public void end()
end
in class CompoundEdit
public DocumentEvent.ElementChange getChange(Element elem)
getChange
in interface DocumentEvent
getChange
in class AbstractDocument.DefaultDocumentEvent
public String toString()
toString
in class AbstractDocument.DefaultDocumentEvent