⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 functions.ijxp

📁 java插件系统源码
💻 IJXP
字号:
<%
// Java Plug-in Framework (JPF)
// Copyright (C) 2004 - 2005 Dmitry Olshansky
// $Id: functions.ijxp,v 1.2 2005/07/09 20:31:14 ddimon Exp $
%>
<%
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>");
	}
}
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -