1 /* Copyright (C) 2005-2011 Fabio Riccardi */
2 
3 package com.lightcrafts.platform;
4 
5 import com.lightcrafts.image.export.ImageExportOptions;
6 
7 import java.awt.*;
8 import java.io.File;
9 import java.io.FilenameFilter;
10 
11 public interface FileChooser {
12 
13     /**
14      * Conduct an open-file dialog.
15      * @param windowTitle The title to use for the open-file dialog, or null to
16      * get a default title.
17      * @param directory A default File for the dialog, or null to get a
18      * default directory.
19      * @param parent A Frame owner for dialog boxes, or null.
20      * @param filter Something to restrict files that will be selectable.
21      * @return A chosen File to open, or null to indicate the user cancelled.
22      */
openFile( String windowTitle, File directory, Frame parent, FilenameFilter filter )23     File openFile(
24         String windowTitle, File directory, Frame parent, FilenameFilter filter
25     );
26 
27     /**
28      * Conduct a file dialog to select a directory.
29      * @param windowTitle The title to use for the dialog, or null to
30      * get a default title.
31      * @param directory A default File for the dialog, or null to get a
32      * default directory.
33      * @param parent A Frame owner for dialog boxes, or null.
34      * @param showHidden If true, show hidden folders in the chooser.
35      * @return A chosen selected directory, or null to indicate the user
36      * cancelled.
37      */
chooseDirectory( String windowTitle, File directory, Window parent, boolean showHidden )38     File chooseDirectory(
39         String windowTitle, File directory, Window parent, boolean showHidden
40     );
41 
42     /**
43      * Conduct a save-file dialog, including warning messages for clobbering
44      * existing Files.
45      * @param windowTitle The title to use for the save-file dialog, or null
46      * to get a default title.
47      * @param file A default File for the dialog, or null to get some default
48      * default.
49      * @param parent A Frame owner for dialog boxes, or to get a dialog
50      * centered on screen.
51      * @return A chosen File to save in, or null to indicate the user
52      * cancelled.
53      */
saveFile(File file, Frame parent)54     File saveFile(File file, Frame parent);
55 
56     /**
57      * Conduct an export-file dialog, including warning messages for clobbering
58      * existing Files.
59      * @param parent A Frame owner for dialog boxes, or null.
60      * @param options Some default ImageExportOptions to use to initialize the
61      * dialog's controls.
62      * @return Some ImageExportOptions selected by the user, or null to
63      * indicate the user cancelled.
64      */
exportFile( ImageExportOptions options, Frame parent )65     ImageExportOptions exportFile( ImageExportOptions options, Frame parent );
66 }
67 /* vim:set et sw=4 ts=4: */
68