19 package org.sleuthkit.autopsy.casemodule.multiusercasesbrowser;
21 import java.awt.BorderLayout;
22 import java.util.HashMap;
23 import java.util.List;
25 import javax.swing.ListSelectionModel;
26 import javax.swing.event.ListSelectionListener;
27 import org.netbeans.swing.outline.DefaultOutlineModel;
28 import org.netbeans.swing.outline.Outline;
29 import org.openide.explorer.ExplorerManager;
30 import org.openide.util.NbBundle;
31 import org.openide.explorer.view.OutlineView;
43 @SuppressWarnings(
"PMD.SingularField")
46 private static final long serialVersionUID = 1L;
47 private static final int NAME_COLUMN_INDEX = 0;
48 private static final int NAME_COLUMN_WIDTH = 150;
66 this.explorerManager = explorerManager;
67 this.customizer = customizer;
69 outlineView =
new org.openide.explorer.view.OutlineView();
70 outline = this.outlineView.getOutline();
71 configureOutlineView();
72 add(outlineView, BorderLayout.CENTER);
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 setMinimumSize(
new java.awt.Dimension(0, 5));
150 setPreferredSize(
new java.awt.Dimension(5, 5));
151 setLayout(
new java.awt.BorderLayout());
List< SortColumn > getSortColumns()
ExplorerManager getExplorerManager()
boolean allowMultiSelect()
final MultiUserCaseBrowserCustomizer customizer
final OutlineView outlineView
void configureOutlineView()
final ExplorerManager explorerManager
final boolean sortAscending
MultiUserCasesBrowserPanel(ExplorerManager explorerManager, MultiUserCaseBrowserCustomizer customizer)
void addListSelectionListener(ListSelectionListener listener)
List< Column > getColumns()