1
1
package com .ciy .plugin .ui ;
2
2
3
3
import com .ciy .plugin .Constants ;
4
+ import com .ciy .plugin .ShowInputDialogAction ;
4
5
import com .ciy .plugin .modle .*;
5
6
import com .google .gson .Gson ;
6
7
import com .google .gson .reflect .TypeToken ;
@@ -39,6 +40,7 @@ public class SelectApiDialog extends JDialog {
39
40
private JTextField tfPack ;
40
41
private JLabel lbTitle ;
41
42
private JButton btnReverse ;
43
+ private JButton btnSelectAll ;
42
44
private Project project ;
43
45
private ProjectInfoBean projectInfo ;
44
46
private SelectApiDialogListener listener ;
@@ -76,7 +78,7 @@ public void actionPerformed(ActionEvent e) {
76
78
}
77
79
});
78
80
79
- btnReverse .addActionListener (new AbstractAction () {
81
+ btnReverse .addActionListener (new ActionListener () {
80
82
@ Override
81
83
public void actionPerformed (ActionEvent e ) {
82
84
apiList .stream ().forEach (it -> {
@@ -86,6 +88,16 @@ public void actionPerformed(ActionEvent e) {
86
88
}
87
89
});
88
90
91
+ btnSelectAll .addActionListener (new ActionListener () {
92
+ @ Override
93
+ public void actionPerformed (ActionEvent e ) {
94
+ apiList .stream ().forEach (it -> {
95
+ it .setSelect (true );
96
+ });
97
+ refreshListData ();
98
+ }
99
+ });
100
+
89
101
tfPack .addActionListener (new AbstractAction () {
90
102
@ Override
91
103
public void actionPerformed (ActionEvent e ) {
@@ -183,7 +195,8 @@ private void readSelectApi() {
183
195
Module selectModule = moduleList .get (cbModule .getSelectedIndex ());
184
196
if (selectModule != null ) {
185
197
String pack = tfPack .getText ().replace ("." , "/" );
186
- VirtualFile apiServiceFile = selectModule .getModuleFile ().getParent ().findFileByRelativePath ("src/main/java/" + pack + "/URLConstant.kt" );
198
+ VirtualFile apiServiceFile = selectModule .getModuleFile ().getParent ().findFileByRelativePath ("src/main/java/" +
199
+ pack + "/" + ShowInputDialogAction .Companion .getUrlConstantClassName () + ".kt" );
187
200
if (apiServiceFile != null && apiServiceFile .exists ()) {
188
201
// URLConstant 存在读取里面的url
189
202
try {
@@ -213,7 +226,7 @@ private void readSelectApi() {
213
226
} else {
214
227
// URLConstant 不存在则全选
215
228
apiList .forEach (it -> {
216
- it .setSelect (true );
229
+ it .setSelect (false );
217
230
});
218
231
}
219
232
refreshListData ();
0 commit comments