Autopsy  4.13.0
Graphical digital forensics platform for The Sleuth Kit and other tools.
ConfigWizardPanel2.java
Go to the documentation of this file.
1 /*
2  * Autopsy
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.logicalimager.configuration;
20 
21 import javax.swing.event.ChangeListener;
22 import org.openide.WizardDescriptor;
23 import org.openide.util.HelpCtx;
24 
28 final class ConfigWizardPanel2 implements WizardDescriptor.Panel<WizardDescriptor> {
29 
34  private ConfigVisualPanel2 component;
35  private String configFilename;
36  private LogicalImagerConfig config;
37 
38  // Get the visual component for the panel. In this template, the component
39  // is kept separate. This can be more efficient: if the wizard is created
40  // but never displayed, or not all panels are displayed, it is better to
41  // create only those which really need to be visible.
42  @Override
43  public ConfigVisualPanel2 getComponent() {
44  if (component == null) {
45  component = new ConfigVisualPanel2();
46  }
47  return component;
48  }
49 
50  @Override
51  public HelpCtx getHelp() {
52  // Show no Help button for this panel:
53  return HelpCtx.DEFAULT_HELP;
54  // If you have context help:
55  // return new HelpCtx("help.key.here");
56  }
57 
58  @Override
59  public boolean isValid() {
60  // If it is always OK to press Next or Finish, then:
61  return true;
62  // If it depends on some condition (form filled out...) and
63  // this condition changes (last form field filled in...) then
64  // use ChangeSupport to implement add/removeChangeListener below.
65  // WizardDescriptor.ERROR/WARNING/INFORMATION_MESSAGE will also be useful.
66  }
67 
68  @Override
69  public void readSettings(WizardDescriptor wiz) {
70  // use wiz.getProperty to retrieve previous panel state
71  configFilename = (String) wiz.getProperty("configFilename"); // NON-NLS
72  config = (LogicalImagerConfig) wiz.getProperty("config"); // NON-NLS
73  component.setConfiguration(configFilename, config);
74  }
75 
76  @Override
77  public void storeSettings(WizardDescriptor wiz) {
78  // use wiz.putProperty to remember current panel state
79  }
80 
81  @Override
82  public void addChangeListener(ChangeListener cl) {
83  // Not used
84  }
85 
86  @Override
87  public void removeChangeListener(ChangeListener cl) {
88  // Not used
89  }
90 
91 }

Copyright © 2012-2019 Basis Technology. Generated on: Tue Jan 7 2020
This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.