private void selectDownloadToShowOnDownloadGrid() { DownloadWrapper d = null; if (table.getSelectedRow() == -1) { d = selectDownloadToShowOnDownloadGridIgnoringSelection(); } else { DownloadWrapper dw = rows.get(table.getSelectedRow()); if (dw != null && dw.download != null && !dw.download.isComplete() && dw.download.isActive()) { d = dw; } else { d = selectDownloadToShowOnDownloadGridIgnoringSelection(); } } if (d != null && downloadGrid != null) { downloadGrid.setDownload(d.download); } interestingDownloadWrapper = d; }