mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
16.47.2009 f8f7bf5c46f0e0153c3cb34d40e3acd4a07ca6c7
opends/src/guitools/org/opends/guitools/controlpanel/browser/BrowserController.java
@@ -159,7 +159,7 @@
    tree.setCellRenderer(new BrowserCellRenderer());
    displayFlags = DISPLAY_ACI_COUNT;
    displayAttribute = RDN_ATTRIBUTE;
    followReferrals = true;
    followReferrals = false;
    sorted = false;
    showContainerOnly = true;
    containerClasses = new String[0];
@@ -457,10 +457,18 @@
   * Enable/display the following of referrals.
   * This routine starts a refresh on each referral node.
   * @param followReferrals whether to follow referrals or not.
   * @throws NamingException if there is an error updating the request controls
   * of the internal connections.
   */
  public void setFollowReferrals(boolean followReferrals) {
  public void setFollowReferrals(boolean followReferrals) throws NamingException
  {
    this.followReferrals = followReferrals;
    startRefreshReferralNodes(rootNode);
    stopRefresh();
    removeAllChildNodes(rootNode, true /* Keep suffixes */);
    ctxConfiguration.setRequestControls(getConfigurationRequestControls());
    ctxUserData.setRequestControls(getRequestControls());
    connectionPool.setRequestControls(getRequestControls());
    startRefresh(null);
  }
@@ -1324,16 +1332,24 @@
   */
  Control[] getRequestControls()
  {
    Control ctls[] = new Control[sorted ? 2 : 1];
    ctls[0] = new ManageReferralControl(true);
    if (sorted) {
    Control ctls[];
    if (followReferrals)
    {
      ctls = new Control[sorted ? 2 : 1];
    }
    else
    {
      ctls = new Control[sorted ? 1 : 0];
    }
    if (sorted)
    {
      SortKey[] keys = new SortKey[SORT_ATTRIBUTES.length];
      for (int i=0; i<keys.length; i++) {
        keys[i] = new SortKey(SORT_ATTRIBUTES[i]);
      }
      try
      {
        ctls[1] = new SortControl(keys, true);
        ctls[0] = new SortControl(keys, false);
      }
      catch (IOException ioe)
      {
@@ -1342,6 +1358,10 @@
            ioe);
      }
    }
    if (followReferrals)
    {
      ctls[ctls.length - 1] = new ManageReferralControl(false);
    }
    return ctls;
  }
@@ -1351,8 +1371,7 @@
   */
  Control[] getConfigurationRequestControls()
  {
    Control ctls[] = new Control[0];
    return ctls;
    return getRequestControls();
  }