Class ReportDirChooser

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ReportDirChooser extends JFileChooser
A custom JFileChooser, for a user to choose a report directory.
See Also:
  • Field Details

  • Constructor Details

    • ReportDirChooser

      public ReportDirChooser()
      Create a ReportDirChooser, initially showing the user's current directory.
    • ReportDirChooser

      public ReportDirChooser(File initialDir)
      Create a ReportDirChooser, initially showing a given directory.
      Parameters:
      initialDir - the initial directory to be shown
  • Method Details

    • setMode

      public void setMode(int mode)
      Set whether the chooser is to be used to create a new report directory or to open an existing report directory.
      Parameters:
      mode - a constant to indicate how the chooser is to operate
      See Also:
    • getSelectedReportDirectory

      public File getSelectedReportDirectory()
      Get the report directory that was most recently selected by the user.
      Returns:
      the report directory that was most recently selected by the user
      See Also:
    • showDialog

      public int showDialog(Component parent)
      Show a dialog to allow the user to select a report directory. If a report directory is selected, it can be accessed via getSelectedReportDirectory.
      Parameters:
      parent - the component to be used at the parent of this dialog
      Returns:
      an integer signifying how the dialog was dismissed (APPROVE_OPTION or CANCEL_OPTION).
      See Also:
    • approveSelection

      public void approveSelection()
      Overrides:
      approveSelection in class JFileChooser