| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
IdeFileChooser provides a simple mechanism for the user to chooser a file.
| Method Summary | |
void | addChoosableFileFilter(FileFilter filter)Adds a filter to the list of user choosable file filters. |
FileFilter | getAcceptAllFileFilter()Returns the AcceptAll file filter. |
String | getApproveButtonText()Returns the text used in the ApproveButton in the FileChooserUI. |
FileFilter[] | getChoosableFileFilters()Gets the list of the file filters that can be chosen by the user. |
File | getCurrentDirectory()Returns the current directory. |
String | getDialogTitle()Gets the string displayed in the FileChooser's titlebar. |
int | getDialogType()Returns the type of this dialog. |
FileFilter | getFileFilter()Returns the currently selected file filter. |
int | getFileSelectionMode()Returns the current file-selection mode. |
File | getSelectedFile()Returns the selected file. |
boolean | removeChoosableFileFilter(FileFilter f)Removes specified filter from the list of user choosable file filters. |
void | resetChoosableFileFilters()Resets the choosable file filter list to it's initial state. |
void | setApproveButtonText(String approveButtonText)Sets specified text for the ApproveButton in the FileChooserUI. |
void | setCurrentDirectory(File dir)Sets the current directory. |
void | setDialogTitle(String dialogTitle)Sets specified string to be displayed in the FileChooser window's title bar. |
void | setDialogType(int dialogType)Sets the type of this dialog. |
void | setFileFilter(FileFilter filter)Sets the current File Filter. |
void | setFileSelectionMode(int mode)Sets the FileChooser to allow the user to select only files, to select only directories, or to select both files and directetories. |
void | setSelectedFile(File selectedFile)Sets the selected file. |
int | showDialog(Component parent)Displays the file chooser dialog. |
| Method Detail |
public void addChoosableFileFilter(FileFilter filter)
FileFilter to be added to the choosable file
filter listpublic FileFilter getAcceptAllFileFilter()
FileFilter AcceptAllpublic String getApproveButtonText()
null, the UI object will determine the button's text.
Typically, this would be "Open" or "Save".String text used in the ApproveButtonpublic FileFilter[] getChoosableFileFilters()
FileFilter[] array containing all the choosable
file filterspublic File getCurrentDirectory()
public String getDialogTitle()
String title of the file chooserpublic int getDialogType()
int identifier of the dialog type:
OPEN_DIALOG, SAVE_DIALOG, CUSTOM_DIALOGpublic FileFilter getFileFilter()
FileFilter object representing the current file filter.public int getFileSelectionMode()
int indicating the type of dialog to be displayed:
FILES_ONLY, DIRECTORIES_ONLY, FILES_AND_DIRECTORIESpublic File getSelectedFile()
public boolean removeChoosableFileFilter(FileFilter f)
true if the file filter was successfully deleted.FileFilter - to be deletedtrue if this filter is successfully deletedpublic void resetChoosableFileFilters()
public void setApproveButtonText(String approveButtonText)
String text used in the ApproveButtonpublic void setCurrentDirectory(File dir)
null sets the filechooser
to point to the users's home directory.
If the file passed in as dir is not a directory, the
parent of this file will be used as the current directory. If the
parent is not traversable, then it will walk up the parent tree
until it finds a traversable directory, or hits the root of the
file system.
File object representing the current directory to point topublic void setDialogTitle(String dialogTitle)
String title of the dialogpublic void setDialogType(int dialogType)
int type of the dialog to be displayed:
OPEN_DIALOG, SAVE_DIALOG, CUSTOM_DIALOGpublic void setFileFilter(FileFilter filter)
public void setFileSelectionMode(int mode)
int type of dialog to be displayed:
FILES_ONLY, DIRECTORIES_ONLY, FILES_AND_DIRECTORIESpublic void setSelectedFile(File selectedFile)
public int showDialog(Component parent)
Component is not
null, the frame of the Component is used as
the parent frame for the dialog box.Component descendant used to determine the parent of the dialog box.int state of the filechooser on popdown:
CANCEL_OPTION, APPROVE_OPTION
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||