styleparser.lzx
<library>
<class name="styleparser">
<attribute name="haschildren" value="false
"/>
<attribute name="isleaf" value="false
"/>
<attribute name="style" type="expression" value="${null}"/>
<attribute name="defaultstyle" type="expression" value="${null}"/>
<attribute name="increment" type="number" value="0
"/>
<method name="init">
super.init();
this.recursive();
</method>
<method name="recursive">
if( this.defaultstyle != null &&
this.defaultstyle.subnodes != null &&
this.defaultstyle.subnodes.length > 0 ) {
for(this.increment = 0; this.increment < this.defaultstyle.subnodes.length; this.increment++ )
this.readChildrenNode();
} else {
this.setAttribute( 'isleaf' , true );
}
this.increment = 0;
</method>
<method name="readChildrenNode">
if( this.style.constructor.tagname == this.defaultstyle.constructor.tagname ) {
lParser = new lz.styleparser(this, {defaultstyle:this.defaultstyle.subnodes[this.increment], style:this.style});
} else if( this.style[this.defaultstyle.name] ) {
lParser = new lz.styleparser(this, {defaultstyle:this.defaultstyle.subnodes[this.increment], style:this.style[this.defaultstyle.name]});
}
else {
this.style[this.defaultstyle.name] = this.defaultstyle;
this.style.subnodes.push(this.defaultstyle);
this.style.subviews.push(this.defaultstyle);
lParser = new lz.styleparser(this, {defaultstyle:this.defaultstyle.subnodes[this.increment], style:this.style[this.defaultstyle.subnodes[this.increment].name]});
}
</method>
<handler name="onisleaf" method="readLeafNode"/>
<method name="readLeafNode" args="ignore">
if( this.style != null )
if( this.style.constructor.tagname == this.defaultstyle.constructor.tagname ) {
// continue;
} else if( this.style[this.defaultstyle.name] ) {
// continue;
}
else {
this.style[this.defaultstyle.name] = this.defaultstyle;
this.style.subnodes.push(this.defaultstyle);
this.style.subviews.push(this.defaultstyle);
}
</method>
</class>
</library>