19 package org.sleuthkit.autopsy.casemodule.multiusercasesbrowser;
21 import java.util.HashMap;
22 import java.util.List;
24 import javax.swing.ListSelectionModel;
25 import javax.swing.event.ListSelectionListener;
26 import org.netbeans.swing.outline.DefaultOutlineModel;
27 import org.netbeans.swing.outline.Outline;
28 import org.openide.explorer.ExplorerManager;
29 import org.openide.util.NbBundle;
30 import org.openide.explorer.view.OutlineView;
42 @SuppressWarnings(
"PMD.SingularField")
45 private static final long serialVersionUID = 1L;
46 private static final int NAME_COLUMN_INDEX = 0;
47 private static final int NAME_COLUMN_WIDTH = 150;
65 this.explorerManager = explorerManager;
66 this.customizer = customizer;
68 outlineView =
new org.openide.explorer.view.OutlineView();
69 outline = this.outlineView.getOutline();
70 configureOutlineView();
71 caseTableScrollPane.add(outlineView);
72 caseTableScrollPane.setViewportView(outlineView);
73 this.setVisible(
true);
78 return explorerManager;
88 Map<Column, SortColumn> sortColumns =
new HashMap<>();
90 sortColumns.put(sortColumn.column(), sortColumn);
92 ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(
Column.
DISPLAY_NAME.getDisplayName());
97 List<Column> sheetProperties = customizer.
getColumns();
98 for (
int index = 0; index < sheetProperties.size(); ++index) {
99 Column property = sheetProperties.get(index);
101 outlineView.addPropertyColumn(propertyName, propertyName, propertyName);
102 if (sortColumns.containsKey(property)) {
103 SortColumn sortColumn = sortColumns.get(property);
111 outline.getColumnModel().getColumn(NAME_COLUMN_INDEX).setPreferredWidth(NAME_COLUMN_WIDTH);
116 outline.setRootVisible(
false);
117 outline.setSelectionMode(customizer.
allowMultiSelect() ? ListSelectionModel.MULTIPLE_INTERVAL_SELECTION : ListSelectionModel.SINGLE_SELECTION);
126 outline.getSelectionModel().addListSelectionListener(listener);
134 "MultiUserCasesBrowserPanel.waitNode.message=Please Wait..."
137 explorerManager.setRootContext(
new MultiUserCasesRootNode(customizer));
145 @SuppressWarnings(
"unchecked")
147 private
void initComponents() {
149 caseTableScrollPane =
new javax.swing.JScrollPane();
151 setMinimumSize(
new java.awt.Dimension(0, 5));
152 setPreferredSize(
new java.awt.Dimension(5, 5));
153 setLayout(
new java.awt.BorderLayout());
155 caseTableScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
156 caseTableScrollPane.setMinimumSize(
new java.awt.Dimension(0, 5));
157 caseTableScrollPane.setOpaque(
false);
158 caseTableScrollPane.setPreferredSize(
new java.awt.Dimension(500, 500));
159 add(caseTableScrollPane, java.awt.BorderLayout.CENTER);
List< SortColumn > getSortColumns()
ExplorerManager getExplorerManager()
boolean allowMultiSelect()
final MultiUserCaseBrowserCustomizer customizer
final OutlineView outlineView
void configureOutlineView()
final ExplorerManager explorerManager
final boolean sortAscending
javax.swing.JScrollPane caseTableScrollPane
MultiUserCasesBrowserPanel(ExplorerManager explorerManager, MultiUserCaseBrowserCustomizer customizer)
void addListSelectionListener(ListSelectionListener listener)
List< Column > getColumns()