Autopsy  4.21.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ExtractAction.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2013-2019 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 content 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 
22 import java.awt.event.ActionEvent;
23 import java.util.Collection;
24 import javax.swing.AbstractAction;
25 import org.openide.util.NbBundle;
26 import org.openide.util.Utilities;
27 import org.openide.util.Lookup;
28 import org.sleuthkit.datamodel.AbstractFile;
29 
33 public final class ExtractAction extends AbstractAction {
34 
35  // This class is a singleton to support multi-selection of nodes, since
36  // org.openide.nodes.NodeOp.findActions(Node[] nodes) will only pick up an Action if every
37  // node in the array returns a reference to the same action object from Node.getActions(boolean).
38  private static ExtractAction instance;
39 
40  public static synchronized ExtractAction getInstance() {
41  if (null == instance) {
42  instance = new ExtractAction();
43  }
44  return instance;
45  }
46 
48 
52  private ExtractAction() {
53  super(NbBundle.getMessage(ExtractAction.class, "ExtractAction.title.extractFiles.text"));
54  }
55 
62  @Override
63  public void actionPerformed(ActionEvent e) {
64  Lookup lookup = Utilities.actionsGlobalContext();
65  Collection<? extends AbstractFile> selectedFiles =lookup.lookupAll(AbstractFile.class);
66  extractor.extract(e, selectedFiles);
67 
68  }
69 }
static synchronized ExtractAction getInstance()
void extract(ActionEvent event, Collection<?extends AbstractFile > selectedFiles)

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