SimpleNode rootNode = convertSuggestionsToTree(list);
setSuggestions(rootNode);
}
private SimpleNode convertSuggestionsToTree(List<ISuggestionCategory> list) {
SimpleNode root = new SimpleNode(null, "");
if (list != null) {
for (ISuggestionCategory c : list) {
SimpleNode cNode = new SimpleNode(null, c.getLabel());
if (c.getSuggestionList() != null) {
for (ISuggestionItem a : c.getSuggestionList()) {
SimpleNode aNode = new SimpleNode(a.getValue(), a.getLabel());
cNode.getChildren().add(aNode);
}
root.getChildren().add(cNode);
}
}