Review review = (Review) liReviews.getSelectedValue();
if (!review.isExternalizable())
{
String errorTitle = RevuBundle.message("friendlyError.notExternalizableReview.title.text", review.getName());
String errorDetails = RevuBundle.message("friendlyError.notExternalizableReview.details.details.text", review.getName());
StatusBarComponent.showMessageInPopup(project, new StatusBarMessage(StatusBarMessage.Type.ERROR, errorTitle, errorDetails), true);
return;
}
ExportDialog exportDialog = new ExportDialog(project);
exportDialog.show(review);
if (!exportDialog.isOK())
{
return;
}
File f = exportDialog.getFile();
if (f != null)
{
try
{
project.getComponent(IReviewExternalizer.class).save(review, f);
}
catch (Exception ex)
{
LOGGER.warn("Failed to close exported review file", ex);
String errorTitle = RevuBundle.message("friendlyError.exportFailed.title.text", review.getName());
String errorDetails = RevuBundle.message("friendlyError.externalizing.save.error.details.text",
f.getPath(), ex.getMessage());
StatusBarComponent.showMessageInPopup(project, (new StatusBarMessage(StatusBarMessage.Type.ERROR, errorTitle,
errorDetails)), false);
}
}
}