|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdip.misc.XJFileChooser
A simplified and extended JFileChooser for single-file (only!) selections. It is also cached, so that it displays faster.
SimpleFileFilter support is integrated, so that file extensions are automatically appended (unless "all files" is selected).
Futhermore, if saving a file, checking is done to determine if a file will be overwritten; if so, a confirmation dialog is displayed.
Method Summary | |
void |
addFileFilter(SimpleFileFilter filter)
Adds a SimpleFileFilter to the list of available file filters. |
java.io.File |
display(java.awt.Component parent,
java.lang.String title,
java.lang.String acceptButtonText,
int type,
int mode)
Display the file chooser, with the given title and Accept button text. |
java.io.File |
displayOpen(java.awt.Component parent)
The typical "Open" dialog. |
java.io.File |
displayOpen(java.awt.Component parent,
java.lang.String title)
The typical "Open" dialog. |
java.io.File |
displaySave(java.awt.Component parent)
The typical "Save" dialog. |
java.io.File |
displaySave(java.awt.Component parent,
java.lang.String title)
The typical "Save" dialog. |
java.io.File |
displaySaveAs(java.awt.Component parent)
The typical "Save As" dialog. |
java.io.File |
displaySelectDir(java.awt.Component parent,
java.lang.String title)
Display a filechooser that only allows the selection of a single directory. |
static void |
dispose()
Disposes the in-use XJFileChooser. |
static XJFileChooser |
getXJFileChooser()
Gets the XJFileChooser (only one exists -- this must be enforced by you!). |
static void |
init()
Can be used to initialize the XJFileChooser when called to provide faster response later |
void |
setCurrentDirectory(java.io.File file)
Set the current directory. |
void |
setFileFilter(SimpleFileFilter filter)
Sets the default file filter. |
void |
setSelectedFile(java.io.File file)
Sets the suggested file name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void init()
public static XJFileChooser getXJFileChooser()
The file filters are reset when this is called, which means that (usually) only the AcceptAll file filter (which is not a SimpleFileFilter) remains.
public static void dispose()
public void addFileFilter(SimpleFileFilter filter)
public void setFileFilter(SimpleFileFilter filter)
public void setCurrentDirectory(java.io.File file)
public void setSelectedFile(java.io.File file)
public java.io.File display(java.awt.Component parent, java.lang.String title, java.lang.String acceptButtonText, int type, int mode)
public java.io.File displayOpen(java.awt.Component parent)
public java.io.File displayOpen(java.awt.Component parent, java.lang.String title)
public java.io.File displaySave(java.awt.Component parent)
public java.io.File displaySave(java.awt.Component parent, java.lang.String title)
public java.io.File displaySaveAs(java.awt.Component parent)
public java.io.File displaySelectDir(java.awt.Component parent, java.lang.String title)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |