Package com.actelion.research.gui
Class FileHelper
- java.lang.Object
-
- com.actelion.research.chem.io.CompoundFileHelper
-
- com.actelion.research.gui.FileHelper
-
public class FileHelper extends CompoundFileHelper
-
-
Field Summary
-
Fields inherited from class com.actelion.research.chem.io.CompoundFileHelper
cFileTypeDataWarrior, cFileTypeDataWarriorCompatibleData, cFileTypeDataWarriorMacro, cFileTypeDataWarriorQuery, cFileTypeDataWarriorTemplate, cFileTypeDataWarriorTemplateContaining, cFileTypeDirectory, cFileTypeGIF, cFileTypeJPG, cFileTypeMask, cFileTypeMOL, cFileTypeMOL2, cFileTypePDB, cFileTypePictureFile, cFileTypePNG, cFileTypeRD, cFileTypeRDV2, cFileTypeRDV3, cFileTypeRXN, cFileTypeSD, cFileTypeSDV2, cFileTypeSDV3, cFileTypeSOM, cFileTypeSVG, cFileTypeText, cFileTypeTextCommaSeparated, cFileTypeTextTabDelimited, cFileTypeUnknown
-
-
Constructor Summary
Constructors Constructor Description FileHelper(java.awt.Component parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanfileExists(java.io.File file)java.io.File.exists() and java.nio.file.Files.exists() may cause minutes of delay, if a file is/was on a network share which is currently unmounted.static booleanfileExists(java.io.File file, long timeOutMillis)java.io.File.exists() and java.nio.file.Files.exists() may cause minutes of delay, if a file is/was on a network share which is currently unmounted.static java.util.ArrayList<java.io.File>getCompatibleFileList(java.io.File directory, int filetypes)static java.io.FilegetFile(java.awt.Component parent, java.lang.String title, int filetypes)For compatibility reasons...java.io.FileselectFileToOpen(java.lang.String title, int filetypes)java.io.FileselectFileToOpen(java.lang.String title, int filetypes, java.lang.String initialFileName)Shows a file-open-dialog, lets the user choose and returns the selected file.java.lang.StringselectFileToSave(java.lang.String title, int filetype, java.lang.String newFileName)Shows a file-save-dialog, lets the user choose and return the file's path and name.java.lang.StringselectOption(java.lang.String message, java.lang.String title, java.lang.String[] option)voidshowMessage(java.lang.String message)-
Methods inherited from class com.actelion.research.chem.io.CompoundFileHelper
createFileFilter, getCurrentDirectory, getErrorCount, getExtension, getExtensionList, getFileType, getRecordCount, readIDCodesFromFile, readIDCodesFromFile, readIDCodesWithNamesFromFile, readStructuresFromFile, readStructuresFromFile, removeExtension, removePathAndExtension, saveRXNFile, setCurrentDirectory
-
-
-
-
Method Detail
-
selectOption
public java.lang.String selectOption(java.lang.String message, java.lang.String title, java.lang.String[] option)- Specified by:
selectOptionin classCompoundFileHelper
-
showMessage
public void showMessage(java.lang.String message)
- Specified by:
showMessagein classCompoundFileHelper
-
getFile
public static java.io.File getFile(java.awt.Component parent, java.lang.String title, int filetypes)For compatibility reasons...- Parameters:
parent-title-filetypes-- Returns:
-
getCompatibleFileList
public static java.util.ArrayList<java.io.File> getCompatibleFileList(java.io.File directory, int filetypes)
-
selectFileToOpen
public java.io.File selectFileToOpen(java.lang.String title, int filetypes)- Specified by:
selectFileToOpenin classCompoundFileHelper
-
selectFileToOpen
public java.io.File selectFileToOpen(java.lang.String title, int filetypes, java.lang.String initialFileName)Shows a file-open-dialog, lets the user choose and returns the selected file.- Parameters:
title- of the dialog shownfiletypes- one or more file types defined in CompoundFileHelperinitialFileName- null or a suggested file name with or without complete path- Returns:
- null or selected file
-
selectFileToSave
public java.lang.String selectFileToSave(java.lang.String title, int filetype, java.lang.String newFileName)Shows a file-save-dialog, lets the user choose and return the file's path and name.- Specified by:
selectFileToSavein classCompoundFileHelper- Parameters:
title- of the dialog shownfiletype- one of the file types defined in CompoundFileHelpernewFileName- null or a suggested file name with or without extension- Returns:
- null or complete file path and name
-
fileExists
public static boolean fileExists(java.io.File file)
java.io.File.exists() and java.nio.file.Files.exists() may cause minutes of delay, if a file is/was on a network share which is currently unmounted. This version returns quickly.
-
fileExists
public static boolean fileExists(java.io.File file, long timeOutMillis)java.io.File.exists() and java.nio.file.Files.exists() may cause minutes of delay, if a file is/was on a network share which is currently unmounted. This version returns quickly.
-
-