nl_tokens: Replaces specified classes with the newly specified classes . It uses the {
pl_tokens: function ( oldCls , newCls , prefix , suffix ) { // We could have just called {@link #removeCls} and {@link #addCls}, but that would mean {@link #updateCls} // would get called twice, which would have performance implications because it will update the dom. var cls = this . getCls ( ) , array = ( cls ) ? cls . slice ( ) : [ ] , ln , i , cachedCls ; prefix = prefix || '' ; suffix = suffix || '' ; //remove all oldCls if ( typeof oldCls == "string" ) { array = Ext . Array . remove ( array , prefix + oldCls + suffix ) ; } else if ( oldCls ) { ln = oldCls . length ; for ( i = 0 ; i < ln ; i ++ ) { array = Ext . Array . remove ( array , prefix + oldCls [ i ] + suffix ) ; } } //add all newCls if ( typeof newCls == "string" ) { array . push ( prefix + newCls + suffix ) ; } else if ( newCls ) { ln = newCls . length ; //check if there is currently nothing in the array and we don't need to add a prefix or a suffix. //if true, we can just set the array value to the newCls property, because that is what the value will be //if false, we need to loop through each and add them to the array if ( ! array . length && prefix === '' && suffix === '' ) { array = newCls ; } else { for ( i = 0 ; i < ln ; i ++ ) { cachedCls = <mask> + newCls [ i ] + suffix ; if ( array . indexOf ( cachedCls ) == - 1 ) { array . push ( cachedCls ) ; } } } } this . setCls ( array ) ; }