2518 moved startDataSourceProcessing call to AddImageWizardIterator

This commit is contained in:
William Schaefer 2017-04-05 11:52:12 -04:00
parent 28a706efde
commit 3aad466133
3 changed files with 40 additions and 41 deletions

View File

@ -61,7 +61,7 @@ class AddImageWizardAddingProgressPanel extends ShortcutWizardDescriptorPanel {
private final AddImageAction addImageAction; private final AddImageAction addImageAction;
private DataSourceProcessor dsProcessor; private DataSourceProcessor dsProcessor = null;
private boolean cancelled; private boolean cancelled;
/** /**
* flag to indicate that the image adding process is finished and this panel * flag to indicate that the image adding process is finished and this panel
@ -307,6 +307,7 @@ class AddImageWizardAddingProgressPanel extends ShortcutWizardDescriptorPanel {
* DataSourceProcessor * DataSourceProcessor
*/ */
void startDataSourceProcessing(DataSourceProcessor dsp) { void startDataSourceProcessing(DataSourceProcessor dsp) {
if (dsProcessor == null) { //this can only be run once
final UUID dataSourceId = UUID.randomUUID(); final UUID dataSourceId = UUID.randomUUID();
newContents.clear(); newContents.clear();
cleanupTask = null; cleanupTask = null;
@ -340,6 +341,7 @@ class AddImageWizardAddingProgressPanel extends ShortcutWizardDescriptorPanel {
// Kick off the DSProcessor // Kick off the DSProcessor
dsProcessor.run(getDSPProgressMonitorImpl(), cbObj); dsProcessor.run(getDSPProgressMonitorImpl(), cbObj);
} }
}
/* /*
* Cancels the data source processing - in case the users presses 'Cancel' * Cancels the data source processing - in case the users presses 'Cancel'

View File

@ -47,12 +47,9 @@ class AddImageWizardDataSourceSettingsPanel extends ShortcutWizardDescriptorPane
*/ */
private AddImageWizardDataSourceSettingsVisual component; private AddImageWizardDataSourceSettingsVisual component;
private boolean isNextEnable = false; private boolean isNextEnable = false;
private final AddImageWizardAddingProgressPanel progressPanel;
private boolean processingStarted = false;
// paths to any set hash lookup databases (can be null) // paths to any set hash lookup databases (can be null)
AddImageWizardDataSourceSettingsPanel(AddImageWizardAddingProgressPanel proPanel) { AddImageWizardDataSourceSettingsPanel() {
this.progressPanel = proPanel;
} }
/** /**
@ -200,12 +197,6 @@ class AddImageWizardDataSourceSettingsPanel extends ShortcutWizardDescriptorPane
*/ */
@Override @Override
public void storeSettings(WizardDescriptor settings) { public void storeSettings(WizardDescriptor settings) {
// Start processing the data source by handing it off to the selected DSP,
// so it gets going in the background while the user is still picking the Ingest modules
if (!processingStarted) { //storeSettings is called twice
processingStarted = true;
progressPanel.startDataSourceProcessing(component.getCurrentDSProcessor());
}
} }
/** /**

View File

@ -58,7 +58,7 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
panels.add(dspSelection); panels.add(dspSelection);
AddImageWizardAddingProgressPanel progressPanel = new AddImageWizardAddingProgressPanel(action); AddImageWizardAddingProgressPanel progressPanel = new AddImageWizardAddingProgressPanel(action);
AddImageWizardDataSourceSettingsPanel dsPanel = new AddImageWizardDataSourceSettingsPanel(progressPanel); AddImageWizardDataSourceSettingsPanel dsPanel = new AddImageWizardDataSourceSettingsPanel();
AddImageWizardIngestConfigPanel ingestConfigPanel = new AddImageWizardIngestConfigPanel(progressPanel); AddImageWizardIngestConfigPanel ingestConfigPanel = new AddImageWizardIngestConfigPanel(progressPanel);
panels.add(dsPanel); panels.add(dsPanel);
List<IngestProfiles.IngestProfile> profiles = IngestProfiles.getIngestProfiles(); List<IngestProfiles.IngestProfile> profiles = IngestProfiles.getIngestProfiles();
@ -174,7 +174,13 @@ class AddImageWizardIterator implements WizardDescriptor.Iterator<WizardDescript
if (!hasNext()) { if (!hasNext()) {
throw new NoSuchElementException(); throw new NoSuchElementException();
} }
// Start processing the data source by handing it off to the selected DSP,
// so it gets going in the background while the user is still picking the Ingest modules
// This will occur when the next button is clicked on the panel where you have chosen your data to process
if (index == dsPanelIndex) {
((AddImageWizardAddingProgressPanel) panels.get(progressPanelIndex)).
startDataSourceProcessing(((AddImageWizardDataSourceSettingsPanel) panels.get(dsPanelIndex)).getComponent().getCurrentDSProcessor());
}
boolean panelEnablesSkipping = current().panelEnablesSkipping(); boolean panelEnablesSkipping = current().panelEnablesSkipping();
boolean skipNextPanel = current().skipNextPanel(); boolean skipNextPanel = current().skipNextPanel();
index++; index++;