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);