77
88import com .intellij .openapi .project .Project ;
99import com .intellij .psi .PsiDirectory ;
10- import com .magento .idea .magento2plugin .actions .generation .NewEmailTemplateAction ;
1110import com .magento .idea .magento2plugin .actions .generation .data .EmailTemplateHtmlData ;
1211import com .magento .idea .magento2plugin .actions .generation .data .EmailTemplatesXmlData ;
1312import com .magento .idea .magento2plugin .actions .generation .dialog .validator .annotation .FieldValidation ;
1615import com .magento .idea .magento2plugin .actions .generation .dialog .validator .rule .NotEmptyRule ;
1716import com .magento .idea .magento2plugin .actions .generation .generator .ModuleEmailTemplateHtmlGenerator ;
1817import com .magento .idea .magento2plugin .actions .generation .generator .ModuleEmailTemplatesXmlGenerator ;
18+ import com .magento .idea .magento2plugin .actions .generation .NewEmailTemplateAction ;
1919import com .magento .idea .magento2plugin .magento .files .EmailTemplateHtml ;
2020import com .magento .idea .magento2plugin .magento .packages .Areas ;
2121import com .magento .idea .magento2plugin .ui .FilteredComboBox ;
2222import com .magento .idea .magento2plugin .util .magento .GetModuleNameByDirectoryUtil ;
23- import javax .swing .JPanel ;
24- import javax .swing .JComponent ;
25- import javax .swing .JButton ;
26- import javax .swing .KeyStroke ;
27- import javax .swing .JTextField ;
28- import java .awt .event .WindowEvent ;
29- import java .awt .event .WindowAdapter ;
30- import java .awt .event .ActionListener ;
3123import java .awt .event .ActionEvent ;
24+ import java .awt .event .ActionListener ;
3225import java .awt .event .KeyEvent ;
26+ import java .awt .event .WindowAdapter ;
27+ import java .awt .event .WindowEvent ;
3328import java .util .ArrayList ;
3429import java .util .Arrays ;
3530import java .util .List ;
31+ import javax .swing .JButton ;
32+ import javax .swing .JComponent ;
33+ import javax .swing .JPanel ;
34+ import javax .swing .JTextField ;
35+ import javax .swing .KeyStroke ;
3636
3737public class NewEmailTemplateDialog extends AbstractDialog {
3838 private final String moduleName ;
@@ -60,6 +60,12 @@ public class NewEmailTemplateDialog extends AbstractDialog {
6060 private FilteredComboBox templateType ;
6161 private JTextField subject ;
6262
63+ /**
64+ * New email template dialog.
65+ *
66+ * @param project Project
67+ * @param directory Directory
68+ */
6369 public NewEmailTemplateDialog (final Project project , final PsiDirectory directory ) {
6470 setContentPane (contentPane );
6571 setModal (true );
@@ -79,11 +85,15 @@ public void windowClosing(final WindowEvent e) {
7985 });
8086
8187 // call onCancel() on ESCAPE
82- contentPane .registerKeyboardAction (new ActionListener () {
83- public void actionPerformed (ActionEvent e ) {
84- onCancel ();
85- }
86- }, KeyStroke .getKeyStroke (KeyEvent .VK_ESCAPE , 0 ), JComponent .WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
88+ contentPane .registerKeyboardAction (
89+ new ActionListener () {
90+ public void actionPerformed (ActionEvent e ) {
91+ onCancel ();
92+ }
93+ },
94+ KeyStroke .getKeyStroke (KeyEvent .VK_ESCAPE , 0 ),
95+ JComponent .WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
96+ );
8797 }
8898
8999 /**
0 commit comments