public class FileManager
extends java.lang.Object
javax.swing.filechooser.FileFilter[] filters = new javax.swing.filechooser.FileFilter[2]; filters[0] = new FileManager.HDF5ExtFilter(); filters[1] = new FileManager.NetcdfExtFilter(); fileChooser = new FileManager(parentFrame, null, filters, (PreferencesExt) prefs.node("FileManager")); AbstractAction fileAction = new AbstractAction() { public void actionPerformed(ActionEvent e) { String filename = fileChooser.chooseFilename(); if (filename == null) return; process(filename); } }; BAMutil.setActionProperties( fileAction, "FileChooser", "open Local dataset...", false, 'L', -1);
Modifier and Type | Class and Description |
---|---|
static class |
FileManager.ExtFilter |
static class |
FileManager.HDF5ExtFilter |
static class |
FileManager.NetcdfExtFilter |
static class |
FileManager.XMLExtFilter |
Modifier and Type | Field and Description |
---|---|
protected javax.swing.JPanel |
main |
Constructor and Description |
---|
FileManager(javax.swing.JFrame parent) |
FileManager(javax.swing.JFrame parent,
java.lang.String defDir) |
FileManager(javax.swing.JFrame parent,
java.lang.String defDir,
javax.swing.filechooser.FileFilter[] filters,
PreferencesExt prefs) |
FileManager(javax.swing.JFrame parent,
java.lang.String defDir,
java.lang.String file_extension,
java.lang.String desc,
PreferencesExt prefs) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
chooseDirectory(java.lang.String defaultDirectory) |
java.lang.String |
chooseFilename()
Allow user to select file, then return the filename, in canonical form,
always using '/', never '\'
|
java.lang.String |
chooseFilename(java.io.File def) |
java.lang.String |
chooseFilename(java.lang.String defaultFilename) |
java.lang.String |
chooseFilenameToSave(java.lang.String defaultFilename) |
java.io.File[] |
chooseFiles() |
java.lang.String |
getCurrentDirectory() |
javax.swing.JFileChooser |
getFileChooser() |
static void |
main(java.lang.String[] args) |
void |
save() |
void |
setCurrentDirectory(java.lang.String dirName) |
public FileManager(javax.swing.JFrame parent)
public FileManager(javax.swing.JFrame parent, java.lang.String defDir)
public FileManager(javax.swing.JFrame parent, java.lang.String defDir, java.lang.String file_extension, java.lang.String desc, PreferencesExt prefs)
public FileManager(javax.swing.JFrame parent, java.lang.String defDir, javax.swing.filechooser.FileFilter[] filters, PreferencesExt prefs)
public void save()
public javax.swing.JFileChooser getFileChooser()
public java.lang.String chooseFilenameToSave(java.lang.String defaultFilename)
public java.lang.String chooseDirectory(java.lang.String defaultDirectory)
public java.lang.String chooseFilename()
public java.lang.String chooseFilename(java.io.File def)
public java.lang.String chooseFilename(java.lang.String defaultFilename)
public java.io.File[] chooseFiles()
public java.lang.String getCurrentDirectory()
public void setCurrentDirectory(java.lang.String dirName)
public static void main(java.lang.String[] args) throws java.io.IOException
java.io.IOException