@Override public String getHref() { return getTopic(); }
public synchronized ITopic getTopic(String href, String locale) { Toc[] tocs = HelpPlugin.getTocManager().getTocs(locale); for (int i=0;i<tocs.length;++i) { ITopic topic = tocs[i].getTopic(href); if (topic != null) { return topic; } } int index = href.indexOf('#'); if (index != -1) { return getTopic(href.substring(0, index), locale); } return null; }
/** * @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; } /*
String descriptionHref = tocs[t].getTopic(null).getHref(); if (descriptionHref != null && descriptionHref.length() > 0
@Override public short handle(UAElement element, String id) { if (element instanceof Topic) { Topic topic = (Topic)element; String href = topic.getHref(); if (href != null) { topic.setHref(normalize(href, id)); } processCriteria(element, id); return HANDLED_CONTINUE; } else if (element instanceof Toc) { Toc toc = (Toc)element; toc.setHref(id); String topic = toc.getTopic(); if (topic != null) { toc.setTopic(normalize(topic, id)); } processCriteria(element, id); return HANDLED_CONTINUE; } return UNHANDLED; }