19 package org.sleuthkit.autopsy.report.infrastructure;
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
24 import java.util.prefs.Preferences;
25 import javax.swing.JButton;
26 import javax.swing.event.ChangeListener;
27 import org.openide.WizardDescriptor;
28 import org.openide.util.HelpCtx;
29 import org.openide.util.NbBundle;
30 import org.openide.util.NbPreferences;
33 class ReportWizardPanel1
implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
35 private WizardDescriptor wiz;
36 private ReportVisualPanel1 component;
37 private final Map<String, ReportModuleConfig> moduleConfigs;
38 private final JButton nextButton;
39 private final JButton finishButton;
41 ReportWizardPanel1(Map<String, ReportModuleConfig> moduleConfigs) {
42 this.moduleConfigs = moduleConfigs;
43 nextButton =
new JButton(NbBundle.getMessage(
this.getClass(),
"ReportWizardPanel1.nextButton.text"));
44 finishButton =
new JButton(NbBundle.getMessage(
this.getClass(),
"ReportWizardPanel1.finishButton.text"));
45 finishButton.setEnabled(
false);
48 nextButton.addActionListener(
new ActionListener() {
50 public void actionPerformed(ActionEvent e) {
55 finishButton.addActionListener(
new ActionListener() {
57 public void actionPerformed(ActionEvent e) {
64 public ReportVisualPanel1 getComponent() {
65 if (component == null) {
66 component =
new ReportVisualPanel1(
this, moduleConfigs);
72 public HelpCtx getHelp() {
73 return HelpCtx.DEFAULT_HELP;
77 public boolean isValid() {
84 public boolean isFinishPanel() {
88 public void setNext(
boolean enabled) {
89 nextButton.setEnabled(enabled);
92 public void setFinish(
boolean enabled) {
93 finishButton.setEnabled(enabled);
97 public void addChangeListener(ChangeListener l) {
101 public void removeChangeListener(ChangeListener l) {
105 public void readSettings(WizardDescriptor wiz) {
108 wiz.setOptions(
new Object[]{WizardDescriptor.PREVIOUS_OPTION, nextButton, finishButton, WizardDescriptor.CANCEL_OPTION});
112 public void storeSettings(WizardDescriptor wiz) {
113 wiz.putProperty(
"moduleConfigs", getComponent().getUpdatedModuleConfigs());
114 wiz.putProperty(
"modules", getComponent().getReportModules());
118 Preferences prefs = NbPreferences.forModule(ReportWizardPanel1.class);
119 prefs.putBoolean(
"tableModule", getComponent().getTableModule() != null);
120 prefs.putBoolean(
"generalModule", getComponent().getGeneralModule() != null);
121 prefs.putBoolean(
"portableCaseModule", getComponent().getPortableCaseModule() != null);