Class FileDialogFactory


  • public final class FileDialogFactory
    extends java.lang.Object
    This factory is used to create popup dialogs for file-related user interaction.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void showCouldNotOpenDialog​(java.awt.Component frame, java.lang.String message)
      Show a dialog informing the user that the file could not be opened.
      static void showCouldNotOpenFileDialog​(java.awt.Component frame, java.lang.String filePath, FileUtils.OpenFileResult reason)
      Show an error dialog indicating the file could not be opened, with a particular reason.
      static void showCouldNotOpenFilepathDialog​(java.awt.Component frame, java.lang.String filePath)
      Show a generic error dialog indicating the file could not be opened.
      static void showReadOnlyDialog​(java.awt.Component frame)
      Show a dialog informing the user that the file is currently read-only.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FileDialogFactory

        public FileDialogFactory()
    • Method Detail

      • showReadOnlyDialog

        public static void showReadOnlyDialog​(java.awt.Component frame)
        Show a dialog informing the user that the file is currently read-only.
        Parameters:
        frame - a JFrame to act as parent to this dialog
      • showCouldNotOpenFilepathDialog

        public static void showCouldNotOpenFilepathDialog​(java.awt.Component frame,
                                                          java.lang.String filePath)
        Show a generic error dialog indicating the file could not be opened.
        Parameters:
        frame - a JFrame to act as parent to this dialog
        filePath - a String representing the path to the file we failed to open
      • showCouldNotOpenFileDialog

        public static void showCouldNotOpenFileDialog​(java.awt.Component frame,
                                                      java.lang.String filePath,
                                                      FileUtils.OpenFileResult reason)
        Show an error dialog indicating the file could not be opened, with a particular reason.
        Parameters:
        frame - a JFrame to act as parent to this dialog
        filePath - a String representing the path to the file we failed to open
        reason - a FileUtils.OpenFileResult specifying more precisely why we failed to open the file
      • showCouldNotOpenDialog

        public static void showCouldNotOpenDialog​(java.awt.Component frame,
                                                  java.lang.String message)
        Show a dialog informing the user that the file could not be opened.
        Parameters:
        frame - a JFrame to act as parent to this dialog
        message - a String giving the specific reason the file could not be opened