JAL-3775 JAL-3633 Make java.net.Authenticator code conditional on not being JalviewJS
[jalview.git] / src / jalview / jbgui / GPreferences.java
index 38a4732..5af94e4 100755 (executable)
@@ -1205,45 +1205,56 @@ public class GPreferences extends JPanel
     gbc.gridy++;
     proxyPanel.add(hpPanel, gbc);
 
-    // Require authentication checkbox
-    gbc.gridy++;
-    proxyPanel.add(proxyAuth, gbc);
-
-    // username and password
-    JPanel upPanel = new JPanel();
-    upPanel.setLayout(new GridBagLayout());
-    // username row
-    c.gridy = 0;
-    c.gridx = 0;
-    c.gridwidth = 1;
-    c.weightx = 0.4;
-    c.anchor = GridBagConstraints.LINE_END;
-    upPanel.add(proxyAuthUsernameLabel, c);
-
-    c.gridx++;
-    c.weightx = 1.0;
-    c.anchor = GridBagConstraints.LINE_START;
-    upPanel.add(proxyAuthUsernameTB, c);
-
-    // password row
-    c.gridy++;
-    c.gridx = 0;
-    c.weightx = 0.4;
-    c.anchor = GridBagConstraints.LINE_END;
-    upPanel.add(proxyAuthPasswordLabel, c);
-
-    c.gridx++;
-    c.weightx = 1.0;
-    c.anchor = GridBagConstraints.LINE_START;
-    upPanel.add(proxyAuthPasswordPB, c);
-
-    c.gridx++;
-    c.weightx = 0.4;
-    c.anchor = GridBagConstraints.LINE_START;
-    upPanel.add(passwordNotStoredLabel, c);
-
-    gbc.gridy++;
-    proxyPanel.add(upPanel, gbc);
+    if (!Platform.isJS())
+    /**
+     * java.net.Authenticator is not implemented in SwingJS. Not displaying the
+     * Authentication options in Preferences.
+     * 
+     * @j2sIgnore
+     * 
+     */
+    {
+      // Require authentication checkbox
+      gbc.gridy++;
+      proxyPanel.add(proxyAuth, gbc);
+
+      // username and password
+      JPanel upPanel = new JPanel();
+      upPanel.setLayout(new GridBagLayout());
+      // username row
+      c.gridy = 0;
+      c.gridx = 0;
+      c.gridwidth = 1;
+      c.weightx = 0.4;
+      c.anchor = GridBagConstraints.LINE_END;
+      upPanel.add(proxyAuthUsernameLabel, c);
+
+      c.gridx++;
+      c.weightx = 1.0;
+      c.anchor = GridBagConstraints.LINE_START;
+      upPanel.add(proxyAuthUsernameTB, c);
+
+      // password row
+      c.gridy++;
+      c.gridx = 0;
+      c.weightx = 0.4;
+      c.anchor = GridBagConstraints.LINE_END;
+      upPanel.add(proxyAuthPasswordLabel, c);
+
+      c.gridx++;
+      c.weightx = 1.0;
+      c.anchor = GridBagConstraints.LINE_START;
+      upPanel.add(proxyAuthPasswordPB, c);
+
+      c.gridx++;
+      c.weightx = 0.4;
+      c.anchor = GridBagConstraints.LINE_START;
+      upPanel.add(passwordNotStoredLabel, c);
+
+      gbc.gridy++;
+      proxyPanel.add(upPanel, gbc);
+
+    } // end j2sIgnore
 
     applyProxyButton.setText(MessageManager.getString("action.apply"));
     applyProxyButton.addActionListener(new ActionListener()