Class NativeFileChooser


  • public class NativeFileChooser
    extends AbstractFileChooser
    File chooser based on the AWT's FileDialog implementation, which looks like more a native file chooser than the Swing implementation.
    Since:
    7578
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.awt.FileDialog fileDialog
      The instance of the fileDialog
      private javax.swing.filechooser.FileFilter fileFilter  
      private java.util.List<javax.swing.filechooser.FileFilter> fileFilters  
      private int selectionMode  
    • Constructor Summary

      Constructors 
      Constructor Description
      NativeFileChooser​(java.io.File file)
      Constructs a new NativeFileChooser.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addChoosableFileFilter​(javax.swing.filechooser.FileFilter filter)
      Adds a filter to the list of user choosable file filters.
      javax.swing.ActionMap getActionMap()
      Gets the list of action names.
      javax.swing.filechooser.FileFilter[] getChoosableFileFilters()
      Gets the list of user choosable file filters.
      java.io.File getCurrentDirectory()
      Returns the current directory.
      javax.swing.filechooser.FileFilter getFileFilter()
      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 file chooser is set to allow multiple selection.
      boolean isMultiSelectionEnabled()
      Returns true if multiple files can be selected.
      void setAcceptAllFileFilterUsed​(boolean b)
      Determines whether the AcceptAll FileFilter is used as an available choice in the choosable filter list.
      void setCurrentDirectory​(java.io.File f)
      Sets the current directory.
      void setDialogTitle​(java.lang.String title)
      Sets the string that goes in the JFileChooser window's title bar.
      void setFileFilter​(javax.swing.filechooser.FileFilter cff)
      Sets the current file filter.
      void setFileSelectionMode​(int selectionMode)
      Sets the JFileChooser to allow the user to just select files, just select directories, or select both files and directories.
      void setMultiSelectionEnabled​(boolean multiple)
      Sets the file chooser to allow multiple file selections.
      void setSelectedFile​(java.io.File file)
      Sets the selected file.
      int showOpenDialog​(java.awt.Component parent)
      Pops up an "Open File" file chooser dialog.
      int showSaveDialog​(java.awt.Component parent)
      Pops up a "Save File" file chooser dialog.
      static boolean supportsSelectionMode​(int selectionMode)
      Determines if the selection mode is suuported by the native file chooser.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait