Autopsy  4.16.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ReportWizardPortableCaseOptionsPanel.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.report.infrastructure;
20 
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
23 import java.util.Map;
24 import javax.swing.JButton;
25 import javax.swing.event.ChangeListener;
26 import org.openide.WizardDescriptor;
27 import org.openide.util.HelpCtx;
28 import org.openide.util.NbBundle;
29 
34 class ReportWizardPortableCaseOptionsPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
35 
36  private WizardDescriptor wiz;
37  private ReportWizardPortableCaseOptionsVisualPanel component;
38  private final JButton finishButton;
39  private Map<String, ReportModuleConfig> moduleConfigs;
40  private final boolean useCaseSpecificData;
41 
42  ReportWizardPortableCaseOptionsPanel(Map<String, ReportModuleConfig> moduleConfigs, boolean useCaseSpecificData) {
43  this.moduleConfigs = moduleConfigs;
44  this.useCaseSpecificData = useCaseSpecificData;
45  finishButton = new JButton(
46  NbBundle.getMessage(this.getClass(), "ReportWizardFileOptionsPanel.finishButton.text"));
47  finishButton.setEnabled(false);
48 
49  finishButton.addActionListener(new ActionListener() {
50  @Override
51  public void actionPerformed(ActionEvent e) {
52  wiz.doFinishClick();
53  }
54  });
55  }
56 
62  void setFinish(boolean enable) {
63  finishButton.setEnabled(enable);
64  }
65 
66  @Override
67  public boolean isFinishPanel() {
68  return true;
69  }
70 
71  @Override
72  public ReportWizardPortableCaseOptionsVisualPanel getComponent() {
73  if (component == null) {
74  component = new ReportWizardPortableCaseOptionsVisualPanel(this, moduleConfigs, useCaseSpecificData);
75  }
76  return component;
77  }
78 
79  @Override
80  public HelpCtx getHelp() {
81  return HelpCtx.DEFAULT_HELP;
82  }
83 
84  @Override
85  public void readSettings(WizardDescriptor data) {
86  this.wiz = data;
87  wiz.setOptions(new Object[]{WizardDescriptor.PREVIOUS_OPTION, WizardDescriptor.NEXT_OPTION, finishButton, WizardDescriptor.CANCEL_OPTION});
88  }
89 
90  @Override
91  public void storeSettings(WizardDescriptor data) {
92  data.putProperty("portableCaseReportSettings", getComponent().getPortableCaseReportSettings()); //NON-NLS
93  }
94 
95  @Override
96  public boolean isValid() {
97  return true;
98  }
99 
100  @Override
101  public void addChangeListener(ChangeListener cl) {
102  // Nothing to do
103  }
104 
105  @Override
106  public void removeChangeListener(ChangeListener cl) {
107  // Nothing to do
108  }
109 
110 }
111 

Copyright © 2012-2020 Basis Technology. Generated on: Tue Sep 22 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.