public class BufferChangedEvent extends EventObject
IBufferChangedListener notifications.
For text insertions, getOffset is the offset
of the first inserted character, getText is the
inserted text, and getLength is 0.
For text removals, getOffset is the offset
of the first removed character, getText is null,
and getLength is the length of the text that was removed.
For replacements (including IBuffer.setContents),
getOffset is the offset
of the first replaced character, getText is the replacement
text, and getLength is the length of the original text
that was replaced.
When a buffer is closed, getOffset is 0, getLength
is 0, and getText is null.
This class is not intended to be instantiated or subclassed by clients. Instances of this class are automatically created by the Java model.
IBuffer,
Serialized Formsource| Constructor and Description |
|---|
BufferChangedEvent(IBuffer buffer,
int offset,
int length,
String text)
Creates a new buffer changed event indicating that the given buffer has changed.
|
| Modifier and Type | Method and Description |
|---|---|
IBuffer |
getBuffer()
Returns the buffer which has changed.
|
int |
getLength()
Returns the length of text removed or replaced in the buffer, or
0 if text has been inserted into the buffer.
|
int |
getOffset()
Returns the index of the first character inserted, removed, or replaced
in the buffer.
|
String |
getText()
Returns the text that was inserted, the replacement text,
or
null if text has been removed. |
getSource, toStringpublic IBuffer getBuffer()
public int getLength()
0 in case of insertion).public int getOffset()
public String getText()
null if text has been removed. null
in case of deletion).Copyright (c) IBM Corp. and others 2000, 2006. All Rights Reserved.