19 package org.sleuthkit.autopsy.report;
21 import java.awt.event.ActionEvent;
22 import java.awt.event.ActionListener;
23 import java.util.Collection;
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;
32 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 TableReportModule module = getComponent().getTableModule();
111 GeneralReportModule general = getComponent().getGeneralModule();
112 wiz.putProperty(
"tableModule", module);
113 wiz.putProperty(
"generalModule", general);
114 wiz.putProperty(
"fileModule", getComponent().getFileModule());
118 Preferences prefs = NbPreferences.forModule(ReportWizardPanel1.class);
119 prefs.putBoolean(
"tableModule", module != null);
120 prefs.putBoolean(
"generalModule", general != null);
130 private boolean any(Collection<Boolean> bools) {
131 for (Boolean b : bools) {