}
}
if (!allAdded)
{
baseDNNewElements.add(new CategorizedComboBoxElement(ALL_BASE_DNS,
CategorizedComboBoxElement.Type.REGULAR));
allAdded = true;
}
for (String backendID : backendIDs)
{
baseDNNewElements.add(new CategorizedComboBoxElement(backendID,
CategorizedComboBoxElement.Type.CATEGORY));
SortedSet<String> baseDNs = hmBaseDNs.get(backendID);
for (String baseDN : baseDNs)
{
baseDNNewElements.add(new CategorizedComboBoxElement(baseDN,
CategorizedComboBoxElement.Type.REGULAR));
if (baseDNWithEntries == null)
{
baseDNWithEntries = hmBaseDNWithEntries.get(baseDN);
}
}
}
for (DN dn : otherBaseDns)
{
if (allAdded)
{
baseDNNewElements.add(COMBO_SEPARATOR);
}
baseDNNewElements.add(new CategorizedComboBoxElement(
Utilities.unescapeUtf8(dn.toString()),
CategorizedComboBoxElement.Type.REGULAR));
}
if (allAdded)
{
baseDNNewElements.add(COMBO_SEPARATOR);
baseDNNewElements.add(OTHER_BASE_DN);
}
if (firstTimeDisplayed && (baseDNWithEntries != null))
{
ignoreBaseDNEvents = true;
}
updateComboBoxModel(baseDNNewElements,
(DefaultComboBoxModel)baseDNs.getModel());
// Select the element in the combo box.
if (firstTimeDisplayed && (baseDNWithEntries != null))
{
final Object toSelect = new CategorizedComboBoxElement(
Utilities.unescapeUtf8(baseDNWithEntries.getDn().toString()),
CategorizedComboBoxElement.Type.REGULAR);
SwingUtilities.invokeLater(new Runnable()
{
/**