测试禁用、启用对插件运行的影响,先安装插件,新建模板,输入测试函数:FRTest("return value"),单元格显示内容为:用html显示内容。保存预览,显示aaa链接,单击链接,正常显示return value,如果禁用、启用一下插件,或者重启设计器,就不能显示正常内容了,提示报错。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.4 KiB

4 years ago
package com.fr.plugin.cool.cartnoon;
import com.fr.intelli.record.Focus;
import com.fr.intelli.record.Original;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.script.AbstractFunction;
4 years ago
import com.fr.stable.Primitive;
4 years ago
import com.fr.stable.fun.Authorize;
import java.awt.*;
@EnableMetrics
@Authorize(callSignKey = com.fr.plugin.cool.cartnoon.FunConstants.PLUGIN_ID)
4 years ago
public class FRPrintText extends AbstractFunction {
4 years ago
@Override
4 years ago
@Focus(id = com.fr.plugin.cool.cartnoon.FunConstants.PLUGIN_ID, text = "Plugin-Function_FRPrintText", source = Original.PLUGIN)
4 years ago
public Object run(Object[] args) {
4 years ago
if(!FunConstants.Author()){
return FunConstants.AUTHOR_ERROR;
}
if(!FunConstants.CheckArgs(args,6)){
return Primitive.ERROR_VALUE;
}
4 years ago
final String text = args[0].toString();
int width= Integer.parseInt(args[1].toString());
int height= Integer.parseInt(args[2].toString());
int fontSize= Integer.parseInt(args[3].toString());
int rate= Integer.parseInt(args[4].toString());
final Color color = FunConstants.TextToColor(args[5].toString());
4 years ago
final String id=FunConstants.GetCellId(this);
final String url="/webroot/decision/url/img?id="+id;
4 years ago
4 years ago
FunConstants.CreatePrintAnimate(id,text,fontSize,rate,color,width);
return "<img src=\""+url+"\" width=\""+width+"\" height=\""+height+"\" />";
4 years ago
}
}