- java.lang.Object
-
- org.tentackle.fx.rdc.FileUtilities
-
@Service(FileUtilities.class) public class FileUtilities extends java.lang.Object
File-related utility methods.- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description FileUtilities()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voideditFile(java.io.File file)Edits/opens a given file via the Desktop utilities.
The corresponding application will be chosen according to the mime/file type.static FileUtilitiesgetInstance()The singleton.java.io.FileselectFile(java.lang.String prefName, java.lang.String prefKey, java.lang.String fileExtension, java.lang.String fileType, javafx.stage.Stage owner)Selects a file via filechooser dialog and remembers the decision in the user preferences.
-
-
-
Method Detail
-
getInstance
public static FileUtilities getInstance()
The singleton.- Returns:
- the singleton
-
selectFile
public java.io.File selectFile(java.lang.String prefName, java.lang.String prefKey, java.lang.String fileExtension, java.lang.String fileType, javafx.stage.Stage owner)Selects a file via filechooser dialog and remembers the decision in the user preferences.- Parameters:
prefName- the preferences nameprefKey- the preferences keyfileExtension- the filename extension (including the leading dot)fileType- the localized name of the file typeowner- the dialog owner for the selection dialog, null if none- Returns:
- the selected file, null if aborted
-
editFile
public void editFile(java.io.File file)
Edits/opens a given file via the Desktop utilities.
The corresponding application will be chosen according to the mime/file type.- Parameters:
file- the file
-
-