Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
DataSourceSummaryResultViewer.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2020 Basis Technology Corp.
5 * Contact: carrier <at> sleuthkit <dot> org
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 */
19package org.sleuthkit.autopsy.resultviewers.summary;
20
21import java.awt.BorderLayout;
22import java.awt.Cursor;
23import java.util.logging.Level;
24import javax.swing.SwingUtilities;
25import org.openide.explorer.ExplorerManager;
26import org.openide.nodes.Node;
27import org.openide.util.NbBundle.Messages;
28import org.openide.util.lookup.ServiceProvider;
29import org.sleuthkit.autopsy.datasourcesummary.ui.DataSourceSummaryTabbedPane;
30import org.sleuthkit.autopsy.corecomponentinterfaces.DataResultViewer;
31import org.sleuthkit.autopsy.corecomponents.AbstractDataResultViewer;
32import org.sleuthkit.datamodel.DataSource;
33import org.sleuthkit.autopsy.coreutils.Logger;
34import org.sleuthkit.autopsy.coreutils.ThreadConfined;
35
39@ServiceProvider(service = DataResultViewer.class)
40@SuppressWarnings("PMD.SingularField") // UI widgets cause lots of false positives
42
43 private static final long serialVersionUID = 1L;
44 private static final Logger LOGGER = Logger.getLogger(DataSourceSummaryResultViewer.class.getName());
45
46 private final String title;
47
53 this(null);
54 }
55
64 @Messages({
65 "DataSourceSummaryResultViewer_title=Summary"
66 })
68 this(explorerManager, Bundle.DataSourceSummaryResultViewer_title());
69 }
70
80 public DataSourceSummaryResultViewer(ExplorerManager explorerManager, String title) {
81 super(explorerManager);
82 this.title = title;
84 }
85
86 @Override
90
91 @Override
92 public boolean isSupported(Node node) {
93 return getDataSource(node) != null;
94 }
95
103 private DataSource getDataSource(Node node) {
104 return node == null ? null : node.getLookup().lookup(DataSource.class);
105 }
106
107 @Override
109 public void setNode(Node node) {
110 if (!SwingUtilities.isEventDispatchThread()) {
111 LOGGER.log(Level.SEVERE, "Attempting to run setNode() from non-EDT thread.");
112 return;
113 }
114
115 DataSource dataSource = getDataSource(node);
116
117 this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
118 try {
119 if (summaryPanel != null) {
120 summaryPanel.setDataSource(dataSource);
121 }
122 } finally {
123 this.setCursor(null);
124 }
125 }
126
127 @Override
128 public String getTitle() {
129 return title;
130 }
131
132 private void initComponents() {
134 setLayout(new BorderLayout());
135 add(summaryPanel, BorderLayout.CENTER);
136 }
137
138 @Override
139 public void clearComponent() {
140 summaryPanel.close();
141 summaryPanel = null;
142 }
143
145
146}
synchronized static Logger getLogger(String name)
Definition Logger.java:124

Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.