Autopsy  4.19.3
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.datasourcesummary.ui;
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;
32 
33 @ActionID(category = "Case", id = "org.sleuthkit.autopsy.casemodule.datasourcesummary.DataSourceSummaryAction")
34 @ActionRegistration(displayName = "#CTL_DataSourceSummaryAction", lazy = false)
35 @Messages({"CTL_DataSourceSummaryAction=Data Source Summary"})
40 public class DataSourceSummaryAction extends CallableSystemAction {
41 
42  private static final long serialVersionUID = 1L;
43 
49  putValue(Action.NAME, Bundle.CTL_DataSourceSummaryAction());
50  this.setEnabled(false);
51  Case.addEventTypeSubscriber(EnumSet.of(Case.Events.CURRENT_CASE), (PropertyChangeEvent evt) -> {
52  setEnabled(null != evt.getNewValue());
53  });
54  }
55 
56  @Override
57  public void performAction() {
58  //perform the action of a ViewSummaryInformationAction with a ActionEvent which will not be used
59  new ViewSummaryInformationAction(null).actionPerformed(new ActionEvent(Boolean.TRUE, 0, ""));
60  }
61 
62  @Override
63  public String getName() {
64  return Bundle.CTL_DataSourceSummaryAction();
65  }
66 
67  @Override
68  public HelpCtx getHelpCtx() {
69  return HelpCtx.DEFAULT_HELP;
70  }
71 
72  @Override
73  public boolean asynchronous() {
74  return false;
75  }
76 }
static void addEventTypeSubscriber(Set< Events > eventTypes, PropertyChangeListener subscriber)
Definition: Case.java:711

Copyright © 2012-2022 Basis Technology. Generated on: Mon Dec 5 2022
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.