19 package org.sleuthkit.autopsy.casemodule;
21 import java.util.HashSet;
22 import java.util.Iterator;
24 import javax.swing.event.ChangeEvent;
25 import javax.swing.event.ChangeListener;
26 import org.openide.WizardDescriptor;
27 import org.openide.WizardValidationException;
28 import org.openide.util.HelpCtx;
29 import org.openide.windows.WindowManager;
30 import java.awt.Cursor;
40 class NewCaseWizardPanel2
implements WizardDescriptor.ValidatingPanel<WizardDescriptor> {
46 private NewCaseVisualPanel2 component;
47 private Boolean isFinish =
true;
48 private String caseName;
49 private String caseDir;
50 private String createdDirectory;
51 private CaseType caseType;
62 public NewCaseVisualPanel2 getComponent() {
63 if (component == null) {
64 component =
new NewCaseVisualPanel2();
76 public HelpCtx getHelp() {
78 return HelpCtx.DEFAULT_HELP;
91 public boolean isValid() {
100 private final Set<ChangeListener> listeners =
new HashSet<ChangeListener>(1);
108 public final void addChangeListener(ChangeListener l) {
109 synchronized (listeners) {
120 public final void removeChangeListener(ChangeListener l) {
121 synchronized (listeners) {
130 protected final void fireChangeEvent() {
131 Iterator<ChangeListener> it;
132 synchronized (listeners) {
133 it =
new HashSet<>(listeners).iterator();
135 ChangeEvent ev =
new ChangeEvent(
this);
136 while (it.hasNext()) {
137 it.next().stateChanged(ev);
154 public void readSettings(WizardDescriptor settings) {
155 caseName = (String) settings.getProperty(
"caseName");
156 caseDir = (String) settings.getProperty(
"caseParentDir");
157 createdDirectory = (String) settings.getProperty(
"createdDirectory");
158 caseType = CaseType.values()[(int) settings.getProperty(
"caseType")];
171 public void storeSettings(WizardDescriptor settings) {
172 NewCaseVisualPanel2 currentComponent = getComponent();
173 settings.putProperty(
"caseNumber", currentComponent.getCaseNumber());
174 settings.putProperty(
"caseExaminer", currentComponent.getExaminer());
178 public void validate() throws WizardValidationException {
179 WindowManager.getDefault().getMainWindow().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));