|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.util.FileManager
public class FileManager
Wrapper cover for JFileChooser.
| Nested Class Summary | |
|---|---|
static class |
FileManager.ExtFilter
A FileFilter extension that allows specifiying
an extension and description. |
static class |
FileManager.NetcdfExtFilter
A FileFilter extension for netCDF files. |
| Field Summary | |
|---|---|
static PatternFileFilter |
FILTER_ANIMATEDGIF
Filter for QuickTime files |
static PatternFileFilter |
FILTER_AVI
Filter for QuickTime files |
static PatternFileFilter |
FILTER_CSV
Filter for CSV files |
static PatternFileFilter |
FILTER_IMAGE
Filter for Image files |
static PatternFileFilter |
FILTER_IMAGE_OR_PDF
Filter for image or pdf files |
static PatternFileFilter |
FILTER_IMAGEWRITE
Filter for Image files for writing |
static PatternFileFilter |
FILTER_JAR
File filter used for bundle files |
static PatternFileFilter |
FILTER_JPG
Filter for JPEG files |
static PatternFileFilter |
FILTER_KMZ
Filter for kmz files |
static PatternFileFilter |
FILTER_LOG
Filter for log files |
static PatternFileFilter |
FILTER_MOV
Filter for QuickTime files |
static PatternFileFilter |
FILTER_NETCDF
Filter for netCDF files |
static PatternFileFilter |
FILTER_XLS
Filter for xls files |
static PatternFileFilter |
FILTER_XML
Filter for XML files |
static String |
NULL_BTNTEXT
null button text intrinsic |
static String |
NULL_STRING
null string intrinsic |
static String |
NULL_TITLE
null title intrinsic |
static String |
PROP_DIR_HISTORY
Property in the store for the history list |
static String |
PROP_DIRECTORY
Property in the store for the last dir |
static String |
SUFFIX_CSV
Suffix for CSV files |
static String |
SUFFIX_GIF
Suffix for JPEG files |
static String |
SUFFIX_JPG
Suffix for JPEG files |
static String |
SUFFIX_LOG
Suffix for log files |
static String |
SUFFIX_MOV
Suffix for Quicktime files |
static String |
SUFFIX_NETCDF
Suffix for log files |
static String |
SUFFIX_XLS
Suffix for CSV files |
static String |
SUFFIX_XML
Suffix for XML files |
| Constructor Summary | |
|---|---|
FileManager(Component parent)
Create a FileManager and use parent as the
parent for the dialog. |
|
FileManager(Component parent,
String defDir,
FileFilter filter)
Create a FileManager and use the specified params to configure its behavior. |
|
FileManager(Component parent,
String defDir,
FileFilter filter,
String title)
Create a FileManager and use the specified params to configure its behavior. |
|
FileManager(Component parent,
String defDir,
List filters)
Create a FileManager and use the specified params to configure its behavior. |
|
FileManager(Component parent,
String defDir,
List filters,
String title)
Create a FileManager and use the specified params to configure its behavior. |
|
FileManager(Component parent,
String defDir,
List filters,
String title,
boolean includeAllFilter)
Create a FileManager and use the specified params to configure its behavior. |
|
FileManager(Component parent,
String defDir,
String file_extension,
String desc)
Create a FileManager and use the specified params to configure its behavior. |
|
| Method Summary | |
|---|---|
static void |
addToHistory(File file)
Add the file (or its parent directory if it is not a directory) to the history list. |
String |
chooseFilename()
Choose a filename. |
String |
chooseFilename(String title)
Choose a filename and set the title in the dialog. |
String |
chooseFilename(String title,
String approveButtonText)
Choose a filename, set the title in the dialog, and set the text of the approve button on the chooser. |
String |
chooseFilename(String title,
String approveButtonText,
boolean includeUrl)
Choose a filename, set the title in the dialog, and set the text of the approve button on the chooser. |
JFileChooser |
getChooser()
Get the chooser that this FileManager wraps. |
static File |
getDirectory(String dfltDir)
Return a directory selection. |
static File |
getDirectory(String dfltDir,
String title)
Have the user select a directory |
static File |
getDirectory(String dfltDir,
String title,
JComponent accessory)
_more_ |
String |
getDirectoryName()
Get the current directory name. |
static String |
getFile(boolean forWrite,
String title,
String buttonText,
String property,
List filters,
String suffix,
boolean includeAllFilter,
JComponent accessory,
boolean includeUrl)
Get the file that this FileManager is pointing to. |
static String |
getFile(boolean forWrite,
String title,
String buttonText,
String property,
List filters,
String suffix,
boolean includeAllFilter,
JComponent accessory,
boolean includeUrl,
String dfltFile)
Get the file that this FileManager is pointing to. |
static boolean |
getFileHidingEnabled()
|
static List |
getHistoryList()
Get the history list. |
static List |
getHistoryList(ActionListener listener)
Get the history list. |
static String |
getReadFile()
Get the file that this FileManager will read from using the defaults. |
static String |
getReadFile(FileFilter filter)
Get the file that this FileManager will read from using the specified parameters to configure the widget. |
static String |
getReadFile(FileFilter filter,
boolean includeAllFilter)
Get the file that this FileManager will read from using the specified parameters to configure the widget. |
static String |
getReadFile(String title,
FileFilter filter)
Get the file that this FileManager will read from using the specified parameters to configure the widget. |
static String |
getReadFile(String title,
List filters)
Get the file that this FileManager will read from using the specified parameters to configure the widget. |
static String |
getReadFile(String title,
List filters,
JComponent accessory)
Get the file that this FileManager will read from using the specified parameters to configure the widget. |
static String |
getReadFileOrURL(String title,
List filters,
JComponent accessory)
Get the file that this FileManager will read from using the specified parameters to configure the widget. |
static String |
getWriteFile()
Get the file that this FileManager will write to using the defaults. |
static String |
getWriteFile(FileFilter filter,
String suffix)
Get the file that this FileManager will write to using the specified parameters. |
static String |
getWriteFile(FileFilter filter,
String suffix,
JComponent accessory)
Get the file that this FileManager will write to using the specified parameters. |
static String |
getWriteFile(List filters,
String suffix)
Get the file that this FileManager will write to using the specified parameters. |
static String |
getWriteFile(List filters,
String suffix,
JComponent accessory)
Get the file that this FileManager will write to using the specified parameters. |
static String |
getWriteFile(String filename)
Get the file that this FileManager will write to using the defaults. |
static String |
getWriteFile(String title,
FileFilter filter,
String suffix)
Get the file that this FileManager will write to using the specified parameters. |
static String |
getWriteFile(String title,
List filters,
String suffix)
Get the file that this FileManager will write to using the specified parameters. |
static JComponent |
makeDirectoryHistoryComponent(JFileChooser fileChooser,
boolean includeLabel)
Create the directory history button and menu |
void |
setAccessory(JComponent comp)
Set the accessory for the file chooser to comp. |
void |
setApproveButtonText(String approveButtonText)
Set the approve button text for the chooser. |
static void |
setFileHidingEnabled(boolean value)
|
void |
setSelectedFile(String file)
Set the selected file for the chooser. |
static void |
setStore(PersistentStore store,
String writeProperty,
String readProperty)
Set the persistent store for this FileManager. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String PROP_DIR_HISTORY
public static final String PROP_DIRECTORY
public static final String SUFFIX_XML
public static final String SUFFIX_CSV
public static final String SUFFIX_XLS
public static final String SUFFIX_JPG
public static final String SUFFIX_GIF
public static final String SUFFIX_MOV
public static final String SUFFIX_LOG
public static final String SUFFIX_NETCDF
public static final PatternFileFilter FILTER_XML
public static final PatternFileFilter FILTER_NETCDF
public static final PatternFileFilter FILTER_CSV
public static final PatternFileFilter FILTER_XLS
public static final PatternFileFilter FILTER_JAR
public static final PatternFileFilter FILTER_JPG
public static final PatternFileFilter FILTER_IMAGE
public static final PatternFileFilter FILTER_IMAGEWRITE
public static final PatternFileFilter FILTER_IMAGE_OR_PDF
public static final PatternFileFilter FILTER_MOV
public static final PatternFileFilter FILTER_AVI
public static final PatternFileFilter FILTER_ANIMATEDGIF
public static final PatternFileFilter FILTER_LOG
public static final PatternFileFilter FILTER_KMZ
public static final String NULL_STRING
public static final String NULL_BTNTEXT
public static final String NULL_TITLE
| Constructor Detail |
|---|
public FileManager(Component parent)
parent as the
parent for the dialog.
parent - parent component for the dialog.
public FileManager(Component parent,
String defDir,
String file_extension,
String desc)
parent - parent component for the dialog.defDir - default directory to open upfile_extension - file_extention to use for a filterdesc - description of files of type file_extension
public FileManager(Component parent,
String defDir,
FileFilter filter)
parent - parent component for the dialog.defDir - default directory to open upfilter - default FileFilter
public FileManager(Component parent,
String defDir,
FileFilter filter,
String title)
parent - parent component for the dialog.defDir - default directory to open upfilter - default FileFiltertitle - title for the dialog window
public FileManager(Component parent,
String defDir,
List filters)
parent - parent component for the dialog.defDir - default directory to open upfilters - List of default FileFilter's
public FileManager(Component parent,
String defDir,
List filters,
String title)
parent - parent component for the dialog.defDir - default directory to open upfilters - List of default FileFilter'stitle - title for the dialog window
public FileManager(Component parent,
String defDir,
List filters,
String title,
boolean includeAllFilter)
parent - parent component for the dialog.defDir - default directory to open upfilters - List of default FileFilter'stitle - title for the dialog windowincludeAllFilter - true to include the "All files" filter.| Method Detail |
|---|
public JFileChooser getChooser()
FileManager wraps.
public static boolean getFileHidingEnabled()
public static void setFileHidingEnabled(boolean value)
public void setSelectedFile(String file)
file - name of the filepublic String chooseFilename()
public String chooseFilename(String title)
title - for dialog
public String chooseFilename(String title,
String approveButtonText)
title - title for the dialog windowapproveButtonText - text for the approve button in the dialog
public String chooseFilename(String title,
String approveButtonText,
boolean includeUrl)
title - title for the dialog windowapproveButtonText - text for the approve button in the dialogincludeUrl - inclues a URL
public static List getHistoryList(ActionListener listener)
listener - Listener to notify
public static List getHistoryList()
public static void addToHistory(File file)
file - File to addpublic void setAccessory(JComponent comp)
comp.
comp - component to use for the accessory.public String getDirectoryName()
public void setApproveButtonText(String approveButtonText)
approveButtonText - text for the button.
public static void setStore(PersistentStore store,
String writeProperty,
String readProperty)
store - store for persistencewriteProperty - write propertyreadProperty - read propertypublic static File getDirectory(String dfltDir)
dfltDir -
public static File getDirectory(String dfltDir,
String title)
dfltDir - Default dirtitle - Window title
public static File getDirectory(String dfltDir,
String title,
JComponent accessory)
dfltDir - _more_title - _more_accessory - _more_
public static String getWriteFile(String filename)
filename - default file name
public static String getWriteFile()
public static String getWriteFile(List filters,
String suffix)
filters - List of file filterssuffix - default suffix
public static String getWriteFile(FileFilter filter,
String suffix)
filter - file filtersuffix - default suffix
public static String getWriteFile(FileFilter filter,
String suffix,
JComponent accessory)
filter - file filtersuffix - default suffixaccessory - accessory component
public static String getWriteFile(List filters,
String suffix,
JComponent accessory)
filters - file filterssuffix - default suffixaccessory - accessory component
public static String getWriteFile(String title,
FileFilter filter,
String suffix)
title - title for the dialog.filter - file filtersuffix - default suffix
public static String getWriteFile(String title,
List filters,
String suffix)
title - title for the dialog.filters - List of file filterssuffix - default suffix
public static String getReadFile()
public static String getReadFile(FileFilter filter)
filter - filter to use
public static String getReadFile(FileFilter filter,
boolean includeAllFilter)
filter - filter to useincludeAllFilter - true to include the "All files (*.*)" filter
public static String getReadFile(String title,
FileFilter filter)
title - title for the dialogfilter - filter to use
public static String getReadFile(String title,
List filters)
title - title for the dialogfilters - List of filters to use
public static String getReadFile(String title,
List filters,
JComponent accessory)
title - title for the dialogfilters - List of filters to useaccessory - accessory for the chooser (may be null)
public static String getReadFileOrURL(String title,
List filters,
JComponent accessory)
title - title for the dialogfilters - List of filters to useaccessory - accessory for the chooser (may be null)
public static String getFile(boolean forWrite,
String title,
String buttonText,
String property,
List filters,
String suffix,
boolean includeAllFilter,
JComponent accessory,
boolean includeUrl)
forWrite - true if this is for getting a file to write totitle - title for the dialogbuttonText - text for the approve buttonproperty - property for the storefilters - List of filters to usesuffix - default suffix for file to writeincludeAllFilter - true to include the "All files (*.*)" filteraccessory - accessory for the chooserincludeUrl - allow a URL
public static String getFile(boolean forWrite,
String title,
String buttonText,
String property,
List filters,
String suffix,
boolean includeAllFilter,
JComponent accessory,
boolean includeUrl,
String dfltFile)
forWrite - true if this is for getting a file to write totitle - title for the dialogbuttonText - text for the approve buttonproperty - property for the storefilters - List of filters to usesuffix - default suffix for file to writeincludeAllFilter - true to include the "All files (*.*)" filteraccessory - accessory for the chooserincludeUrl - allow a URLdfltFile - the default file
public static JComponent makeDirectoryHistoryComponent(JFileChooser fileChooser,
boolean includeLabel)
fileChooser - The chooser to set the dir onincludeLabel - Should the label be included in the component.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||