19 package org.sleuthkit.autopsy.logicalimager.configuration;
21 import java.beans.PropertyChangeEvent;
22 import java.beans.PropertyChangeListener;
23 import java.util.HashSet;
24 import java.util.Iterator;
26 import javax.swing.event.ChangeEvent;
27 import javax.swing.event.ChangeListener;
28 import org.openide.WizardDescriptor;
29 import org.openide.util.HelpCtx;
34 final class ConfigWizardPanel3
implements WizardDescriptor.Panel<WizardDescriptor> {
36 private final Set<ChangeListener> listeners =
new HashSet<>(1);
37 private ConfigVisualPanel3 component;
40 public ConfigVisualPanel3 getComponent() {
41 if (component == null) {
42 component =
new ConfigVisualPanel3();
43 component.addPropertyChangeListener(
new PropertyChangeListener() {
45 public void propertyChange(PropertyChangeEvent evt) {
46 if (evt.getPropertyName().equals(ConfigVisualPanel3.getSavedEventName())) {
56 public HelpCtx getHelp() {
57 return HelpCtx.DEFAULT_HELP;
61 public void readSettings(WizardDescriptor wiz) {
62 String configFilename = (String) wiz.getProperty(
"configFilename");
63 LogicalImagerConfig config = (LogicalImagerConfig) wiz.getProperty(
"config");
64 component.setConfigInfoForSaving(configFilename, config);
65 component.resetPanel();
69 public void storeSettings(WizardDescriptor data) {
74 public boolean isValid() {
75 return component.isSaved();
81 private void fireChangeEvent() {
82 Iterator<ChangeListener> it;
83 synchronized (listeners) {
84 it =
new HashSet<>(listeners).iterator();
86 ChangeEvent ev =
new ChangeEvent(
this);
87 while (it.hasNext()) {
88 it.next().stateChanged(ev);
93 public void addChangeListener(ChangeListener cl) {
94 synchronized (listeners) {
100 public void removeChangeListener(ChangeListener cl) {
101 synchronized (listeners) {
102 listeners.remove(cl);