30
30
import javax .swing .KeyStroke ;
31
31
import org .jetbrains .annotations .NotNull ;
32
32
33
- public class CreateAnObserverDialog extends AbstractDialog {
33
+ public class CreateAnObserverDialog extends AbstractDialog {//NOPMD
34
34
@ NotNull
35
35
private final Project project ;
36
36
@ NotNull
37
37
private final CreateAnObserverDialogValidator validator ;
38
- private String targetEvent ;
38
+ private final String targetEvent ;
39
39
private JPanel contentPane ;
40
40
private JButton buttonOK ;
41
41
private JButton buttonCancel ;
42
42
private JTextField observerClassName ;
43
- private JLabel observerClassNameLabel ;
44
43
private JTextField observerDirectory ;
45
- private JLabel observerDirectoryName ;
46
- private JLabel selectObserverModule ;
47
44
private FilteredComboBox observerModule ;
48
45
private JComboBox observerArea ;
49
- private JLabel observerAreaLabel ;
50
- private JLabel observerNameLabel ;
51
46
private JTextField observerName ;
47
+ private JLabel observerClassNameLabel ;//NOPMD
48
+ private JLabel observerDirectoryName ;//NOPMD
49
+ private JLabel selectObserverModule ;//NOPMD
50
+ private JLabel observerAreaLabel ;//NOPMD
51
+ private JLabel observerNameLabel ;//NOPMD
52
52
53
53
/**
54
54
* Constructor.
55
55
*
56
56
* @param project Project Scope
57
57
* @param targetEvent Action Event
58
58
*/
59
- public CreateAnObserverDialog (@ NotNull Project project , String targetEvent ) {
59
+ public CreateAnObserverDialog (@ NotNull final Project project , final String targetEvent ) {
60
+ super ();
61
+
60
62
this .project = project ;
61
63
this .targetEvent = targetEvent ;
62
64
this .validator = CreateAnObserverDialogValidator .getInstance (this );
@@ -71,7 +73,7 @@ public CreateAnObserverDialog(@NotNull Project project, String targetEvent) {
71
73
72
74
setDefaultCloseOperation (DO_NOTHING_ON_CLOSE );
73
75
addWindowListener (new WindowAdapter () {
74
- public void windowClosing (WindowEvent e ) {
76
+ public void windowClosing (final WindowEvent event ) {
75
77
onCancel ();
76
78
}
77
79
});
@@ -89,8 +91,8 @@ public void windowClosing(WindowEvent e) {
89
91
* @param project Project Scope
90
92
* @param targetEvent Action Event
91
93
*/
92
- public static void open (@ NotNull Project project , String targetEvent ) {
93
- CreateAnObserverDialog dialog = new CreateAnObserverDialog (project , targetEvent );
94
+ public static void open (@ NotNull final Project project , final String targetEvent ) {
95
+ final CreateAnObserverDialog dialog = new CreateAnObserverDialog (project , targetEvent );
94
96
dialog .pack ();
95
97
dialog .centerDialog (dialog );
96
98
dialog .setVisible (true );
@@ -100,7 +102,7 @@ public static void open(@NotNull Project project, String targetEvent) {
100
102
* Setup observer area combobox.
101
103
*/
102
104
private void fillTargetAreaOptions () {
103
- for (Package .Areas area : Package .Areas .values ()) {
105
+ for (final Package .Areas area : Package .Areas .values ()) {
104
106
observerArea .addItem (area .toString ());
105
107
}
106
108
}
@@ -152,14 +154,14 @@ public String getObserverModule() {
152
154
return this .observerModule .getSelectedItem ().toString ();
153
155
}
154
156
155
- private void createUiComponents () {
156
- List <String > allModulesList = ModuleIndex .getInstance (project ).getEditableModuleNames ();
157
+ private void createUiComponents () {//NOPMD
158
+ final List <String > allModulesList = ModuleIndex .getInstance (project ).getEditableModuleNames ();
157
159
158
160
this .observerModule = new FilteredComboBox (allModulesList );
159
161
}
160
162
161
163
private String getNamespace () {
162
- String targetModule = getObserverModule ();
164
+ final String targetModule = getObserverModule ();
163
165
String namespace = targetModule .replace (
164
166
Package .VENDOR_MODULE_NAME_SEPARATOR ,
165
167
Package .FQN_SEPARATOR
0 commit comments