protected Menu getPopUpMenu() {
if (getItemCount() == 0)
return no_items_menu;
int download_status = NO_FILE;
SharingManager sharing_manager = _core.getSharingManager();
DownloadManager download_manager = _core.getDownloadManager();
for (SearchResultItem item : getSelectedObjects()) {
if (download_manager.hasDownload(item.getFileHash())) {
try {
if (!download_manager.getDownload(
item.getFileHash()).isStarted()) {
download_status = DOWNLOAD_FILE;
} else {
download_status = SHARED_FILE;
}
} catch (DownloadManagerException e) {
e.printStackTrace();
}
break;
}
if (sharing_manager.hasFile(item.getFileHash())) {
download_status = SHARED_FILE;
}
}
switch (download_status) {
case NO_FILE: {