19 package org.sleuthkit.autopsy.centralrepository.contentviewer;
21 import java.awt.Component;
22 import java.awt.Cursor;
23 import java.util.concurrent.ExecutionException;
24 import java.util.logging.Level;
26 import javax.swing.JPanel;
27 import org.apache.commons.lang.StringUtils;
28 import org.openide.nodes.Node;
29 import org.openide.util.NbBundle.Messages;
30 import org.openide.util.lookup.ServiceProvider;
42 @SuppressWarnings(
"PMD.SingularField")
43 @ServiceProvider(service = DataContentViewer.class, position = 10)
44 @Messages({
"DataContentViewerOtherCases.title=Other Occurrences",
45 "DataContentViewerOtherCases.toolTip=Displays instances of the selected file/artifact from other occurrences."})
48 private static final long serialVersionUID = -1L;
52 private OtherOccurrencesNodeWorker worker = null;
59 add(otherOccurrencesPanel);
64 return Bundle.DataContentViewerOtherCases_title();
69 return Bundle.DataContentViewerOtherCases_toolTip();
84 otherOccurrencesPanel.
reset();
102 if (node.getLookup().lookup(OsAccount.class) != null) {
110 if (node.getLookup().lookup(BlackboardArtifactTag.class) != null) {
114 AbstractFile file = node.getLookup().lookup(AbstractFile.class);
116 if (file != null && !StringUtils.isBlank(file.getMd5Hash())) {
127 otherOccurrencesPanel.
reset();
128 otherOccurrencesPanel.showPanelLoadingMessage();
134 if (worker != null) {
137 worker =
new OtherOccurrencesNodeWorker(node) {
141 if (!isCancelled()) {
142 OtherOccurrencesData data =
get();
143 otherOccurrencesPanel.populateTable(data);
144 otherOccurrencesPanel.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
146 }
catch (InterruptedException | ExecutionException ex) {
151 otherOccurrencesPanel.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
160 @SuppressWarnings(
"unchecked")
162 private
void initComponents() {
163 java.awt.GridBagConstraints gridBagConstraints;
165 setMinimumSize(
new java.awt.Dimension(1000, 10));
167 setPreferredSize(
new java.awt.Dimension(1000, 63));
168 setLayout(
new java.awt.BorderLayout());
int isPreferred(Node node)
static final Logger logger
boolean isSupported(Node node)
DataContentViewerOtherCases()
synchronized static Logger getLogger(String name)
DataContentViewer createInstance()
static boolean isEnabled()