Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

diva.gui
Class DefaultStoragePolicy

java.lang.Object
 extended bydiva.gui.AbstractStoragePolicy
 extended bydiva.gui.DefaultStoragePolicy
All Implemented Interfaces:
StoragePolicy

public class DefaultStoragePolicy
extends AbstractStoragePolicy

A Default storage policy that is useful for most applications. This policy is somewhat intelligent about preventing the user from doing something stupid (like closing the document without saving).

Version:
$Id: DefaultStoragePolicy.java,v 1.17 2005年07月08日 19:55:11 cxh Exp $
Author:
John Reekie, Michael Shilman

Constructor Summary
DefaultStoragePolicy()
Method Summary
boolean close(Document d)
Close the document.
javax.swing.JFileChooser getFileChooser()
Deprecated. Use getOpenFileChooser() or getSaveFileChooser()
javax.swing.JFileChooser getOpenFileChooser()
Get the open file chooser used by this storage policy.
javax.swing.JFileChooser getSaveFileChooser()
Get the save file chooser used by this storage policy.
Document open(Application app)
Open a new document.
Document open(java.io.File file, Application app)
Open a file and create a new document.
Document open(java.net.URL url, Application app)
Open a URL and create a new document.
boolean save(Document d)
Save the document.
boolean saveAs(Document d)
Save the document to a user-specified location.
Methods inherited from class diva.gui.AbstractStoragePolicy
getDirectory, setDirectory, setDirectory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

DefaultStoragePolicy

public DefaultStoragePolicy()
Method Detail

close

public boolean close(Document d)
Close the document. Forward the request to the document. Do nothing if the document is null. If the file is successfully saved and closed, then return true, otherwise return false.


getOpenFileChooser

public javax.swing.JFileChooser getOpenFileChooser()
Get the open file chooser used by this storage policy. This allows the application to set file filters on the chooser.


getFileChooser

public javax.swing.JFileChooser getFileChooser()
Deprecated. Use getOpenFileChooser() or getSaveFileChooser()

Get the open file chooser used by this storage policy.


getSaveFileChooser

public javax.swing.JFileChooser getSaveFileChooser()
Get the save file chooser used by this storage policy. This allows the application to set file filters on the chooser.


open

public Document open(Application app)
Open a new document. Open a file chooser and open the selected file using the application's document factory. Return the new document if one was created, otherwise null.


open

public Document open(java.io.File file,
 Application app)
Open a file and create a new document. Convert the file reference to canonical form in the process. Return the new document if one was created, otherwise null.


open

public Document open(java.net.URL url,
 Application app)
Open a URL and create a new document. Return the new document if one was created, otherwise null.


save

public boolean save(Document d)
Save the document. Forward the request to the document. Do nothing if the document is null. Always return true, unless an I/O exception occurred.


saveAs

public boolean saveAs(Document d)
Save the document to a user-specified location. Open a file chooser and forward the request to the document. Don't change the document's file object. Do nothing if the document is null. Return true if successful, otherwise false.


Overview Package Class Tree Deprecated Index Help
PREV CLASS NEXT CLASS FRAMES NO FRAMES All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

AltStyle によって変換されたページ (->オリジナル) /