Package adams.gui.chooser
Class ChooserHelper
- java.lang.Object
-
- adams.gui.chooser.ChooserHelper
-
public class ChooserHelper extends Object
Helper class for file choosers.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Constructor Summary
Constructors Constructor Description ChooserHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String[]
getDataContainerReadersForFile(Class cls, File file)
Returns all the classnames of data container readers that could handle the given file, based on the file extensions that they handle.static String[]
getDataContainerWritersForFile(Class cls, File file)
Returns all the classnames of data container writers that could handle the given file, based on the file extensions that they handle.protected static Object
getInstance(Class superclass, String subclass)
Returns an instance of the specified subclass.static String[]
getReportReadersForFile(Class cls, File file)
Returns all the classnames of report readers that could handle the given file, based on the file extensions that they handle.static String[]
getReportWritersForFile(Class cls, File file)
Returns all the classnames of report writers that could handle the given file, based on the file extensions that they handle.
-
-
-
Method Detail
-
getInstance
protected static Object getInstance(Class superclass, String subclass)
Returns an instance of the specified subclass. Checks whether it is a subclass of the specified superclass.- Parameters:
superclass
- the super class to checksubclass
- the class name of the sub class- Returns:
- the instance or null in case of an instantiation or sub-class error
-
getDataContainerReadersForFile
public static String[] getDataContainerReadersForFile(Class cls, File file)
Returns all the classnames of data container readers that could handle the given file, based on the file extensions that they handle.- Parameters:
cls
- the superclass of readers to usefile
- the file to retrieve reader(s) for- Returns:
- the classnames of potential readers
-
getDataContainerWritersForFile
public static String[] getDataContainerWritersForFile(Class cls, File file)
Returns all the classnames of data container writers that could handle the given file, based on the file extensions that they handle.- Parameters:
cls
- the superclass of writers to usefile
- the file to retrieve writer(s) for- Returns:
- the classnames of potential writers
-
getReportReadersForFile
public static String[] getReportReadersForFile(Class cls, File file)
Returns all the classnames of report readers that could handle the given file, based on the file extensions that they handle.- Parameters:
cls
- the superclass of readers to usefile
- the file to retrieve reader(s) for- Returns:
- the classnames of potential readers
-
getReportWritersForFile
public static String[] getReportWritersForFile(Class cls, File file)
Returns all the classnames of report writers that could handle the given file, based on the file extensions that they handle.- Parameters:
cls
- the superclass of writers to usefile
- the file to retrieve writer(s) for- Returns:
- the classnames of potential writers
-
-