Class FileManager


  • public class FileManager
    extends Object
    Cover for JFileChooser.

     

    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);

    • Field Detail

    • Method Detail

      • save

        public void save()
      • chooseFilenameToSave

        public String chooseFilenameToSave​(String defaultFilename)
      • chooseDirectory

        public String chooseDirectory​(String defaultDirectory)
      • chooseFilename

        @Nullable
        public String chooseFilename()
        Allow user to select file, then return the filename, in canonical form, always using '/', never '\'
        Returns:
        chosen filename in canonical form, or null if nothing chosen.
      • chooseFilename

        public String chooseFilename​(File def)
      • chooseFilename

        public String chooseFilename​(String defaultFilename)
      • chooseFiles

        public File[] chooseFiles()
      • getCurrentDirectory

        public String getCurrentDirectory()
      • setCurrentDirectory

        public void setCurrentDirectory​(String dirName)