Autopsy 4.22.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
ViewArtifactAction.java
Go to the documentation of this file.
1/*
2 * Autopsy Forensic Browser
3 *
4 * Copyright 2021 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.actions;
20
21import java.awt.Cursor;
22import java.awt.event.ActionEvent;
23import java.util.concurrent.ExecutionException;
24import java.util.logging.Level;
25import javax.swing.AbstractAction;
26import javax.swing.SwingWorker;
27import org.openide.windows.WindowManager;
28import org.sleuthkit.autopsy.coreutils.Logger;
29import org.sleuthkit.autopsy.directorytree.DirectoryTreeTopComponent;
30import org.sleuthkit.datamodel.BlackboardArtifact;
31
35public class ViewArtifactAction extends AbstractAction {
36
37 private static final Logger logger = Logger.getLogger(ViewArtifactAction.class.getName());
38 private final BlackboardArtifact artifact;
39
46 public ViewArtifactAction(BlackboardArtifact artifact, String displayName) {
47 super(displayName);
48 this.artifact = artifact;
49 }
50
51 @Override
52 public void actionPerformed(ActionEvent e) {
53 WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
54 new SwingWorker<Void, Void>() {
55
56 @Override
57 protected Void doInBackground() throws Exception {
59 return null;
60 }
61
62 @Override
63 protected void done() {
64 try {
65 get();
66 } catch (InterruptedException ex) {
67 logger.log(Level.SEVERE, "Unexpected interrupt while navigating to artifact.", ex);
68 } catch (ExecutionException ex) {
69 logger.log(Level.SEVERE, "Error navigating to artifact.", ex);
70 }
71 WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
72 }
73 }.execute();
74 }
75
76}
ViewArtifactAction(BlackboardArtifact artifact, String displayName)
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.