20 package org.sleuthkit.autopsy.commonpropertiessearch;
22 import java.util.Collections;
23 import java.util.Enumeration;
24 import java.util.HashMap;
26 import java.util.logging.Level;
28 import javax.swing.table.TableColumn;
29 import javax.swing.table.TableColumnModel;
30 import org.openide.util.NbBundle;
51 Map<String, Integer> map =
new HashMap<>();
54 map.put(NbBundle.getMessage(
AbstractAbstractFileNode.class,
"AbstractAbstractFileNode.createSheet.comment.name"), 20);
56 map.put(Bundle.CommonFilesSearchResultsViewerTable_instancesColLbl(), 65);
57 map.put(Bundle.CommonFilesSearchResultsViewerTable_pathColLbl(), 300);
58 map.put(Bundle.CommonFilesSearchResultsViewerTable_caseColLbl(), 200);
59 map.put(Bundle.CommonFilesSearchResultsViewerTable_localPath(), 200);
60 map.put(Bundle.CommonFilesSearchResultsViewerTable_valueColLbl(), 200);
61 map.put(Bundle.CommonFilesSearchResultsViewerTable_dataSourceColLbl(), 200);
64 COLUMN_WIDTHS = Collections.unmodifiableMap(map);
81 "CommonFilesSearchResultsViewerTable.noDescText= ",
82 "CommonFilesSearchResultsViewerTable.instancesColLbl=Instances",
83 "CommonFilesSearchResultsViewerTable.localPath=Parent Path in Current Case",
84 "CommonFilesSearchResultsViewerTable.pathColLbl=Parent Path",
85 "CommonFilesSearchResultsViewerTable.caseColLbl=Case",
86 "CommonFilesSearchResultsViewerTable.valueColLbl=Value",
87 "CommonFilesSearchResultsViewerTable.dataSourceColLbl=Data Source",
93 Enumeration<TableColumn> columnsEnumerator = model.getColumns();
94 while (columnsEnumerator.hasMoreElements()) {
96 TableColumn column = columnsEnumerator.nextElement();
98 final String headerValue = column.getHeaderValue().toString();
100 final Integer defaultWidth = COLUMN_WIDTHS.get(headerValue);
102 if (defaultWidth == null) {
103 column.setPreferredWidth(DEFAULT_WIDTH);
104 LOGGER.log(Level.WARNING, String.format(
"Tried to set width on a column not supported by the CommonAttributesSearchResultsViewerTable: %s", headerValue));
106 column.setPreferredWidth(defaultWidth);
TableColumnModel getColumnModel()
static final long serialVersionUID
static final int DEFAULT_WIDTH
static final Map< String, Integer > COLUMN_WIDTHS
static final Logger LOGGER
CommonAttributesSearchResultsViewerTable()
void addTreeExpansionListener(TreeExpansionListener listener)
synchronized static Logger getLogger(String name)