|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.cburch.editor.DirtyTracker
public class DirtyTracker
Tracks whether there have been any changes to a document.
Field Summary | |
---|---|
static java.lang.String |
isDirtyProperty
The property associated with the dirtiness currently tracked. |
Constructor Summary | |
---|---|
DirtyTracker(javax.swing.text.Document document)
Constructs a tracker to determine when the document has changed. |
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
|
boolean |
isDirty()
Returns true if the document has changed
since setDirty(false) was last called. |
boolean |
isEnabled()
Returns true if this tracker is currently
enabled. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
|
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
|
void |
setDirty(boolean value)
Sets the "dirtiness" state we use for the document. |
void |
setDocument(javax.swing.text.Document value)
Sets the document that we are tracking. |
void |
setEnabled(boolean value)
Enables or disables the tracking. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String isDirtyProperty
Constructor Detail |
---|
public DirtyTracker(javax.swing.text.Document document)
document
- the document we are to track.Method Detail |
---|
public boolean isDirty()
true
if the document has changed
since setDirty(false)
was last called.
true
if the document has changed.public void setDirty(boolean value)
false
(perhaps when the user has saved the text).
value
- the value to assign to the "dirtiness"public void setDocument(javax.swing.text.Document value)
value
- the document to track.public boolean isEnabled()
true
if this tracker is currently
enabled. It is enabled by default.
true
if the tracker is currently
tracking the document for changes.public void setEnabled(boolean value)
value
- true
to enable this tracker,
false
to disable it.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |