19 package org.sleuthkit.autopsy.report;
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
23 import java.util.Collection;
25 import java.util.prefs.Preferences;
26 import javax.swing.JButton;
27 import javax.swing.event.ChangeListener;
28 import org.openide.WizardDescriptor;
29 import org.openide.util.HelpCtx;
30 import org.openide.util.NbBundle;
31 import org.openide.util.NbPreferences;
33 class ReportWizardPanel1
implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
34 private WizardDescriptor wiz;
35 private ReportVisualPanel1 component;
36 private JButton nextButton;
37 private JButton finishButton;
39 ReportWizardPanel1() {
40 nextButton =
new JButton(NbBundle.getMessage(
this.getClass(),
"ReportWizardPanel1.nextButton.text"));
41 finishButton =
new JButton(NbBundle.getMessage(
this.getClass(),
"ReportWizardPanel1.finishButton.text"));
42 finishButton.setEnabled(
false);
45 nextButton.addActionListener(
new ActionListener() {
47 public void actionPerformed(ActionEvent e) {
52 finishButton.addActionListener(
new ActionListener() {
54 public void actionPerformed(ActionEvent e) {
61 public ReportVisualPanel1 getComponent() {
62 if (component == null) {
63 component =
new ReportVisualPanel1(
this);
69 public HelpCtx getHelp() {
70 return HelpCtx.DEFAULT_HELP;
74 public boolean isValid() {
81 public boolean isFinishPanel() {
85 public void setNext(
boolean enabled) {
86 nextButton.setEnabled(enabled);
89 public void setFinish(
boolean enabled) {
90 finishButton.setEnabled(enabled);
94 public void addChangeListener(ChangeListener l) {
98 public void removeChangeListener(ChangeListener l) {
102 public void readSettings(WizardDescriptor wiz) {
105 wiz.setOptions(
new Object[] {WizardDescriptor.PREVIOUS_OPTION, nextButton, finishButton, WizardDescriptor.CANCEL_OPTION});
109 public void storeSettings(WizardDescriptor wiz) {
110 Map<TableReportModule, Boolean> tables = getComponent().getTableModuleStates();
111 Map<GeneralReportModule, Boolean> generals = getComponent().getGeneralModuleStates();
112 wiz.putProperty(
"tableModuleStates", tables);
113 wiz.putProperty(
"generalModuleStates", generals);
114 wiz.putProperty(
"fileModuleStates", getComponent().getFileModuleStates());
118 Preferences prefs = NbPreferences.forModule(ReportWizardPanel1.class);
119 prefs.putBoolean(
"tableModule", any(tables.values()));
120 prefs.putBoolean(
"generalModule", any(generals.values()));
128 private boolean any(Collection<Boolean> bools) {
129 for (Boolean b : bools) {