Autopsy  4.5.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 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.Dimension;
22 import java.awt.Toolkit;
23 import java.awt.event.ActionEvent;
24 import java.awt.event.ActionListener;
25 import java.util.logging.Level;
26 import java.util.logging.Logger;
27 import javax.swing.AbstractAction;
28 import javax.swing.JDialog;
29 import javax.swing.JFrame;
30 import org.openide.util.NbBundle;
31 import org.openide.windows.WindowManager;
32 import org.sleuthkit.datamodel.Volume;
33 import org.sleuthkit.datamodel.TskCoreException;
34 
38 final public class FileSystemDetailsAction extends AbstractAction {
39  private static final Logger logger = Logger.getLogger(FileSystemDetailsPanel.class.getName());
40  final Volume fsContent;
41 
42  @NbBundle.Messages({"FileSystemDetailsAction.title.text=File System Details"})
43  public FileSystemDetailsAction(Volume content) {
44  super(Bundle.FileSystemDetailsAction_title_text());
45  enabled = false;
46  fsContent = content;
47  try {
48  if (!fsContent.getFileSystems().isEmpty()) {
49  enabled = true;
50  }
51  } catch (TskCoreException ex) {
52  logger.log(Level.SEVERE, "Unable to create FileSystemDetailsAction", ex);
53  }
54  }
55 
56  @Override
57  public void actionPerformed(ActionEvent e) {
58  FileSystemDetailsDialog fsDetailsDialog = new FileSystemDetailsDialog();
59  fsDetailsDialog.display(fsContent);
60 
61  }
62 
63  private final class FileSystemDetailsDialog extends JDialog implements ActionListener {
64 
65  private static final long serialVersionUID = 1L;
66 
68  super((JFrame) WindowManager.getDefault().getMainWindow(),
69  Bundle.FileSystemDetailsAction_title_text(),
70  false);
71  }
72 
73  private void display(Volume content) {
74  FileSystemDetailsPanel fsPanel = new FileSystemDetailsPanel(content);
75  fsPanel.setOKButtonActionListener(this);
76  setContentPane(fsPanel);
77  pack();
78  Dimension screenDimension = Toolkit.getDefaultToolkit().getScreenSize();
79  setLocation((screenDimension.width - getSize().width) / 2, (screenDimension.height - getSize().height) / 2);
80  setVisible(true);
81  }
82 
83  @Override
84  public void actionPerformed(ActionEvent e) {
85  dispose();
86  }
87 
88  }
89 
90 }
synchronized static Logger getLogger(String name)
Definition: Logger.java:124

Copyright © 2012-2016 Basis Technology. Generated on: Tue Feb 20 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.