src/aria/widgets/AriaSkinNormalization.js
function (widgetName, beanDef) {
            if (widgetName == "Icon") {
                // no inheritance, use usual normalization
                return function (skinClassName, skin, std) {
                    beanDef.$fastNorm(skin);
                };
            }
            var hasFrame = (beanDef.$properties.frame != null);
            var writer = new ariaUtilsFunctionWriter(["skinClassName", "skin", "std"]);
            ariaUtilsInheritanceNormalization.writeInheritanceNormalization({
                writer : writer,
                beanDef : beanDef,
                varToNormalize : "skin",
                parentVars : ["std"],
                excludes : {
                    "states" : true,
                    "frame" : true
                }
            });
            if (hasFrame) {
                // uses a frame, let's normalize it
                var frameStateNormalizerVar = writer.createTempVariable("this.normFrame(this.widgetName,skinClassName,skin,std)");
            }
            var states = beanDef.$properties.states;
            if (states) {
                states = states.$properties;
                writer.writeEnsureObjectExists("skin.states");
                var skinStatesVar = writer.createTempVariable("skin.states");
                var stdStatesVar = writer.createTempVariable("std.states||{}");
                var out = writer.out;
                for (var curState in states) {
                    if (states.hasOwnProperty(curState) && curState != "normal") {
                        var dotState = writer.getDotProperty(curState);
                        writer.writeEnsureObjectExists(skinStatesVar + dotState);
                        out.push("this.normState(", skinStatesVar, dotState, ",", stdStatesVar, dotState, ",", skinStatesVar, ".normal,", stdStatesVar, ".normal);");
                        if (hasFrame) {
                            // uses a frame, let's normalize it
                            out.push(frameStateNormalizerVar, ".call(this,skinClassName,", writer.stringify(curState), ",", skinStatesVar, dotState, ",", stdStatesVar, dotState, ",", skinStatesVar, ".normal, ", stdStatesVar, ".normal);");
                        }
                    }
                }
                writer.writeEnsureObjectExists(skinStatesVar + ".normal");
                out.push("this.normState(", skinStatesVar, ".normal, ", stdStatesVar, ".normal);");
                if (hasFrame) {
                    // uses a frame, let's normalize it
                    out.push(frameStateNormalizerVar, '.call(this,skinClassName,"normal",', skinStatesVar, '.normal,', stdStatesVar, '.normal);');
                }

            }
            var res = writer.createFunction();
            writer.$dispose();
            return res;
        }
function (widgetName, beanDef) {
            if (widgetName == "Icon") {
                // no inheritance, use usual normalization
                return function (skinClassName, skin, std) {
                    beanDef.$fastNorm(skin);
                };
            }
            var hasFrame = (beanDef.$properties.frame != null);
            var writer = new ariaUtilsFunctionWriter(["skinClassName", "skin", "std"]);
            ariaUtilsInheritanceNormalization.writeInheritanceNormalization({
                writer : writer,
                beanDef : beanDef,
                varToNormalize : "skin",
                parentVars : ["std"],
                excludes : {
                    "states" : true,
                    "frame" : true
                }
            });
            if (hasFrame) {
                // uses a frame, let's normalize it
                var frameStateNormalizerVar = writer.createTempVariable("this.normFrame(this.widgetName,skinClassName,skin,std)");
            }
            var states = beanDef.$properties.states;
            if (states) {
                states = states.$properties;
                writer.writeEnsureObjectExists("skin.states");
                var skinStatesVar = writer.createTempVariable("skin.states");
                var stdStatesVar = writer.createTempVariable("std.states||{}");
                var out = writer.out;
                for (var curState in states) {
                    if (states.hasOwnProperty(curState) && curState != "normal") {
                        var dotState = writer.getDotProperty(curState);
                        writer.writeEnsureObjectExists(skinStatesVar + dotState);
                        out.push("this.normState(", skinStatesVar, dotState, ",", stdStatesVar, dotState, ",", skinStatesVar, ".normal,", stdStatesVar, ".normal);");
                        if (hasFrame) {
                            // uses a frame, let's normalize it
                            out.push(frameStateNormalizerVar, ".call(this,skinClassName,", writer.stringify(curState), ",", skinStatesVar, dotState, ",", stdStatesVar, dotState, ",", skinStatesVar, ".normal, ", stdStatesVar, ".normal);");
                        }
                    }
                }
                writer.writeEnsureObjectExists(skinStatesVar + ".normal");
                out.push("this.normState(", skinStatesVar, ".normal, ", stdStatesVar, ".normal);");
                if (hasFrame) {
                    // uses a frame, let's normalize it
                    out.push(frameStateNormalizerVar, '.call(this,skinClassName,"normal",', skinStatesVar, '.normal,', stdStatesVar, '.normal);');
                }

            }
            var res = writer.createFunction();
            writer.$dispose();
            return res;
        }
function ( widgetName , beanDef ) { if ( widgetName == "Icon" ) { // no inheritance, use usual normalization return function ( skinClassName , skin , std ) { beanDef . $fastNorm ( skin ) ; } ; } var hasFrame = ( beanDef . $properties . frame != null ) ; var writer = new ariaUtilsFunctionWriter ( [ "skinClassName" , "skin" , "std" ] ) ; ariaUtilsInheritanceNormalization . writeInheritanceNormalization ( { writer : writer , beanDef : beanDef , varToNormalize : "skin" , parentVars : [ "std" ] , excludes : { "states" : true , "frame" : true } } ) ; if ( hasFrame ) { // uses a frame, let's normalize it var frameStateNormalizerVar = writer . createTempVariable ( "this.normFrame(this.widgetName,skinClassName,skin,std)" ) ; } var states = beanDef . $properties . states ; if ( states ) { states = states . $properties ; writer . writeEnsureObjectExists ( "skin.states" ) ; var skinStatesVar = writer . createTempVariable ( "skin.states" ) ; var stdStatesVar = writer . createTempVariable ( "std.states||{}" ) ; var out = writer . out ; for ( var curState in states ) { if ( states . hasOwnProperty ( curState ) && curState != "normal" ) { var dotState = writer . getDotProperty ( curState ) ; writer . writeEnsureObjectExists ( skinStatesVar + dotState ) ; out . push ( "this.normState(" , skinStatesVar , dotState , "," , stdStatesVar , dotState , "," , skinStatesVar , ".normal," , stdStatesVar , ".normal);" ) ; if ( hasFrame ) { // uses a frame, let's normalize it out . push ( frameStateNormalizerVar , ".call(this,skinClassName," , writer . stringify ( curState ) , "," , skinStatesVar , dotState , "," , stdStatesVar , dotState , "," , skinStatesVar , ".normal, " , stdStatesVar , ".normal);" ) ; } } } writer . writeEnsureObjectExists ( skinStatesVar + ".normal" ) ; out . push ( "this.normState(" , skinStatesVar , ".normal, " , stdStatesVar , ".normal);" ) ; if ( hasFrame ) { // uses a frame, let's normalize it out . push ( frameStateNormalizerVar , '.call(this,skinClassName,"normal",' , skinStatesVar , '.normal,' , stdStatesVar , '.normal);' ) ; } } var res = writer . createFunction ( ) ; writer . $dispose ( ) ; return res ; }
Create a normalizer function for a widget.
@param {String} widgetName name of the widget (in fact, the skinnable class, which may not correspond exactly
to widgets)
@param {Object} beanDef bean definition of the widget
@return {Function}
Create a normalizer function for a widget .