public abstract class AbstractDocument extends java.lang.Object implements Document
Constructor and Description |
---|
AbstractDocument(Application a)
Construct a document that is owned by the given application
|
Modifier and Type | Method and Description |
---|---|
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.
|
public AbstractDocument(Application a)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface Document
public javax.swing.undo.UndoableEditSupport getEditSupport()
getEditSupport
in interface Document
public javax.swing.undo.UndoManager getUndoManager()
getUndoManager
in interface Document
public void close() throws java.lang.Exception
public Application getApplication()
getApplication
in interface Document
public java.io.File getFile()
public java.lang.String getShortTitle()
getShortTitle
in interface Document
public java.lang.String getTitle()
public java.net.URL getURL()
public boolean isDirty()
public boolean isEditable()
isEditable
in interface Document
public boolean isWritable()
isWritable
in interface Document
public abstract void open() throws java.lang.Exception
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface Document
public abstract void save() throws java.lang.Exception
public abstract void saveAs(java.io.File file) throws java.lang.Exception
public abstract void saveAs(java.net.URL url) throws java.lang.Exception
public void setFile(java.io.File file)
public void setURL(java.net.URL url)
public void setEditable(boolean flag)
setEditable
in interface Document
public void setDirty(boolean flag)
public void setWritable(boolean flag)
setWritable
in interface Document