| | |
| | | * |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2015 ForgeRock AS. |
| | | * Portions Copyright 2015-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.guitools.controlpanel.ui; |
| | | |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | | import java.util.HashSet; |
| | | import java.util.LinkedHashSet; |
| | | import java.util.Set; |
| | |
| | | import javax.swing.border.Border; |
| | | import javax.swing.border.EmptyBorder; |
| | | |
| | | import org.forgerock.opendj.ldap.schema.AttributeType; |
| | | import org.opends.guitools.controlpanel.event.SchemaElementSelectionEvent; |
| | | import org.opends.guitools.controlpanel.event.SchemaElementSelectionListener; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.ObjectClass; |
| | | import org.opends.server.types.Schema; |
| | | |
| | |
| | | */ |
| | | protected Set<String> getAliases(AttributeType attr) |
| | | { |
| | | return getAliases(attr.getNormalizedNames(), attr.getPrimaryName()); |
| | | return getAliases(attr.getNames(), toLowerCase(attr.getNameOrOID())); |
| | | } |
| | | |
| | | /** |
| | |
| | | return getAliases(oc.getNormalizedNames(), oc.getPrimaryName()); |
| | | } |
| | | |
| | | private Set<String> getAliases(Set<String> names, String primaryName) |
| | | private Set<String> getAliases(Iterable<String> names, String primaryName) |
| | | { |
| | | Set<String> aliases = new LinkedHashSet<>(); |
| | | if (primaryName == null) |
| | |
| | | { |
| | | if (!name.equalsIgnoreCase(primaryName)) |
| | | { |
| | | aliases.add(name); |
| | | aliases.add(toLowerCase(name)); |
| | | } |
| | | } |
| | | return aliases; |