private void addSimilarNodes( SearchFieldTreeNode parent, SearchableFieldChoiceItem[] choices, int startAt, MiniLocalization localizationToUse) { String label = parent.toString(); int index = startAt; while (index < choices.length && choices[index].getSpec().getLabel().equals(label)) { SearchableFieldChoiceItem choice = choices[index]; parent.add(new SearchFieldTreeNode(choice, localizationToUse)); ++index; } }
private void differentiateChildNodes(SearchFieldTreeNode parent) { SearchFieldTreeNode[] needDifferentiation = getIndexesOfReusableDropdownChildren(parent); for (int i = 0; i < needDifferentiation.length; ++i) { SearchFieldTreeNode child = needDifferentiation[i]; SearchableFieldChoiceItem choice = child.getChoiceItem(); FieldSpec spec = choice.getSpec(); String reusableListLabels = ""; for (int level = 0; level < spec.getReusableChoicesCodes().length; ++level) { if (level > 0) reusableListLabels += ", "; reusableListLabels += spec.getReusableChoicesCodes()[level]; } child.setLabel(child.toString() + " (" + reusableListLabels + ")"); } }