org.homeunix.thecave.moss.model
Interface StandardDocument

All Known Subinterfaces:
Document
All Known Implementing Classes:
AbstractDocument, DocumentImpl, LanguageEditorDocument

public interface StandardDocument


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.
 java.io.File getFile()
          Returns the file associated with this document
 boolean isChanged()
           
 void removeDocumentChangeListener(DocumentChangeListener listener)
          Unregisters this listener from recieving events when the document changes.
 void resetChanged()
           
 void save()
          Save the data file to the current file (obtained by getFile()).
 void saveAs(java.io.File file)
          Prompt the user for a different file, and save the model to that file.
 void setChanged()
           
 void setFile(java.io.File file)
          Sets the file associated with this document
 void startBatchChange()
          Turn off notification of changes to the data model, pending the start of many change operations.
 

Method Detail

isChanged

boolean isChanged()

setChanged

void setChanged()

resetChanged

void resetChanged()

getFile

java.io.File getFile()
Returns the file associated with this document

Returns:

setFile

void setFile(java.io.File file)
Sets the file associated with this document

Parameters:
file -

startBatchChange

void startBatchChange()
Turn off notification of changes to the data model, pending the start of many change operations. This is implemented as a stack; you must finish each of the change operations before you are able to continue processing events.


finishBatchChange

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.


save

void save()
          throws DocumentSaveException
Save the data file to the current file (obtained by getFile()). If the current file has not yet been set, perform a saveAs().

Throws:
DocumentSaveException

saveAs

void saveAs(java.io.File file)
            throws DocumentSaveException
Prompt the user for a different file, and save the model to that file. Set the current file, for future saves.

Parameters:
file - File to save to
Throws:
DocumentSaveException

addDocumentChangeListener

void addDocumentChangeListener(DocumentChangeListener listener)
Registers this listener to recieve events when the document changes.

Parameters:
listener -

removeDocumentChangeListener

void removeDocumentChangeListener(DocumentChangeListener listener)
Unregisters this listener from recieving events when the document changes.

Parameters:
listener -