// Show method's set-up dialog.
final MZmineModuleWrapper wrappedModule = (MZmineModuleWrapper) selectedItem;
final MZmineProcessingModule selectedMethod = (MZmineProcessingModule) wrappedModule
.getModule();
final ParameterSet methodParams = MZmineCore.getConfiguration()
.getModuleParameters(selectedMethod.getClass());
if (methodParams.getParameters().length > 0) {
ExitCode exitCode = methodParams.showSetupDialog();
if (exitCode != ExitCode.OK)
return;
}
// Make a new step
final ParameterSet stepParams = methodParams.cloneParameter();
final MZmineProcessingStep<MZmineProcessingModule> step = new MZmineProcessingStepImpl<MZmineProcessingModule>(
selectedMethod, stepParams);
// Add step to queue.
batchQueue.add(step);
currentStepsList.setListData(batchQueue);
currentStepsList.setSelectedIndex(currentStepsList.getModel()
.getSize() - 1);
}
}
if (btnRemove.equals(src)) {
// Remove selected step.
final MZmineProcessingStep selected = (MZmineProcessingStep) currentStepsList
.getSelectedValue();
if (selected != null) {
final int index = currentStepsList.getSelectedIndex();
batchQueue.remove(selected);
currentStepsList.setListData(batchQueue);
selectStep(index);
}
}
if (btnClear.equals(src)) {
// Clear the queue.
batchQueue.clear();
currentStepsList.setListData(batchQueue);
}
if (btnConfig.equals(src)) {
// Configure the selected item.
final MZmineProcessingStep selected = (MZmineProcessingStep) currentStepsList
.getSelectedValue();
final ParameterSet parameters = selected == null ? null : selected
.getParameterSet();
if (parameters != null) {
parameters.showSetupDialog();
}
}
if (btnSave.equals(src)) {