/** * Searches the selected directories in the filesystem for Mp3 files. * * @param e ActionEvent */ public synchronized void actionPerformed(ActionEvent e) { try { Mp3Controller controller = getMp3Controller(); // launch filechooser and import selected directory FileSystemModel fsModel = controller.getFileSystemModel(); fsModel.clear(); File file = FileChooser.chooseDirectory(super.getSearchPanel(), "Import"); if (file != null) { getStatusPanel().startProcessing("Loading... " + file); fsModel.includeDirectory(file.toURI().toURL()); Mp3Model mp3Model = controller.getMp3Model(); mp3Model.setMp3ModelListener(getMp3ModelListener()); mp3Model.loadMp3s(fsModel); } // underlying model/data has changed getSearchPanel().constraintsHaveChanged(); getStatusPanel().stopProcessing("Successfully loaded: " + file); } catch (Exception exception) { getStatusPanel().stopProcessingError("Error(s) occurred while loading Mp3s"); ExceptionHandler.handleException(exception); } }