private Object[] getChildren(IIndexEntry entry) { /* * Index entry has two types of children: topics and subentries. * * The method returns topics among children only if number of the topics * more than 1. * * In case when the entry owns only one topic, this topic is not returned * as child because the entry will represent this topic by its keyword. */ IHelpResource[] topics = entry.getTopics(); IIndexEntry[] subentries = entry.getSubentries(); if (topics.length <= 1) { return subentries; } Object[] childrens = new Object[topics.length + subentries.length]; System.arraycopy(topics, 0, childrens, 0, topics.length); System.arraycopy(subentries, 0, childrens, topics.length, subentries.length); return childrens; }
private boolean isEnabled(IIndexEntry entry) { if (!UAContentFilter.isFiltered(entry, HelpEvaluationContext.getContext())) { IHelpResource[] topics = entry.getTopics(); for (int i = 0; i < topics.length; i++) { if (isEnabled(topics[i])) return true; } IIndexEntry[] subentries = entry.getSubentries(); for (int i = 0; i < subentries.length; i++) { if (isEnabled(subentries[i])) return true; } } return false; }