use of org.baderlab.csplugins.enrichmentmap.view.creation.ErrorMessageDialog in project EnrichmentMapApp by BaderLab.
the class PostAnalysisPanelMediator method buildPostAnalysisParameters.
/**
* Creates a PostAnalysisParameters object based on the user's input.
*/
private Optional<PostAnalysisParameters> buildPostAnalysisParameters(PostAnalysisInputPanel inputPanel, EnrichmentMap map, JDialog parent) {
PostAnalysisParameters.Builder builder = new PostAnalysisParameters.Builder();
List<String> messages = inputPanel.validateInput();
if (!messages.isEmpty()) {
ErrorMessageDialog dialog = errorMessageDialogFactory.create(parent);
dialog.addSection(MessageType.ERROR, "Post Analysis: Error", IconManager.ICON_FILE_O, messages);
dialog.pack();
dialog.setLocationRelativeTo(parent);
dialog.setModal(true);
dialog.setVisible(true);
return Optional.empty();
}
boolean built = inputPanel.build(builder);
if (!built) {
return Optional.empty();
}
builder.setAttributePrefix(map.getParams().getAttributePrefix());
return Optional.of(builder.build());
}
Aggregations