File: functions.ijxp

package info (click to toggle)
libjpf-java 1.5.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,280 kB
  • ctags: 2,079
  • sloc: java: 13,449; xml: 337; sh: 48; makefile: 10
file content (100 lines) | stat: -rw-r--r-- 2,834 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<%
// Java Plug-in Framework (JPF)
// Copyright (C) 2004 - 2005 Dmitry Olshansky
// $Id$
%>
<%
import java.text.*;
import org.java.plugin.*;

function void printFooter() {
%>
<br><br>
<div class="footer">
	<span style="float:left;">Generated by JPF DocGen</span>
	<span style="float:right;"><%= new SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.US).format(new Date()) %></span>
</div>
<br>
<%
}

function void printDoc(DocGenerator.Tool tool, Documentable obj) {
	Documentation doc = obj.getDocumentation();
	if (doc == null) {
		return;
	}
	println("<h3>" + tool.processDocText(doc.getCaption()) + "</h3>");
	println("<p>" + tool.processDocText(doc.getText()) + "</p>");
	if (doc.getReferences().isEmpty()) {
		return;
	}
	println("<p>References</p><ul>");
	for (Documentation.Reference ref : doc.getReferences()) {
		println("<li><a  href=\"" + tool.getLink(ref) + "\" "
			+ (tool.isAbsoluteUrl(ref.getRef()) ? "target=\"_new\"" : "")
			+ ">" + tool.processDocText(ref.getCaption()) + "</a></li>");
	}
	println("</ul>");
}

function void printAttr(DocGenerator.Tool tool, PluginAttribute attr) {
	println(attr.getId() + " [" + attr.getValue() + "]");
	if (attr.getSubAttributes().isEmpty()) {
		return;
	}
	println("<ul>");
	for (PluginAttribute subAttr : attr.getSubAttributes()) {
		println("<li>");
		printAttr(tool, subAttr);
		println("</li>");
	}
	println("</ul>");
}

function void printParamTableRow(DocGenerator.Tool tool,
                                 ExtensionPoint.ParameterDefinition def, 
                                 int nestedLevel,
                                 boolean isOdd) {
    if(isOdd) {
      print("<tr class=\"odd\">");
    } else {
      print("<tr class=\"even\">");
    }
	print("<td>");
    for(int i =0; i < nestedLevel; i++) {
      print("&nbsp;&nbsp;&nbsp;");
    }
	
	print(def.getId() + "</td>"); 
	print("<td>" + def.getType() + "</td>");
	print("<td>" + def.getMultiplicity() + "</td>");
	print("<td>");
	printParamDoc(tool, def); 
	println("</tr>");
	
	for (ExtensionPoint.ParameterDefinition subDef : def.getSubDefinitions()) {
		printParamTableRow(tool, subDef, nestedLevel + 1, isOdd);
	}  
}
function void printParamDoc(DocGenerator.Tool tool,
        ExtensionPoint.ParameterDefinition def) {
	Documentation doc = def.getDocumentation();
	if (doc == null) {
		return;
	}
	print(tool.processDocText(doc.getText()));        
}

function void printParam(DocGenerator.Tool tool, Extension.Parameter param) {
	println(param.getId() + " [" + param.rawValue() + "]");
	if (param.getSubParameters().isEmpty()) {
		return;
	}
	println("<ul>");
	for (Extension.Parameter subParam : param.getSubParameters()) {
		println("<li>");
		printParam(tool, subParam);
		println("</li>");
	}
}
%>