Autopsy  4.19.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
ReportWizardPanel2.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2012 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 javax.swing.JButton;
24 import javax.swing.event.ChangeListener;
25 import org.openide.WizardDescriptor;
26 import org.openide.util.HelpCtx;
27 import org.openide.util.NbBundle;
28 
29 class ReportWizardPanel2 implements WizardDescriptor.Panel<WizardDescriptor> {
30 
31  private ReportVisualPanel2 component;
32  private final JButton finishButton;
33  private final JButton nextButton;
34  private WizardDescriptor wiz;
35  private final boolean useCaseSpecificData;
36  private final TableReportSettings settings;
37 
38  ReportWizardPanel2(boolean useCaseSpecificData, TableReportSettings settings) {
39  this.useCaseSpecificData = useCaseSpecificData;
40  this.settings = settings;
41  finishButton = new JButton(NbBundle.getMessage(this.getClass(), "ReportWizardPanel2.finishButton.text"));
42  nextButton = new JButton(NbBundle.getMessage(this.getClass(), "ReportWizardPanel2.nextButton.text"));
43  nextButton.setEnabled(true);
44 
45  nextButton.addActionListener(new ActionListener() {
46  @Override
47  public void actionPerformed(ActionEvent e) {
48  wiz.doNextClick();
49  }
50  });
51 
52  finishButton.addActionListener(new ActionListener() {
53  @Override
54  public void actionPerformed(ActionEvent e) {
55  wiz.doFinishClick();
56  }
57  });
58  }
59 
60  @Override
61  public ReportVisualPanel2 getComponent() {
62  if (component == null) {
63  component = new ReportVisualPanel2(this, useCaseSpecificData, settings);
64  }
65  return component;
66  }
67 
68  @Override
69  public HelpCtx getHelp() {
70  return HelpCtx.DEFAULT_HELP;
71  }
72 
73  @Override
74  public boolean isValid() {
75  return true;
76  }
77 
78  @Override
79  public void addChangeListener(ChangeListener l) {
80  }
81 
82  @Override
83  public void removeChangeListener(ChangeListener l) {
84  }
85 
86  public void setFinish(boolean enabled) {
87  nextButton.setEnabled(false);
88  finishButton.setEnabled(enabled);
89  }
90 
91  @Override
92  public void readSettings(WizardDescriptor wiz) {
93  // Re-enable the normal wizard buttons
94  this.wiz = wiz;
95  wiz.setOptions(new Object[]{WizardDescriptor.PREVIOUS_OPTION, nextButton, finishButton, WizardDescriptor.CANCEL_OPTION});
96  }
97 
98  @Override
99  public void storeSettings(WizardDescriptor wiz) {
100  wiz.putProperty("tableReportSettings", new TableReportSettings(getComponent().getArtifactStates(), getComponent().getTagStates(), useCaseSpecificData, getComponent().getSelectedReportType()));
101  }
102 }

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