public abstract class AbstractTextSource extends Object implements TextSource
TextSource
implementation that adds TextSource.Listener
and isDirty()
support. See setClean()
for important subclass responsibilities.TextSource.Factory, TextSource.Listener
Constructor and Description |
---|
AbstractTextSource() |
Modifier and Type | Method and Description |
---|---|
void |
addListener(TextSource.Listener listener)
Listener registration.
|
boolean |
isDirty()
Return whether the text has changed since the last call to
TextSource.getText() or TextSource.setText(java.lang.String) . |
protected void |
setChanged()
Used by subclasses to mark that the
TextSource has
changed. |
protected void |
setClean()
Used by subclasses to mark that the
TextSource is
clean. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getText, setText
public boolean isDirty()
TextSource.getText()
or TextSource.setText(java.lang.String)
.isDirty
in interface TextSource
true
=> the text has changed.protected final void setClean()
TextSource
is
clean. Subclasses should call setClean()
in their
TextSource.setText(java.lang.String)
and TextSource.getText()
implementations.protected final void setChanged()
TextSource
has
changed.public void addListener(TextSource.Listener listener)
addListener
in interface TextSource
listener
- The listener.Copyright © 2000-2014. All Rights Reserved.