Package org.jampa.model.disk

Examples of org.jampa.model.disk.FileItem


      if (monitor.isCanceled())
        return;
      item = iter.next();
      if (item instanceof DirectoryItem) {
        // First add the files.
        FileItem fileItem;
        Iterator<FileItem> fileIter = ((DirectoryItem) item).getFileList().iterator();
        while (fileIter.hasNext()) {
          if (monitor.isCanceled())
            return;
          fileItem = fileIter.next();
         
          if (_firstFileItem == null)
            _firstFileItem = fileItem;
         
          monitor.subTask(Messages.getString("PlaylistController.AddToPlaylist") + fileItem.getLabel()); //$NON-NLS-1$
          Controller.getInstance().getPlaylistController().addFileToPlaylist(playlistName, fileItem, false, false, _insertionIndex);
          if (_insertionIndex != -1) {
            _insertionIndex++;
          }
          monitor.worked(1);       
View Full Code Here


    _rootItem = rootItem;
  }
     
  private void internalAddDirectoryToPlaylist(IProgressMonitor monitor, String playlistName, DirectoryItem directoryItem) {
    // First add the files.
    FileItem item;
    Iterator<FileItem> iter = directoryItem.getFileList().iterator();
    while (iter.hasNext()) {
      if (monitor.isCanceled())
        return;
      item = iter.next();
      monitor.subTask(Messages.getString("PlaylistController.AddToPlaylist") + item.getLabel()); //$NON-NLS-1$
      Controller.getInstance().getPlaylistController().addFileToPlaylist(playlistName, item, false, false);
      monitor.worked(1);       
    }
   
    // then the directories.
View Full Code Here

      }
      default : playlistName = playlistSelection.getItem(playlistSelection.getSelectionIndex());
    }
   
    AudioItem audioItem;
    FileItem fileItem;
    List<IDiskItem> list = new ArrayList<IDiskItem>();
    for (int i = 0; i < searchResults.getItemCount(); i++) {
      if (searchResults.getItem(i).getChecked()) {
        audioItem = (AudioItem) searchResults.getItem(i).getData();
        fileItem = new FileItem(audioItem.getFileName(), null);
        list.add(fileItem);
      }
    }
    Controller.getInstance().getPlaylistController().addDiskItemsToPlaylist(playlistName, list, playFirst);
  }
View Full Code Here

    _rootItem = rootItem;     
  }
 
  private void internalCheckDirectories(IProgressMonitor monitor, DirectoryItem directoryItem) {
    // First add the files.
    FileItem item;
    Iterator<FileItem> iter = directoryItem.getFileList().iterator();
    while (iter.hasNext()) {
      if (monitor.isCanceled())
        return;
      item = iter.next();
      monitor.subTask(Messages.getString("Controller.UpdateLibraryCheckDirectories") + item.getLabel()); //$NON-NLS-1$
     
      if (!Controller.getInstance().getHSQLController().doesLibraryItemExists(item.getFileName())) {
        Log.getInstance(Controller.class).info("Adding file to library: " + item.getFileName()); //$NON-NLS-1$
        Controller.getInstance().getHSQLController().insertFileToLibrary(item.getFileName());
      }       
      monitor.worked(1);       
    }
   
    // then the directories.
View Full Code Here

    _rootItem = rootItem;
  }
         
  private void internalAddDirectory(IProgressMonitor monitor, DirectoryItem directoryItem) {
    // First add the files.
    FileItem item;
    Iterator<FileItem> iter = directoryItem.getFileList().iterator();
    while (iter.hasNext()) {
      if (monitor.isCanceled())
        return;
      item = iter.next();
      monitor.subTask(Messages.getString("Controller.ScanningDirectory") + item.getLabel()); //$NON-NLS-1$
      Controller.getInstance().getHSQLController().insertFileToLibrary(item.getFileName());
      monitor.worked(1);       
    }
   
    // then the directories.
    Iterator<DirectoryItem> dirIter = directoryItem.getDirectoryList().iterator();
View Full Code Here

TOP

Related Classes of org.jampa.model.disk.FileItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.