public String showOpenDialog(View parentView,
String dialogTitle,
ContentType contentType) {
if (contentType == ContentType.USER_DEFINED) {
// Let user choose multiple model files
JFileChooser fileChooser = new JFileChooser();
// Update current directory
if (this.modelsDirectory != null) {
fileChooser.setCurrentDirectory(this.modelsDirectory);
}
fileChooser.setDialogTitle(dialogTitle);
fileChooser.setMultiSelectionEnabled(true);
if (fileChooser.showOpenDialog((JComponent)parentView) == JFileChooser.APPROVE_OPTION) {
// Retrieve current directory for future calls
this.modelsDirectory = fileChooser.getCurrentDirectory();
// Return selected files separated by path separator character
String files = "";
for (File selectedFile : fileChooser.getSelectedFiles()) {
if (files.length() > 0) {
files += File.pathSeparator;
}
files += selectedFile;
}