7811 check table model row count instead of table

This commit is contained in:
William Schaefer 2021-07-13 12:57:51 -04:00
parent 5db2cd89fb
commit 7923e582da

View File

@ -254,8 +254,8 @@ public final class OtherOccurrencesPanel extends javax.swing.JPanel {
private void saveToCSV() throws NoCurrentCaseException {
if (casesTableModel.getRowCount() > 0) {
if(CSVFileChooser == null) {
try{
if (CSVFileChooser == null) {
try {
CSVFileChooser = futureFileChooser.get();
} catch (InterruptedException | ExecutionException ex) {
// If something happened with the thread try and
@ -339,13 +339,14 @@ public final class OtherOccurrencesPanel extends javax.swing.JPanel {
casesTableModel.addCorrelationCase(NO_ARTIFACTS_CASE);
} else if (caseCount == 0) {
casesTableModel.addCorrelationCase(NO_RESULTS_CASE);
}
} else {
String earliestDate = data.getEarliestCaseDate();
earliestCaseDate.setText(earliestDate.isEmpty() ? Bundle.OtherOccurrencesPanel_earliestCaseNotAvailable() : earliestDate);
foundInLabel.setText(String.format(Bundle.OtherOccurrencesPanel_foundIn_text(), data.getTotalCount(), caseCount, data.getDataSourceCount()));
if (caseCount > 0) {
casesTable.setRowSelectionInterval(0, 0);
}
}
} catch (InterruptedException | ExecutionException ex) {
logger.log(Level.SEVERE, "Failed to update OtherOccurrence panel", ex);
@ -389,7 +390,7 @@ public final class OtherOccurrencesPanel extends javax.swing.JPanel {
casesTableModel.addCorrelationCase(NO_ARTIFACTS_CASE);
} else if (caseCount == 0) {
casesTableModel.addCorrelationCase(NO_RESULTS_CASE);
}
} else {
String earliestDate = data.getEarliestCaseDate();
earliestCaseDate.setText(earliestDate.isEmpty() ? Bundle.OtherOccurrencesPanel_earliestCaseNotAvailable() : earliestDate);
foundInLabel.setText(String.format(Bundle.OtherOccurrencesPanel_foundIn_text(), data.getInstanceDataCount(), caseCount, data.getDataSourceCount()));
@ -397,6 +398,7 @@ public final class OtherOccurrencesPanel extends javax.swing.JPanel {
casesTable.setRowSelectionInterval(0, 0);
}
}
}
/**
* Updates displayed information to be correct for the current case
@ -457,7 +459,7 @@ public final class OtherOccurrencesPanel extends javax.swing.JPanel {
}
}
}
if (dataSourcesTable.getRowCount() > 0) {
if (dataSourcesTableModel.getRowCount() > 0) {
dataSourcesTable.setRowSelectionInterval(0, 0);
}
@ -514,7 +516,7 @@ public final class OtherOccurrencesPanel extends javax.swing.JPanel {
}
}
}
if (filesTable.getRowCount() > 0) {
if (filesTableModel.getRowCount() > 0) {
filesTable.setRowSelectionInterval(0, 0);
}
} catch (InterruptedException | ExecutionException ex) {
@ -633,7 +635,7 @@ public final class OtherOccurrencesPanel extends javax.swing.JPanel {
for (CorrelationAttributeInstance corAttr : coAtInstances) {
correlatedNodeDataMap.putAll(OtherOccurrences.getCorrelatedInstances(abstractFile, deviceIdStr, dataSourceNameStr, corAttr));
if(isCancelled()) {
if (isCancelled()) {
return new HashMap<>();
}
}