public final class TextEvent extends DocumentEvent
DocumentEvent.Type
source, type
Constructor and Description |
---|
TextEvent()
Constructs an event intended to be used several times with different
field values.
|
TextEvent(Object source,
DocumentEvent.Type type,
int offset,
String oldString,
String newString)
Contructs an event.
|
Modifier and Type | Method and Description |
---|---|
String |
getNewString()
Returns deleted or replaced string or
null if a string has
been inserted. |
int |
getOffset()
Returns index (within text node) of first character of
newString if a string has been inserted or replaced or index
of first character of oldString if a string has been deleted.
|
String |
getOldString()
Returns deleted or replaced string or
null if a string has
been inserted. |
TextNode |
getTextSource()
Returns the text node which has been modified.
|
void |
initialize(Object source,
DocumentEvent.Type type,
int offset,
String oldString,
String newString)
Initializes this event.
|
String |
toString()
Returns a string representation of this event which can be
used when debugging.
|
copy, getSource, getType, initialize
public TextEvent()
initialize(java.lang.Object, com.xmlmind.xml.doc.DocumentEvent.Type, int, java.lang.String, java.lang.String)
to initialize its fields.public TextEvent(Object source, DocumentEvent.Type type, int offset, String oldString, String newString)
source
- the modified text nodetype
- the type of the eventoffset
- index (within text node) of first character of
newString if a string has been inserted or replaced or index
of first character of oldString if a string has been deletedoldString
- deleted or replaced string or null
if a
string has been insertednewString
- inserted or replacement string or null
if
a string has been deletedpublic void initialize(Object source, DocumentEvent.Type type, int offset, String oldString, String newString)
source
- the modified text nodetype
- the type of the eventpublic TextNode getTextSource()
public int getOffset()
public String getOldString()
null
if a string has
been inserted.public String getNewString()
null
if a string has
been inserted.public String toString()
DocumentEvent
toString
in class DocumentEvent