final CommentForm commentForm = new CommentForm(project, editor, filePath, commentSide, commentToEdit);
final JBPopup balloon = commentBalloonBuilder.getNewCommentBalloon(commentForm, "Comment");
balloon.addListener(new JBPopupAdapter() {
@Override
public void onClosed(LightweightWindowEvent event) {
DraftInput comment = commentForm.getComment();
if (comment != null) {
handleComment(comment, project);
}
}
});