Autopsy  3.1
Graphical digital forensics platform for The Sleuth Kit and other tools.
ReportWizardFileOptionsPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2013 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 
34  class ReportWizardFileOptionsPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor>{
35  private WizardDescriptor wiz;
36  private ReportWizardFileOptionsVisualPanel component;
37  private JButton finishButton;
38 
39  ReportWizardFileOptionsPanel() {
40  finishButton = new JButton(
41  NbBundle.getMessage(this.getClass(), "ReportWizardFileOptionsPanel.finishButton.text"));
42  finishButton.setEnabled(false);
43 
44  finishButton.addActionListener(new ActionListener() {
45  @Override
46  public void actionPerformed(ActionEvent e) {
47  wiz.doFinishClick();
48  };
49  });
50  }
51 
52  public void setFinish(boolean enable) {
53  finishButton.setEnabled(enable);
54  }
55 
56  @Override
57  public boolean isFinishPanel() {
58  return true;
59  }
60 
61  @Override
62  public ReportWizardFileOptionsVisualPanel getComponent() {
63  if (component == null) {
64  component = new ReportWizardFileOptionsVisualPanel(this);
65  }
66  return component;
67  }
68 
69  @Override
70  public HelpCtx getHelp() {
71  return HelpCtx.DEFAULT_HELP;
72  }
73 
74  @Override
75  public void readSettings(WizardDescriptor data) {
76  this.wiz = data;
77  wiz.setOptions(new Object[] {WizardDescriptor.PREVIOUS_OPTION, WizardDescriptor.NEXT_OPTION, finishButton, WizardDescriptor.CANCEL_OPTION});
78  }
79 
80  @Override
81  public void storeSettings(WizardDescriptor data) {
82  data.putProperty("fileReportOptions", getComponent().getFileReportOptions()); //NON-NLS
83  }
84 
85  @Override
86  public boolean isValid() {
87  return true;
88  }
89 
90  @Override
91  public void addChangeListener(ChangeListener cl) {
92  }
93 
94  @Override
95  public void removeChangeListener(ChangeListener cl) {
96  }
97 
98 }

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.