5252 "PMD.ExcessiveImports" ,
5353})
5454public class NewMessageQueueDialog extends AbstractDialog {
55+
5556 private static final String TOPIC_NAME = "Topic Name" ;
5657 private static final String HANDLER_NAME = "Handler Name" ;
5758 private static final String HANDLER_TYPE = "Handler Type" ;
@@ -64,6 +65,8 @@ public class NewMessageQueueDialog extends AbstractDialog {
6465 private static final String BINDING_TOPIC = "Binding Topic" ;
6566
6667 private JComboBox connectionName ;
68+ private final Project project ;
69+ private final String moduleName ;
6770
6871 /* TODO: Improve validation */
6972 @ FieldValidation (rule = RuleRegistry .NOT_EMPTY ,
@@ -146,13 +149,16 @@ public class NewMessageQueueDialog extends AbstractDialog {
146149 private JLabel consumerNameLabel ;//NOPMD
147150 private JLabel handlerDirectoryLabel ;//NOPMD
148151
149- private final Project project ;
150- private final String moduleName ;
151-
152152 /**
153153 * Constructor.
154+ *
155+ * @param project Project
156+ * @param directory PsiDirectory
154157 */
155- public NewMessageQueueDialog (final Project project , final PsiDirectory directory ) {
158+ public NewMessageQueueDialog (
159+ final @ NotNull Project project ,
160+ final @ NotNull PsiDirectory directory
161+ ) {
156162 super ();
157163
158164 this .project = project ;
@@ -224,19 +230,20 @@ private void toggleConsumer() {
224230
225231 /**
226232 * Opens the dialog window.
233+ *
234+ * @param project Project
235+ * @param directory PsiDirectory
227236 */
228- public static void open (final Project project , final PsiDirectory directory ) {
237+ public static void open (
238+ final @ NotNull Project project ,
239+ final @ NotNull PsiDirectory directory
240+ ) {
229241 final NewMessageQueueDialog dialog = new NewMessageQueueDialog (project , directory );
230242 dialog .pack ();
231243 dialog .centerDialog (dialog );
232244 dialog .setVisible (true );
233245 }
234246
235- @ Override
236- public void onCancel () {
237- dispose ();
238- }
239-
240247 private void onOK () {
241248 if (validateFormFields ()) {
242249 generateCommunication ();
@@ -248,8 +255,8 @@ private void onOK() {
248255 if (getConnectionName ().equals (MessageQueueConnections .DB .getType ())) {
249256 generateConsumerClass ();
250257 }
258+ exit ();
251259 }
252- exit ();
253260 }
254261
255262 private void generateCommunication () {
0 commit comments