public class SFileChooser
extends java.lang.Object
Constructor and Description |
---|
SFileChooser(java.lang.String currentDirectory,
java.lang.String description)
Creates file chooser dialog.
|
SFileChooser(java.lang.String currentDirectory,
java.lang.String description,
java.lang.String extension)
Creates the file chooser dialog.
|
Modifier and Type | Method and Description |
---|---|
void |
addExtension(java.lang.String extension)
Adds an extension with the default description to the filenamefilter.
|
void |
addExtension(java.lang.String description,
java.lang.String extension)
Adds an extension with the provided description to the filenamefilter.
|
boolean |
confirmOverwrite(java.io.File file)
Ask user whether to overwrite the give existing file.
|
java.lang.String |
getCurrentLocation()
Returns the directory this chooser is in.
|
static java.lang.String |
getExtension(java.io.File theFile)
Returns all the characters after the last period in the file name.
|
static java.lang.String |
getExtension(java.lang.String fileName)
Returns all the characters after the last period in the file name.
|
void |
setUseImagePreview(boolean useViewer)
Sets the file chooser to use image preview viewer.
|
java.io.File |
showOpenDialog()
Shows dialog for opening files.
|
java.io.File |
showSaveDialog()
Shows the save dialog.
|
java.io.File |
showSaveDialog(java.io.File file)
Shows dialog for saving files.
|
java.io.File |
showSaveDialog(java.lang.String file)
Shows the save dialog for the given string name.
|
public SFileChooser(java.lang.String currentDirectory, java.lang.String description)
currentDirectory
- Open and save directorydescription
- the description for the full set of extensionspublic SFileChooser(java.lang.String currentDirectory, java.lang.String description, java.lang.String extension)
currentDirectory
- Open and save directorydescription
- a description of the extensionextension
- File type extension for open and savepublic void addExtension(java.lang.String description, java.lang.String extension)
extension
- the extensiondescription
- the descriptionpublic void addExtension(java.lang.String extension)
extension
- the extension to addpublic java.io.File showOpenDialog()
public java.io.File showSaveDialog(java.io.File file)
file
- public boolean confirmOverwrite(java.io.File file)
file
- the file in questionpublic java.io.File showSaveDialog(java.lang.String file)
file
- the name of the filepublic java.io.File showSaveDialog()
public static java.lang.String getExtension(java.io.File theFile)
theFile
- the filepublic static java.lang.String getExtension(java.lang.String fileName)
fileName
- the file's namepublic java.lang.String getCurrentLocation()
public void setUseImagePreview(boolean useViewer)
useViewer
- use image preview viewer.