19 package org.sleuthkit.autopsy.centralrepository.optionspanel;
21 import java.util.ArrayList;
22 import java.util.List;
23 import javax.swing.table.AbstractTableModel;
24 import org.openide.util.NbBundle.Messages;
31 class CasesTableModel
extends AbstractTableModel {
33 private static final long serialVersionUID = 1L;
38 private final List<CaseDataSourcesWrapper> eamCases;
44 eamCases =
new ArrayList<>();
48 public int getColumnCount() {
49 return CaseTableColumns.values().length;
53 public int getRowCount() {
54 return eamCases.size();
58 public String getColumnName(
int colIdx) {
59 return CaseTableColumns.values()[colIdx].columnName();
63 public Object getValueAt(
int rowIdx,
int colIdx) {
64 if (eamCases.isEmpty()) {
65 return Bundle.CasesTableModel_noData();
68 return mapValueById(rowIdx, CaseTableColumns.values()[colIdx]);
79 @Messages({
"CasesTableModel.noData=No Cases"})
80 private Object mapValueById(
int rowIdx, CaseTableColumns colId) {
81 CaseDataSourcesWrapper eamCase = eamCases.get(rowIdx);
82 String value = Bundle.CasesTableModel_noData();
86 value = eamCase.getDisplayName();
89 value = eamCase.getCreationDate();
98 public Class<String> getColumnClass(
int colIdx) {
107 void addEamCase(CorrelationCase eamCase, List<CorrelationDataSource> dataSourceList) {
108 eamCases.add(
new CaseDataSourcesWrapper(eamCase, dataSourceList));
109 fireTableDataChanged();
121 CaseDataSourcesWrapper getEamCase(
int listIndex) {
122 return eamCases.get(listIndex);
128 @Messages({
"CasesTableModel.case=Case Name",
129 "CasesTableModel.creationDate=Creation Date"})
144 this.columnName = columnName;
CaseTableColumns(String columnName)