Merge pull request #3114 from APriestman/restoreColorsOtherOccurrences

Use name of "known" column to determine color instead of index
This commit is contained in:
Richard Cordovano 2017-09-26 16:18:26 -04:00 committed by GitHub
commit 0e059888b1
2 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,8 @@ public class DataContentViewerOtherCasesTableCellRenderer implements TableCellRe
foreground = Color.WHITE;
background = Color.BLUE;
} else {
String known_status = (String) table.getModel().getValueAt(row, 5);
String known_status = (String) table.getModel().getValueAt(row,
table.getColumn(DataContentViewerOtherCasesTableModel.TableColumns.KNOWN.columnName()).getModelIndex());
if (known_status.equals(TskData.FileKnown.BAD.getName())) {
foreground = Color.WHITE;
background = Color.RED;

View File

@ -40,9 +40,8 @@ public class DataContentViewerOtherCasesTableModel extends AbstractTableModel {
"DataContentViewerOtherCasesTableModel.known=Known",
"DataContentViewerOtherCasesTableModel.comment=Comment",
"DataContentViewerOtherCasesTableModel.noData=No Data.",})
private enum TableColumns {
enum TableColumns {
// Ordering here determines displayed column order in Content Viewer.
// If order is changed, update the CellRenderer to ensure correct row coloring.
CASE_NAME(Bundle.DataContentViewerOtherCasesTableModel_case(), 75),
DATA_SOURCE(Bundle.DataContentViewerOtherCasesTableModel_dataSource(), 75),
TYPE(Bundle.DataContentViewerOtherCasesTableModel_type(), 40),