1 11 package org.eclipse.help.internal.toc; 12 13 import java.util.List ; 14 15 import org.eclipse.help.internal.model.*; 16 import org.xml.sax.*; 17 20 class Anchor extends TocNode implements IAnchorElement { 21 protected Toc parentToc; 22 protected String id; 23 protected TocFile tocFile; 24 27 protected Anchor(TocFile tocFile, Attributes attrs) { 28 this.tocFile = tocFile; 29 if (attrs == null) 30 return; 31 id = attrs.getValue("id"); id = HrefUtil.normalizeHref(tocFile.getPluginID(), tocFile.getHref() 33 + "#" + id); parentToc = tocFile.getToc(); 35 } 36 39 public void build(TocBuilder builder) { 40 builder.buildAnchor(this); 41 } 42 45 protected String getID() { 46 return id; 47 } 48 51 public TocFile getTocFile() { 52 return tocFile; 53 } 54 58 public void addChild(ITocNode child) { 59 super.addChild(child); 60 if (child instanceof Toc && parentToc != null) { 61 parentToc.getChildrenTocs().add(child); 62 } 63 } 64 65 68 public List getChildTopics() { 69 tocFile = null; 71 return super.getChildTopics(); 72 } 73 74 } 75 | Popular Tags |