KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > help > internal > Topic


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.help.internal;
12
13 import org.eclipse.help.ITopic;
14 import org.w3c.dom.Element JavaDoc;
15
16 public class Topic extends UAElement implements ITopic {
17
18     public static final String JavaDoc NAME = "topic"; //$NON-NLS-1$
19
public static final String JavaDoc ATTRIBUTE_HREF = "href"; //$NON-NLS-1$
20
public static final String JavaDoc ATTRIBUTE_LABEL = "label"; //$NON-NLS-1$
21

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 JavaDoc src) {
34         super(src);
35     }
36
37     public String JavaDoc getHref() {
38         return getAttribute(ATTRIBUTE_HREF);
39     }
40     
41     public String JavaDoc 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 JavaDoc href) {
50         setAttribute(ATTRIBUTE_HREF, href);
51     }
52     
53     public void setLabel(String JavaDoc label) {
54         setAttribute(ATTRIBUTE_LABEL, label);
55     }
56 }
57
Popular Tags