Package diva.gui

Examples of diva.gui.DefaultStoragePolicy


    /** Initialize the application.
     */
    public void initializeApp() {
        // Create and initialize the storage policy
        try {
            DefaultStoragePolicy storage = new DefaultStoragePolicy();
            setStoragePolicy(storage);

            FileFilter ff = new FileFilter() {
                public boolean accept(File file) {
                    return GUIUtilities.getFileExtension(file).toLowerCase()
                            .equals("txt");
                }

                public String getDescription() {
                    return "Text files";
                }
            };

            JFileChooser fc;
            fc = storage.getOpenFileChooser();
            fc.addChoosableFileFilter(ff);
            fc.setFileFilter(ff);

            fc = storage.getSaveFileChooser();
            fc.addChoosableFileFilter(ff);
            fc.setFileFilter(ff);
        } catch (SecurityException ex) {
            // FIXME: create a new "NoStoragePolicy"
        }
View Full Code Here


    /** Initialize the application.
     */
    public void initializeApp() {
        // Create and initialize the storage policy
        try {
            DefaultStoragePolicy storage = new DefaultStoragePolicy();
            setStoragePolicy(storage);

            FileFilter ff = new FileFilter() {
                public boolean accept(File file) {
                    return GUIUtilities.getFileExtension(file).toLowerCase()
                            .equals("txt");
                }

                public String getDescription() {
                    return "Text files";
                }
            };

            JFileChooser fc;
            fc = storage.getOpenFileChooser();
            fc.addChoosableFileFilter(ff);
            fc.setFileFilter(ff);

            fc = storage.getSaveFileChooser();
            fc.addChoosableFileFilter(ff);
            fc.setFileFilter(ff);
        } catch (SecurityException ex) {
            // FIXME: create a new "NoStoragePolicy"
        }
View Full Code Here

TOP

Related Classes of diva.gui.DefaultStoragePolicy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.