return null;
} catch (final InvocationTargetException e) {
final Throwable t = e.getTargetException();
if (t instanceof ExecutionException && t.getCause() instanceof CoreException) {
final CoreException cause = (CoreException) t.getCause();
StatusAdapter status;
if (cause.getStatus().getCode() == IResourceStatus.CASE_VARIANT_EXISTS) {
status = new StatusAdapter(StatusUtil.newStatus(IStatus.WARNING, NLS
.bind(WizardMessages.NewProject_caseVariantExistsError,
newProjectHandle.getName()), cause));
} else {
status = new StatusAdapter(
StatusUtil.newStatus(cause.getStatus().getSeverity(),
WizardMessages.NewProject_errorMessage, cause));
}
status.setProperty(IStatusAdapterConstants.TITLE_PROPERTY,
WizardMessages.NewProject_errorMessage);
StatusManager.getManager().handle(status, StatusManager.BLOCK);
} else {
final StatusAdapter status = new StatusAdapter(new Status(
IStatus.WARNING, ErlideUIPlugin.PLUGIN_ID, 0, NLS.bind(
WizardMessages.NewProject_internalError, t.getMessage()),
t));
status.setProperty(IStatusAdapterConstants.TITLE_PROPERTY,
WizardMessages.NewProject_errorMessage);
StatusManager.getManager().handle(status,
StatusManager.LOG | StatusManager.BLOCK);
}
return null;