use of net.parostroj.timetable.model.imports.Import.ImportError in project grafikon by jub77.
the class ImportModelAction method eventDispatchActionAfter.
@Override
protected void eventDispatchActionAfter() {
if (context.isCancelled()) {
return;
}
List<ImportError> errors = new LinkedList<>();
for (ImportComponent comp : imports.getImportComponents()) {
errors.addAll(imports.getErrors(comp));
}
// create string ...
if (!errors.isEmpty()) {
StringBuilder message = new StringBuilder();
int lineLength = 70;
int nextLimit = lineLength;
for (ImportError error : errors) {
if (message.length() != 0) {
message.append(", ");
}
if (nextLimit < message.length()) {
message.append('\n');
nextLimit += lineLength;
}
message.append(getText(error));
}
JOptionPane.showConfirmDialog(getActionContext().getLocationComponent(), message, ResourceLoader.getString("import.warning.title"), JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE);
}
}
Aggregations