Package org.aspectj.org.eclipse.jdt.core
Klasse BufferChangedEvent
java.lang.Object
java.util.EventObject
org.aspectj.org.eclipse.jdt.core.BufferChangedEvent
- Alle implementierten Schnittstellen:
Serializable
A buffer changed event describes how a buffer has changed. These events are
used in
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
.
- Siehe auch:
-
Feldübersicht
Von Klasse geerbte Felder java.util.EventObject
source
-
Konstruktorübersicht
KonstruktorBeschreibungBufferChangedEvent
(IBuffer buffer, int offset, int length, String text) Creates a new buffer changed event indicating that the given buffer has changed. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungReturns the buffer which has changed.int
Returns the length of text removed or replaced in the buffer, or 0 if text has been inserted into the buffer.int
Returns the index of the first character inserted, removed, or replaced in the buffer.getText()
Returns the text that was inserted, the replacement text, ornull
if text has been removed.Von Klasse geerbte Methoden java.util.EventObject
getSource, toString
-
Konstruktordetails
-
BufferChangedEvent
Creates a new buffer changed event indicating that the given buffer has changed.- Parameter:
buffer
- the given bufferoffset
- the given offsetlength
- the given lengthtext
- the given text
-
-
Methodendetails
-
getBuffer
Returns the buffer which has changed.- Gibt zurück:
- the buffer affected by the change
-
getLength
public int getLength()Returns the length of text removed or replaced in the buffer, or 0 if text has been inserted into the buffer.- Gibt zurück:
- the length of the original text fragment modified by the
buffer change (
0
in case of insertion).
-
getOffset
public int getOffset()Returns the index of the first character inserted, removed, or replaced in the buffer.- Gibt zurück:
- the source offset of the textual manipulation in the buffer
-
getText
Returns the text that was inserted, the replacement text, ornull
if text has been removed.- Gibt zurück:
- the text corresponding to the buffer change (
null
in case of deletion).
-