Skip to content
Snippets Groups Projects
Commit aadfa28e authored by Markus Alexander Kuppe's avatar Markus Alexander Kuppe
Browse files

Verify that the user provided email address is valid and can be used to

send the model checking result to.

[Feature][Toolbox]
parent 91e8f444
No related branches found
No related tags found
No related merge requests found
......@@ -742,6 +742,29 @@ public class MainModelPage extends BasicFormPage implements IConfigurationConsta
}
}
// Verify that the user provided email address is valid and can be used to send
// the model checking result to.
if (this.distributedCombo.getSelectionIndex() > 1) {
final String text = resultMailAddressText.getText();
try {
javax.mail.internet.InternetAddress.parse(text, true);
} catch (javax.mail.internet.AddressException exp) {
modelEditor.addErrorMessage("email address invalid",
"For Cloud TLC to work please enter a valid email address.", this.getId(),
IMessageProvider.ERROR,
UIHelper.getWidget(dm.getAttributeControl(LAUNCH_DISTRIBUTED_RESULT_MAIL_ADDRESS)));
setComplete(false);
expandSection(SEC_HOW_TO_RUN);
}
if ("".equals(text.trim())) {
modelEditor.addErrorMessage("email address missing",
"For Cloud TLC to work please enter an email address.", this.getId(), IMessageProvider.ERROR,
UIHelper.getWidget(dm.getAttributeControl(LAUNCH_DISTRIBUTED_RESULT_MAIL_ADDRESS)));
setComplete(false);
expandSection(SEC_HOW_TO_RUN);
}
}
mm.setAutoUpdate(true);
super.validatePage(switchToErrorPage);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment