Statistics
| Revision:

gvsig-tools / org.gvsig.tools / library / trunk / org.gvsig.tools / org.gvsig.tools.util / org.gvsig.tools.util.api / src / main / java / org / gvsig / filedialogchooser / FileDialogChooser.java @ 3079

History | View | Annotate | Download (2.62 KB)

1
/*
2
 * To change this license header, choose License Headers in Project Properties.
3
 * To change this template file, choose Tools | Templates
4
 * and open the template in the editor.
5
 */
6
package org.gvsig.filedialogchooser;
7

    
8
import java.awt.Component;
9
import java.beans.PropertyChangeListener;
10
import java.io.File;
11
import java.nio.charset.Charset;
12
import javax.swing.JComponent;
13
import javax.swing.JFileChooser;
14
import javax.swing.filechooser.FileFilter;
15

    
16
public interface FileDialogChooser {
17

    
18
    /**
19
     * Return value if approve (yes, ok) is chosen.
20
     */
21
    int APPROVE_OPTION = JFileChooser.APPROVE_OPTION;
22
    
23
    /**
24
     * Return value if cancel is chosen.
25
     */
26
    int CANCEL_OPTION = JFileChooser.CANCEL_OPTION;
27

    
28
    /** Instruction to display only directories. */
29
    int DIRECTORIES_ONLY = JFileChooser.DIRECTORIES_ONLY;
30

    
31
    /**
32
     * Return value if an error occurred.
33
     */
34
    int ERROR_OPTION = JFileChooser.ERROR_OPTION;
35

    
36
    /** Instruction to display both files and directories. */
37
    int FILES_AND_DIRECTORIES = JFileChooser.FILES_AND_DIRECTORIES;
38

    
39
    /** Instruction to display only files. */
40
    int FILES_ONLY = JFileChooser.FILES_ONLY;
41

    
42
    /**
43
     * Type value indicating that the <code>FileDialogChooser</code> supports an
44
     * "Open" file operation.
45
     */
46
    int OPEN_DIALOG = JFileChooser.OPEN_DIALOG;
47
    
48
    /**
49
     * Type value indicating that the <code>FileDialogChooser</code> supports a
50
     * "Save" file operation.
51
     */
52
    int SAVE_DIALOG = JFileChooser.SAVE_DIALOG;
53

    
54

    
55
    void setCurrentDirectory(File dir);
56

    
57
    public File getCurrentDirectory();
58

    
59
    void setDialogTitle(String dialogTitle);
60

    
61
    void setDialogType(int dialogType);
62

    
63
    void setDragEnabled(boolean b);
64

    
65
    void setFileFilter(FileFilter filter);
66

    
67
    void setFileSelectionMode(int mode);
68

    
69
    File getSelectedFile();
70

    
71
    /**
72
     * Returns a list of selected files if the file chooser is
73
     * set to allow multiple selection.
74
     * @return 
75
     */
76
    File[] getSelectedFiles();
77

    
78
    void setFileHidingEnabled(boolean b);
79

    
80
    void setMultiSelectionEnabled(boolean b);
81

    
82
    public boolean isMultiSelectionEnabled();
83

    
84
    int showOpenDialog(Component parent);
85

    
86
    int showSaveDialog(Component parent);
87

    
88
    int showSaveDialog(Component parent, File folder);
89

    
90
    public void setAcceptAllFileFilterUsed(boolean b);
91

    
92
    public void addChoosableFileFilter(FileFilter next);
93

    
94
    public FileFilter getFileFilter();
95

    
96
    public void setAccessory(JComponent newAccessory);
97

    
98
    public void addPropertyChangeListener(PropertyChangeListener listener);
99
    
100
    public void setVisibleCharsetPicker(boolean b);
101
    
102
    public Charset getCharset();
103
}