Autopsy  3.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;
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 import org.openide.util.NbPreferences;
29 
30  class ReportWizardPanel2 implements WizardDescriptor.Panel<WizardDescriptor> {
31  private ReportVisualPanel2 component;
32  private JButton finishButton;
33  private JButton nextButton;
34  private WizardDescriptor wiz;
35 
36  ReportWizardPanel2() {
37  finishButton = new JButton(NbBundle.getMessage(this.getClass(), "ReportWizardPanel2.finishButton.text"));
38 
39  nextButton = new JButton(NbBundle.getMessage(this.getClass(), "ReportWizardPanel2.nextButton.text"));
40  nextButton.setEnabled(true);
41 
42  nextButton.addActionListener(new ActionListener() {
43  @Override
44  public void actionPerformed(ActionEvent e) {
45  wiz.doNextClick();
46  }
47  });
48 
49  finishButton.addActionListener(new ActionListener() {
50  @Override
51  public void actionPerformed(ActionEvent e) {
52  wiz.doFinishClick();
53  }
54  });
55  }
56 
57  @Override
58  public ReportVisualPanel2 getComponent() {
59  if (component == null) {
60  component = new ReportVisualPanel2(this);
61  }
62  return component;
63  }
64 
65  @Override
66  public HelpCtx getHelp() {
67  return HelpCtx.DEFAULT_HELP;
68  }
69 
70  @Override
71  public boolean isValid() {
72  return true;
73  }
74 
75  @Override
76  public void addChangeListener(ChangeListener l) {
77  }
78 
79  @Override
80  public void removeChangeListener(ChangeListener l) {
81  }
82 
83  public void setFinish(boolean enabled) {
84  nextButton.setEnabled(false);
85  finishButton.setEnabled(enabled);
86  }
87 
88  @Override
89  public void readSettings(WizardDescriptor wiz) {
90  // Re-enable the normal wizard buttons
91  setFinish(true);
92  this.wiz = wiz;
93  wiz.setOptions(new Object[] {WizardDescriptor.PREVIOUS_OPTION, nextButton, finishButton, WizardDescriptor.CANCEL_OPTION});
94  }
95 
96  @Override
97  public void storeSettings(WizardDescriptor wiz) {
98  wiz.putProperty("tagStates", getComponent().getTagStates()); //NON-NLS
99  wiz.putProperty("artifactStates", getComponent().getArtifactStates()); //NON-NLS
100  wiz.putProperty("isTagsSelected", getComponent().isTaggedResultsRadioButtonSelected()); //NON-NLS
101  }
102 }

Copyright © 2012-2015 Basis Technology. Generated on: Mon Oct 19 2015
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.