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

Copyright © 2012-2016 Basis Technology. Generated on: Fri Sep 29 2017
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.