43
43
* DubboCommonPanel </br>
44
44
*/
45
45
public class DubboCommonPanel {
46
+ /** Registry */
46
47
private JComboBox <String > registryProtocolText ;
47
- private JComboBox <String > rpcProtocolText ;
48
48
private JTextField addressText ;
49
49
private JTextField registryGroupText ;
50
+ private JTextField registryUserNameText ;
51
+ private JTextField registryPasswordText ;
52
+ private JTextField registryTimeoutText ;
53
+ /** ConfigCenter */
54
+ private JComboBox configCenterProtocolText ;
55
+ private JTextField configCenterGroupText ;
56
+ private JTextField configCenterNamespaceText ;
57
+ private JTextField configCenterUserNameText ;
58
+ private JTextField configCenterPasswordText ;
59
+ private JTextField configCenterAddressText ;
60
+ private JTextField configCenterTimeoutText ;
61
+ /** Rpc Protocol */
62
+ private JComboBox <String > rpcProtocolText ;
63
+ /** Consumer & Service */
50
64
private JTextField timeoutText ;
51
65
private JTextField versionText ;
52
66
private JTextField retriesText ;
53
67
private JTextField clusterText ;
54
- private JTextField interfaceText ;
55
- private JTextField methodText ;
56
68
private JTextField groupText ;
57
69
private JTextField connectionsText ;
58
70
private JComboBox <String > loadbalanceText ;
59
71
private JComboBox <String > asyncText ;
60
- //参数表格
72
+ /** Interface */
73
+ private JTextField interfaceText ;
74
+ private JTextField methodText ;
75
+ /** Method Args Table */
61
76
private DefaultTableModel model ;
62
77
private String [] columnNames = {"paramType" , "paramValue" };
63
78
private String [] tmpRow = {"" , "" };
64
- //隐式参数表格
79
+ /** Attachment Table */
65
80
private DefaultTableModel modelAttachment ;
66
81
private String [] columnNamesAttachment = {"key" , "value" };
67
82
private int textColumns = 2 ;
@@ -76,7 +91,7 @@ public void bundleElement(TestElement element) {
76
91
public JPanel drawRegistrySettingsPanel () {
77
92
//Registry Settings
78
93
JPanel registrySettings = new VerticalPanel ();
79
- registrySettings .setBorder (BorderFactory .createTitledBorder ("Registry Settings " ));
94
+ registrySettings .setBorder (BorderFactory .createTitledBorder ("Registry Center " ));
80
95
//Protocol
81
96
JPanel ph = new HorizontalPanel ();
82
97
JLabel protocolLable = new JLabel ("Protocol:" , SwingConstants .RIGHT );
@@ -86,6 +101,27 @@ public JPanel drawRegistrySettingsPanel() {
86
101
ph .add (protocolLable );
87
102
ph .add (registryProtocolText );
88
103
ph .add (makeHelper ("Registry center address protocol, The 'none' is direct connection. " ));
104
+ //Group
105
+ JLabel registryGroupLable = new JLabel ("Group:" , SwingConstants .RIGHT );
106
+ registryGroupText = new JTextField ();
107
+ registryGroupLable .setLabelFor (registryGroupText );
108
+ ph .add (registryGroupLable );
109
+ ph .add (registryGroupText );
110
+ ph .add (makeHelper ("Service registration grouping, cross-group services will not affect each other, and can not be called each other, suitable for environmental isolation." ));
111
+ //UserName
112
+ JLabel registryUserNameLable = new JLabel ("UserName:" , SwingConstants .RIGHT );
113
+ registryUserNameText = new JTextField ();
114
+ registryUserNameLable .setLabelFor (registryUserNameText );
115
+ ph .add (registryUserNameLable );
116
+ ph .add (registryUserNameText );
117
+ ph .add (makeHelper ("The usename of the registry. Do not set it if the registry doesn't need validation." ));
118
+ //Password
119
+ JLabel registryPasswordLable = new JLabel ("Password:" , SwingConstants .RIGHT );
120
+ registryPasswordText = new JTextField ();
121
+ registryPasswordLable .setLabelFor (registryPasswordText );
122
+ ph .add (registryPasswordLable );
123
+ ph .add (registryPasswordText );
124
+ ph .add (makeHelper ("The password of the registry. Do not set it if the registry doesn't need validation." ));
89
125
registrySettings .add (ph );
90
126
//Address
91
127
JPanel ah = new HorizontalPanel ();
@@ -95,20 +131,81 @@ public JPanel drawRegistrySettingsPanel() {
95
131
ah .add (addressLable );
96
132
ah .add (addressText );
97
133
ah .add (makeHelper ("Use the registry to allow multiple addresses, Use direct connection to allow only one address! Multiple address format: ip1:port1,ip2:port2 . Direct address format: ip:port . " ));
98
- JLabel registryGroupLable = new JLabel ("Group:" , SwingConstants .RIGHT );
99
- registryGroupText = new JTextField ();
100
- registryGroupLable .setLabelFor (registryGroupText );
101
- ah .add (registryGroupLable );
102
- ah .add (registryGroupText );
103
- ah .add (makeHelper ("Service registration grouping, cross-group services will not affect each other, and can not be called each other, suitable for environmental isolation." ));
134
+ //Timeout
135
+ JLabel registryTimeoutLable = new JLabel ("Timeout:" , SwingConstants .RIGHT );
136
+ registryTimeoutText = new JTextField ();
137
+ registryTimeoutLable .setLabelFor (registryTimeoutText );
138
+ ah .add (registryTimeoutLable );
139
+ ah .add (registryTimeoutText );
140
+ ah .add (makeHelper ("The timeout(ms) of the request to registry." ));
104
141
registrySettings .add (ah );
105
142
return registrySettings ;
106
143
}
107
144
145
+ public JPanel drawConfigCenterSettingsPanel () {
146
+ //Config Center Settings
147
+ JPanel configCenterSettings = new VerticalPanel ();
148
+ configCenterSettings .setBorder (BorderFactory .createTitledBorder ("Config Center" ));
149
+ //Protocol
150
+ JPanel ph = new HorizontalPanel ();
151
+ JLabel protocolLable = new JLabel ("Protocol:" , SwingConstants .RIGHT );
152
+ configCenterProtocolText = new JComboBox <String >(new String []{"" ,"zookeeper" , "nacos" , "apollo" });
153
+ protocolLable .setLabelFor (configCenterProtocolText );
154
+ ph .add (protocolLable );
155
+ ph .add (configCenterProtocolText );
156
+ ph .add (makeHelper ("Which configuration center to use: apollo, zookeeper, nacos, etc. 2.7.0+" ));
157
+ //Group
158
+ JLabel configCenterGroupLable = new JLabel ("Group:" , SwingConstants .RIGHT );
159
+ configCenterGroupText = new JTextField ();
160
+ configCenterGroupLable .setLabelFor (configCenterGroupText );
161
+ ph .add (configCenterGroupLable );
162
+ ph .add (configCenterGroupText );
163
+ ph .add (makeHelper ("The meaning varies according to the configuration center selected. 2.7.0+" ));
164
+ //Namespace
165
+ JLabel configCenterNamespaceLable = new JLabel ("Namespace:" , SwingConstants .RIGHT );
166
+ configCenterNamespaceText = new JTextField ();
167
+ configCenterNamespaceLable .setLabelFor (configCenterNamespaceText );
168
+ ph .add (configCenterNamespaceLable );
169
+ ph .add (configCenterNamespaceText );
170
+ ph .add (makeHelper ("Using for multi-tenant isolation generally, the actual meaning varies depending on the configuration center. 2.7.0+" ));
171
+ //UserName
172
+ JLabel configCenterUserNameLable = new JLabel ("UserName:" , SwingConstants .RIGHT );
173
+ configCenterUserNameText = new JTextField ();
174
+ configCenterUserNameLable .setLabelFor (configCenterUserNameText );
175
+ ph .add (configCenterUserNameLable );
176
+ ph .add (configCenterUserNameText );
177
+ ph .add (makeHelper ("the username if the configuration center requires validation, Apollo is not yet enabled. 2.7.0+" ));
178
+ //Password
179
+ JLabel configCenterPasswordLable = new JLabel ("Password:" , SwingConstants .RIGHT );
180
+ configCenterPasswordText = new JTextField ();
181
+ configCenterPasswordLable .setLabelFor (configCenterPasswordText );
182
+ ph .add (configCenterPasswordLable );
183
+ ph .add (configCenterPasswordText );
184
+ ph .add (makeHelper ("password if configuration center needs to do check, Apollo is not yet enabled. 2.7.0+" ));
185
+ configCenterSettings .add (ph );
186
+ //Address
187
+ JPanel ah = new HorizontalPanel ();
188
+ JLabel configCenterAddressLable = new JLabel ("Address:" , SwingConstants .RIGHT );
189
+ configCenterAddressText = new JTextField (textColumns );
190
+ configCenterAddressLable .setLabelFor (configCenterAddressText );
191
+ ah .add (configCenterAddressLable );
192
+ ah .add (configCenterAddressText );
193
+ ah .add (makeHelper ("Configuration center address. 2.7.0+" ));
194
+ //Timeout
195
+ JLabel configCenterTimeoutLable = new JLabel ("Timeout:" , SwingConstants .RIGHT );
196
+ configCenterTimeoutText = new JTextField ();
197
+ configCenterTimeoutLable .setLabelFor (configCenterTimeoutText );
198
+ ah .add (configCenterTimeoutLable );
199
+ ah .add (configCenterTimeoutText );
200
+ ah .add (makeHelper ("Gets the configured timeout. 2.7.0+ " ));
201
+ configCenterSettings .add (ah );
202
+ return configCenterSettings ;
203
+ }
204
+
108
205
public JPanel drawProtocolSettingsPanel () {
109
206
//RPC Protocol Settings
110
207
JPanel protocolSettings = new VerticalPanel ();
111
- protocolSettings .setBorder (BorderFactory .createTitledBorder ("RPC Protocol Settings " ));
208
+ protocolSettings .setBorder (BorderFactory .createTitledBorder ("RPC Protocol" ));
112
209
//RPC Protocol
113
210
JPanel rpcPh = new HorizontalPanel ();
114
211
JLabel rpcProtocolLable = new JLabel ("Protocol:" , SwingConstants .RIGHT );
@@ -124,7 +221,7 @@ public JPanel drawProtocolSettingsPanel() {
124
221
public JPanel drawConsumerSettingsPanel () {
125
222
//Consumer Settings
126
223
JPanel consumerSettings = new VerticalPanel ();
127
- consumerSettings .setBorder (BorderFactory .createTitledBorder ("Consumer&Service Settings " ));
224
+ consumerSettings .setBorder (BorderFactory .createTitledBorder ("Consumer & Service " ));
128
225
JPanel h = new HorizontalPanel ();
129
226
//Timeout
130
227
JLabel timeoutLable = new JLabel (" Timeout:" , SwingConstants .RIGHT );
@@ -197,7 +294,7 @@ public JPanel drawConsumerSettingsPanel() {
197
294
public JPanel drawInterfaceSettingsPanel () {
198
295
//Interface Settings
199
296
JPanel interfaceSettings = new VerticalPanel ();
200
- interfaceSettings .setBorder (BorderFactory .createTitledBorder ("Interface Settings " ));
297
+ interfaceSettings .setBorder (BorderFactory .createTitledBorder ("Interface" ));
201
298
//Selection Interface
202
299
JPanel sh = new HorizontalPanel ();
203
300
JButton jButton = new JButton ("Get Provider List" );
@@ -340,8 +437,21 @@ public void actionPerformed(ActionEvent arg0) {
340
437
341
438
public void configureRegistry (TestElement element ) {
342
439
registryProtocolText .setSelectedItem (Constants .getRegistryProtocol (element ));
343
- addressText .setText (Constants .getAddress (element ));
344
440
registryGroupText .setText (Constants .getRegistryGroup (element ));
441
+ registryUserNameText .setText (Constants .getRegistryUserName (element ));
442
+ registryPasswordText .setText (Constants .getRegistryPassword (element ));
443
+ addressText .setText (Constants .getAddress (element ));
444
+ registryTimeoutText .setText (Constants .getRegistryTimeout (element ));
445
+ }
446
+
447
+ public void configureConfigCenter (TestElement element ) {
448
+ configCenterProtocolText .setSelectedItem (Constants .getConfigCenterProtocol (element ));
449
+ configCenterGroupText .setText (Constants .getConfigCenterGroup (element ));
450
+ configCenterNamespaceText .setText (Constants .getConfigCenterNamespace (element ));
451
+ configCenterUserNameText .setText (Constants .getConfigCenterUserName (element ));
452
+ configCenterPasswordText .setText (Constants .getConfigCenterPassword (element ));
453
+ configCenterAddressText .setText (Constants .getConfigCenterAddress (element ));
454
+ configCenterTimeoutText .setText (Constants .getConfigCenterTimeout (element ));
345
455
}
346
456
347
457
public void configureProtocol (TestElement element ) {
@@ -375,7 +485,19 @@ public void configureInterface(TestElement element) {
375
485
public void modifyRegistry (TestElement element ) {
376
486
Constants .setRegistryProtocol (registryProtocolText .getSelectedItem ().toString (), element );
377
487
Constants .setRegistryGroup (registryGroupText .getText (), element );
488
+ Constants .setRegistryUserName (registryUserNameText .getText (), element );
489
+ Constants .setRegistryPassword (registryPasswordText .getText (), element );
378
490
Constants .setAddress (addressText .getText (), element );
491
+ Constants .setRegistryTimeout (registryTimeoutText .getText (), element );
492
+ }
493
+ public void modifyConfigCenter (TestElement element ) {
494
+ Constants .setConfigCenterProtocol (configCenterProtocolText .getSelectedItem ().toString (), element );
495
+ Constants .setConfigCenterGroup (configCenterGroupText .getText (), element );
496
+ Constants .setConfigCenterNamespace (configCenterNamespaceText .getText (), element );
497
+ Constants .setConfigCenterUserName (configCenterUserNameText .getText (), element );
498
+ Constants .setConfigCenterPassword (configCenterPasswordText .getText (), element );
499
+ Constants .setConfigCenterAddress (configCenterAddressText .getText (), element );
500
+ Constants .setConfigCenterTimeout (configCenterTimeoutText .getText (), element );
379
501
}
380
502
public void modifyProtocol (TestElement element ) {
381
503
Constants .setRpcProtocol (rpcProtocolText .getSelectedItem ().toString (), element );
@@ -399,7 +521,19 @@ public void modifyInterface(TestElement element) {
399
521
public void clearRegistry () {
400
522
registryProtocolText .setSelectedIndex (0 );
401
523
registryGroupText .setText ("" );
524
+ registryUserNameText .setText ("" );
525
+ registryPasswordText .setText ("" );
402
526
addressText .setText ("" );
527
+ registryTimeoutText .setText ("" );
528
+ }
529
+ public void clearConfigCenter () {
530
+ configCenterProtocolText .setSelectedIndex (0 );
531
+ configCenterGroupText .setText ("" );
532
+ configCenterNamespaceText .setText ("" );
533
+ configCenterUserNameText .setText ("" );
534
+ configCenterPasswordText .setText ("" );
535
+ configCenterAddressText .setText ("" );
536
+ configCenterTimeoutText .setText ("" );
403
537
}
404
538
public void clearProtocol () {
405
539
rpcProtocolText .setSelectedIndex (0 );
0 commit comments