| | |
| | | |
| | | Comparator<String> lowerCaseComparator = new LowerCaseComparator(); |
| | | |
| | | TreeSet<String> standardOcNames = new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, StandardObjectClassTreeNode> hmStandardOcs = |
| | | new HashMap<String, StandardObjectClassTreeNode>(); |
| | | TreeSet<String> configurationOcNames = |
| | | new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, ConfigurationObjectClassTreeNode> hmConfigurationOcs = |
| | | new HashMap<String, ConfigurationObjectClassTreeNode>(); |
| | | TreeSet<String> customOcNames = new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, CustomObjectClassTreeNode> hmCustomOcs = |
| | | new HashMap<String, CustomObjectClassTreeNode>(); |
| | | TreeSet<String> standardOcNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, StandardObjectClassTreeNode> hmStandardOcs = new HashMap<>(); |
| | | TreeSet<String> configurationOcNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, ConfigurationObjectClassTreeNode> hmConfigurationOcs = new HashMap<>(); |
| | | TreeSet<String> customOcNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, CustomObjectClassTreeNode> hmCustomOcs = new HashMap<>(); |
| | | for (ObjectClass oc : lastSchema.getObjectClasses().values()) |
| | | { |
| | | if (mustAdd(oc)) |
| | |
| | | } |
| | | |
| | | |
| | | TreeSet<String> standardAttrNames = |
| | | new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, StandardAttributeTreeNode> hmStandardAttrs = |
| | | new HashMap<String, StandardAttributeTreeNode>(); |
| | | TreeSet<String> configurationAttrNames = |
| | | new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, ConfigurationAttributeTreeNode> hmConfigurationAttrs = |
| | | new HashMap<String, ConfigurationAttributeTreeNode>(); |
| | | TreeSet<String> customAttrNames = new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, CustomAttributeTreeNode> hmCustomAttrs = |
| | | new HashMap<String, CustomAttributeTreeNode>(); |
| | | TreeSet<String> standardAttrNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, StandardAttributeTreeNode> hmStandardAttrs = new HashMap<>(); |
| | | TreeSet<String> configurationAttrNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, ConfigurationAttributeTreeNode> hmConfigurationAttrs = new HashMap<>(); |
| | | TreeSet<String> customAttrNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, CustomAttributeTreeNode> hmCustomAttrs = new HashMap<>(); |
| | | for (AttributeType attr : lastSchema.getAttributeTypes().values()) |
| | | { |
| | | if (mustAdd(attr)) |
| | |
| | | } |
| | | } |
| | | |
| | | TreeSet<String> matchingRuleNames = |
| | | new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, MatchingRuleTreeNode> hmMatchingRules = |
| | | new HashMap<String, MatchingRuleTreeNode>(); |
| | | TreeSet<String> matchingRuleNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, MatchingRuleTreeNode> hmMatchingRules = new HashMap<>(); |
| | | for (MatchingRule matchingRule : lastSchema.getMatchingRules().values()) |
| | | { |
| | | if (mustAdd(matchingRule)) |
| | |
| | | } |
| | | } |
| | | |
| | | TreeSet<String> syntaxNames = new TreeSet<String>(lowerCaseComparator); |
| | | HashMap<String, AttributeSyntaxTreeNode> hmSyntaxes = |
| | | new HashMap<String, AttributeSyntaxTreeNode>(); |
| | | TreeSet<String> syntaxNames = new TreeSet<>(lowerCaseComparator); |
| | | HashMap<String, AttributeSyntaxTreeNode> hmSyntaxes = new HashMap<>(); |
| | | for (AttributeSyntax<?> syntax : lastSchema.getSyntaxes().values()) |
| | | { |
| | | if (mustAdd(syntax)) |
| | |
| | | } |
| | | |
| | | |
| | | ArrayList<TreeSet<String>> names = new ArrayList<TreeSet<String>>(); |
| | | ArrayList<TreeSet<String>> names = new ArrayList<>(); |
| | | names.add(standardOcNames); |
| | | names.add(standardAttrNames); |
| | | names.add(customOcNames); |
| | |
| | | names.add(matchingRuleNames); |
| | | names.add(syntaxNames); |
| | | |
| | | ArrayList<HashMap<String, ? extends DefaultMutableTreeNode>> nodes = |
| | | new ArrayList<HashMap<String, ? extends DefaultMutableTreeNode>>(); |
| | | ArrayList<HashMap<String, ? extends DefaultMutableTreeNode>> nodes = new ArrayList<>(); |
| | | nodes.add(hmStandardOcs); |
| | | nodes.add(hmStandardAttrs); |
| | | nodes.add(hmCustomOcs); |
| | |
| | | String f = filter.getText().trim(); |
| | | boolean filterProvided = f.length() > 0; |
| | | |
| | | ArrayList<TreePath> toExpand = new ArrayList<TreePath>(); |
| | | ArrayList<TreePath> toExpand = new ArrayList<>(); |
| | | |
| | | int i = 0; |
| | | int positionUnderRoot = 0; |
| | |
| | | |
| | | private void deleteClicked() |
| | | { |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<LocalizableMessage>(); |
| | | ArrayList<LocalizableMessage> errors = new ArrayList<>(); |
| | | TreePath[] paths = treePane.getTree().getSelectionPaths(); |
| | | ArrayList<ObjectClass> ocsToDelete = new ArrayList<ObjectClass>(); |
| | | ArrayList<AttributeType> attrsToDelete = new ArrayList<AttributeType>(); |
| | | ArrayList<ObjectClass> ocsToDelete = new ArrayList<>(); |
| | | ArrayList<AttributeType> attrsToDelete = new ArrayList<>(); |
| | | if (paths != null) |
| | | { |
| | | for (TreePath path : paths) |
| | |
| | | } |
| | | if (errors.isEmpty()) |
| | | { |
| | | ArrayList<String> allNames = new ArrayList<String>(); |
| | | ArrayList<String> allNames = new ArrayList<>(); |
| | | if (displayConfirmationDialog( |
| | | INFO_CTRL_PANEL_CONFIRMATION_REQUIRED_SUMMARY.get(), |
| | | confirmationMessage)) |
| | |
| | | |
| | | private boolean mustAdd(String name, String oid, String primaryName, Iterable<String> names) |
| | | { |
| | | ArrayList<String> values = new ArrayList<String>(); |
| | | ArrayList<String> values = new ArrayList<>(); |
| | | values.add(oid); |
| | | if (primaryName != null) |
| | | { |
| | |
| | | |
| | | private boolean mustAdd(String f, String oid, String name) |
| | | { |
| | | ArrayList<String> values = new ArrayList<String>(2); |
| | | ArrayList<String> values = new ArrayList<>(2); |
| | | values.add(oid); |
| | | if (name != null) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | private HashMap<Object, ImageIcon> hmCategoryImages = |
| | | new HashMap<Object, ImageIcon>(); |
| | | private HashMap<Class<?>, ImageIcon> hmImages = |
| | | new HashMap<Class<?>, ImageIcon>(); |
| | | private HashMap<Object, ImageIcon> hmCategoryImages = new HashMap<>(); |
| | | private HashMap<Class<?>, ImageIcon> hmImages = new HashMap<>(); |
| | | { |
| | | Object[] nodes = {attributes, objectClasses, standardObjectClasses, |
| | | standardAttributes, configurationObjectClasses, configurationAttributes, |
| | |
| | | private LinkedHashSet<ObjectClass> getOrderedObjectClassesToDelete( |
| | | Collection<ObjectClass> ocsToDelete) |
| | | { |
| | | ArrayList<ObjectClass> lOrderedOcs = new ArrayList<ObjectClass>(); |
| | | // Reorder objectClasses and attributes to delete them in the proper |
| | | // order. |
| | | ArrayList<ObjectClass> lOrderedOcs = new ArrayList<>(); |
| | | // Reorder objectClasses and attributes to delete them in the proper order. |
| | | for (ObjectClass oc : ocsToDelete) |
| | | { |
| | | int index = -1; |
| | |
| | | lOrderedOcs.add(index, oc); |
| | | } |
| | | } |
| | | return new LinkedHashSet<ObjectClass>(lOrderedOcs); |
| | | return new LinkedHashSet<>(lOrderedOcs); |
| | | } |
| | | |
| | | private LinkedHashSet<AttributeType> getOrderedAttributesToDelete( |
| | | Collection<AttributeType> attrsToDelete) |
| | | { |
| | | ArrayList<AttributeType> lOrderedAttributes = |
| | | new ArrayList<AttributeType>(); |
| | | ArrayList<AttributeType> lOrderedAttributes = new ArrayList<>(); |
| | | for (AttributeType attr : attrsToDelete) |
| | | { |
| | | int index = -1; |
| | |
| | | lOrderedAttributes.add(index, attr); |
| | | } |
| | | } |
| | | return new LinkedHashSet<AttributeType>(lOrderedAttributes); |
| | | return new LinkedHashSet<>(lOrderedAttributes); |
| | | } |
| | | |
| | | private LocalizableMessage getConfirmationMessage( |
| | |
| | | Collection<AttributeType> attrsToDelete, |
| | | Schema schema) |
| | | { |
| | | ArrayList<ObjectClass> childClasses = new ArrayList<ObjectClass>(); |
| | | ArrayList<ObjectClass> childClasses = new ArrayList<>(); |
| | | // Analyze objectClasses |
| | | for (ObjectClass objectClass : ocsToDelete) |
| | | { |
| | |
| | | childClasses.removeAll(ocsToDelete); |
| | | } |
| | | |
| | | ArrayList<AttributeType> childAttributes = new ArrayList<AttributeType>(); |
| | | TreeSet<String> dependentClasses = new TreeSet<String>(); |
| | | ArrayList<AttributeType> childAttributes = new ArrayList<>(); |
| | | TreeSet<String> dependentClasses = new TreeSet<>(); |
| | | // Analyze attributes |
| | | for (AttributeType attribute : attrsToDelete) |
| | | { |
| | |
| | | LocalizableMessageBuilder mb = new LocalizableMessageBuilder(); |
| | | if (!childClasses.isEmpty()) |
| | | { |
| | | TreeSet<String> childNames = new TreeSet<String>(); |
| | | TreeSet<String> childNames = new TreeSet<>(); |
| | | for (ObjectClass oc : childClasses) |
| | | { |
| | | childNames.add(oc.getNameOrOID()); |
| | |
| | | } |
| | | if (!childAttributes.isEmpty()) |
| | | { |
| | | TreeSet<String> childNames = new TreeSet<String>(); |
| | | TreeSet<String> childNames = new TreeSet<>(); |
| | | for (AttributeType attr : childAttributes) |
| | | { |
| | | childNames.add(attr.getNameOrOID()); |
| | |
| | | mb.append("<br>"); |
| | | } |
| | | |
| | | ArrayList<String> allNames = new ArrayList<String>(); |
| | | ArrayList<String> allNames = new ArrayList<>(); |
| | | for (ObjectClass ocToDelete : ocsToDelete) |
| | | { |
| | | allNames.add(ocToDelete.getNameOrOID()); |