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;
40 private final boolean displayCaseSpecificData;
42 ReportWizardPanel1(Map<String, ReportModuleConfig> moduleConfigs,
boolean displayCaseSpecificData) {
43 this.moduleConfigs = moduleConfigs;
44 this.displayCaseSpecificData = displayCaseSpecificData;
45 nextButton =
new JButton(NbBundle.getMessage(
this.getClass(),
"ReportWizardPanel1.nextButton.text"));
46 finishButton =
new JButton(NbBundle.getMessage(
this.getClass(),
"ReportWizardPanel1.finishButton.text"));
47 finishButton.setEnabled(
false);
50 nextButton.addActionListener(
new ActionListener() {
52 public void actionPerformed(ActionEvent e) {
57 finishButton.addActionListener(
new ActionListener() {
59 public void actionPerformed(ActionEvent e) {
66 public ReportVisualPanel1 getComponent() {
67 if (component == null) {
68 component =
new ReportVisualPanel1(
this, moduleConfigs, displayCaseSpecificData);
74 public HelpCtx getHelp() {
75 return HelpCtx.DEFAULT_HELP;
79 public boolean isValid() {
86 public boolean isFinishPanel() {
90 public void setNext(
boolean enabled) {
91 nextButton.setEnabled(enabled);
94 public void setFinish(
boolean enabled) {
95 finishButton.setEnabled(enabled);
99 public void addChangeListener(ChangeListener l) {
103 public void removeChangeListener(ChangeListener l) {
107 public void readSettings(WizardDescriptor wiz) {
110 wiz.setOptions(
new Object[]{WizardDescriptor.PREVIOUS_OPTION, nextButton, finishButton, WizardDescriptor.CANCEL_OPTION});
114 public void storeSettings(WizardDescriptor wiz) {
115 wiz.putProperty(
"moduleConfigs", getComponent().getUpdatedModuleConfigs());
116 wiz.putProperty(
"modules", getComponent().getReportModules());
120 Preferences prefs = NbPreferences.forModule(ReportWizardPanel1.class);
121 TableReportModule tableModuleSelection = getComponent().getTableModule();
122 GeneralReportModule generalModuleSelection = getComponent().getGeneralModule();
123 FileReportModule fileModuleSelection = getComponent().getFileModule();
125 prefs.putBoolean(
"tableModule", tableModuleSelection != null);
126 prefs.putBoolean(
"generalModule", generalModuleSelection != null);
127 prefs.putBoolean(
"portableCaseModule", getComponent().getPortableCaseModule() != null);
128 prefs.putBoolean(
"showDataSourceSelectionPanel",
false);
130 if(generalModuleSelection != null && generalModuleSelection.supportsDataSourceSelection()) {
131 prefs.putBoolean(
"showDataSourceSelectionPanel",
true);
134 if(tableModuleSelection != null) {
135 prefs.putBoolean(
"showDataSourceSelectionPanel",
true);
138 if(fileModuleSelection != null) {
139 prefs.putBoolean(
"showDataSourceSelectionPanel",
true);