@doc>
A tree provider class for the recently used functions in the dynamic expression editor tree
(c) SAP AG 2003-2006. All rights reserved.
#INCLUDE[lib:defs.inc]
#INCLUDE[gml:defs.inc]
class DEHelper inherit gml:Object;
<@doc>
scope="private">dynamic expression parser object
readonly property dynexpEngine = null;
static readonly property iconName = '#URL[~skin:icons.dynexp.expr.gif]';
<@doc>
Creates a DEHelper object
The $ENV.dynexp object
constructor (deEngine)
this.dynexpEngine = deEngine;
end
<@doc>
Creates the tooltip for the DE Tree
The function name
The function definition
The tooltip
method createTreeToolTip(funcName, def)
var functionList = this.dynexpEngine.Class.metadata.funcTable; //used in case of an alias
var token = def.token ? def.token : functionList[def.alias].token; //used in case of an alias
var argTypes = def.args ? def.args : functionList[def.alias].args; //number of args
var argsNum = argTypes.length;
var argType, buf=[];
var optionalParamPrefix, exampleArg;
if (token == 'FUNC') { // Functions
var argTypesStrings = [];
for (var i = 0; i for operators the tooltip already contains the operand type (in the dictionary.properties)
}
buf.push(def.descr);
return(buf.join(''));
end
method typeToString(type, funcName) // convert arg type from code (single char) to meaningful name
var argType;
switch (type.charAt(0)) {
case 'b': argType = 'Boolean'; break;
case 's': argType = 'String'; break;
case 'n': argType = 'Number'; break;
case 'd': argType = 'Date'; break;
case 't': argType = 'Time'; break;
case 'q': argType = 'Quantity'; break;
case 'c': argType = 'Datetime'; break;
case 'a': argType = 'Any-type'; break;
default: argType = 'String';
#LOG[2, 'Error - unexpected arg type in function definition for the function '+ funcName];
}
return argType;
end