PageRenderTime 22ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/Frameworks/AppKit/rhino.platform/CPOutlineView.j

http://github.com/jfahrenkrug/MapKit-HelloWorld
Unknown | 56 lines | 56 code | 0 blank | 0 comment | 0 complexity | 415bed904d3da7bf67c66736b1dafeb4 MD5 | raw file
 1i;13;CPTableView.jc;2698;
 2var _1=objj_allocateClassPair(CPTableView,"CPOutlineView"),_2=_1.isa;
 3class_addIvars(_1,[new objj_ivar("_outlineDataSource"),new objj_ivar("_itemsByRow")]);
 4objj_registerClassPair(_1);
 5objj_addClassForBundle(_1,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
 6class_addMethods(_1,[new objj_method(sel_getUid("initWithFrame:"),function(_3,_4,_5){
 7with(_3){
 8_3=objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPTableView")},"initWithFrame:",_5);
 9if(_3){
10objj_msgSendSuper({receiver:_3,super_class:objj_getClass("CPTableView")},"setDataSource:",_3);
11_itemsByRow=objj_msgSend(objj_msgSend(CPArray,"alloc"),"init");
12}
13return _3;
14}
15}),new objj_method(sel_getUid("setDataSource:"),function(_6,_7,_8){
16with(_6){
17if(!objj_msgSend(_8,"respondsToSelector:",sel_getUid("outlineView:child:ofItem"))){
18objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"Data source must implement 'outlineView:child:ofItem'");
19}
20if(!objj_msgSend(_8,"respondsToSelector:",sel_getUid("outlineView:isItemExpandable"))){
21objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"Data source must implement 'outlineView:isItemExpandable'");
22}
23if(!objj_msgSend(_8,"respondsToSelector:",sel_getUid("outlineView:numberOfChildrenOfItem"))){
24objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"Data source must implement 'outlineView:numberOfChildrenOfItem'");
25}
26if(!objj_msgSend(_8,"respondsToSelector:",sel_getUid("outlineView:objectValueForTableColumn:byItem"))){
27objj_msgSend(CPException,"raise:reason:",CPInternalInconsistencyException,"Data source must implement 'outlineView:objectValueForTableColumn:byItem'");
28}
29_outlineDataSource=_8;
30objj_msgSend(_6,"reloadData");
31}
32}),new objj_method(sel_getUid("reloadData"),function(_9,_a){
33with(_9){
34_numberOfVisibleItems=objj_msgSend(_outlineDataSource,"outlineView:numberOfChildrenOfItem:",_9,nil);
35_numberOfRows=_numberOfVisibleItems;
36var i=0;
37for(;i<_numberOfVisibleItems;++i){
38_itemsByRow[i]=objj_msgSend(_outlineDataSource,"outlineView:child:ofItem:",_9,i,nil);
39}
40objj_msgSend(_9,"loadTableCellsInRect:",objj_msgSend(_9,"bounds"));
41}
42})]);
43var _1=objj_getClass("CPOutlineView");
44if(!_1){
45objj_exception_throw(new objj_exception(OBJJClassNotFoundException,"*** Could not find definition for class \"CPOutlineView\""));
46}
47var _2=_1.isa;
48class_addMethods(_1,[new objj_method(sel_getUid("numberOfRowsInTableView:"),function(_c,_d,_e){
49with(_c){
50return _numberOfVisibleItems;
51}
52}),new objj_method(sel_getUid("tableView:objectValueForTableColumn:row:"),function(_f,_10,_11,_12,_13){
53with(_f){
54return objj_msgSend(_outlineDataSource,"outlineView:objectValueForTableColumn:byItem:",_f,_12,_itemsByRow[_13]);
55}
56})]);