|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TextBufferListener
The TextBufferListener
interface should be implemented by observers interested in receiving notifications of changes to the associated TextBuffer
. These change notifications provide information about each insert or removal of text into the TextBuffer
regardless of the source, or the change of one of the buffer attributes, such as the read-only mode, or EOL type.
Notifications are provided via the mutating thread causing the change to the TextBuffer
- this guarantees listeners that they will have read access for the duration of the notification.
As with notifications in the swing text package, there is no guarantee about the order of delivery of notifications to listeners, and all listeners must be notified before any further changes to the TextBuffer
. This means it is illegal for listeners to issue a change to the TextBuffer
during the notification.
Note, instead of defining a TextBufferEvent, the details about the change are passed as parameters to the listener to avoid an explicit object creation.
There are two pseudo-attributes used to notify clients that the entire contents of the TextBuffer
is being reloaded from a Reader
instance. The RELOAD_START_ATTRIBUTE
is sent as a pre-notification before the reload occurs. The RELOAD_END_ATTRIBUTE
is sent as a post-notification after the reload has finished. This allows editor implementations to distinguish regular text buffer edits from text buffer reloads. The TextBuffer
implementations are required to guarantee that these two psuedo-attributes will be fired as a pair (i.e., will not be missing the END attribute).
Field Summary | |
---|---|
static int |
EDIT_BEGIN_ATTRIBUTE Public (pseudo-attribute) constant used as notification to clients that TextBuffer.beginEdit( ) has been invoked to begin a compound edit. |
static int |
EDIT_END_ATTRIBUTE Public (pseudo-attribute) constant used as notification to clients that TextBuffer.endEdit( ) has been invoked to end a compound edit. |
static int |
EOL_TYPE_ATTRIBUTE Public constant for the attribute for EOL type. |
static int |
MODIFIED_ATTRIBUTE Public constant for the attribute for the modified state. |
static int |
READ_ONLY_ATTRIBUTE Public constant for the attribute for read-only mode. |
static int |
RELOAD_END_ATTRIBUTE Public (pseudo-attribute) constant used as a post-notification to clients that the TextBuffer.read( Reader ) has been completed, and that the contents of the buffer have already been replaced. |
static int |
RELOAD_START_ATTRIBUTE Public (pseudo-attribute) constant used as a pre-notification to clients that the TextBuffer.read( Reader ) has been invoked, and that the contents of the buffer are about to be reloaded. |
Method Summary | |
---|---|
void |
attributeUpdate(TextBuffer buffer, int attribute) Provides notification regarding a change to one of the buffer attributes. |
void |
insertUpdate(TextBuffer buffer, int offset, int count, char[] insertedData) Provides notification about an insertion into the TextBuffer . |
void |
removeUpdate(TextBuffer buffer, int offset, int count, char[] removedData) Provides notification about a removal from the TextBuffer . |
Field Detail |
---|
static final int EOL_TYPE_ATTRIBUTE
attributeUpdate()
to report a change to the EOL type.
static final int READ_ONLY_ATTRIBUTE
attributeUpdate()
to report a change to the read-only mode.
static final int RELOAD_START_ATTRIBUTE
TextBuffer.read( Reader )
has been invoked, and that the contents of the buffer are about to be reloaded.
static final int RELOAD_END_ATTRIBUTE
TextBuffer.read( Reader )
has been completed, and that the contents of the buffer have already been replaced.
static final int MODIFIED_ATTRIBUTE
attributeUpdate()
to report a change in the modified state of the buffer.
static final int EDIT_BEGIN_ATTRIBUTE
TextBuffer.beginEdit( )
has been invoked to begin a compound edit.
static final int EDIT_END_ATTRIBUTE
TextBuffer.endEdit( )
has been invoked to end a compound edit.
Method Detail |
---|
void insertUpdate(TextBuffer buffer, int offset, int count, char[] insertedData)
TextBuffer
.buffer
- the TextBuffer
that changed.offset
- the offset where the insert took placecount
- the number of characters inserted (insertedData.length)insertedData
- an array of the removed characters.void removeUpdate(TextBuffer buffer, int offset, int count, char[] removedData)
TextBuffer
.buffer
- the TextBuffer
that changed.offset
- the offset of the first removed character.count
- the number of characters removed (removedData.length)removedData
- an array of the removed charactersvoid attributeUpdate(TextBuffer buffer, int attribute)
buffer
- the TextBuffer
that changed.attribute
- the attribute that changed
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |