Ejemplo n.º 1
0
 @Override
 protected void execute(Component parentComponent) {
   Path mp3File =
       DirectoryFileChooser.chooseSingleFile(
           parentComponent,
           ADD_MUSIC_CHOOSER_VALUE,
           resources.getString("Music.Actions.AddFile.FileDialogTitle"),
           new Mp3FileFilter(resources)); // $NON-NLS-1$
   if (mp3File == null) {
     return;
   }
   String libraryName = ((ILibrary) view.getSelectedLibrary()).getName();
   try {
     model.addTrack(libraryName, mp3File);
     view.getTrackListView()
         .setObjects(searchControl.getTracks(((ILibrary) view.getSelectedLibrary()).getName()));
   } catch (Exception e) {
     MessageUtilities.indicateMessage(
         AddMusicFileAction.class,
         parentComponent,
         new Message(resources.getString("Errors.MusicDatabase.ReadMusicData"), e)); // $NON-NLS-1$
   }
 }
Ejemplo n.º 2
0
 private void updateEnabled() {
   setEnabled(view.getSelectedLibrary() != null);
 }