52
52
"PMD.ExcessiveImports" ,
53
53
})
54
54
public class NewMessageQueueDialog extends AbstractDialog {
55
+
55
56
private static final String TOPIC_NAME = "Topic Name" ;
56
57
private static final String HANDLER_NAME = "Handler Name" ;
57
58
private static final String HANDLER_TYPE = "Handler Type" ;
@@ -64,6 +65,8 @@ public class NewMessageQueueDialog extends AbstractDialog {
64
65
private static final String BINDING_TOPIC = "Binding Topic" ;
65
66
66
67
private JComboBox connectionName ;
68
+ private final Project project ;
69
+ private final String moduleName ;
67
70
68
71
/* TODO: Improve validation */
69
72
@ FieldValidation (rule = RuleRegistry .NOT_EMPTY ,
@@ -146,13 +149,16 @@ public class NewMessageQueueDialog extends AbstractDialog {
146
149
private JLabel consumerNameLabel ;//NOPMD
147
150
private JLabel handlerDirectoryLabel ;//NOPMD
148
151
149
- private final Project project ;
150
- private final String moduleName ;
151
-
152
152
/**
153
153
* Constructor.
154
+ *
155
+ * @param project Project
156
+ * @param directory PsiDirectory
154
157
*/
155
- public NewMessageQueueDialog (final Project project , final PsiDirectory directory ) {
158
+ public NewMessageQueueDialog (
159
+ final @ NotNull Project project ,
160
+ final @ NotNull PsiDirectory directory
161
+ ) {
156
162
super ();
157
163
158
164
this .project = project ;
@@ -224,19 +230,20 @@ private void toggleConsumer() {
224
230
225
231
/**
226
232
* Opens the dialog window.
233
+ *
234
+ * @param project Project
235
+ * @param directory PsiDirectory
227
236
*/
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
+ ) {
229
241
final NewMessageQueueDialog dialog = new NewMessageQueueDialog (project , directory );
230
242
dialog .pack ();
231
243
dialog .centerDialog (dialog );
232
244
dialog .setVisible (true );
233
245
}
234
246
235
- @ Override
236
- public void onCancel () {
237
- dispose ();
238
- }
239
-
240
247
private void onOK () {
241
248
if (validateFormFields ()) {
242
249
generateCommunication ();
@@ -248,8 +255,8 @@ private void onOK() {
248
255
if (getConnectionName ().equals (MessageQueueConnections .DB .getType ())) {
249
256
generateConsumerClass ();
250
257
}
258
+ exit ();
251
259
}
252
- exit ();
253
260
}
254
261
255
262
private void generateCommunication () {
0 commit comments