26
26
import java .awt .*;
27
27
import java .awt .event .ActionEvent ;
28
28
import java .awt .event .ActionListener ;
29
-
30
- import org .jetbrains .annotations .NotNull ;
31
29
import org .jetbrains .annotations .Nullable ;
32
30
33
31
public class WatsonxSettingsForm {
34
32
35
33
private final JBCheckBox onPremCheckbox ;
36
34
private final JBPasswordField apiKeyField ;
37
- private final ComboBox regionComboBox ;
38
35
private final JBPasswordField onPremApiKeyField ;
39
36
private final JBTextField onPremHostField ;
40
37
private final JBTextField usernameField ;
@@ -46,7 +43,6 @@ public class WatsonxSettingsForm {
46
43
private final String getStartedText = "Click here to get started with IBM watsonx.ai as a Service" ;
47
44
private final String getStartedUrl = "https://dataplatform.cloud.ibm.com/registration/stepone?context=wx" ;
48
45
private final JButton getStartedLink ;
49
-
50
46
private final JBTextField apiVersionField ;
51
47
private final JBTextField projectIdField ;
52
48
private final JBTextField spaceIdField ;
@@ -86,8 +82,6 @@ class OpenUrlAction implements ActionListener {
86
82
getStartedLink .setToolTipText (getStartedUrl );
87
83
getStartedLink .addActionListener (new OpenUrlAction ());
88
84
89
- regionComboBox = new ComboBox (new String [] {"Dallas" , "Frankfurt" , "London" , "Tokyo" });
90
- regionComboBox .setSelectedItem (settings .getRegion ());
91
85
apiKeyField = new JBPasswordField ();
92
86
apiKeyField .setColumns (35 );
93
87
ApplicationManager .getApplication ().executeOnPooledThread (() -> {
@@ -123,10 +117,6 @@ class OpenUrlAction implements ActionListener {
123
117
124
118
onCloudAuthenticationFieldPanel = new UI .PanelFactory ().grid ()
125
119
.add (UI .PanelFactory .panel (getStartedLink ))
126
- .add (UI .PanelFactory .panel (regionComboBox )
127
- .withLabel (CodeGPTBundle .get ("settingsConfigurable.service.watsonx.cloudRegion.label" ))
128
- .withComment (CodeGPTBundle .get ("settingsConfigurable.service.watsonx.cloudRegion.comment" ))
129
- .resizeX (false ))
130
120
.add (UI .PanelFactory .panel (apiKeyField )
131
121
.withLabel (CodeGPTBundle .get ("settingsConfigurable.service.watsonx.onCloudApiKey.label" ))
132
122
.withComment (CodeGPTBundle .get (
@@ -268,7 +258,6 @@ public WatsonxSettingsState getCurrentState() {
268
258
state .setOnPremHost (onPremHostField .getText ());
269
259
state .setUsername (usernameField .getText ());
270
260
state .setZenApiKey (zenApiKeyCheckbox .isSelected ());
271
- state .setRegion ((String )regionComboBox .getSelectedItem ());
272
261
state .setApiVersion (apiVersionField .getText ());
273
262
state .setSpaceId (spaceIdField .getText ());
274
263
state .setProjectId (projectIdField .getText ());
@@ -292,7 +281,6 @@ public void resetForm() {
292
281
usernameField .setText (state .getUsername ());
293
282
zenApiKeyCheckbox .setSelected (state .isZenApiKey ());
294
283
apiKeyField .setText (CredentialsStore .getCredential (WATSONX_API_KEY ));
295
- regionComboBox .setSelectedItem (state .getRegion ());
296
284
apiVersionField .setText (state .getApiVersion ());
297
285
spaceIdField .setText (state .getSpaceId ());
298
286
projectIdField .setText (state .getProjectId ());
0 commit comments