19 package org.sleuthkit.autopsy.communications.relationships;
21 import java.awt.Component;
22 import java.awt.KeyboardFocusManager;
23 import java.beans.PropertyChangeEvent;
24 import java.beans.PropertyChangeListener;
25 import static javax.swing.SwingUtilities.isDescendingFrom;
26 import org.netbeans.swing.outline.DefaultOutlineModel;
27 import org.netbeans.swing.outline.Outline;
28 import org.openide.explorer.ExplorerManager;
29 import static org.openide.explorer.ExplorerUtils.createLookup;
30 import org.openide.nodes.AbstractNode;
31 import org.openide.nodes.ChildFactory;
32 import org.openide.nodes.Children;
33 import org.openide.nodes.Node;
34 import org.openide.util.Lookup;
44 public class MessagesPanel extends javax.swing.JPanel implements Lookup.Provider {
60 focusPropertyListener = (
final PropertyChangeEvent focusEvent) -> {
61 if (focusEvent.getPropertyName().equalsIgnoreCase(
"focusOwner")) {
62 final Component newFocusOwner = (Component) focusEvent.getNewValue();
64 if (newFocusOwner == null) {
70 }
else if (isDescendingFrom(newFocusOwner,
MessagesPanel.this)) {
80 "From", Bundle.MessageViewer_columnHeader_From(),
81 "To", Bundle.MessageViewer_columnHeader_To(),
82 "Date", Bundle.MessageViewer_columnHeader_Date(),
83 "Subject", Bundle.MessageViewer_columnHeader_Subject(),
84 "Attms", Bundle.MessageViewer_columnHeader_Attms()
86 outline.setRootVisible(
false);
87 ((DefaultOutlineModel) outline.getOutlineModel()).setNodesColumnLabel(
"Type");
90 if (evt.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) {
93 if (nodes != null && nodes.length == 1) {
109 setChildFactory(nodeFactory);
121 KeyboardFocusManager.getCurrentKeyboardFocusManager()
122 .addPropertyChangeListener(
"focusOwner", focusPropertyListener);
127 super.removeNotify();
128 KeyboardFocusManager.getCurrentKeyboardFocusManager()
129 .removePropertyChangeListener(
"focusOwner", focusPropertyListener);
132 final void setChildFactory(ChildFactory<?> nodeFactory) {
137 Children.create(nodeFactory,
true)),
146 @SuppressWarnings(
"unchecked")
150 splitPane =
new javax.swing.JSplitPane();
154 setLayout(
new java.awt.BorderLayout());
156 splitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
160 add(
splitPane, java.awt.BorderLayout.CENTER);
ExplorerManager getExplorerManager()
org.sleuthkit.autopsy.communications.relationships.OutlineViewPanel outlineViewPanel
void setTableColumnsWidth(double...percentages)
final ModifiableProxyLookup proxyLookup
final PropertyChangeListener focusPropertyListener
void setNewLookups(final Lookup...lookups)
MessagesPanel(ChildFactory<?> nodeFactory)
org.sleuthkit.autopsy.contentviewers.MessageContentViewer messageContentViewer
javax.swing.JSplitPane splitPane
OutlineView getOutlineView()