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

jvergara
19.20.2008 216e65ae1f4a926d601bb54f7ff4f19e310c6dd4
Fix for issue 3623 (Control Panel: MatchingRules Used by attributes panel is never refreshed)

Only add the attributes that are actually using the given matching rule.
1 files modified
13 ■■■■ changed files
opends/src/guitools/org/opends/guitools/controlpanel/ui/MatchingRulePanel.java 13 ●●●● patch | view | raw | blame | history
opends/src/guitools/org/opends/guitools/controlpanel/ui/MatchingRulePanel.java
@@ -33,6 +33,7 @@
import java.awt.GridBagConstraints;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Comparator;
import java.util.TreeSet;
import javax.swing.DefaultListModel;
@@ -41,6 +42,7 @@
import org.opends.guitools.controlpanel.event.ConfigurationChangeEvent;
import org.opends.guitools.controlpanel.ui.components.TitlePanel;
import org.opends.guitools.controlpanel.util.LowerCaseComparator;
import org.opends.guitools.controlpanel.util.Utilities;
import org.opends.messages.Message;
import org.opends.server.api.ApproximateMatchingRule;
@@ -237,10 +239,17 @@
    type.setText(getTypeValue(matchingRule).toString());
    TreeSet<String> attributes = new TreeSet<String>();
    Comparator<String> lowerCaseComparator = new LowerCaseComparator();
    TreeSet<String> attributes = new TreeSet<String>(lowerCaseComparator);
    for (AttributeType attr : schema.getAttributeTypes().values())
    {
      attributes.add(attr.getNameOrOID());
      if (matchingRule.equals(attr.getApproximateMatchingRule()) ||
          matchingRule.equals(attr.getEqualityMatchingRule()) ||
          matchingRule.equals(attr.getSubstringMatchingRule()) ||
          matchingRule.equals(attr.getOrderingMatchingRule()))
      {
        attributes.add(attr.getNameOrOID());
      }
    }
    DefaultListModel model = (DefaultListModel)usedByAttributes.getModel();
    model.clear();