Class FPMIFileUtilities
- 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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.inductiveautomation.ignition.client.script.ClientFileUtilities
ClientFileUtilities.BinaryFileWritingTask, ClientFileUtilities.CharFileWritingTask, ClientFileUtilities.FileWritingTask, ClientFileUtilities.FileWritingTaskFactory
-
-
Constructor Summary
Constructors Constructor Description FPMIFileUtilities(java.awt.Component parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
openFile()
Shows the open file dialog box with no file extension restrictions.static java.lang.String
openFile(java.awt.Component parent, java.lang.String extension)
Shows the open file dialog box with a file extension filter for the given extension.static java.lang.String
openFile(java.awt.Component parent, java.lang.String extension, java.lang.String defaultLocation)
Shows the open file dialog box with a file extension filter for the given extension.java.lang.String
openFile(java.lang.String extension)
Shows the open file dialog box with a file extension filter for the given extension.java.lang.String
openFile(java.lang.String extension, java.lang.String defaultLocation)
Shows the open file dialog box with a file extension filter for the given extension, at the given location.java.lang.String[]
openFiles()
Shows the open file dialog box, allows multiple files to be selected.static java.lang.String[]
openFiles(java.awt.Component parent, java.lang.String extension, java.lang.String defaultLocation)
Shows the open file dialog box with a file extension filter for the given extension, at the given location.java.lang.String[]
openFiles(java.lang.String extension)
Shows the open file dialog box with a file extension filter for the given extension.java.lang.String[]
openFiles(java.lang.String extension, java.lang.String defaultLocation)
Shows the open file dialog box with a file extension filter for the given extension, at the given location.java.lang.String
saveFile(java.lang.String filename)
Asks the user to save a file with the namefilename
Returns the chosen file's path if the user hits OKjava.lang.String
saveFile(java.lang.String filename, java.lang.String extension, java.lang.String fileTypeDescription)
Opens a save as dialog box, and returns the path to the selected file, or None if the dialog was canceledstatic java.lang.String
saveToFile(java.awt.Component parent, java.lang.String filename, java.lang.String extension, java.lang.String fileTypeDescription, ClientFileUtilities.FileWritingTask writer)
Show a save as dialog box with the givenfilename
as a suggestion.-
Methods inherited from class com.inductiveautomation.ignition.client.script.ClientFileUtilities
getChooser
-
-
-
-
Method Detail
-
saveFile
public java.lang.String saveFile(java.lang.String filename)
Asks the user to save a file with the namefilename
Returns the chosen file's path if the user hits OK
-
saveFile
public java.lang.String saveFile(java.lang.String filename, java.lang.String extension, java.lang.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 java.lang.String saveToFile(java.awt.Component parent, java.lang.String filename, java.lang.String extension, java.lang.String fileTypeDescription, ClientFileUtilities.FileWritingTask writer)
Show a save as dialog box with the givenfilename
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 java.lang.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 java.lang.String openFile(java.lang.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 java.lang.String openFile(java.lang.String extension, java.lang.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 java.lang.String openFile(java.awt.Component parent, java.lang.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 boxextension
- 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 java.lang.String openFile(java.awt.Component parent, java.lang.String extension, java.lang.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 java.lang.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 java.lang.String[] openFiles(java.lang.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 java.lang.String[] openFiles(java.lang.String extension, java.lang.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 java.lang.String[] openFiles(java.awt.Component parent, java.lang.String extension, java.lang.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 boxextension
- 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.
-
-