Autopsy  4.19.3
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  */
19 package org.sleuthkit.autopsy.actions;
20 
21 import java.awt.Cursor;
22 import java.awt.event.ActionEvent;
23 import java.util.concurrent.ExecutionException;
24 import java.util.logging.Level;
25 import javax.swing.AbstractAction;
26 import javax.swing.SwingWorker;
27 import org.openide.windows.WindowManager;
30 import org.sleuthkit.datamodel.BlackboardArtifact;
31 
35 public 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
static synchronized DirectoryTreeTopComponent findInstance()

Copyright © 2012-2022 Basis Technology. Generated on: Tue Oct 4 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.