コード例 #1
0
  @Override
  public void apply(@NotNull HttpConfigurable settings) {
    if (!isValid()) {
      return;
    }

    if (isModified(settings)) {
      settings.AUTHENTICATION_CANCELLED = false;
    }

    settings.USE_PROXY_PAC = myAutoDetectProxyRb.isSelected();
    settings.USE_PAC_URL = myPacUrlCheckBox.isSelected();
    settings.PAC_URL = getText(myPacUrlTextField);
    settings.USE_HTTP_PROXY = myUseHTTPProxyRb.isSelected();
    settings.PROXY_TYPE_IS_SOCKS = mySocks.isSelected();
    settings.PROXY_AUTHENTICATION = myProxyAuthCheckBox.isSelected();
    settings.KEEP_PROXY_PASSWORD = myRememberProxyPasswordCheckBox.isSelected();

    settings.setProxyLogin(getText(myProxyLoginTextField));
    settings.setPlainProxyPassword(new String(myProxyPasswordTextField.getPassword()));
    settings.PROXY_EXCEPTIONS = StringUtil.nullize(myProxyExceptions.getText(), true);

    settings.PROXY_PORT = myProxyPortTextField.getNumber();
    settings.PROXY_HOST = getText(myProxyHostTextField);
  }
コード例 #2
0
  public void apply() {
    HttpConfigurable httpConfigurable = myHttpConfigurable;
    if (isModified()) {
      httpConfigurable.AUTHENTICATION_CANCELLED = false;
    }
    httpConfigurable.USE_PROXY_PAC = myAutoDetectProxyRb.isSelected();
    httpConfigurable.USE_PAC_URL = myPacUrlCheckBox.isSelected();
    httpConfigurable.PAC_URL = trimFieldText(myPacUrlTextField);
    httpConfigurable.USE_HTTP_PROXY = myUseHTTPProxyRb.isSelected();
    httpConfigurable.PROXY_TYPE_IS_SOCKS = mySocks.isSelected();
    httpConfigurable.PROXY_AUTHENTICATION = myProxyAuthCheckBox.isSelected();
    httpConfigurable.KEEP_PROXY_PASSWORD = myRememberProxyPasswordCheckBox.isSelected();

    httpConfigurable.PROXY_LOGIN = trimFieldText(myProxyLoginTextField);
    httpConfigurable.setPlainProxyPassword(new String(myProxyPasswordTextField.getPassword()));
    httpConfigurable.PROXY_EXCEPTIONS = myProxyExceptions.getText();

    try {
      httpConfigurable.PROXY_PORT = Integer.valueOf(trimFieldText(myProxyPortTextField)).intValue();
    } catch (NumberFormatException e) {
      httpConfigurable.PROXY_PORT = 80;
    }
    httpConfigurable.PROXY_HOST = trimFieldText(myProxyHostTextField);
  }