19 package org.sleuthkit.autopsy.centralrepository.contentviewer;
21 import java.util.ArrayList;
22 import java.util.List;
23 import javax.swing.table.AbstractTableModel;
24 import org.openide.util.NbBundle.Messages;
33 @Messages({
"DataContentViewerOtherCasesTableModel.case=Case",
34 "DataContentViewerOtherCasesTableModel.device=Device",
35 "DataContentViewerOtherCasesTableModel.dataSource=Data Source",
36 "DataContentViewerOtherCasesTableModel.path=Path",
37 "DataContentViewerOtherCasesTableModel.attribute=Matched Attribute",
38 "DataContentViewerOtherCasesTableModel.value=Attribute Value",
39 "DataContentViewerOtherCasesTableModel.known=Known",
40 "DataContentViewerOtherCasesTableModel.comment=Comment",
41 "DataContentViewerOtherCasesTableModel.noData=No Data.",})
45 CASE_NAME(Bundle.DataContentViewerOtherCasesTableModel_case(), 100),
46 DATA_SOURCE(Bundle.DataContentViewerOtherCasesTableModel_dataSource(), 100),
47 ATTRIBUTE(Bundle.DataContentViewerOtherCasesTableModel_attribute(), 125),
48 VALUE(Bundle.DataContentViewerOtherCasesTableModel_value(), 200),
49 KNOWN(Bundle.DataContentViewerOtherCasesTableModel_known(), 50),
50 FILE_PATH(Bundle.DataContentViewerOtherCasesTableModel_path(), 450),
51 COMMENT(Bundle.DataContentViewerOtherCasesTableModel_comment(), 200),
52 DEVICE(Bundle.DataContentViewerOtherCasesTableModel_device(), 250);
54 private final String columnName;
55 private final int columnWidth;
57 TableColumns(String columnName,
int columnWidth) {
58 this.columnName = columnName;
59 this.columnWidth = columnWidth;
62 public String columnName() {
66 public int columnWidth() {
71 private final List<OtherOccurrenceNodeData>
nodeDataList;
74 nodeDataList =
new ArrayList<>();
79 return TableColumns.values().length;
93 return TableColumns.values()[colIdx].columnWidth();
98 return nodeDataList.size();
103 return TableColumns.values()[colIdx].columnName();
108 if (0 == nodeDataList.size()) {
109 return Bundle.DataContentViewerOtherCasesTableModel_noData();
112 OtherOccurrenceNodeData nodeData = nodeDataList.get(rowIdx);
113 TableColumns columnId = TableColumns.values()[colIdx];
114 if (nodeData instanceof OtherOccurrenceNodeMessageData) {
129 if (columnId == TableColumns.CASE_NAME) {
130 return nodeData.getDisplayMessage();
144 String value = Bundle.DataContentViewerOtherCasesTableModel_noData();
148 if (null != nodeData.getCaseName()) {
149 value = nodeData.getCaseName();
153 if (null != nodeData.getDeviceID()) {
154 value = nodeData.getDeviceID();
158 if (null != nodeData.getDataSourceName()) {
159 value = nodeData.getDataSourceName();
163 value = nodeData.getFilePath();
166 value = nodeData.getType();
169 value = nodeData.getValue();
172 value = nodeData.getKnown().getName();
175 value = nodeData.getComment();
183 Object getRow(
int rowIdx) {
184 return nodeDataList.get(rowIdx);
197 void addNodeData(OtherOccurrenceNodeData newNodeData) {
198 nodeDataList.add(newNodeData);
199 fireTableDataChanged();
206 nodeDataList.clear();
207 fireTableDataChanged();
static final long serialVersionUID
Object mapNodeMessageData(OtherOccurrenceNodeMessageData nodeData, TableColumns columnId)
Object mapNodeInstanceData(OtherOccurrenceNodeInstanceData nodeData, TableColumns columnId)
int getColumnPreferredWidth(int colIdx)
String getColumnName(int colIdx)
Object getValueAt(int rowIdx, int colIdx)
final List< OtherOccurrenceNodeData > nodeDataList
Class< String > getColumnClass(int colIdx)