Autopsy  4.17.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
FileSystemDetailsAction.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2017-2018 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.directorytree;
20 
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
23 import java.util.logging.Level;
24 import javax.swing.AbstractAction;
25 import javax.swing.JDialog;
26 import javax.swing.JFrame;
27 import org.openide.util.NbBundle;
28 import org.openide.windows.WindowManager;
30 import org.sleuthkit.datamodel.Volume;
31 import org.sleuthkit.datamodel.TskCoreException;
32 
36 final public class FileSystemDetailsAction extends AbstractAction {
37  private static final Logger logger = Logger.getLogger(FileSystemDetailsPanel.class.getName());
38  final Volume fsContent;
39 
40  @NbBundle.Messages({"FileSystemDetailsAction.title.text=File System Details"})
41  public FileSystemDetailsAction(Volume content) {
42  super(Bundle.FileSystemDetailsAction_title_text());
43  enabled = false;
44  fsContent = content;
45  try {
46  if (!fsContent.getFileSystems().isEmpty()) {
47  enabled = true;
48  }
49  } catch (TskCoreException ex) {
50  logger.log(Level.SEVERE, "Unable to create FileSystemDetailsAction", ex);
51  }
52  }
53 
54  @Override
55  public void actionPerformed(ActionEvent e) {
56  FileSystemDetailsDialog fsDetailsDialog = new FileSystemDetailsDialog();
57  fsDetailsDialog.display(fsContent);
58 
59  }
60 
61  private final class FileSystemDetailsDialog extends JDialog implements ActionListener {
62 
63  private static final long serialVersionUID = 1L;
64 
66  super((JFrame) WindowManager.getDefault().getMainWindow(),
67  Bundle.FileSystemDetailsAction_title_text(),
68  false);
69  }
70 
71  private void display(Volume content) {
72  FileSystemDetailsPanel fsPanel = new FileSystemDetailsPanel(content);
73  fsPanel.setOKButtonActionListener(this);
74  setContentPane(fsPanel);
75  pack();
76  setLocationRelativeTo(WindowManager.getDefault().getMainWindow());
77  setVisible(true);
78  }
79 
80  @Override
81  public void actionPerformed(ActionEvent e) {
82  dispose();
83  }
84 
85  }
86 
87 }
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

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