this.name=name;
this.udf=udf;
// meta
List<FDSimpleVariable> list=new ArrayList<FDSimpleVariable>();
children.add(new FDSimpleVariable(frame,"Meta Data","",list));
list.add(new FDSimpleVariable(frame,"Function Name",udf.getFunctionName(),null));
if(!StringUtil.isEmpty(udf.getDisplayName()))
list.add(new FDSimpleVariable(frame,"Display Name",udf.getDisplayName(),null));
if(!StringUtil.isEmpty(udf.getDescription()))
list.add(new FDSimpleVariable(frame,"Description",udf.getDescription(),null));
if(!StringUtil.isEmpty(udf.getHint()))
list.add(new FDSimpleVariable(frame,"Hint",udf.getHint(),null));
list.add(new FDSimpleVariable(frame,"Return Type",udf.getReturnTypeAsString(),null));
list.add(new FDSimpleVariable(frame,"Return Format",UDFUtil.toReturnFormat(udf.getReturnFormat(),"plain"),null));
list.add(new FDSimpleVariable(frame,"Source",Caster.toString(udf.getPageSource().getDisplayPath()),null));
list.add(new FDSimpleVariable(frame,"Secure Json",Caster.toString(udf.getSecureJson(),""),null));
list.add(new FDSimpleVariable(frame,"Verify Client",Caster.toString(udf.getVerifyClient(),""),null));
// arguments
list=new ArrayList();
List el;
children.add(new FDSimpleVariable(frame,"Arguments","",list));
FunctionArgument[] args = udf.getFunctionArguments();
for(int i=0;i<args.length;i++){
el=new ArrayList();
list.add(new FDSimpleVariable(frame,"["+(i+1)+"]","",el));
el.add(new FDSimpleVariable(frame,"Name",args[i].getName().getString(),null));
el.add(new FDSimpleVariable(frame,"Type",args[i].getTypeAsString(),null));
el.add(new FDSimpleVariable(frame,"Required",Caster.toString(args[i].isRequired()),null));
if(!StringUtil.isEmpty(args[i].getDisplayName()))
el.add(new FDSimpleVariable(frame,"Display Name",args[i].getDisplayName(),null));
if(!StringUtil.isEmpty(args[i].getHint()))
el.add(new FDSimpleVariable(frame,"Hint",args[i].getHint(),null));
}
// return
children.add(new FDSimpleVariable(frame,"return",udf.getReturnTypeAsString(),null));
}