private Map<String, TreeElement> getElementMap(final List<TreeElement> model) { final Map<String, TreeElement> elementMap = new HashMap<String, TreeElement>(model.size()); for (final TreeElement te : model) { if (te.getName() != null) { elementMap.put(te.getName(), te); } } return Collections.unmodifiableMap(elementMap); }
private void fillTree( final TreeItem parentTi, final String clazz, final Map<String, TreeElement> elementMap) { final TreeElement currentElement = elementMap.get(clazz); if (currentElement != null) { final Set<String> duplicateCheck = new HashSet<String>(); for (final TreeElement el : currentElement.getElements()) { final String clz = el.getClazz(); if (clz != null && !clz.startsWith("SOAP::") && duplicateCheck.add(clz)) { final TreeItem ti = new TreeItem(parentTi, SWT.NONE); ti.setText(clz); fillTree(ti, clz, elementMap); } } } }
private Set<String> getRoots(List<TreeElement> model) { final Set<String> roots = new HashSet<String>(model.size()); for (final TreeElement tn : model) { if (tn.getName() != null) { roots.add(tn.getName()); } } for (final TreeElement tn : model) { for (final TreeElement child : tn.getElements()) { if (child.getClazz() != null) { roots.remove(child.getClazz()); } } } return roots; }