java.lang.Object
com.inductiveautomation.ignition.client.script.ClientFileUtilities
com.inductiveautomation.factorypmi.application.script.builtin.FPMIFileUtilities

public class FPMIFileUtilities extends ClientFileUtilities
These are the file utilities that have a GUI element.
  • Constructor Details

    • FPMIFileUtilities

      public FPMIFileUtilities(Component parent)
  • Method Details

    • saveFile

      public String saveFile(String filename)
      Asks the user to save a file with the name filename Returns the chosen file's path if the user hits OK
    • saveFile

      public String saveFile(String filename, String extension, String fileTypeDescription)
      Opens a save as dialog box, and returns the path to the selected file, or None if the dialog was canceled
    • saveToFile

      public static String saveToFile(Component parent, String filename, String extension, String fileTypeDescription, ClientFileUtilities.FileWritingTask writer)
      Show a save as dialog box with the given filename as a suggestion. If save is selected, the FileWritingTask will be invoked to write to the file
      Returns:
      The path to the saved file, or null if the action failed or was canceled.
    • openFile

      public String openFile()
      Shows the open file dialog box with no file extension restrictions.
      Returns:
      A string representing the path to the selected file, or None if cancelled.
    • openFile

      public String openFile(String extension)
      Shows the open file dialog box with a file extension filter for the given extension.
      Parameters:
      extension - a filename extension, like "pdf", without the prepending period.
      Returns:
      A string representing the path to the selected file, or None if cancelled.
    • openFile

      public String openFile(String extension, String defaultLocation)
      Shows the open file dialog box with a file extension filter for the given extension, at the given location.
      Parameters:
      extension - a filename extension, like "pdf", without the prepending period.
      defaultLocation - the default folder location to open with the file chooser.
      Returns:
      A string representing the path to the selected file, or None if cancelled.
    • openFile

      public static String openFile(Component parent, String extension)
      Shows the open file dialog box with a file extension filter for the given extension.
      Parameters:
      parent - The parent component of the dialog box
      extension - a filename extension, like "pdf", without the prepending period.
      Returns:
      A string representing the path to the selected file, or None if cancelled.
    • openFile

      public static String openFile(Component parent, String extension, String defaultLocation)
      Shows the open file dialog box with a file extension filter for the given extension.
      Parameters:
      extension - a filename extension, like "pdf", without the prepending period.
      defaultLocation - the full path to a default location to open the dialog with.
      Returns:
      A string representing the path(s) to the selected file(s), or None if cancelled.
    • openFiles

      public String[] openFiles()
      Shows the open file dialog box, allows multiple files to be selected.
      Returns:
      A list of the the path(s) to the selected file(s), or None if cancelled.
    • openFiles

      public String[] openFiles(String extension)
      Shows the open file dialog box with a file extension filter for the given extension. Allows multiple files to be selected.
      Parameters:
      extension - a filename extension, like "pdf", without the prepending period.
      Returns:
      A list of the the path(s) to the selected file(s), or None if cancelled.
    • openFiles

      public String[] openFiles(String extension, String defaultLocation)
      Shows the open file dialog box with a file extension filter for the given extension, at the given location. Allows multiple files to be selected.
      Parameters:
      extension - a filename extension, like "pdf", without the prepending period.
      defaultLocation - the default folder location to open with the file chooser.
      Returns:
      A list of the the path(s) to the selected file(s), or None if cancelled.
    • openFiles

      public static String[] openFiles(Component parent, String extension, String defaultLocation)
      Shows the open file dialog box with a file extension filter for the given extension, at the given location. Allows multiple files to be selected.
      Parameters:
      parent - The parent component of the dialog box
      extension - a filename extension, like "pdf", without the prepending period.
      defaultLocation - the default folder location to open with the file chooser.
      Returns:
      A list of the the path(s) to the selected file(s), or None if cancelled.