public synchronized Toc getOwningToc(String href) { if (tocsByTopic == null) { tocsByTopic = new HashMap<>(); Toc[] tocs = HelpPlugin.getTocManager().getTocs(Platform.getNL()); for (int i=0;i<tocs.length;++i) { ITocContribution contribution = tocs[i].getTocContribution(); String[] extraDocuments = contribution.getExtraDocuments(); for (int j=0;j<extraDocuments.length;++j) { tocsByTopic.put(extraDocuments[j], tocs[i]); } } } return tocsByTopic.get(href); }
parent.insertBefore((UAElement)children[j], anchor); addExtraDocuments(destContribution, srcContributions[i].getExtraDocuments());
/** * @param href * href of a topic * @param tocList * List of IToc * @return true if given topic belongs to one of enabled ITocs */ private boolean isInTocSubtree(String href, Toc[] tocList) { for (int i=0;i<tocList.length;++i) { Toc toc = tocList[i]; if (!HelpBasePlugin.getActivitySupport().isEnabled(toc.getHref())) { // TOC is not enabled, check other TOCs continue; } // Check topics in navigation if (toc.getTopic(href) != null) { return true; } // Check extra docs String[] extraDocs = toc.getTocContribution().getExtraDocuments(); for (int j=0;j<extraDocs.length;++j) { if (extraDocs[j].equals(href)) { return true; } } } return false; } /*
contribution.setCategoryId(contrib[j].getCategoryId()); contribution.setContributorId(contrib[j].getContributorId()); contribution.setExtraDocuments(contrib[j].getExtraDocuments()); contribution.setId(contrib[j].getId()); contribution.setLocale(contrib[j].getLocale());