Package org.apache.jmeter.gui.util
Class FileDialoger
java.lang.Object
org.apache.jmeter.gui.util.FileDialoger
Class implementing a file open dialogue
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
static JFileChooser
Prompts the user to choose a file or a directory from their filesystems for our own devious uses.static JFileChooser
promptToOpenFile
(Component parentComponent, String[] exts, String existingFileName, boolean onlyDirectories) Prompts the user to choose a file or a directory from their filesystems for our own devious uses.static JFileChooser
promptToOpenFile
(String existingFileName) Prompts the user to choose a file or a directory from their filesystems for our own devious uses.static JFileChooser
promptToOpenFile
(String[] exts) Prompts the user to choose a file or a directory from their filesystems for our own devious uses.static JFileChooser
promptToOpenFile
(String[] exts, String existingFileName) Prompts the user to choose a file or a directory from their filesystems for our own devious uses.static JFileChooser
promptToOpenFile
(String[] exts, String existingFileName, boolean onlyDirectories) Prompts the user to choose a file or a directory from their filesystems for our own devious uses.static JFileChooser
promptToOpenFile
(String existingFileName, boolean onlyDirectories) Prompts the user to choose a file or a directory from their filesystems for our own devious uses.static JFileChooser
promptToSaveFile
(String filename) Prompts the user to choose a file from their filesystems for our own devious uses.static JFileChooser
promptToSaveFile
(String filename, String[] extensions) Get a JFileChooser with a new FileFilter.static void
setLastJFCDirectory
(String lastJFCDirectory)
-
Method Details
-
promptToOpenFile
Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.- Returns:
- the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen
-
promptToOpenFile
Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.- Parameters:
existingFileName
- The name of a file with path. If the filename points to an existing file, the directory in which it lies, will be used as the starting point for the returned JFileChooser.- Returns:
- the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen
-
promptToOpenFile
Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.- Parameters:
existingFileName
- The name of a file with path. If the filename points to an existing file, the directory in which it lies, will be used as the starting point for the returned JFileChooser.onlyDirectories
- If true, only directories are displayed in the FileChooser- Returns:
- the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen
-
promptToOpenFile
Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.- Parameters:
exts
- The list of allowed file extensions. If empty, any file extension is allowed- Returns:
- the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen
-
promptToOpenFile
Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.- Parameters:
exts
- The list of allowed file extensions. If empty, any file extension is allowedexistingFileName
- The name of a file with path. If the filename points to an existing file, the directory in which it lies, will be used as the starting point for the returned JFileChooser.- Returns:
- the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen
-
promptToOpenFile
public static JFileChooser promptToOpenFile(String[] exts, String existingFileName, boolean onlyDirectories) Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.- Parameters:
exts
- The list of allowed file extensions. If empty, any file extension is allowedexistingFileName
- The name of a file with path. If the filename points to an existing file, the directory in which it lies, will be used as the starting point for the returned JFileChooser.onlyDirectories
- If true, only directories are displayed in the FileChooser- Returns:
- the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen
-
promptToOpenFile
public static JFileChooser promptToOpenFile(Component parentComponent, String[] exts, String existingFileName, boolean onlyDirectories) Prompts the user to choose a file or a directory from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.- Parameters:
parentComponent
- Component parent of current elementexts
- The list of allowed file extensions. If empty, any file extension is allowedexistingFileName
- The name of a file with path. If the filename points to an existing file, the directory in which it lies, will be used as the starting point for the returned JFileChooser.onlyDirectories
- If true, only directories are displayed in the FileChooser- Returns:
- the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen
-
promptToSaveFile
Prompts the user to choose a file from their filesystems for our own devious uses. This method maintains the last directory the user visited before dismissing the dialog. This does NOT imply they actually chose a file from that directory, only that they closed the dialog there. It is the caller's responsibility to check to see if the selected file is non-null.- Parameters:
filename
- The name of a file with path. If the filename points to an existing file, the directory in which it lies, will be used as the starting point for the returned JFileChooser.- Returns:
- the JFileChooser that interacted with the user, after they are finished using it - null if no file was chosen
- See Also:
-
promptToSaveFile
Get a JFileChooser with a new FileFilter.- Parameters:
filename
- file nameextensions
- list of extensions- Returns:
- the FileChooser - null if no file was chosen
-
getLastJFCDirectory
- Returns:
- The last directory visited by the user while choosing Files
-
setLastJFCDirectory
- Parameters:
lastJFCDirectory
- The last directory visited by the user while choosing Files
-