Autopsy  4.11.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ReportWizardPortableCaseOptionsPanel.java
Go to the documentation of this file.
1 /*
2  * Autopsy Forensic Browser
3  *
4  * Copyright 2019 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 
33 class ReportWizardPortableCaseOptionsPanel implements WizardDescriptor.FinishablePanel<WizardDescriptor> {
34 
35  private WizardDescriptor wiz;
36  private ReportWizardPortableCaseOptionsVisualPanel component;
37  private final JButton finishButton;
38 
39  ReportWizardPortableCaseOptionsPanel() {
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 
57  void setFinish(boolean enable) {
58  finishButton.setEnabled(enable);
59  }
60 
61  @Override
62  public boolean isFinishPanel() {
63  return true;
64  }
65 
66  @Override
67  public ReportWizardPortableCaseOptionsVisualPanel getComponent() {
68  if (component == null) {
69  component = new ReportWizardPortableCaseOptionsVisualPanel(this);
70  }
71  return component;
72  }
73 
74  @Override
75  public HelpCtx getHelp() {
76  return HelpCtx.DEFAULT_HELP;
77  }
78 
79  @Override
80  public void readSettings(WizardDescriptor data) {
81  this.wiz = data;
82  wiz.setOptions(new Object[]{WizardDescriptor.PREVIOUS_OPTION, WizardDescriptor.NEXT_OPTION, finishButton, WizardDescriptor.CANCEL_OPTION});
83  }
84 
85  @Override
86  public void storeSettings(WizardDescriptor data) {
87  data.putProperty("portableCaseReportOptions", getComponent().getPortableCaseReportOptions()); //NON-NLS
88  }
89 
90  @Override
91  public boolean isValid() {
92  return true;
93  }
94 
95  @Override
96  public void addChangeListener(ChangeListener cl) {
97  // Nothing to do
98  }
99 
100  @Override
101  public void removeChangeListener(ChangeListener cl) {
102  // Nothing to do
103  }
104 
105 }
106 

Copyright © 2012-2018 Basis Technology. Generated on: Fri Jun 21 2019
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.