@doc>
Holds a context for the Dynamic Expression engine.
(c) SAP AG 2003-2006. All rights reserved.
///////////////////////////////////////////////////////////////////////
// CLASS DEFINITION
class DynExpContext inherit gml:Object;
///////////////////////////////////////////////////////////////////////
// PROPERTIES
// public properties
<@doc>The title of the editor dialog
readonly property title = '#TEXT[XTIT_DE_EDITOR]';
<@doc>The description of the editor dialog
readonly property description = '#TEXT[XMSG_EDIT_DE]';
<@doc>The context IInfoset Enumeration
readonly property infosetEnum = null;
<@doc>The context Infoset
readonly property infoset = null;
<@doc>The field in the contexto
readonly property field = '';
<@doc>Indicates the expected type of the value calculated by the expression
readonly property exprType = null;
<@doc>The previous expression text
readonly property exprText = '';
<@doc>The context containig element
readonly property element = null;
<@doc>The property that contains the expression
readonly property propName = '';
<@doc>Optional property translation type
readonly property transType = '';
///////////////////////////////////////////////////////////////////////
// PUBLIC METHODS
<@doc scope="public">
Sets the title of the editor dialog
The title of the editor dialog
method setTitle(title)
if((null != title) && (''!= title))
{
this.title= title;
}
end
<@doc scope="public">
Sets the description of the editor dialog
The description of the editor dialog
method setDescription(description)
this.description= description;
end
<@doc scope="public">
Sets the context Infoset Emumeration
The context Infoset Emumeration
Returns true when the object is a infoset enumeration
method setInfosetEnum(infosetEnum)
if(ISA(infosetEnum, 'dev:IInfosetEnumerator'))
{
this.infosetEnum = infosetEnum;
return true;
}
return false;
end
<@doc scope="public">
Sets the Infoset
The context Infoset
Returns true when all parameters are valid
method setInfoset(infoset)
if(ISA(infoset, 'dev:IInfoset'))
{
this.infoset = infoset;
return true;
}
return false;
end
<@doc scope="public">
Sets the field
The context field
method setField(field)
if(ISA(field, 'dev:IField'))
{
this.field = field;
return true;
}
return false;
end
<@doc scope="public">
Sets the expression type
The expression type
Returns true when type is valid
method setExprType(exprType)
// Check type validity:
if('String'==exprType ||
'Number'==exprType ||
'Boolean'==exprType ||
'Date'==exprType ||
'Time'==exprType ||
'Quantity'==exprType)
{
this.exprType= exprType;
return true;
}
return false;
end
<@doc scope="public">
Sets the property name and the translation type for the property that holds the expression.
A GML element that contains the property
The propertyName
The type (XTIT,XBTN...)
method setTranslation(element, propName, transType)
this.element = element;
this.propName = propName;
this.transType = transType;
end
<@doc scope="public">
Sets the context
The context Infoset enumeration
The context infoset
The context field
Returns true when all parameters are valid
method setContext(infosetEnum, infoset, field)
if(infosetEnum)
{
if(false == this.setInfosetEnum(infosetEnum))
{
return false;
}
}
if(infoset)
{
if(false == this.setInfoset(infoset))
{
return false;
}
}
if(field)
{
if(false == this.setField(field))
{
return false;
}
}
return true;
end
<@doc scope="public">
Sets the previous expression text
The previous expression text //TODO:: Check if necessary
method setPrevExprTxt(exprText)
this.exprText= exprText;
end