JComponent () { myValidateButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { try { VelocityHelper.verify(myEditor.getDocument().getText()); Messages.showInfoMessage(myProject, CopyrightBundle.message("dialog.message.velocity.template.is.valid"), CopyrightBundle.message("dialog.title.validation")); } catch (Exception e1) { Messages.showInfoMessage(myProject, CopyrightBundle.message("dialog.message.velocity.template.contains.error.0", e1.getMessage()), CopyrightBundle.message("dialog.title.validation")); } } }); myWholePanel.setBorder(JBUI.Borders.empty(5, 10, 10, 10)); return myWholePanel; }