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 @ 1872
History | View | Annotate | Download (2.44 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 javax.swing.JComponent; |
12 |
import javax.swing.JFileChooser; |
13 |
import javax.swing.filechooser.FileFilter; |
14 |
|
15 |
public interface FileDialogChooser { |
16 |
|
17 |
/**
|
18 |
* Return value if approve (yes, ok) is chosen.
|
19 |
*/
|
20 |
int APPROVE_OPTION = JFileChooser.APPROVE_OPTION; |
21 |
|
22 |
/**
|
23 |
* Return value if cancel is chosen.
|
24 |
*/
|
25 |
int CANCEL_OPTION = JFileChooser.CANCEL_OPTION; |
26 |
|
27 |
/** Instruction to display only directories. */
|
28 |
int DIRECTORIES_ONLY = JFileChooser.DIRECTORIES_ONLY; |
29 |
|
30 |
/**
|
31 |
* Return value if an error occurred.
|
32 |
*/
|
33 |
int ERROR_OPTION = JFileChooser.ERROR_OPTION; |
34 |
|
35 |
/** Instruction to display both files and directories. */
|
36 |
int FILES_AND_DIRECTORIES = JFileChooser.FILES_AND_DIRECTORIES; |
37 |
|
38 |
/** Instruction to display only files. */
|
39 |
int FILES_ONLY = JFileChooser.FILES_ONLY; |
40 |
|
41 |
/**
|
42 |
* Type value indicating that the <code>FileDialogChooser</code> supports an
|
43 |
* "Open" file operation.
|
44 |
*/
|
45 |
int OPEN_DIALOG = JFileChooser.OPEN_DIALOG; |
46 |
|
47 |
/**
|
48 |
* Type value indicating that the <code>FileDialogChooser</code> supports a
|
49 |
* "Save" file operation.
|
50 |
*/
|
51 |
int SAVE_DIALOG = JFileChooser.SAVE_DIALOG; |
52 |
|
53 |
|
54 |
void setCurrentDirectory(File dir); |
55 |
|
56 |
public File getCurrentDirectory(); |
57 |
|
58 |
void setDialogTitle(String dialogTitle); |
59 |
|
60 |
void setDialogType(int dialogType); |
61 |
|
62 |
void setDragEnabled(boolean b); |
63 |
|
64 |
void setFileFilter(FileFilter filter); |
65 |
|
66 |
void setFileSelectionMode(int mode); |
67 |
|
68 |
File getSelectedFile();
|
69 |
|
70 |
/**
|
71 |
* Returns a list of selected files if the file chooser is
|
72 |
* set to allow multiple selection.
|
73 |
* @return
|
74 |
*/
|
75 |
File[] getSelectedFiles(); |
76 |
|
77 |
void setFileHidingEnabled(boolean b); |
78 |
|
79 |
void setMultiSelectionEnabled(boolean b); |
80 |
|
81 |
public boolean isMultiSelectionEnabled(); |
82 |
|
83 |
int showOpenDialog(Component parent); |
84 |
|
85 |
int showSaveDialog(Component parent); |
86 |
|
87 |
public void setAcceptAllFileFilterUsed(boolean b); |
88 |
|
89 |
public void addChoosableFileFilter(FileFilter next); |
90 |
|
91 |
public FileFilter getFileFilter(); |
92 |
|
93 |
public void setAccessory(JComponent newAccessory); |
94 |
|
95 |
public void addPropertyChangeListener(PropertyChangeListener listener); |
96 |
} |