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

Copyright © 2012-2018 Basis Technology. Generated on: Tue Dec 18 2018
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.