Autopsy  4.12.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
DataSourceSummaryAction.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 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 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.casemodule.datasourcesummary;
20 
21 import java.awt.event.ActionEvent;
22 import java.beans.PropertyChangeEvent;
23 import java.util.EnumSet;
24 import javax.swing.Action;
25 import org.openide.awt.ActionID;
26 import org.openide.awt.ActionRegistration;
27 import org.openide.util.HelpCtx;
28 import org.openide.util.NbBundle.Messages;
29 import org.openide.util.actions.CallableSystemAction;
31 
32 @ActionID(category = "Case", id = "org.sleuthkit.autopsy.casemodule.datasourcesummary.DataSourceSummaryAction")
33 @ActionRegistration(displayName = "#CTL_DataSourceSummaryAction", lazy = false)
34 @Messages({"CTL_DataSourceSummaryAction=Data Source Summary"})
39 public class DataSourceSummaryAction extends CallableSystemAction {
40 
41  private static final long serialVersionUID = 1L;
42 
48  putValue(Action.NAME, Bundle.CTL_DataSourceSummaryAction());
49  this.setEnabled(false);
50  Case.addEventTypeSubscriber(EnumSet.of(Case.Events.CURRENT_CASE), (PropertyChangeEvent evt) -> {
51  setEnabled(null != evt.getNewValue());
52  });
53  }
54 
55  @Override
56  public void performAction() {
57  //perform the action of a ViewSummaryInformationAction with a ActionEvent which will not be used
58  new ViewSummaryInformationAction(null).actionPerformed(new ActionEvent(Boolean.TRUE, 0, ""));
59  }
60 
61  @Override
62  public String getName() {
63  return Bundle.CTL_DataSourceSummaryAction();
64  }
65 
66  @Override
67  public HelpCtx getHelpCtx() {
68  return HelpCtx.DEFAULT_HELP;
69  }
70 
71  @Override
72  public boolean asynchronous() {
73  return false;
74  }
75 }
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
Definition: Case.java:477

Copyright © 2012-2018 Basis Technology. Generated on: Wed Sep 18 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.