{
private final static Logger LOGGER = Logger.getInstance(ExportReviewAction.class.getName());
public void actionPerformed(AnActionEvent e)
{
Project project = e.getData(PlatformDataKeys.PROJECT);
JList liReviews = (JList) e.getData(PlatformDataKeys.CONTEXT_COMPONENT);
if ((project == null) || (liReviews == null))
{
return;
}
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());