public final class NodeUpdater extends java.lang.Object implements java.awt.event.ActionListener, TextBufferListener
NodeUpdater
class is a class which
takes care of the delayed notification in the idle time after a
text buffer change occurs. This updater is responsible for tracking
the text buffer for changes, and sending a delayed notification.
This is paired with NodeObserver
to work correctly.
EDIT_BEGIN_ATTRIBUTE, EDIT_END_ATTRIBUTE, EOL_TYPE_ATTRIBUTE, MODIFIED_ATTRIBUTE, READ_ONLY_ATTRIBUTE, RELOAD_END_ATTRIBUTE, RELOAD_START_ATTRIBUTE
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
This is invoked when an action is performed.
|
void |
attributeUpdate(TextBuffer buffer,
int attribute)
Provides notification regarding a change to one of the buffer
attributes.
|
protected void |
finalize()
The finalizer is used to ensure that the observer will close
at some point.
|
static NodeUpdater |
getUpdater(Subject nodeSubject,
TextBuffer textBuffer)
Fetches an updater for the given node - all cached updaters are
stored on the list as WeakReferences so that they can be
GC'd correcty.
|
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 . |
public static NodeUpdater getUpdater(Subject nodeSubject, TextBuffer textBuffer)
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
event
- the action eventpublic void insertUpdate(TextBuffer buffer, int offset, int count, char[] insertedData)
TextBuffer
.insertUpdate
in interface TextBufferListener
buffer
- offset
- the offset where the insert took placecount
- the number of characters inserted (insertedData.length)insertedData
- the contents of the insertionpublic void removeUpdate(TextBuffer buffer, int offset, int count, char[] removedData)
TextBuffer
.removeUpdate
in interface TextBufferListener
buffer
- offset
- the offset where the removal took placecount
- the number of characters removed (removedData.length)removedData
- the contents of the removalpublic void attributeUpdate(TextBuffer buffer, int attribute)
attributeUpdate
in interface TextBufferListener
buffer
- attribute
- the attribute that changed