1 11 package org.eclipse.help.internal; 12 13 import org.eclipse.help.ITopic; 14 import org.w3c.dom.Element ; 15 16 public class Topic extends UAElement implements ITopic { 17 18 public static final String NAME = "topic"; public static final String ATTRIBUTE_HREF = "href"; public static final String ATTRIBUTE_LABEL = "label"; 22 public Topic() { 23 super(NAME); 24 } 25 26 public Topic(ITopic src) { 27 super(NAME, src); 28 setHref(src.getHref()); 29 setLabel(src.getLabel()); 30 appendChildren(src.getChildren()); 31 } 32 33 public Topic(Element src) { 34 super(src); 35 } 36 37 public String getHref() { 38 return getAttribute(ATTRIBUTE_HREF); 39 } 40 41 public String getLabel() { 42 return getAttribute(ATTRIBUTE_LABEL); 43 } 44 45 public ITopic[] getSubtopics() { 46 return (ITopic[])getChildren(ITopic.class); 47 } 48 49 public void setHref(String href) { 50 setAttribute(ATTRIBUTE_HREF, href); 51 } 52 53 public void setLabel(String label) { 54 setAttribute(ATTRIBUTE_LABEL, label); 55 } 56 } 57 | Popular Tags |