use of org.eclipse.jface.dialogs.MessageDialog.openError in project n4js by eclipse.
the class TestResultsView method performRelaunch.
/**
* Invoked when user performs {@link #actionRelaunch}.
*/
protected void performRelaunch() {
if (null != currentRoot) {
final TestSession session = from(registeredSessions).firstMatch(s -> s.root == currentRoot).orNull();
if (null != session) {
final TestConfiguration configurationToReRun = session.configuration;
registeredSessions.remove(session);
try {
final TestConfiguration newConfiguration = testerFrontEnd.createConfiguration(configurationToReRun);
testerFrontEndUI.runInUI(newConfiguration);
} catch (Exception e) {
String message = "Test class not found in the workspace.";
if (!Strings.isNullOrEmpty(e.getMessage())) {
message += " Reason: " + e.getMessage();
}
MessageDialog.openError(getShell(), "Cannot open editor", message);
}
}
}
}
Aggregations