private void updateFields(final String text) {
    try {
      eventDepth++;
      if (eventDepth != 1) return;

      String strippedText = stripGitCloneCommand(text);
      final URIish u = new URIish(strippedText);
      if (!text.equals(strippedText)) {
        uriText.setText(strippedText);
      }
      safeSet(hostText, u.getHost());
      safeSet(pathText, u.getPath());
      safeSet(userText, u.getUser());
      safeSet(passText, u.getPass());

      if (u.getPort() > 0) portText.setText(Integer.toString(u.getPort()));
      else portText.setText(EMPTY_STRING);

      if (u.getScheme() != null) {
        scheme.select(scheme.indexOf(u.getScheme()));
        scheme.notifyListeners(SWT.Selection, new Event());
      }

      updateGroups();
      uri = u;
    } catch (URISyntaxException err) {
      // leave uriText as it is, but clean up underlying uri and
      // decomposed fields
      uri = new URIish();
      hostText.setText(EMPTY_STRING);
      pathText.setText(EMPTY_STRING);
      userText.setText(EMPTY_STRING);
      passText.setText(EMPTY_STRING);
      portText.setText(EMPTY_STRING);
      scheme.select(-1);
    } finally {
      eventDepth--;
    }
    checkPage();
  }
 private void updateRemoteAndURIPanels() {
   UIUtils.setEnabledRecursively(uriPanel, isURISelected());
   if (uriPanel.getEnabled()) updateGroups();
   if (configuredRemotes != null) UIUtils.setEnabledRecursively(remotePanel, !isURISelected());
 }