if (button == null) {
return;
}
try {
TableRowCore[] selectedRows = view.getSelectedRows();
if (selectedRows.length == 0) {
return;
}
boolean bResume = true;
for (int i = 0; i < selectedRows.length; i++) {
TableRowCore row = selectedRows[i];
DownloadManager dm = (DownloadManager) row.getDataSource(true);
if (dm != null) {
int state = dm.getState();
boolean bNotRunning = state == DownloadManager.STATE_QUEUED
|| state == DownloadManager.STATE_STOPPED
|| state == DownloadManager.STATE_STOPPING
|| state == DownloadManager.STATE_ERROR;
if (!bNotRunning) {
bResume = false;
break;
}
}
}
if (bResume) {
button.setTextID("v3.MainWindow.button.resume");
} else {
button.setTextID("v3.MainWindow.button.pause");
}
} catch (Exception e) {
Debug.out(e);
}