PageRenderTime 20ms CodeModel.GetById 13ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Frameworks/AppKit/rhino.platform/_CPCibConnector.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 73 lines | 73 code | 0 blank | 0 comment | 0 complexity | 3ff2b2b595dd057da0f597a48605c10e MD5 | raw file
 1I;21;Foundation/CPObject.jI;29;Foundation/CPKeyValueCoding.jc;3017;
 2var _1="_CPCibConnectorSourceKey",_2="_CPCibConnectorDestinationKey",_3="_CPCibConnectorLabelKey";
 3var _4=objj_allocateClassPair(CPObject,"_CPCibConnector"),_5=_4.isa;
 4class_addIvars(_4,[new objj_ivar("_source"),new objj_ivar("_destination"),new objj_ivar("_label")]);
 5objj_registerClassPair(_4);
 6objj_addClassForBundle(_4,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
 7class_addMethods(_4,[new objj_method(sel_getUid("replaceObjects:"),function(_6,_7,_8){
 8with(_6){
 9var _9=_8[objj_msgSend(_source,"hash")];
10if(_9!==undefined){
11_source=_9;
12}
13_9=_8[objj_msgSend(_destination,"hash")];
14if(_9!==undefined){
15_destination=_9;
16}
17}
18})]);
19var _4=objj_getClass("_CPCibConnector");
20if(!_4){
21objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"_CPCibConnector\""));
22}
23var _5=_4.isa;
24class_addMethods(_4,[new objj_method(sel_getUid("initWithCoder:"),function(_a,_b,_c){
25with(_a){
26_a=objj_msgSendSuper({receiver:_a,super_class:objj_getClass("CPObject")},"init");
27if(_a){
28_source=objj_msgSend(_c,"decodeObjectForKey:",_1);
29_destination=objj_msgSend(_c,"decodeObjectForKey:",_2);
30_label=objj_msgSend(_c,"decodeObjectForKey:",_3);
31}
32return _a;
33}
34}),new objj_method(sel_getUid("encodeWithCoder:"),function(_d,_e,_f){
35with(_d){
36objj_msgSend(_f,"encodeObject:forKey:",_source,_1);
37objj_msgSend(_f,"encodeObject:forKey:",_destination,_2);
38objj_msgSend(_f,"encodeObject:forKey:",_label,_3);
39}
40})]);
41var _4=objj_allocateClassPair(_CPCibConnector,"_CPCibControlConnector"),_5=_4.isa;
42objj_registerClassPair(_4);
43objj_addClassForBundle(_4,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
44class_addMethods(_4,[new objj_method(sel_getUid("establishConnection"),function(_10,_11){
45with(_10){
46var _12=_label;
47if(!objj_msgSend(_12,"hasSuffix:",":")){
48_12+=":";
49}
50var _13=CPSelectorFromString(_12);
51if(!_13){
52objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"-["+objj_msgSend(_10,"className")+" "+_11+"] selector "+_12+" does not exist.");
53}
54if(objj_msgSend(_source,"respondsToSelector:",sel_getUid("setAction:"))){
55objj_msgSend(_source,sel_getUid("setAction:"),_13);
56}else{
57objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"-["+objj_msgSend(_10,"className")+" "+_11+"] "+objj_msgSend(_source,"description")+" does not respond to setAction:");
58}
59if(objj_msgSend(_source,"respondsToSelector:",sel_getUid("setTarget:"))){
60objj_msgSend(_source,sel_getUid("setTarget:"),_destination);
61}else{
62objj_msgSend(CPException,"raise:reason:",CPInvalidArgumentException,"-["+objj_msgSend(_10,"className")+" "+_11+"] "+objj_msgSend(_source,"description")+" does not respond to setTarget:");
63}
64}
65})]);
66var _4=objj_allocateClassPair(_CPCibConnector,"_CPCibOutletConnector"),_5=_4.isa;
67objj_registerClassPair(_4);
68objj_addClassForBundle(_4,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
69class_addMethods(_4,[new objj_method(sel_getUid("establishConnection"),function(_14,_15){
70with(_14){
71objj_msgSend(_source,"setValue:forKey:",_destination,_label);
72}
73})]);