|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.homeunix.thecave.moss.model.AbstractDocument
public abstract class AbstractDocument
An abstract implementation of StandardDocument, which incldues some default methods. IMPORTANT: We use a weak hash map as backing for the DocumentChangeListener set. This means that you must keep a reference to the listener in each class which calls it. See addDocumentChangeListener() javadocs for more information.
| Constructor Summary | |
|---|---|
AbstractDocument()
|
|
| Method Summary | |
|---|---|
void |
addDocumentChangeListener(DocumentChangeListener listener)
Registers this listener to recieve events when the document changes. |
void |
finishBatchChange()
Turn on notification of changes again, and if the model has changed in the interim (and there are no more change events on the stack), fire an event. |
protected void |
fireDocumentChangeEvent()
|
java.io.File |
getFile()
Returns the file associated with this document |
static java.lang.String |
getGeneratedUid(java.lang.Object object)
Generate a UID string for a particular object. |
long |
getMinimumChangeEventPeriod()
Returns the minimum amount of time (in millis) between fire events. |
boolean |
isBatchChange()
Is there a batch change currently going on? |
boolean |
isChanged()
Has the document changed since the last save |
void |
removeDocumentChangeListener(DocumentChangeListener listener)
Unregisters this listener from recieving events when the document changes. |
void |
resetChanged()
The document has not been changed since the last save. |
void |
setChanged()
Indicates that the document has changed. |
void |
setFile(java.io.File file)
Sets the file associated with this document |
void |
setMinimumChangeEventPeriod(long minimumChangeEventPeriod)
Sets the minimum time (in millis) between fire events. |
void |
startBatchChange()
Turn off notification of changes to the data model, pending the start of many change operations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.homeunix.thecave.moss.model.StandardDocument |
|---|
save, saveAs |
| Constructor Detail |
|---|
public AbstractDocument()
| Method Detail |
|---|
public boolean isChanged()
isChanged in interface StandardDocumentpublic void setChanged()
setChanged in interface StandardDocumentpublic void resetChanged()
resetChanged in interface StandardDocumentpublic java.io.File getFile()
getFile in interface StandardDocumentpublic void setFile(java.io.File file)
setFile in interface StandardDocumentfile - public long getMinimumChangeEventPeriod()
public void setMinimumChangeEventPeriod(long minimumChangeEventPeriod)
minimumChangeEventPeriod - public void startBatchChange()
startBatchChange in interface StandardDocumentpublic void finishBatchChange()
finishBatchChange in interface StandardDocumentpublic boolean isBatchChange()
public void addDocumentChangeListener(DocumentChangeListener listener)
addDocumentChangeListener in interface StandardDocumentlistener - public void removeDocumentChangeListener(DocumentChangeListener listener)
removeDocumentChangeListener in interface StandardDocumentlistener - protected void fireDocumentChangeEvent()
public static java.lang.String getGeneratedUid(java.lang.Object object)
object -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||