Autopsy  4.15.0
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.infrastructure;
20 
22 import java.awt.event.ActionEvent;
23 import java.awt.event.ActionListener;
24 import javax.swing.JButton;
25 import javax.swing.event.ChangeListener;
26 import org.openide.WizardDescriptor;
27 import org.openide.util.HelpCtx;
28 import org.openide.util.NbBundle;
29 
35 class ReportWizardFileOptionsPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
36 
37  private WizardDescriptor wiz;
38  private ReportWizardFileOptionsVisualPanel component;
39  private final JButton finishButton;
40  private final FileReportSettings settings;
41 
42  ReportWizardFileOptionsPanel(FileReportSettings settings) {
43  this.settings = settings;
44  finishButton = new JButton(
45  NbBundle.getMessage(this.getClass(), "ReportWizardFileOptionsPanel.finishButton.text"));
46  finishButton.setEnabled(false);
47 
48  finishButton.addActionListener(new ActionListener() {
49  @Override
50  public void actionPerformed(ActionEvent e) {
51  wiz.doFinishClick();
52  }
53  ;
54  }
55 
56  );
57  }
58 
59  public void setFinish(boolean enable) {
60  finishButton.setEnabled(enable);
61  }
62 
63  @Override
64  public boolean isFinishPanel() {
65  return true;
66  }
67 
68  @Override
69  public ReportWizardFileOptionsVisualPanel getComponent() {
70  if (component == null) {
71  component = new ReportWizardFileOptionsVisualPanel(this, settings);
72  }
73  return component;
74  }
75 
76  @Override
77  public HelpCtx getHelp() {
78  return HelpCtx.DEFAULT_HELP;
79  }
80 
81  @Override
82  public void readSettings(WizardDescriptor data) {
83  this.wiz = data;
84  wiz.setOptions(new Object[]{WizardDescriptor.PREVIOUS_OPTION, WizardDescriptor.NEXT_OPTION, finishButton, WizardDescriptor.CANCEL_OPTION});
85  }
86 
87  @Override
88  public void storeSettings(WizardDescriptor data) {
89  wiz.putProperty("fileReportSettings", new FileReportSettings(getComponent().getFileReportOptions()));
90  }
91 
92  @Override
93  public boolean isValid() {
94  return true;
95  }
96 
97  @Override
98  public void addChangeListener(ChangeListener cl) {
99  }
100 
101  @Override
102  public void removeChangeListener(ChangeListener cl) {
103  }
104 
105 }

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