|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.utils.swing.CustomDocumentListener edu.northwestern.at.utils.swing.notepad.Notepad.MyDocumentListener
protected class Notepad.MyDocumentListener
Listens for changes to document being edited.
Constructor Summary | |
---|---|
protected |
Notepad.MyDocumentListener()
|
Method Summary | |
---|---|
protected boolean |
isRealChange(javax.swing.event.DocumentEvent e)
Check if event really does something. |
Methods inherited from class edu.northwestern.at.utils.swing.CustomDocumentListener |
---|
changedUpdate, insertUpdate, removeUpdate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Notepad.MyDocumentListener()
Method Detail |
---|
protected boolean isRealChange(javax.swing.event.DocumentEvent e)
CustomDocumentListener
isRealChange
in class CustomDocumentListener
e
- An event to check.
For some reason, the document listener can get events saying something changed, but in fact these events record no real change to the document. To prevent the document from being marked dirty unnecessarily, we check the "toString()" of the event. A bogus event returns "[]" as its toString(), while a real event will have a much lengthier toString() with information about the nature of the change, what was changed, etc.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |