~ubuntu-branches/ubuntu/trusty/cdk/trusty-proposed

« back to all changes in this revision

Viewing changes to src/net/sf/cdk/tools/doclets/CDKModuleTaglet.java

  • Committer: Bazaar Package Importer
  • Author(s): Paul Cager
  • Date: 2008-04-09 21:17:53 UTC
  • Revision ID: james.westby@ubuntu.com-20080409211753-46lmjw5z8mx5pd8d
Tags: upstream-1.0.2
ImportĀ upstreamĀ versionĀ 1.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Revision: 7973 $ $Author: egonw $ $Date: 2007-02-19 13:16:03 +0100 (Mon, 19 Feb 2007) $
 
2
 *
 
3
 * Copyright (C) 2004  Egon Willighagen <egonw@users.sf.net>
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or
 
6
 * modify it under the terms of the GNU Lesser General Public License
 
7
 * as published by the Free Software Foundation; either version 2.1
 
8
 * of the License, or (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU Lesser General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU Lesser General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 
18
 */
 
19
package net.sf.cdk.tools.doclets;
 
20
 
 
21
import com.sun.tools.doclets.Taglet;
 
22
import com.sun.javadoc.*;
 
23
import java.util.Map;
 
24
 
 
25
/**
 
26
 * Taglet that expands @cdk.module tag into a weblink to the CDK
 
27
 * webpage.
 
28
 */
 
29
public class CDKModuleTaglet implements Taglet {
 
30
    
 
31
    private static final String NAME = "cdk.module";
 
32
    
 
33
    public String getName() {
 
34
        return NAME;
 
35
    }
 
36
    
 
37
    public boolean inField() {
 
38
        return true;
 
39
    }
 
40
 
 
41
    public boolean inConstructor() {
 
42
        return true;
 
43
    }
 
44
    
 
45
    public boolean inMethod() {
 
46
        return true;
 
47
    }
 
48
    
 
49
    public boolean inOverview() {
 
50
        return true;
 
51
    }
 
52
 
 
53
    public boolean inPackage() {
 
54
        return true;
 
55
    }
 
56
 
 
57
    public boolean inType() {
 
58
        return true;
 
59
    }
 
60
    
 
61
    public boolean isInlineTag() {
 
62
        return false;
 
63
    }
 
64
    
 
65
    public static void register(Map tagletMap) {
 
66
       CDKModuleTaglet tag = new CDKModuleTaglet();
 
67
       Taglet t = (Taglet) tagletMap.get(tag.getName());
 
68
       if (t != null) {
 
69
           tagletMap.remove(tag.getName());
 
70
       }
 
71
       tagletMap.put(tag.getName(), tag);
 
72
    }
 
73
 
 
74
    public String toString(Tag tag) {
 
75
        return "<DT><B>Belongs to CDK module: </B><DD>"
 
76
               + "<a href=\"http://almost.cubic.uni-koeln.de/cdk/cdk_top/devel/modules/module-"
 
77
               + tag.text() + "/\">" + tag.text() + "</a></DD>\n";
 
78
    }
 
79
    
 
80
    public String toString(Tag[] tags) {
 
81
        if (tags.length == 0) {
 
82
            return null;
 
83
        } else {
 
84
            return toString(tags[0]);
 
85
        }
 
86
    }
 
87
 
 
88
}