|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectdiva.gui.AbstractDocument
public abstract class AbstractDocument
An abstract implementation of the Document interface. This class implements the common elements of the Document abstraction, and takes care of listener notification for properties.
| Field Summary | |
|---|---|
private Application |
_application
The application that owns this document |
private boolean |
_dirty
The flag that says whether the content of the document has changed since the last save. |
private boolean |
_editable
The flag that says whether the document is editable. |
private javax.swing.undo.UndoableEditSupport |
_editSupport
|
private java.io.File |
_file
The file that contains this document's data |
private java.beans.PropertyChangeSupport |
_propertyChange
The support object for property changes |
private javax.swing.undo.UndoManager |
_undoManager
The undo manager that maintains a list of edits. |
private java.net.URL |
_url
The URL that contains this document's data |
private boolean |
_writable
The flag that says whether the document is writable. |
| Constructor Summary | |
|---|---|
AbstractDocument(Application a)
Construct a document that is owned by the given application |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this document. |
void |
close()
Close the document. |
Application |
getApplication()
Get the application that this document belongs to. |
javax.swing.undo.UndoableEditSupport |
getEditSupport()
Return the undoable edit support. |
java.io.File |
getFile()
Get the file object that this document is associated with. |
java.lang.String |
getShortTitle()
Get the short title of this document. |
java.lang.String |
getTitle()
Get the title of this document. |
javax.swing.undo.UndoManager |
getUndoManager()
Return the undo manager of this document. |
java.net.URL |
getURL()
Get the URL that this document is associated with. |
boolean |
isDirty()
Test the "dirty" flag. |
boolean |
isEditable()
Test the "editable" flag. |
boolean |
isWritable()
Test the "writable" flag. |
abstract void |
open()
Open the document from its current file or URL. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this document. |
abstract void |
save()
Save the document to its current file or URL. |
abstract void |
saveAs(java.io.File file)
Save the document to the given file. |
abstract void |
saveAs(java.net.URL url)
Save the document to the given file. |
void |
setDirty(boolean flag)
Set the "dirty" flag. |
void |
setEditable(boolean flag)
Set the "editable" flag. |
void |
setFile(java.io.File file)
Set the file that this document saves itself to. |
void |
setURL(java.net.URL url)
Set the URL that this document saves itself to. |
void |
setWritable(boolean flag)
Set the "writable" flag. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private boolean _dirty
private boolean _editable
private boolean _writable
private java.beans.PropertyChangeSupport _propertyChange
private Application _application
private java.io.File _file
private java.net.URL _url
private javax.swing.undo.UndoManager _undoManager
private javax.swing.undo.UndoableEditSupport _editSupport
| Constructor Detail |
|---|
public AbstractDocument(Application a)
| Method Detail |
|---|
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener in interface Documentpublic javax.swing.undo.UndoableEditSupport getEditSupport()
getEditSupport in interface Documentpublic javax.swing.undo.UndoManager getUndoManager()
getUndoManager in interface Document
public void close()
throws java.lang.Exception
close in interface Documentjava.lang.Exception - If the close operation fails.public Application getApplication()
getApplication in interface Documentpublic java.io.File getFile()
getFile in interface DocumentgetURL()public java.lang.String getShortTitle()
getShortTitle in interface Documentpublic java.lang.String getTitle()
getTitle in interface Documentpublic java.net.URL getURL()
getURL in interface DocumentgetFile()public boolean isDirty()
isDirty in interface Documentpublic boolean isEditable()
isEditable in interface Documentpublic boolean isWritable()
isWritable in interface Document
public abstract void open()
throws java.lang.Exception
open in interface Documentjava.lang.Exception - If the close operation fails.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener in interface Document
public abstract void save()
throws java.lang.Exception
save in interface Documentjava.lang.Exception - If the save operation fails.
public abstract void saveAs(java.io.File file)
throws java.lang.Exception
saveAs in interface Documentjava.lang.Exception - If the save-as operation fails.save()
public abstract void saveAs(java.net.URL url)
throws java.lang.Exception
saveAs in interface Documentjava.lang.Exception - If the save-as operation fails.save()public void setFile(java.io.File file)
setFile in interface Documentpublic void setURL(java.net.URL url)
setURL in interface Documentpublic void setEditable(boolean flag)
setEditable in interface Documentpublic void setDirty(boolean flag)
setDirty in interface Documentpublic void setWritable(boolean flag)
setWritable in interface Document
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||