|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.ui.framework.java.FileChooserDialog
This interface provides a simple mechanism for the user to choose a file to open or choose a file to save. A default start directory, default file, and multiple file selection is supported.
Restrictions:
Field Summary | |
static int |
CANCEL_OPTION
Return value if cancel is chosen. |
static int |
COMMIT_OPTION
Return value if commit (yes, ok) is chosen. |
static int |
DIRECTORIES_ONLY
Instruction to display only directories. |
static int |
FILES_AND_DIRECTORIES
Instruction to display both files and directories. |
static int |
FILES_ONLY
Instruction to display only files. |
Constructor Summary | |
FileChooserDialog()
Creates a FileChooserDialog pointing to the user's home directory. |
|
FileChooserDialog(java.io.File file)
Creates a FileChooserDialog using the given File as the path. |
|
FileChooserDialog(java.lang.String currentDirectoryPath)
Creates a FileChooserDialog using the given path. |
Method Summary | |
void |
addFilter(java.lang.String[] extensions,
java.lang.String description)
Adds a file Filter to the FileChooserDialog |
java.io.File |
getCurrentDirectory()
Returns the current directory. |
java.lang.String |
getDialogTitle()
Gets the string that goes in the FileChooserDialog's titlebar. |
java.lang.String[] |
getFilter()
Returns the currently selected file filter. |
java.io.File |
getSelectedFile()
Returns the selected file. |
java.io.File[] |
getSelectedFiles()
Returns a list of selected files if the filechooser is set to allow multi-selection. |
int |
getSelectionMode()
Returns the current file-selection mode. |
boolean |
isMultiSelectionEnabled()
Returns true if multiple files can be selected. |
void |
removeAcceptAllFilter()
Removes the Accept All filter (*.*) from this FileChooserDialog |
void |
setCurrentDirectory(java.io.File currentDirectory)
Sets the current directory. |
void |
setDialogTitle(java.lang.String dialogTitle)
Sets the string that goes in the FileChooserDialog's titlebar. |
void |
setFilter(java.lang.String[] extensions)
Sets the current file filter. |
void |
setMultiSelectionEnabled(boolean b)
Sets the filechooser to allow multiple file selections. |
void |
setSelectedFile(java.io.File file)
Sets the selected file. |
void |
setSelectedFiles(java.io.File[] files)
Sets the list of selected files if the filechooser is set to allow multi-selection. |
void |
setSelectionMode(int mode)
Sets the FileChooserDialog to allow the user to just select files, just select directories, or select both files and directories. |
int |
showCustomDialog(WindowManager parent,
java.lang.String commitButtonText)
Brings up a FileChooserDialog with custom text on the CommitButton. |
int |
showOpenDialog(WindowManager parent)
Brings up an "Open" FileChooserDialog. |
int |
showSaveDialog(WindowManager parent)
Brings up a "Save" FileChooserDialog. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DIRECTORIES_ONLY
public static final int FILES_ONLY
public static final int FILES_AND_DIRECTORIES
public static final int COMMIT_OPTION
public static final int CANCEL_OPTION
Constructor Detail |
public FileChooserDialog()
public FileChooserDialog(java.lang.String currentDirectoryPath)
currentDirectoryPath
- a String giving the path to a file or directorypublic FileChooserDialog(java.io.File file)
file
- a File object specifying the path to a file
or directoryMethod Detail |
public void setDialogTitle(java.lang.String dialogTitle)
dialogTitle
- The translatable String to be displayedgetDialogTitle()
public java.lang.String getDialogTitle()
setDialogTitle(java.lang.String)
public void setSelectionMode(int mode)
dialogType
- the type of dialog to be displayed:
FILES_ONLY, DIRECTORIES_ONLY, FILES_AND_DIRECTORIESgetSelectionMode()
public int getSelectionMode()
setSelectionMode(int)
public void setMultiSelectionEnabled(boolean b)
isMultiSelectionEnabled()
public boolean isMultiSelectionEnabled()
setMultiSelectionEnabled(boolean)
public void setSelectedFile(java.io.File file)
File
- the selected filegetSelectedFile()
public java.io.File getSelectedFile()
setSelectedFile(java.io.File)
public void setSelectedFiles(java.io.File[] files)
files
- An Array of files to be initially selctedpublic java.io.File[] getSelectedFiles()
public void setCurrentDirectory(java.io.File currentDirectory)
currentDirectory
- the current directory to point togetCurrentDirectory()
public java.io.File getCurrentDirectory()
setCurrentDirectory(java.io.File)
public int showOpenDialog(WindowManager parent)
parent
- the WindowManager that is the parent of this dialogpublic int showSaveDialog(WindowManager parent)
parent
- the WindowManager that is the parent of this dialogpublic int showCustomDialog(WindowManager parent, java.lang.String commitButtonText)
parent
- the WindowManager that is the parent of this dialogapproveButtonText
- the text of the ApproveButtonpublic void addFilter(java.lang.String[] extensions, java.lang.String description)
Adds a file Filter to the FileChooserDialog. The last filter added will be the initially used filter.
extensions
- An array of file extension to filter i.e. "txt", "doc"description
- A translatable description of the filterpublic java.lang.String[] getFilter()
setFilter(java.lang.String[])
,
addFilter(java.lang.String[], java.lang.String)
public void setFilter(java.lang.String[] extensions)
extensions
- the file extensions i.e. "txt" to filtergetFilter()
,
addFilter(java.lang.String[], java.lang.String)
public void removeAcceptAllFilter()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |