Class SnapFileChooser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
ProductFileChooser

public class SnapFileChooser extends JFileChooser
The general SNAP file chooser.
See Also:
  • Constructor Details

    • SnapFileChooser

      public SnapFileChooser()
    • SnapFileChooser

      public SnapFileChooser(FileSystemView fsv)
    • SnapFileChooser

      public SnapFileChooser(File currentDirectory)
    • SnapFileChooser

      public SnapFileChooser(File currentDirectory, FileSystemView fsv)
  • Method Details

    • setFileSystemView

      public void setFileSystemView(FileSystemView fileSystemView)
      Overrides:
      setFileSystemView in class JFileChooser
    • getIcon

      public Icon getIcon(File f)
      Overrides:
      getIcon in class JFileChooser
    • isTraversable

      public boolean isTraversable(File f)
      Overrides:
      isTraversable in class JFileChooser
    • createDialog

      protected JDialog createDialog(Component parent) throws HeadlessException
      Overridden in order to recognize dialog size changes.
      Overrides:
      createDialog in class JFileChooser
      Parameters:
      parent - the parent
      Returns:
      the dialog
      Throws:
      HeadlessException - if GraphicsEnvironment.isHeadless() returns true.
    • approveSelection

      public void approveSelection()
      Called by the UI when the user hits the Approve button (labeled "Open" or "Save", by default). This can also be called by the programmer.
      Overrides:
      approveSelection in class JFileChooser
    • setDialogBounds

      public void setDialogBounds(Rectangle rectangle)
      Sets the dialog bounds to be used for the next JFileChooser.showDialog(java.awt.Component, String) call.
      Parameters:
      rectangle - the dialog bounds
    • getCurrentFilename

      public String getCurrentFilename()
      Returns:
      The current filename, or null.
    • setCurrentFilename

      public void setCurrentFilename(String currentFilename)
      Sets the current filename.
      Parameters:
      currentFilename - The current filename, or null.
    • getSnapFileFilter

      public SnapFileFilter getSnapFileFilter()
      Returns the currently selected SNAP file filter.
      Returns:
      the current SNAP file filter, or null
    • getDefaultExtension

      public String getDefaultExtension()
      Returns:
      The current extension or null if it is unknown.
    • getChoosableFileFilters

      public FileFilter[] getChoosableFileFilters()
      Overrides:
      getChoosableFileFilters in class JFileChooser
    • addChoosableFileFilter

      public void addChoosableFileFilter(FileFilter filter)
      Overrides:
      addChoosableFileFilter in class JFileChooser
    • getName

      public String getName(File f)
      Overrides:
      getName in class JFileChooser
    • getWindow

      protected Window getWindow()
      Utility method which returns this file chooser's parent window.
      Returns:
      the parent window or null