Autopsy  4.8.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
RunIngestAction.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2011-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.ingest;
20 
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
23 import javax.swing.JMenuItem;
24 import org.openide.awt.ActionID;
25 import org.openide.awt.ActionRegistration;
26 import org.openide.util.HelpCtx;
27 import org.openide.util.NbBundle;
28 import org.openide.util.NbBundle.Messages;
29 import org.openide.util.actions.CallableSystemAction;
30 import org.openide.util.actions.Presenter;
33 
39 @ActionID(category = "Tools", id = "org.sleuthkit.autopsy.ingest.RunIngestAction")
40 @ActionRegistration(displayName = "#CTL_RunIngestAction", lazy = false)
41 @Messages("CTL_RunIngestAction=Run Ingest")
42 public final class RunIngestAction extends CallableSystemAction implements Presenter.Menu, ActionListener {
43 
44  private static final long serialVersionUID = 1L;
45  private static RunIngestAction action;
46 
47  static public RunIngestAction getInstance() {
48  if (action == null) {
49  action = new RunIngestAction();
50  }
51  return action;
52  }
53 
54  private RunIngestAction() {
55  }
56 
57  @Override
58  public void performAction() {
59  getMenuPresenter();
60  }
61 
62  @Override
63  public String getName() {
64  return NbBundle.getMessage(RunIngestAction.class, "RunIngestModulesMenu.getName.text");
65  }
66 
67  @Override
68  public HelpCtx getHelpCtx() {
69  return HelpCtx.DEFAULT_HELP;
70  }
71 
72  @Override
73  public JMenuItem getMenuPresenter() {
74  JMenuItem sublist = new RunIngestSubMenu();
75  sublist.setVisible(true);
76  return sublist;
77  }
78 
79  @Override
80  public void actionPerformed(ActionEvent e) {
81  performAction();
82  }
83 
84  @Override
85  public boolean isEnabled() {
86  try {
87  Case openCase = Case.getCurrentCaseThrows();
88  return openCase.hasData();
89  } catch (NoCurrentCaseException ex) {
90  return false;
91  }
92  }
93 }

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