From a18f33383668aac5a465bf86d22a57a6eb022753 Mon Sep 17 00:00:00 2001 From: Richard Cordovano Date: Wed, 20 Jan 2016 13:17:34 -0500 Subject: [PATCH] Improve add data source wizard comments --- .../autopsy/casemodule/AddImageAction.java | 27 ++++++++----------- .../AddImageWizardAddingProgressPanel.java | 3 ++- .../AddImageWizardChooseDataSourcePanel.java | 2 +- .../AddImageWizardIngestConfigPanel.java | 2 -- 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java index 2bb2a58bd3..77be8048d0 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageAction.java @@ -40,11 +40,9 @@ import org.sleuthkit.autopsy.ingest.IngestManager; import org.sleuthkit.datamodel.Image; /** - * An action that adds a data source to the current case. - * - * RC: This action needs to be enabled and disabled as cases are opened and - * closed. Currently this is done using - * CallableSystemAction.get(AddImageAction.class).setEnabled(). + * An action that adds a data source to the current case. This action needs to + * be enabled and disabled as cases are opened and closed. Use + * CallableSystemAction.get(AddImageAction.class).setEnabled() to do so. */ public final class AddImageAction extends CallableSystemAction implements Presenter.Toolbar { @@ -59,8 +57,8 @@ public final class AddImageAction extends CallableSystemAction implements Presen * Constructs an action that adds a data source to the current case. */ public AddImageAction() { - cleanupSupport = new ChangeSupport(this); putValue(Action.NAME, NbBundle.getMessage(AddImageAction.class, "CTL_AddImage")); + cleanupSupport = new ChangeSupport(this); toolbarButton = new JButton(); toolbarButton.addActionListener(AddImageAction.this::actionPerformed); setEnabled(false); @@ -103,9 +101,6 @@ public final class AddImageAction extends CallableSystemAction implements Presen * abstract CleanupTask class to call their cleanup methods (assuming * they have not done an override of stateChanged), after which the * CleanupTasks are unregistered. - * - * RC: This is a convoluted and error-prone way to implement clean up. - * Fortunately, it is confined to this package. */ cleanupSupport.fireChange(); } @@ -185,13 +180,8 @@ public final class AddImageAction extends CallableSystemAction implements Presen * cleanUp method is called. Implementations should not override * stateChanged, and should not re-enable themselves after cleanUp is * called. To stop cleanUp being called, call disable before the wizard is - * dismissed. - * - * Instances must be constructed using a reference to an AddImageAction - * object because this is a non-static inner class. - * - * RC: This is a convoluted and error-prone way to implement clean up. - * Fortunately, it is confined to this package. + * dismissed. Also, instances must be constructed using a reference to an + * AddImageAction object because this is a non-static inner class. */ abstract class CleanupTask implements ChangeListener { @@ -238,6 +228,11 @@ public final class AddImageAction extends CallableSystemAction implements Presen } + /** + * Is not used by Autopsy. + * + * @deprecated + */ @Deprecated public interface IndexImageTask { diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java index f64f41091d..1dfc5e7b77 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardAddingProgressPanel.java @@ -38,7 +38,7 @@ import org.sleuthkit.autopsy.corecomponentinterfaces.DataSourceProcessorProgress final class AddImageWizardAddingProgressPanel implements WizardDescriptor.FinishablePanel { private final ChangeSupport changeSupport; - private final DSPProgressMonitorImpl dspProgressMonitor = new DSPProgressMonitorImpl(); + private final DSPProgressMonitorImpl dspProgressMonitor; private AddImageWizardAddingProgressVisual component; private boolean dataSourceAdded = false; @@ -48,6 +48,7 @@ final class AddImageWizardAddingProgressPanel implements WizardDescriptor.Finish */ AddImageWizardAddingProgressPanel() { changeSupport = new ChangeSupport(this); + dspProgressMonitor = new DSPProgressMonitorImpl(); } /** diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourcePanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourcePanel.java index ba7d7fb7ba..2d895fd910 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourcePanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardChooseDataSourcePanel.java @@ -37,7 +37,7 @@ final class AddImageWizardChooseDataSourcePanel implements WizardDescriptor.Pane private AddImageWizardChooseDataSourceVisual component; private final ChangeSupport changeSupport; - private boolean nextButtonIsEnabled = false; + private boolean nextButtonIsEnabled; /** * Constructs an instance of the first panel of the add data source wizard. diff --git a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java index 5d83ec3994..625391a423 100644 --- a/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java +++ b/Core/src/org/sleuthkit/autopsy/casemodule/AddImageWizardIngestConfigPanel.java @@ -194,8 +194,6 @@ final class AddImageWizardIngestConfigPanel implements WizardDescriptor.Panel