@@ -27,6 +27,7 @@ public class SettingsComponent {
2727 private final ComboBox <LinkMode > myJaegerLinkModeComboBox = new ComboBox <>(new EnumComboBoxModel <>(LinkMode .class ));
2828 private final JBLabel myEmbeddedJaegerMessage = new JBLabel ("<html><body><span style=\" color:\" " + JBColor .BLUE + "\" \" ><b>Jaeger embedded is only supported for deployment on a local environment.</b></span></body>" );
2929 private final ComboBox <SpringBootObservabilityMode > mySpringBootObservabilityModeComboBox = new ComboBox <>(new EnumComboBoxModel <>(SpringBootObservabilityMode .class ));
30+ private final JBLabel myRuntimeObservabilityBackendUrlLabel = new JBLabel ("Runtime observability backend URL:" );
3031 private final JBTextField myRuntimeObservabilityBackendUrlText = new JBTextField ();
3132 private final JBTextField extendedObservabilityTextBox = new JBTextField ();
3233
@@ -107,6 +108,23 @@ public boolean verify(JComponent input) {
107108 });
108109
109110
111+ myRuntimeObservabilityBackendUrlLabel .setToolTipText ("Where should observability data be sent from the IDE? This would be the Digma collector URL typically listening to port 5050" );
112+
113+ myRuntimeObservabilityBackendUrlText .setInputVerifier (new InputVerifier () {
114+ @ Override
115+ public boolean verify (JComponent input ) {
116+ try {
117+ new URL (myRuntimeObservabilityBackendUrlText .getText ().trim ());
118+ myRuntimeObservabilityBackendUrlLabel .setForeground (defaultLabelForeground );
119+ return true ;
120+ } catch (MalformedURLException e ) {
121+ myRuntimeObservabilityBackendUrlLabel .setForeground (JBColor .RED );
122+ return false ;
123+ }
124+ }
125+ });
126+
127+
110128 myEmbeddedJaegerMessage .setForeground (JBColor .BLUE );
111129
112130 var myJaegerLinkModeLabel = new JBLabel ("Jaeger link mode: " );
@@ -124,23 +142,6 @@ public boolean verify(JComponent input) {
124142 + "Micrometer will use Micrometer tracing, including the annotation of 'Observed' "
125143 );
126144
127- var myRuntimeObservabilityBackendUrlLabel = new JBLabel ("Runtime observability backend URL:" );
128- myRuntimeObservabilityBackendUrlLabel .setToolTipText ("Where should observability data be sent from the IDE? This would be the Digma collector URL typically listening to port 5050" );
129- JBLabel feedbackForRuntimeObservabilityBackendUrl = buildFeedbackNotValidUrl ();
130- myRuntimeObservabilityBackendUrlText .setInputVerifier (new InputVerifier () {
131- @ Override
132- public boolean verify (JComponent input ) {
133- try {
134- new URL (myRuntimeObservabilityBackendUrlText .getText ().trim ());
135- feedbackForRuntimeObservabilityBackendUrl .setVisible (false );
136- return true ;
137- } catch (MalformedURLException e ) {
138- feedbackForRuntimeObservabilityBackendUrl .setVisible (true );
139- return false ;
140- }
141- }
142- });
143-
144145 var resetButton = new JButton ("Reset to defaults" );
145146 resetButton .addActionListener (e -> resetToDefaults ());
146147
@@ -154,7 +155,6 @@ public boolean verify(JComponent input) {
154155 .addLabeledComponent (myJaegerQueryUrlLabel , myJaegerQueryUrlText , 1 , false )
155156 .addLabeledComponent (mySpringBootObservabilityModeLabel , mySpringBootObservabilityModeComboBox , 1 , false )
156157 .addLabeledComponent (myRuntimeObservabilityBackendUrlLabel , myRuntimeObservabilityBackendUrlText , 1 , false )
157- .addComponentToRightColumn (feedbackForRuntimeObservabilityBackendUrl , 1 )
158158 .addLabeledComponent ("Extended Observability (beta)" , extendedObservabilityTextBox , 1 , false )
159159 .addComponent (resetButton )
160160 .addComponentFillVertically (new JPanel (), 0 )
@@ -185,19 +185,7 @@ private void linkModeSelected(Color defaultLabelForeground, LinkMode selected) {
185185 }
186186 }
187187
188- @ NotNull
189- private static JBLabel buildFeedbackLabel (String text , String toolTip ) {
190- var feedbackLabel = new JBLabel (text );
191- feedbackLabel .setToolTipText (toolTip );
192- feedbackLabel .setForeground (JBColor .RED );
193- feedbackLabel .setVisible (false );
194- return feedbackLabel ;
195- }
196188
197- @ NotNull
198- private static JBLabel buildFeedbackNotValidUrl () {
199- return buildFeedbackLabel ("Not a valid URL" , "try to use value like http://somehost:8765" );
200- }
201189
202190 public JPanel getPanel () {
203191 return myMainPanel ;
0 commit comments