root / trunk / web / dojo / dojox / wire / TextAdapter.js @ 10
History | View | Annotate | Download (992 Bytes)
1 |
/*
|
---|---|
2 |
Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
3 |
Available via Academic Free License >= 2.1 OR the modified BSD license.
|
4 |
see: http://dojotoolkit.org/license for details
|
5 |
*/
|
6 |
|
7 |
|
8 |
if(!dojo._hasResource["dojox.wire.TextAdapter"]){ |
9 |
dojo._hasResource["dojox.wire.TextAdapter"]=true; |
10 |
dojo.provide("dojox.wire.TextAdapter");
|
11 |
dojo.require("dojox.wire.CompositeWire");
|
12 |
dojo.declare("dojox.wire.TextAdapter",dojox.wire.CompositeWire,{_wireClass:"dojox.wire.TextAdapter",constructor:function(_1){ |
13 |
this._initializeChildren(this.segments); |
14 |
if(!this.delimiter){ |
15 |
this.delimiter=""; |
16 |
} |
17 |
},_getValue:function(_2){ |
18 |
if(!_2||!this.segments){ |
19 |
return _2;
|
20 |
} |
21 |
var _3=""; |
22 |
for(var i in this.segments){ |
23 |
var _4=this.segments[i].getValue(_2); |
24 |
_3=this._addSegment(_3,_4);
|
25 |
} |
26 |
return _3;
|
27 |
},_setValue:function(_5,_6){ |
28 |
throw new Error("Unsupported API: "+this._wireClass+"._setValue"); |
29 |
},_addSegment:function(_7,_8){ |
30 |
if(!_8){
|
31 |
return _7;
|
32 |
}else{
|
33 |
if(!_7){
|
34 |
return _8;
|
35 |
}else{
|
36 |
return _7+this.delimiter+_8; |
37 |
} |
38 |
} |
39 |
}}); |
40 |
} |