1
0

IDE.deploy.js 143 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237
  1. smalltalk.addPackage('IDE', {});
  2. smalltalk.addClass('ClassesList', smalltalk.Widget, ['browser', 'ul', 'nodes'], 'IDE');
  3. smalltalk.addMethod(
  4. "_browser",
  5. smalltalk.method({
  6. selector: "browser",
  7. fn: function (){
  8. var self=this;
  9. return smalltalk.withContext(function($ctx) { return self["@browser"];
  10. }, self, "browser", [], smalltalk.ClassesList)}
  11. }),
  12. smalltalk.ClassesList);
  13. smalltalk.addMethod(
  14. "_browser_",
  15. smalltalk.method({
  16. selector: "browser:",
  17. fn: function (aBrowser){
  18. var self=this;
  19. return smalltalk.withContext(function($ctx) { self["@browser"]=aBrowser;
  20. return self}, self, "browser:", [aBrowser], smalltalk.ClassesList)}
  21. }),
  22. smalltalk.ClassesList);
  23. smalltalk.addMethod(
  24. "_category",
  25. smalltalk.method({
  26. selector: "category",
  27. fn: function (){
  28. var self=this;
  29. return smalltalk.withContext(function($ctx) { var $1;
  30. $1=_st(_st(self)._browser())._selectedPackage();
  31. return $1;
  32. }, self, "category", [], smalltalk.ClassesList)}
  33. }),
  34. smalltalk.ClassesList);
  35. smalltalk.addMethod(
  36. "_getNodes",
  37. smalltalk.method({
  38. selector: "getNodes",
  39. fn: function (){
  40. var self=this;
  41. return smalltalk.withContext(function($ctx) { var $1,$2;
  42. var classes;
  43. var children;
  44. var others;
  45. classes=_st(_st(self)._browser())._classes();
  46. children=[];
  47. others=[];
  48. _st(classes)._do_((function(each){
  49. $1=_st(classes)._includes_(_st(each)._superclass());
  50. if(smalltalk.assert($1)){
  51. return _st(others)._add_(each);
  52. } else {
  53. return _st(children)._add_(each);
  54. };
  55. }));
  56. $2=_st(children)._collect_((function(each){
  57. return _st((smalltalk.ClassesListNode || ClassesListNode))._on_browser_classes_level_(each,_st(self)._browser(),others,(0));
  58. }));
  59. return $2;
  60. }, self, "getNodes", [], smalltalk.ClassesList)}
  61. }),
  62. smalltalk.ClassesList);
  63. smalltalk.addMethod(
  64. "_nodes",
  65. smalltalk.method({
  66. selector: "nodes",
  67. fn: function (){
  68. var self=this;
  69. return smalltalk.withContext(function($ctx) { if(($receiver = self["@nodes"]) == nil || $receiver == undefined){
  70. self["@nodes"]=_st(self)._getNodes();
  71. self["@nodes"];
  72. } else {
  73. self["@nodes"];
  74. };
  75. return self["@nodes"];
  76. }, self, "nodes", [], smalltalk.ClassesList)}
  77. }),
  78. smalltalk.ClassesList);
  79. smalltalk.addMethod(
  80. "_renderOn_",
  81. smalltalk.method({
  82. selector: "renderOn:",
  83. fn: function (html){
  84. var self=this;
  85. return smalltalk.withContext(function($ctx) { var $1,$2;
  86. $1=_st(html)._ul();
  87. _st($1)._class_("amber_column browser classes");
  88. $2=_st($1)._yourself();
  89. self["@ul"]=$2;
  90. _st(self)._updateNodes();
  91. return self}, self, "renderOn:", [html], smalltalk.ClassesList)}
  92. }),
  93. smalltalk.ClassesList);
  94. smalltalk.addMethod(
  95. "_resetNodes",
  96. smalltalk.method({
  97. selector: "resetNodes",
  98. fn: function (){
  99. var self=this;
  100. return smalltalk.withContext(function($ctx) { self["@nodes"]=nil;
  101. return self}, self, "resetNodes", [], smalltalk.ClassesList)}
  102. }),
  103. smalltalk.ClassesList);
  104. smalltalk.addMethod(
  105. "_updateNodes",
  106. smalltalk.method({
  107. selector: "updateNodes",
  108. fn: function (){
  109. var self=this;
  110. return smalltalk.withContext(function($ctx) { _st(self["@ul"])._contents_((function(html){
  111. return _st(_st(self)._nodes())._do_((function(each){
  112. return _st(each)._renderOn_(html);
  113. }));
  114. }));
  115. return self}, self, "updateNodes", [], smalltalk.ClassesList)}
  116. }),
  117. smalltalk.ClassesList);
  118. smalltalk.addMethod(
  119. "_on_",
  120. smalltalk.method({
  121. selector: "on:",
  122. fn: function (aBrowser){
  123. var self=this;
  124. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  125. $2=_st(self)._new();
  126. _st($2)._browser_(aBrowser);
  127. $3=_st($2)._yourself();
  128. $1=$3;
  129. return $1;
  130. }, self, "on:", [aBrowser], smalltalk.ClassesList.klass)}
  131. }),
  132. smalltalk.ClassesList.klass);
  133. smalltalk.addClass('ClassesListNode', smalltalk.Widget, ['browser', 'theClass', 'level', 'nodes'], 'IDE');
  134. smalltalk.addMethod(
  135. "_browser",
  136. smalltalk.method({
  137. selector: "browser",
  138. fn: function (){
  139. var self=this;
  140. return smalltalk.withContext(function($ctx) { return self["@browser"];
  141. }, self, "browser", [], smalltalk.ClassesListNode)}
  142. }),
  143. smalltalk.ClassesListNode);
  144. smalltalk.addMethod(
  145. "_browser_",
  146. smalltalk.method({
  147. selector: "browser:",
  148. fn: function (aBrowser){
  149. var self=this;
  150. return smalltalk.withContext(function($ctx) { self["@browser"]=aBrowser;
  151. return self}, self, "browser:", [aBrowser], smalltalk.ClassesListNode)}
  152. }),
  153. smalltalk.ClassesListNode);
  154. smalltalk.addMethod(
  155. "_getNodesFrom_",
  156. smalltalk.method({
  157. selector: "getNodesFrom:",
  158. fn: function (aCollection){
  159. var self=this;
  160. return smalltalk.withContext(function($ctx) { var $1;
  161. var children;
  162. var others;
  163. children=[];
  164. others=[];
  165. _st(aCollection)._do_((function(each){
  166. $1=_st(_st(each)._superclass()).__eq(_st(self)._theClass());
  167. if(smalltalk.assert($1)){
  168. return _st(children)._add_(each);
  169. } else {
  170. return _st(others)._add_(each);
  171. };
  172. }));
  173. self["@nodes"]=_st(children)._collect_((function(each){
  174. return _st((smalltalk.ClassesListNode || ClassesListNode))._on_browser_classes_level_(each,_st(self)._browser(),others,_st(_st(self)._level()).__plus((1)));
  175. }));
  176. return self}, self, "getNodesFrom:", [aCollection], smalltalk.ClassesListNode)}
  177. }),
  178. smalltalk.ClassesListNode);
  179. smalltalk.addMethod(
  180. "_label",
  181. smalltalk.method({
  182. selector: "label",
  183. fn: function (){
  184. var self=this;
  185. return smalltalk.withContext(function($ctx) { var $1;
  186. var str;
  187. str=_st(_st((smalltalk.String || String))._new())._writeStream();
  188. _st(_st(self)._level())._timesRepeat_((function(){
  189. return _st(str)._nextPutAll_("    ");
  190. }));
  191. _st(str)._nextPutAll_(_st(_st(self)._theClass())._name());
  192. $1=_st(str)._contents();
  193. return $1;
  194. }, self, "label", [], smalltalk.ClassesListNode)}
  195. }),
  196. smalltalk.ClassesListNode);
  197. smalltalk.addMethod(
  198. "_level",
  199. smalltalk.method({
  200. selector: "level",
  201. fn: function (){
  202. var self=this;
  203. return smalltalk.withContext(function($ctx) { return self["@level"];
  204. }, self, "level", [], smalltalk.ClassesListNode)}
  205. }),
  206. smalltalk.ClassesListNode);
  207. smalltalk.addMethod(
  208. "_level_",
  209. smalltalk.method({
  210. selector: "level:",
  211. fn: function (anInteger){
  212. var self=this;
  213. return smalltalk.withContext(function($ctx) { self["@level"]=anInteger;
  214. return self}, self, "level:", [anInteger], smalltalk.ClassesListNode)}
  215. }),
  216. smalltalk.ClassesListNode);
  217. smalltalk.addMethod(
  218. "_nodes",
  219. smalltalk.method({
  220. selector: "nodes",
  221. fn: function (){
  222. var self=this;
  223. return smalltalk.withContext(function($ctx) { return self["@nodes"];
  224. }, self, "nodes", [], smalltalk.ClassesListNode)}
  225. }),
  226. smalltalk.ClassesListNode);
  227. smalltalk.addMethod(
  228. "_renderOn_",
  229. smalltalk.method({
  230. selector: "renderOn:",
  231. fn: function (html){
  232. var self=this;
  233. return smalltalk.withContext(function($ctx) { var $1,$2;
  234. var li;
  235. var cssClass;
  236. cssClass="";
  237. li=_st(_st(html)._li())._onClick_((function(){
  238. return _st(_st(self)._browser())._selectClass_(_st(self)._theClass());
  239. }));
  240. _st(_st(li)._asJQuery())._html_(_st(self)._label());
  241. $1=_st(_st(_st(self)._browser())._selectedClass()).__eq(_st(self)._theClass());
  242. if(smalltalk.assert($1)){
  243. cssClass=_st(cssClass).__comma(" selected");
  244. cssClass;
  245. };
  246. $2=_st(_st(_st(self)._theClass())._comment())._isEmpty();
  247. if(! smalltalk.assert($2)){
  248. cssClass=_st(cssClass).__comma(" commented");
  249. cssClass;
  250. };
  251. _st(li)._class_(cssClass);
  252. _st(_st(self)._nodes())._do_((function(each){
  253. return _st(each)._renderOn_(html);
  254. }));
  255. return self}, self, "renderOn:", [html], smalltalk.ClassesListNode)}
  256. }),
  257. smalltalk.ClassesListNode);
  258. smalltalk.addMethod(
  259. "_theClass",
  260. smalltalk.method({
  261. selector: "theClass",
  262. fn: function (){
  263. var self=this;
  264. return smalltalk.withContext(function($ctx) { return self["@theClass"];
  265. }, self, "theClass", [], smalltalk.ClassesListNode)}
  266. }),
  267. smalltalk.ClassesListNode);
  268. smalltalk.addMethod(
  269. "_theClass_",
  270. smalltalk.method({
  271. selector: "theClass:",
  272. fn: function (aClass){
  273. var self=this;
  274. return smalltalk.withContext(function($ctx) { self["@theClass"]=aClass;
  275. return self}, self, "theClass:", [aClass], smalltalk.ClassesListNode)}
  276. }),
  277. smalltalk.ClassesListNode);
  278. smalltalk.addMethod(
  279. "_on_browser_classes_level_",
  280. smalltalk.method({
  281. selector: "on:browser:classes:level:",
  282. fn: function (aClass,aBrowser,aCollection,anInteger){
  283. var self=this;
  284. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  285. $2=_st(self)._new();
  286. _st($2)._theClass_(aClass);
  287. _st($2)._browser_(aBrowser);
  288. _st($2)._level_(anInteger);
  289. _st($2)._getNodesFrom_(aCollection);
  290. $3=_st($2)._yourself();
  291. $1=$3;
  292. return $1;
  293. }, self, "on:browser:classes:level:", [aClass,aBrowser,aCollection,anInteger], smalltalk.ClassesListNode.klass)}
  294. }),
  295. smalltalk.ClassesListNode.klass);
  296. smalltalk.addClass('DebugErrorHandler', smalltalk.ErrorHandler, [], 'IDE');
  297. smalltalk.addMethod(
  298. "_handleError_",
  299. smalltalk.method({
  300. selector: "handleError:",
  301. fn: function (anError){
  302. var self=this;
  303. return smalltalk.withContext(function($ctx) { var $1,$2;
  304. _st((function(){
  305. $1=_st((smalltalk.Debugger || Debugger))._new();
  306. _st($1)._error_(anError);
  307. $2=_st($1)._open();
  308. return $2;
  309. }))._on_do_((smalltalk.Error || Error),(function(error){
  310. return _st(_st((smalltalk.ErrorHandler || ErrorHandler))._new())._handleError_(error);
  311. }));
  312. return self}, self, "handleError:", [anError], smalltalk.DebugErrorHandler)}
  313. }),
  314. smalltalk.DebugErrorHandler);
  315. smalltalk.addMethod(
  316. "_initialize",
  317. smalltalk.method({
  318. selector: "initialize",
  319. fn: function (){
  320. var self=this;
  321. return smalltalk.withContext(function($ctx) { _st(self)._register();
  322. return self}, self, "initialize", [], smalltalk.DebugErrorHandler.klass)}
  323. }),
  324. smalltalk.DebugErrorHandler.klass);
  325. smalltalk.addClass('SourceArea', smalltalk.Widget, ['editor', 'div', 'receiver', 'onDoIt'], 'IDE');
  326. smalltalk.addMethod(
  327. "_clear",
  328. smalltalk.method({
  329. selector: "clear",
  330. fn: function (){
  331. var self=this;
  332. return smalltalk.withContext(function($ctx) { _st(self)._val_("");
  333. return self}, self, "clear", [], smalltalk.SourceArea)}
  334. }),
  335. smalltalk.SourceArea);
  336. smalltalk.addMethod(
  337. "_currentLine",
  338. smalltalk.method({
  339. selector: "currentLine",
  340. fn: function (){
  341. var self=this;
  342. return smalltalk.withContext(function($ctx) { var $1;
  343. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  344. return $1;
  345. }, self, "currentLine", [], smalltalk.SourceArea)}
  346. }),
  347. smalltalk.SourceArea);
  348. smalltalk.addMethod(
  349. "_currentLineOrSelection",
  350. smalltalk.method({
  351. selector: "currentLineOrSelection",
  352. fn: function (){
  353. var self=this;
  354. return smalltalk.withContext(function($ctx) { var $2,$1;
  355. $2=_st(self["@editor"])._somethingSelected();
  356. if(smalltalk.assert($2)){
  357. $1=_st(self)._selection();
  358. } else {
  359. $1=_st(self)._currentLine();
  360. };
  361. return $1;
  362. }, self, "currentLineOrSelection", [], smalltalk.SourceArea)}
  363. }),
  364. smalltalk.SourceArea);
  365. smalltalk.addMethod(
  366. "_doIt",
  367. smalltalk.method({
  368. selector: "doIt",
  369. fn: function (){
  370. var self=this;
  371. return smalltalk.withContext(function($ctx) { var $1;
  372. var result;
  373. result=_st(self)._eval_(_st(self)._currentLineOrSelection());
  374. $1=_st(self)._onDoIt();
  375. if(($receiver = $1) == nil || $receiver == undefined){
  376. $1;
  377. } else {
  378. _st(_st(self)._onDoIt())._value();
  379. };
  380. return result;
  381. }, self, "doIt", [], smalltalk.SourceArea)}
  382. }),
  383. smalltalk.SourceArea);
  384. smalltalk.addMethod(
  385. "_editor",
  386. smalltalk.method({
  387. selector: "editor",
  388. fn: function (){
  389. var self=this;
  390. return smalltalk.withContext(function($ctx) { return self["@editor"];
  391. }, self, "editor", [], smalltalk.SourceArea)}
  392. }),
  393. smalltalk.SourceArea);
  394. smalltalk.addMethod(
  395. "_eval_",
  396. smalltalk.method({
  397. selector: "eval:",
  398. fn: function (aString){
  399. var self=this;
  400. return smalltalk.withContext(function($ctx) { var $1,$2;
  401. var $early={};
  402. try {
  403. var compiler;
  404. compiler=_st((smalltalk.Compiler || Compiler))._new();
  405. _st((function(){
  406. return _st(compiler)._parseExpression_(aString);
  407. }))._on_do_((smalltalk.Error || Error),(function(ex){
  408. $1=_st(window)._alert_(_st(ex)._messageText());
  409. throw $early=[$1];
  410. }));
  411. $2=_st(_st(_st(compiler)._eval_(_st(compiler)._compile_forClass_(_st(_st("doIt ^[").__comma(aString)).__comma("] value"),(smalltalk.DoIt || DoIt))))._fn())._applyTo_arguments_(_st(self)._receiver(),[]);
  412. return $2;
  413. }
  414. catch(e) {if(e===$early)return e[0]; throw e}
  415. }, self, "eval:", [aString], smalltalk.SourceArea)}
  416. }),
  417. smalltalk.SourceArea);
  418. smalltalk.addMethod(
  419. "_fileIn",
  420. smalltalk.method({
  421. selector: "fileIn",
  422. fn: function (){
  423. var self=this;
  424. return smalltalk.withContext(function($ctx) { _st(_st((smalltalk.Importer || Importer))._new())._import_(_st(_st(self)._currentLineOrSelection())._readStream());
  425. return self}, self, "fileIn", [], smalltalk.SourceArea)}
  426. }),
  427. smalltalk.SourceArea);
  428. smalltalk.addMethod(
  429. "_focus",
  430. smalltalk.method({
  431. selector: "focus",
  432. fn: function (){
  433. var self=this;
  434. return smalltalk.withContext(function($ctx) { _st(_st(self)._editor())._focus();
  435. return self}, self, "focus", [], smalltalk.SourceArea)}
  436. }),
  437. smalltalk.SourceArea);
  438. smalltalk.addMethod(
  439. "_handleKeyDown_",
  440. smalltalk.method({
  441. selector: "handleKeyDown:",
  442. fn: function (anEvent){
  443. var self=this;
  444. return smalltalk.withContext(function($ctx) { if(anEvent.ctrlKey) {
  445. if(anEvent.keyCode === 80) { //ctrl+p
  446. self._printIt();
  447. anEvent.preventDefault();
  448. return false;
  449. }
  450. if(anEvent.keyCode === 68) { //ctrl+d
  451. self._doIt();
  452. anEvent.preventDefault();
  453. return false;
  454. }
  455. if(anEvent.keyCode === 73) { //ctrl+i
  456. self._inspectIt();
  457. anEvent.preventDefault();
  458. return false;
  459. }
  460. };
  461. ;
  462. return self}, self, "handleKeyDown:", [anEvent], smalltalk.SourceArea)}
  463. }),
  464. smalltalk.SourceArea);
  465. smalltalk.addMethod(
  466. "_inspectIt",
  467. smalltalk.method({
  468. selector: "inspectIt",
  469. fn: function (){
  470. var self=this;
  471. return smalltalk.withContext(function($ctx) { _st(_st(self)._doIt())._inspect();
  472. return self}, self, "inspectIt", [], smalltalk.SourceArea)}
  473. }),
  474. smalltalk.SourceArea);
  475. smalltalk.addMethod(
  476. "_onDoIt",
  477. smalltalk.method({
  478. selector: "onDoIt",
  479. fn: function (){
  480. var self=this;
  481. return smalltalk.withContext(function($ctx) { return self["@onDoIt"];
  482. }, self, "onDoIt", [], smalltalk.SourceArea)}
  483. }),
  484. smalltalk.SourceArea);
  485. smalltalk.addMethod(
  486. "_onDoIt_",
  487. smalltalk.method({
  488. selector: "onDoIt:",
  489. fn: function (aBlock){
  490. var self=this;
  491. return smalltalk.withContext(function($ctx) { self["@onDoIt"]=aBlock;
  492. return self}, self, "onDoIt:", [aBlock], smalltalk.SourceArea)}
  493. }),
  494. smalltalk.SourceArea);
  495. smalltalk.addMethod(
  496. "_onKeyDown_",
  497. smalltalk.method({
  498. selector: "onKeyDown:",
  499. fn: function (aBlock){
  500. var self=this;
  501. return smalltalk.withContext(function($ctx) { _st(self["@div"])._onKeyDown_(aBlock);
  502. return self}, self, "onKeyDown:", [aBlock], smalltalk.SourceArea)}
  503. }),
  504. smalltalk.SourceArea);
  505. smalltalk.addMethod(
  506. "_onKeyUp_",
  507. smalltalk.method({
  508. selector: "onKeyUp:",
  509. fn: function (aBlock){
  510. var self=this;
  511. return smalltalk.withContext(function($ctx) { _st(self["@div"])._onKeyUp_(aBlock);
  512. return self}, self, "onKeyUp:", [aBlock], smalltalk.SourceArea)}
  513. }),
  514. smalltalk.SourceArea);
  515. smalltalk.addMethod(
  516. "_print_",
  517. smalltalk.method({
  518. selector: "print:",
  519. fn: function (aString){
  520. var self=this;
  521. return smalltalk.withContext(function($ctx) { var start;
  522. var stop;
  523. start=_st((smalltalk.HashedCollection || HashedCollection))._new();
  524. stop=_st((smalltalk.HashedCollection || HashedCollection))._new();
  525. _st(start)._at_put_("line",_st(_st(self["@editor"])._getCursor_(false))._line());
  526. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getCursor_(false))._ch());
  527. _st(stop)._at_put_("line",_st(start)._at_("line"));
  528. _st(stop)._at_put_("ch",_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2)));
  529. _st(self["@editor"])._replaceSelection_(_st(_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString)).__comma(" "));
  530. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  531. _st(self["@editor"])._setSelection_end_(stop,start);
  532. return self}, self, "print:", [aString], smalltalk.SourceArea)}
  533. }),
  534. smalltalk.SourceArea);
  535. smalltalk.addMethod(
  536. "_printIt",
  537. smalltalk.method({
  538. selector: "printIt",
  539. fn: function (){
  540. var self=this;
  541. return smalltalk.withContext(function($ctx) { _st(self)._print_(_st(_st(self)._doIt())._printString());
  542. _st(self)._focus();
  543. return self}, self, "printIt", [], smalltalk.SourceArea)}
  544. }),
  545. smalltalk.SourceArea);
  546. smalltalk.addMethod(
  547. "_receiver",
  548. smalltalk.method({
  549. selector: "receiver",
  550. fn: function (){
  551. var self=this;
  552. return smalltalk.withContext(function($ctx) { var $1;
  553. if(($receiver = self["@receiver"]) == nil || $receiver == undefined){
  554. $1=_st((smalltalk.DoIt || DoIt))._new();
  555. } else {
  556. $1=self["@receiver"];
  557. };
  558. return $1;
  559. }, self, "receiver", [], smalltalk.SourceArea)}
  560. }),
  561. smalltalk.SourceArea);
  562. smalltalk.addMethod(
  563. "_receiver_",
  564. smalltalk.method({
  565. selector: "receiver:",
  566. fn: function (anObject){
  567. var self=this;
  568. return smalltalk.withContext(function($ctx) { self["@receiver"]=anObject;
  569. return self}, self, "receiver:", [anObject], smalltalk.SourceArea)}
  570. }),
  571. smalltalk.SourceArea);
  572. smalltalk.addMethod(
  573. "_renderOn_",
  574. smalltalk.method({
  575. selector: "renderOn:",
  576. fn: function (html){
  577. var self=this;
  578. return smalltalk.withContext(function($ctx) { var textarea;
  579. self["@div"]=_st(_st(html)._div())._class_("source");
  580. _st(self["@div"])._with_((function(){
  581. textarea=_st(html)._textarea();
  582. return textarea;
  583. }));
  584. _st(self)._setEditorOn_(_st(textarea)._element());
  585. _st(self["@div"])._onKeyDown_((function(e){
  586. return _st(self)._handleKeyDown_(e);
  587. }));
  588. return self}, self, "renderOn:", [html], smalltalk.SourceArea)}
  589. }),
  590. smalltalk.SourceArea);
  591. smalltalk.addMethod(
  592. "_selection",
  593. smalltalk.method({
  594. selector: "selection",
  595. fn: function (){
  596. var self=this;
  597. return smalltalk.withContext(function($ctx) { var $1;
  598. $1=_st(self["@editor"])._getSelection();
  599. return $1;
  600. }, self, "selection", [], smalltalk.SourceArea)}
  601. }),
  602. smalltalk.SourceArea);
  603. smalltalk.addMethod(
  604. "_selectionEnd",
  605. smalltalk.method({
  606. selector: "selectionEnd",
  607. fn: function () {
  608. var self = this;
  609. var $1;
  610. $1 = smalltalk.send(smalltalk.send(textarea, "_element", []), "_selectionEnd", []);
  611. return $1;
  612. }
  613. }),
  614. smalltalk.SourceArea);
  615. smalltalk.addMethod(
  616. "_selectionEnd_",
  617. smalltalk.method({
  618. selector: "selectionEnd:",
  619. fn: function (anInteger) {
  620. var self = this;
  621. smalltalk.send(smalltalk.send(textarea, "_element", []), "_selectionEnd_", [anInteger]);
  622. return self;
  623. }
  624. }),
  625. smalltalk.SourceArea);
  626. smalltalk.addMethod(
  627. "_selectionStart",
  628. smalltalk.method({
  629. selector: "selectionStart",
  630. fn: function () {
  631. var self = this;
  632. var $1;
  633. $1 = smalltalk.send(smalltalk.send(textarea, "_element", []), "_selectionStart", []);
  634. return $1;
  635. }
  636. }),
  637. smalltalk.SourceArea);
  638. smalltalk.addMethod(
  639. "_selectionStart_",
  640. smalltalk.method({
  641. selector: "selectionStart:",
  642. fn: function (anInteger) {
  643. var self = this;
  644. smalltalk.send(smalltalk.send(textarea, "_element", []), "_selectionStart_", [anInteger]);
  645. return self;
  646. }
  647. }),
  648. smalltalk.SourceArea);
  649. smalltalk.addMethod(
  650. "_setEditorOn_",
  651. smalltalk.method({
  652. selector: "setEditorOn:",
  653. fn: function (aTextarea) {
  654. var self = this;
  655. self['@editor'] = CodeMirror.fromTextArea(aTextarea, {theme: "amber", lineNumbers: true, enterMode: "flat", matchBrackets: true, electricChars: false});
  656. return self;
  657. }
  658. }),
  659. smalltalk.SourceArea);
  660. smalltalk.addMethod(
  661. "_val",
  662. smalltalk.method({
  663. selector: "val",
  664. fn: function () {
  665. var self = this;
  666. var $1;
  667. $1 = smalltalk.send(self['@editor'], "_getValue", []);
  668. return $1;
  669. }
  670. }),
  671. smalltalk.SourceArea);
  672. smalltalk.addMethod(
  673. "_val_",
  674. smalltalk.method({
  675. selector: "val:",
  676. fn: function (aString) {
  677. var self = this;
  678. smalltalk.send(self['@editor'], "_setValue_", [aString]);
  679. return self;
  680. }
  681. }),
  682. smalltalk.SourceArea);
  683. smalltalk.addClass('TabManager', smalltalk.Widget, ['selectedTab', 'tabs', 'opened', 'ul', 'input'], 'IDE');
  684. smalltalk.addMethod(
  685. "_addTab_",
  686. smalltalk.method({
  687. selector: "addTab:",
  688. fn: function (aWidget){
  689. var self=this;
  690. return smalltalk.withContext(function($ctx) { _st(_st(self)._tabs())._add_(aWidget);
  691. _st(aWidget)._appendToJQuery_(_st("#amber")._asJQuery());
  692. _st(aWidget)._hide();
  693. return self}, self, "addTab:", [aWidget], smalltalk.TabManager)}
  694. }),
  695. smalltalk.TabManager);
  696. smalltalk.addMethod(
  697. "_close",
  698. smalltalk.method({
  699. selector: "close",
  700. fn: function (){
  701. var self=this;
  702. return smalltalk.withContext(function($ctx) { if(smalltalk.assert(self["@opened"])){
  703. _st(_st("#amber")._asJQuery())._hide();
  704. _st(_st(self["@ul"])._asJQuery())._hide();
  705. _st(self["@selectedTab"])._hide();
  706. _st(self)._removeBodyMargin();
  707. _st(_st("body")._asJQuery())._removeClass_("amberBody");
  708. self["@opened"]=false;
  709. self["@opened"];
  710. };
  711. return self}, self, "close", [], smalltalk.TabManager)}
  712. }),
  713. smalltalk.TabManager);
  714. smalltalk.addMethod(
  715. "_closeTab_",
  716. smalltalk.method({
  717. selector: "closeTab:",
  718. fn: function (aWidget){
  719. var self=this;
  720. return smalltalk.withContext(function($ctx) { _st(self)._removeTab_(aWidget);
  721. _st(self)._selectTab_(_st(_st(self)._tabs())._last());
  722. _st(aWidget)._remove();
  723. _st(self)._update();
  724. return self}, self, "closeTab:", [aWidget], smalltalk.TabManager)}
  725. }),
  726. smalltalk.TabManager);
  727. smalltalk.addMethod(
  728. "_initialize",
  729. smalltalk.method({
  730. selector: "initialize",
  731. fn: function (){
  732. var self=this;
  733. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  734. smalltalk.Widget.fn.prototype._initialize.apply(_st(self), []);
  735. self["@opened"]=true;
  736. _st((function(html){
  737. return _st(_st(html)._div())._id_("amber");
  738. }))._appendToJQuery_(_st("body")._asJQuery());
  739. _st(_st("body")._asJQuery())._addClass_("amberBody");
  740. _st(self)._appendToJQuery_(_st("#amber")._asJQuery());
  741. _st(self)._addTab_(_st((smalltalk.IDETranscript || IDETranscript))._current());
  742. _st(self)._addTab_(_st((smalltalk.Workspace || Workspace))._new());
  743. $1=_st(self)._addTab_(_st((smalltalk.TestRunner || TestRunner))._new());
  744. _st(self)._selectTab_(_st(_st(self)._tabs())._last());
  745. _st(self)._onResize_((function(){
  746. _st(self)._updateBodyMargin();
  747. $2=_st(self)._updatePosition();
  748. return $2;
  749. }));
  750. $3=_st(self)._onWindowResize_((function(){
  751. return _st(self)._updatePosition();
  752. }));
  753. return self}, self, "initialize", [], smalltalk.TabManager)}
  754. }),
  755. smalltalk.TabManager);
  756. smalltalk.addMethod(
  757. "_labelFor_",
  758. smalltalk.method({
  759. selector: "labelFor:",
  760. fn: function (aWidget){
  761. var self=this;
  762. return smalltalk.withContext(function($ctx) { var $1;
  763. var label;
  764. var maxSize;
  765. maxSize=(15);
  766. label=_st(_st(aWidget)._label())._copyFrom_to_((0),_st(_st(_st(aWidget)._label())._size())._min_(maxSize));
  767. $1=_st(_st(_st(aWidget)._label())._size()).__gt(maxSize);
  768. if(smalltalk.assert($1)){
  769. label=_st(label).__comma("...");
  770. label;
  771. };
  772. return label;
  773. }, self, "labelFor:", [aWidget], smalltalk.TabManager)}
  774. }),
  775. smalltalk.TabManager);
  776. smalltalk.addMethod(
  777. "_newBrowserTab",
  778. smalltalk.method({
  779. selector: "newBrowserTab",
  780. fn: function (){
  781. var self=this;
  782. return smalltalk.withContext(function($ctx) { _st((smalltalk.Browser || Browser))._open();
  783. return self}, self, "newBrowserTab", [], smalltalk.TabManager)}
  784. }),
  785. smalltalk.TabManager);
  786. smalltalk.addMethod(
  787. "_onResize_",
  788. smalltalk.method({
  789. selector: "onResize:",
  790. fn: function (aBlock){
  791. var self=this;
  792. return smalltalk.withContext(function($ctx) { jQuery('#amber').resizable({
  793. handles: 'n',
  794. resize: aBlock,
  795. minHeight: 230
  796. });
  797. ;
  798. return self}, self, "onResize:", [aBlock], smalltalk.TabManager)}
  799. }),
  800. smalltalk.TabManager);
  801. smalltalk.addMethod(
  802. "_onWindowResize_",
  803. smalltalk.method({
  804. selector: "onWindowResize:",
  805. fn: function (aBlock){
  806. var self=this;
  807. return smalltalk.withContext(function($ctx) { jQuery(window).resize(aBlock);
  808. ;
  809. return self}, self, "onWindowResize:", [aBlock], smalltalk.TabManager)}
  810. }),
  811. smalltalk.TabManager);
  812. smalltalk.addMethod(
  813. "_open",
  814. smalltalk.method({
  815. selector: "open",
  816. fn: function (){
  817. var self=this;
  818. return smalltalk.withContext(function($ctx) { if(! smalltalk.assert(self["@opened"])){
  819. _st(_st("body")._asJQuery())._addClass_("amberBody");
  820. _st(_st("#amber")._asJQuery())._show();
  821. _st(_st(self["@ul"])._asJQuery())._show();
  822. _st(self)._updateBodyMargin();
  823. _st(self["@selectedTab"])._show();
  824. self["@opened"]=true;
  825. self["@opened"];
  826. };
  827. return self}, self, "open", [], smalltalk.TabManager)}
  828. }),
  829. smalltalk.TabManager);
  830. smalltalk.addMethod(
  831. "_removeBodyMargin",
  832. smalltalk.method({
  833. selector: "removeBodyMargin",
  834. fn: function (){
  835. var self=this;
  836. return smalltalk.withContext(function($ctx) { _st(self)._setBodyMargin_((0));
  837. return self}, self, "removeBodyMargin", [], smalltalk.TabManager)}
  838. }),
  839. smalltalk.TabManager);
  840. smalltalk.addMethod(
  841. "_removeTab_",
  842. smalltalk.method({
  843. selector: "removeTab:",
  844. fn: function (aWidget){
  845. var self=this;
  846. return smalltalk.withContext(function($ctx) { _st(_st(self)._tabs())._remove_(aWidget);
  847. _st(self)._update();
  848. return self}, self, "removeTab:", [aWidget], smalltalk.TabManager)}
  849. }),
  850. smalltalk.TabManager);
  851. smalltalk.addMethod(
  852. "_renderOn_",
  853. smalltalk.method({
  854. selector: "renderOn:",
  855. fn: function (html){
  856. var self=this;
  857. return smalltalk.withContext(function($ctx) { var $1,$2;
  858. _st(_st(html)._div())._id_("logo");
  859. _st(self)._renderToolbarOn_(html);
  860. $1=_st(html)._ul();
  861. _st($1)._id_("amberTabs");
  862. $2=_st($1)._yourself();
  863. self["@ul"]=$2;
  864. _st(self)._renderTabs();
  865. return self}, self, "renderOn:", [html], smalltalk.TabManager)}
  866. }),
  867. smalltalk.TabManager);
  868. smalltalk.addMethod(
  869. "_renderTabFor_on_",
  870. smalltalk.method({
  871. selector: "renderTabFor:on:",
  872. fn: function (aWidget,html){
  873. var self=this;
  874. return smalltalk.withContext(function($ctx) { var $1,$2,$4,$5,$6,$3,$7;
  875. var li;
  876. li=_st(html)._li();
  877. $1=_st(self["@selectedTab"]).__eq(aWidget);
  878. if(smalltalk.assert($1)){
  879. _st(li)._class_("selected");
  880. };
  881. _st(li)._with_((function(){
  882. _st(_st(html)._span())._class_("ltab");
  883. $2=_st(html)._span();
  884. _st($2)._class_("mtab");
  885. $3=_st($2)._with_((function(){
  886. $4=_st(aWidget)._canBeClosed();
  887. if(smalltalk.assert($4)){
  888. $5=_st(html)._span();
  889. _st($5)._class_("close");
  890. _st($5)._with_("x");
  891. $6=_st($5)._onClick_((function(){
  892. return _st(self)._closeTab_(aWidget);
  893. }));
  894. $6;
  895. };
  896. return _st(_st(html)._span())._with_(_st(self)._labelFor_(aWidget));
  897. }));
  898. $3;
  899. return _st(_st(html)._span())._class_("rtab");
  900. }));
  901. $7=_st(li)._onClick_((function(){
  902. return _st(self)._selectTab_(aWidget);
  903. }));
  904. return self}, self, "renderTabFor:on:", [aWidget,html], smalltalk.TabManager)}
  905. }),
  906. smalltalk.TabManager);
  907. smalltalk.addMethod(
  908. "_renderTabs",
  909. smalltalk.method({
  910. selector: "renderTabs",
  911. fn: function (){
  912. var self=this;
  913. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4;
  914. _st(self["@ul"])._contents_((function(html){
  915. _st(_st(self)._tabs())._do_((function(each){
  916. return _st(self)._renderTabFor_on_(each,html);
  917. }));
  918. $1=_st(html)._li();
  919. _st($1)._class_("newtab");
  920. _st($1)._with_((function(){
  921. _st(_st(html)._span())._class_("ltab");
  922. $2=_st(html)._span();
  923. _st($2)._class_("mtab");
  924. $3=_st($2)._with_(" + ");
  925. $3;
  926. return _st(_st(html)._span())._class_("rtab");
  927. }));
  928. $4=_st($1)._onClick_((function(){
  929. return _st(self)._newBrowserTab();
  930. }));
  931. return $4;
  932. }));
  933. return self}, self, "renderTabs", [], smalltalk.TabManager)}
  934. }),
  935. smalltalk.TabManager);
  936. smalltalk.addMethod(
  937. "_renderToolbarOn_",
  938. smalltalk.method({
  939. selector: "renderToolbarOn:",
  940. fn: function (html){
  941. var self=this;
  942. return smalltalk.withContext(function($ctx) { var $1,$3,$4,$5,$6,$7,$2;
  943. $1=_st(html)._div();
  944. _st($1)._id_("amber_toolbar");
  945. $2=_st($1)._with_((function(){
  946. $3=_st(html)._input();
  947. _st($3)._class_("implementors");
  948. $4=_st($3)._yourself();
  949. self["@input"]=$4;
  950. self["@input"];
  951. _st(self["@input"])._onKeyPress_((function(event){
  952. $5=_st(_st(event)._keyCode()).__eq((13));
  953. if(smalltalk.assert($5)){
  954. return _st(self)._search_(_st(_st(self["@input"])._asJQuery())._val());
  955. };
  956. }));
  957. $6=_st(html)._div();
  958. _st($6)._id_("amber_close");
  959. $7=_st($6)._onClick_((function(){
  960. return _st(self)._close();
  961. }));
  962. return $7;
  963. }));
  964. return self}, self, "renderToolbarOn:", [html], smalltalk.TabManager)}
  965. }),
  966. smalltalk.TabManager);
  967. smalltalk.addMethod(
  968. "_search_",
  969. smalltalk.method({
  970. selector: "search:",
  971. fn: function (aString){
  972. var self=this;
  973. return smalltalk.withContext(function($ctx) { var $1;
  974. var searchedClass;
  975. searchedClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(aString);
  976. $1=_st(searchedClass)._isClass();
  977. if(smalltalk.assert($1)){
  978. _st((smalltalk.Browser || Browser))._openOn_(searchedClass);
  979. } else {
  980. _st((smalltalk.ReferencesBrowser || ReferencesBrowser))._search_(aString);
  981. };
  982. return self}, self, "search:", [aString], smalltalk.TabManager)}
  983. }),
  984. smalltalk.TabManager);
  985. smalltalk.addMethod(
  986. "_selectTab_",
  987. smalltalk.method({
  988. selector: "selectTab:",
  989. fn: function (aWidget){
  990. var self=this;
  991. return smalltalk.withContext(function($ctx) { _st(self)._open();
  992. self["@selectedTab"]=aWidget;
  993. _st(_st(self)._tabs())._do_((function(each){
  994. return _st(each)._hide();
  995. }));
  996. _st(aWidget)._show();
  997. _st(self)._update();
  998. return self}, self, "selectTab:", [aWidget], smalltalk.TabManager)}
  999. }),
  1000. smalltalk.TabManager);
  1001. smalltalk.addMethod(
  1002. "_setBodyMargin_",
  1003. smalltalk.method({
  1004. selector: "setBodyMargin:",
  1005. fn: function (anInteger){
  1006. var self=this;
  1007. return smalltalk.withContext(function($ctx) { _st(_st(".amberBody")._asJQuery())._css_put_("margin-bottom",_st(_st(anInteger)._asString()).__comma("px"));
  1008. return self}, self, "setBodyMargin:", [anInteger], smalltalk.TabManager)}
  1009. }),
  1010. smalltalk.TabManager);
  1011. smalltalk.addMethod(
  1012. "_tabs",
  1013. smalltalk.method({
  1014. selector: "tabs",
  1015. fn: function (){
  1016. var self=this;
  1017. return smalltalk.withContext(function($ctx) { var $1;
  1018. if(($receiver = self["@tabs"]) == nil || $receiver == undefined){
  1019. self["@tabs"]=_st((smalltalk.Array || Array))._new();
  1020. $1=self["@tabs"];
  1021. } else {
  1022. $1=self["@tabs"];
  1023. };
  1024. return $1;
  1025. }, self, "tabs", [], smalltalk.TabManager)}
  1026. }),
  1027. smalltalk.TabManager);
  1028. smalltalk.addMethod(
  1029. "_update",
  1030. smalltalk.method({
  1031. selector: "update",
  1032. fn: function (){
  1033. var self=this;
  1034. return smalltalk.withContext(function($ctx) { _st(self)._renderTabs();
  1035. return self}, self, "update", [], smalltalk.TabManager)}
  1036. }),
  1037. smalltalk.TabManager);
  1038. smalltalk.addMethod(
  1039. "_updateBodyMargin",
  1040. smalltalk.method({
  1041. selector: "updateBodyMargin",
  1042. fn: function (){
  1043. var self=this;
  1044. return smalltalk.withContext(function($ctx) { _st(self)._setBodyMargin_(_st(_st("#amber")._asJQuery())._height());
  1045. return self}, self, "updateBodyMargin", [], smalltalk.TabManager)}
  1046. }),
  1047. smalltalk.TabManager);
  1048. smalltalk.addMethod(
  1049. "_updatePosition",
  1050. smalltalk.method({
  1051. selector: "updatePosition",
  1052. fn: function (){
  1053. var self=this;
  1054. return smalltalk.withContext(function($ctx) { jQuery('#amber').css('top', '').css('bottom', '0px');
  1055. ;
  1056. return self}, self, "updatePosition", [], smalltalk.TabManager)}
  1057. }),
  1058. smalltalk.TabManager);
  1059. smalltalk.TabManager.klass.iVarNames = ['current'];
  1060. smalltalk.addMethod(
  1061. "_current",
  1062. smalltalk.method({
  1063. selector: "current",
  1064. fn: function (){
  1065. var self=this;
  1066. return smalltalk.withContext(function($ctx) { var $1;
  1067. if(($receiver = self["@current"]) == nil || $receiver == undefined){
  1068. self["@current"]=smalltalk.Widget.klass.fn.prototype._new.apply(_st(self), []);
  1069. $1=self["@current"];
  1070. } else {
  1071. $1=self["@current"];
  1072. };
  1073. return $1;
  1074. }, self, "current", [], smalltalk.TabManager.klass)}
  1075. }),
  1076. smalltalk.TabManager.klass);
  1077. smalltalk.addMethod(
  1078. "_new",
  1079. smalltalk.method({
  1080. selector: "new",
  1081. fn: function (){
  1082. var self=this;
  1083. return smalltalk.withContext(function($ctx) { _st(self)._shouldNotImplement();
  1084. return self}, self, "new", [], smalltalk.TabManager.klass)}
  1085. }),
  1086. smalltalk.TabManager.klass);
  1087. smalltalk.addClass('TabWidget', smalltalk.Widget, ['div'], 'IDE');
  1088. smalltalk.addMethod(
  1089. "_canBeClosed",
  1090. smalltalk.method({
  1091. selector: "canBeClosed",
  1092. fn: function (){
  1093. var self=this;
  1094. return smalltalk.withContext(function($ctx) { return false;
  1095. }, self, "canBeClosed", [], smalltalk.TabWidget)}
  1096. }),
  1097. smalltalk.TabWidget);
  1098. smalltalk.addMethod(
  1099. "_close",
  1100. smalltalk.method({
  1101. selector: "close",
  1102. fn: function (){
  1103. var self=this;
  1104. return smalltalk.withContext(function($ctx) { _st(_st((smalltalk.TabManager || TabManager))._current())._closeTab_(self);
  1105. return self}, self, "close", [], smalltalk.TabWidget)}
  1106. }),
  1107. smalltalk.TabWidget);
  1108. smalltalk.addMethod(
  1109. "_hide",
  1110. smalltalk.method({
  1111. selector: "hide",
  1112. fn: function (){
  1113. var self=this;
  1114. return smalltalk.withContext(function($ctx) { _st(_st(self["@div"])._asJQuery())._hide();
  1115. return self}, self, "hide", [], smalltalk.TabWidget)}
  1116. }),
  1117. smalltalk.TabWidget);
  1118. smalltalk.addMethod(
  1119. "_label",
  1120. smalltalk.method({
  1121. selector: "label",
  1122. fn: function (){
  1123. var self=this;
  1124. return smalltalk.withContext(function($ctx) { _st(self)._subclassResponsibility();
  1125. return self}, self, "label", [], smalltalk.TabWidget)}
  1126. }),
  1127. smalltalk.TabWidget);
  1128. smalltalk.addMethod(
  1129. "_open",
  1130. smalltalk.method({
  1131. selector: "open",
  1132. fn: function (){
  1133. var self=this;
  1134. return smalltalk.withContext(function($ctx) { _st(_st((smalltalk.TabManager || TabManager))._current())._addTab_(self);
  1135. _st(_st((smalltalk.TabManager || TabManager))._current())._selectTab_(self);
  1136. return self}, self, "open", [], smalltalk.TabWidget)}
  1137. }),
  1138. smalltalk.TabWidget);
  1139. smalltalk.addMethod(
  1140. "_remove",
  1141. smalltalk.method({
  1142. selector: "remove",
  1143. fn: function (){
  1144. var self=this;
  1145. return smalltalk.withContext(function($ctx) { _st(_st(self["@div"])._asJQuery())._remove();
  1146. return self}, self, "remove", [], smalltalk.TabWidget)}
  1147. }),
  1148. smalltalk.TabWidget);
  1149. smalltalk.addMethod(
  1150. "_renderBoxOn_",
  1151. smalltalk.method({
  1152. selector: "renderBoxOn:",
  1153. fn: function (html){
  1154. var self=this;
  1155. return smalltalk.withContext(function($ctx) { return self}, self, "renderBoxOn:", [html], smalltalk.TabWidget)}
  1156. }),
  1157. smalltalk.TabWidget);
  1158. smalltalk.addMethod(
  1159. "_renderButtonsOn_",
  1160. smalltalk.method({
  1161. selector: "renderButtonsOn:",
  1162. fn: function (html){
  1163. var self=this;
  1164. return smalltalk.withContext(function($ctx) { return self}, self, "renderButtonsOn:", [html], smalltalk.TabWidget)}
  1165. }),
  1166. smalltalk.TabWidget);
  1167. smalltalk.addMethod(
  1168. "_renderOn_",
  1169. smalltalk.method({
  1170. selector: "renderOn:",
  1171. fn: function (html){
  1172. var self=this;
  1173. return smalltalk.withContext(function($ctx) { var $1,$2;
  1174. $1=_st(html)._div();
  1175. _st($1)._class_("amberTool");
  1176. $2=_st($1)._yourself();
  1177. self["@div"]=$2;
  1178. _st(self)._renderTab();
  1179. return self}, self, "renderOn:", [html], smalltalk.TabWidget)}
  1180. }),
  1181. smalltalk.TabWidget);
  1182. smalltalk.addMethod(
  1183. "_renderTab",
  1184. smalltalk.method({
  1185. selector: "renderTab",
  1186. fn: function (){
  1187. var self=this;
  1188. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4;
  1189. _st(self["@div"])._contents_((function(html){
  1190. $1=_st(html)._div();
  1191. _st($1)._class_("amber_box");
  1192. $2=_st($1)._with_((function(){
  1193. return _st(self)._renderBoxOn_(html);
  1194. }));
  1195. $2;
  1196. $3=_st(html)._div();
  1197. _st($3)._class_("amber_buttons");
  1198. $4=_st($3)._with_((function(){
  1199. return _st(self)._renderButtonsOn_(html);
  1200. }));
  1201. return $4;
  1202. }));
  1203. return self}, self, "renderTab", [], smalltalk.TabWidget)}
  1204. }),
  1205. smalltalk.TabWidget);
  1206. smalltalk.addMethod(
  1207. "_show",
  1208. smalltalk.method({
  1209. selector: "show",
  1210. fn: function (){
  1211. var self=this;
  1212. return smalltalk.withContext(function($ctx) { _st(_st(self["@div"])._asJQuery())._show();
  1213. return self}, self, "show", [], smalltalk.TabWidget)}
  1214. }),
  1215. smalltalk.TabWidget);
  1216. smalltalk.addMethod(
  1217. "_update",
  1218. smalltalk.method({
  1219. selector: "update",
  1220. fn: function (){
  1221. var self=this;
  1222. return smalltalk.withContext(function($ctx) { _st(self)._renderTab();
  1223. return self}, self, "update", [], smalltalk.TabWidget)}
  1224. }),
  1225. smalltalk.TabWidget);
  1226. smalltalk.addMethod(
  1227. "_open",
  1228. smalltalk.method({
  1229. selector: "open",
  1230. fn: function (){
  1231. var self=this;
  1232. return smalltalk.withContext(function($ctx) { var $1;
  1233. $1=_st(_st(self)._new())._open();
  1234. return $1;
  1235. }, self, "open", [], smalltalk.TabWidget.klass)}
  1236. }),
  1237. smalltalk.TabWidget.klass);
  1238. smalltalk.addClass('Browser', smalltalk.TabWidget, ['selectedPackage', 'selectedClass', 'selectedProtocol', 'selectedMethod', 'packagesList', 'classesList', 'protocolsList', 'methodsList', 'sourceArea', 'tabsList', 'selectedTab', 'saveButton', 'classButtons', 'methodButtons', 'unsavedChanges'], 'IDE');
  1239. smalltalk.addMethod(
  1240. "_addInstanceVariableNamed_toClass_",
  1241. smalltalk.method({
  1242. selector: "addInstanceVariableNamed:toClass:",
  1243. fn: function (aString,aClass){
  1244. var self=this;
  1245. return smalltalk.withContext(function($ctx) { var $1,$2;
  1246. $1=_st(_st(aClass)._instanceVariableNames())._copy();
  1247. _st($1)._add_(aString);
  1248. $2=_st($1)._yourself();
  1249. _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._addSubclassOf_named_instanceVariableNames_package_(_st(aClass)._superclass(),_st(aClass)._name(),$2,_st(_st(aClass)._package())._name());
  1250. return self}, self, "addInstanceVariableNamed:toClass:", [aString,aClass], smalltalk.Browser)}
  1251. }),
  1252. smalltalk.Browser);
  1253. smalltalk.addMethod(
  1254. "_addNewClass",
  1255. smalltalk.method({
  1256. selector: "addNewClass",
  1257. fn: function (){
  1258. var self=this;
  1259. return smalltalk.withContext(function($ctx) { var $1,$2;
  1260. var className;
  1261. className=_st(window)._prompt_("New class");
  1262. $1=_st(_st(className)._notNil())._and_((function(){
  1263. return _st(className)._notEmpty();
  1264. }));
  1265. if(smalltalk.assert($1)){
  1266. _st((smalltalk.Object || Object))._subclass_instanceVariableNames_package_(className,"",_st(self)._selectedPackage());
  1267. _st(self)._resetClassesList();
  1268. $2=_st(self)._updateClassesList();
  1269. $2;
  1270. _st(self)._selectClass_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(className));
  1271. };
  1272. return self}, self, "addNewClass", [], smalltalk.Browser)}
  1273. }),
  1274. smalltalk.Browser);
  1275. smalltalk.addMethod(
  1276. "_addNewProtocol",
  1277. smalltalk.method({
  1278. selector: "addNewProtocol",
  1279. fn: function (){
  1280. var self=this;
  1281. return smalltalk.withContext(function($ctx) { var $1;
  1282. var newProtocol;
  1283. newProtocol=_st(window)._prompt_("New method protocol");
  1284. $1=_st(_st(newProtocol)._notNil())._and_((function(){
  1285. return _st(newProtocol)._notEmpty();
  1286. }));
  1287. if(smalltalk.assert($1)){
  1288. _st(self["@selectedMethod"])._category_(newProtocol);
  1289. _st(self)._setMethodProtocol_(newProtocol);
  1290. };
  1291. return self}, self, "addNewProtocol", [], smalltalk.Browser)}
  1292. }),
  1293. smalltalk.Browser);
  1294. smalltalk.addMethod(
  1295. "_ajaxPutAt_data_",
  1296. smalltalk.method({
  1297. selector: "ajaxPutAt:data:",
  1298. fn: function (anURL,aString){
  1299. var self=this;
  1300. return smalltalk.withContext(function($ctx) { _st(jQuery)._ajax_options_(anURL,smalltalk.HashedCollection._fromPairs_([_st("type").__minus_gt("PUT"),_st("data").__minus_gt(aString),_st("contentType").__minus_gt("text/plain;charset=UTF-8"),_st("error").__minus_gt((function(){
  1301. return _st(window)._alert_(_st("PUT request failed at: ").__comma(anURL));
  1302. }))]));
  1303. return self}, self, "ajaxPutAt:data:", [anURL,aString], smalltalk.Browser)}
  1304. }),
  1305. smalltalk.Browser);
  1306. smalltalk.addMethod(
  1307. "_canBeClosed",
  1308. smalltalk.method({
  1309. selector: "canBeClosed",
  1310. fn: function (){
  1311. var self=this;
  1312. return smalltalk.withContext(function($ctx) { return true;
  1313. }, self, "canBeClosed", [], smalltalk.Browser)}
  1314. }),
  1315. smalltalk.Browser);
  1316. smalltalk.addMethod(
  1317. "_cancelChanges",
  1318. smalltalk.method({
  1319. selector: "cancelChanges",
  1320. fn: function (){
  1321. var self=this;
  1322. return smalltalk.withContext(function($ctx) { var $1;
  1323. if(smalltalk.assert(self["@unsavedChanges"])){
  1324. $1=_st(window)._confirm_("Cancel changes?");
  1325. } else {
  1326. $1=true;
  1327. };
  1328. return $1;
  1329. }, self, "cancelChanges", [], smalltalk.Browser)}
  1330. }),
  1331. smalltalk.Browser);
  1332. smalltalk.addMethod(
  1333. "_classCommentSource",
  1334. smalltalk.method({
  1335. selector: "classCommentSource",
  1336. fn: function (){
  1337. var self=this;
  1338. return smalltalk.withContext(function($ctx) { var $1;
  1339. $1=_st(self["@selectedClass"])._comment();
  1340. return $1;
  1341. }, self, "classCommentSource", [], smalltalk.Browser)}
  1342. }),
  1343. smalltalk.Browser);
  1344. smalltalk.addMethod(
  1345. "_classDeclarationSource",
  1346. smalltalk.method({
  1347. selector: "classDeclarationSource",
  1348. fn: function (){
  1349. var self=this;
  1350. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4;
  1351. var stream;
  1352. stream=_st("")._writeStream();
  1353. if(($receiver = self["@selectedClass"]) == nil || $receiver == undefined){
  1354. $1=_st(self)._classDeclarationTemplate();
  1355. return $1;
  1356. } else {
  1357. self["@selectedClass"];
  1358. };
  1359. _st(stream)._nextPutAll_(_st(_st(self["@selectedClass"])._superclass())._asString());
  1360. _st(stream)._nextPutAll_(" subclass: #");
  1361. _st(stream)._nextPutAll_(_st(self["@selectedClass"])._name());
  1362. _st(stream)._nextPutAll_(_st(_st((smalltalk.String || String))._lf()).__comma(_st((smalltalk.String || String))._tab()));
  1363. $2=_st(stream)._nextPutAll_("instanceVariableNames: '");
  1364. _st(_st(self["@selectedClass"])._instanceVariableNames())._do_separatedBy_((function(each){
  1365. return _st(stream)._nextPutAll_(each);
  1366. }),(function(){
  1367. return _st(stream)._nextPutAll_(" ");
  1368. }));
  1369. _st(stream)._nextPutAll_(_st(_st("'").__comma(_st((smalltalk.String || String))._lf())).__comma(_st((smalltalk.String || String))._tab()));
  1370. _st(stream)._nextPutAll_("package: '");
  1371. _st(stream)._nextPutAll_(_st(self["@selectedClass"])._category());
  1372. $3=_st(stream)._nextPutAll_("'");
  1373. $4=_st(stream)._contents();
  1374. return $4;
  1375. }, self, "classDeclarationSource", [], smalltalk.Browser)}
  1376. }),
  1377. smalltalk.Browser);
  1378. smalltalk.addMethod(
  1379. "_classDeclarationTemplate",
  1380. smalltalk.method({
  1381. selector: "classDeclarationTemplate",
  1382. fn: function (){
  1383. var self=this;
  1384. return smalltalk.withContext(function($ctx) { var $1;
  1385. $1=_st(_st("Object subclass: #NameOfSubclass\x0a\x09instanceVariableNames: ''\x0a\x09package: '").__comma(_st(self)._selectedPackage())).__comma("'");
  1386. return $1;
  1387. }, self, "classDeclarationTemplate", [], smalltalk.Browser)}
  1388. }),
  1389. smalltalk.Browser);
  1390. smalltalk.addMethod(
  1391. "_classes",
  1392. smalltalk.method({
  1393. selector: "classes",
  1394. fn: function (){
  1395. var self=this;
  1396. return smalltalk.withContext(function($ctx) { var $1;
  1397. $1=_st(_st(_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._select_((function(each){
  1398. return _st(_st(each)._category()).__eq(self["@selectedPackage"]);
  1399. })))._sort_((function(a,b){
  1400. return _st(_st(a)._name()).__lt(_st(b)._name());
  1401. })))._asSet();
  1402. return $1;
  1403. }, self, "classes", [], smalltalk.Browser)}
  1404. }),
  1405. smalltalk.Browser);
  1406. smalltalk.addMethod(
  1407. "_commitPackage",
  1408. smalltalk.method({
  1409. selector: "commitPackage",
  1410. fn: function (){
  1411. var self=this;
  1412. return smalltalk.withContext(function($ctx) { if(($receiver = self["@selectedPackage"]) == nil || $receiver == undefined){
  1413. self["@selectedPackage"];
  1414. } else {
  1415. var package;
  1416. package=_st((smalltalk.Package || Package))._named_(self["@selectedPackage"]);
  1417. package;
  1418. _st([_st((smalltalk.Exporter || Exporter)).__minus_gt(_st(_st(_st(_st(package)._commitPathJs()).__comma("/")).__comma(self["@selectedPackage"])).__comma(".js")),_st((smalltalk.StrippedExporter || StrippedExporter)).__minus_gt(_st(_st(_st(_st(package)._commitPathJs()).__comma("/")).__comma(self["@selectedPackage"])).__comma(".deploy.js")),_st((smalltalk.ChunkExporter || ChunkExporter)).__minus_gt(_st(_st(_st(_st(package)._commitPathSt()).__comma("/")).__comma(self["@selectedPackage"])).__comma(".st"))])._do_((function(commitStrategy){
  1419. var fileContents;
  1420. fileContents=_st(_st(_st(commitStrategy)._key())._new())._exportPackage_(self["@selectedPackage"]);
  1421. fileContents;
  1422. return _st(self)._ajaxPutAt_data_(_st(commitStrategy)._value(),fileContents);
  1423. }));
  1424. };
  1425. return self}, self, "commitPackage", [], smalltalk.Browser)}
  1426. }),
  1427. smalltalk.Browser);
  1428. smalltalk.addMethod(
  1429. "_compile",
  1430. smalltalk.method({
  1431. selector: "compile",
  1432. fn: function (){
  1433. var self=this;
  1434. return smalltalk.withContext(function($ctx) { var $1,$2;
  1435. var currentEditLine;
  1436. _st(self)._disableSaveButton();
  1437. currentEditLine=_st(_st(self["@sourceArea"])._editor())._getCursor();
  1438. $1=_st(self["@selectedTab"]).__eq(smalltalk.symbolFor("comment"));
  1439. if(smalltalk.assert($1)){
  1440. if(($receiver = self["@selectedClass"]) == nil || $receiver == undefined){
  1441. self["@selectedClass"];
  1442. } else {
  1443. _st(self)._compileClassComment();
  1444. };
  1445. } else {
  1446. $2=_st(_st(self["@selectedProtocol"])._notNil())._or_((function(){
  1447. return _st(self["@selectedMethod"])._notNil();
  1448. }));
  1449. if(smalltalk.assert($2)){
  1450. _st(self)._compileMethodDefinition();
  1451. } else {
  1452. _st(self)._compileDefinition();
  1453. };
  1454. };
  1455. _st(_st(self["@sourceArea"])._editor())._setCursor_(currentEditLine);
  1456. return self}, self, "compile", [], smalltalk.Browser)}
  1457. }),
  1458. smalltalk.Browser);
  1459. smalltalk.addMethod(
  1460. "_compileClassComment",
  1461. smalltalk.method({
  1462. selector: "compileClassComment",
  1463. fn: function (){
  1464. var self=this;
  1465. return smalltalk.withContext(function($ctx) { _st(self["@selectedClass"])._comment_(_st(self["@sourceArea"])._val());
  1466. return self}, self, "compileClassComment", [], smalltalk.Browser)}
  1467. }),
  1468. smalltalk.Browser);
  1469. smalltalk.addMethod(
  1470. "_compileDefinition",
  1471. smalltalk.method({
  1472. selector: "compileDefinition",
  1473. fn: function (){
  1474. var self=this;
  1475. return smalltalk.withContext(function($ctx) { var $1;
  1476. var newClass;
  1477. newClass=_st(_st((smalltalk.Compiler || Compiler))._new())._evaluateExpression_(_st(self["@sourceArea"])._val());
  1478. _st(self)._resetClassesList();
  1479. _st(self)._updateCategoriesList();
  1480. $1=_st(self)._updateClassesList();
  1481. _st(self)._selectClass_(newClass);
  1482. return self}, self, "compileDefinition", [], smalltalk.Browser)}
  1483. }),
  1484. smalltalk.Browser);
  1485. smalltalk.addMethod(
  1486. "_compileMethodDefinition",
  1487. smalltalk.method({
  1488. selector: "compileMethodDefinition",
  1489. fn: function (){
  1490. var self=this;
  1491. return smalltalk.withContext(function($ctx) { var $1;
  1492. $1=_st(self["@selectedTab"]).__eq(smalltalk.symbolFor("instance"));
  1493. if(smalltalk.assert($1)){
  1494. _st(self)._compileMethodDefinitionFor_(self["@selectedClass"]);
  1495. } else {
  1496. _st(self)._compileMethodDefinitionFor_(_st(self["@selectedClass"])._class());
  1497. };
  1498. return self}, self, "compileMethodDefinition", [], smalltalk.Browser)}
  1499. }),
  1500. smalltalk.Browser);
  1501. smalltalk.addMethod(
  1502. "_compileMethodDefinitionFor_",
  1503. smalltalk.method({
  1504. selector: "compileMethodDefinitionFor:",
  1505. fn: function (aClass){
  1506. var self=this;
  1507. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4,$5;
  1508. var $early={};
  1509. try {
  1510. var compiler;
  1511. var method;
  1512. var source;
  1513. var node;
  1514. source=_st(self["@sourceArea"])._val();
  1515. if(($receiver = self["@selectedProtocol"]) == nil || $receiver == undefined){
  1516. self["@selectedProtocol"]=_st(self["@selectedMethod"])._category();
  1517. self["@selectedProtocol"];
  1518. } else {
  1519. self["@selectedProtocol"];
  1520. };
  1521. compiler=_st((smalltalk.Compiler || Compiler))._new();
  1522. _st(compiler)._source_(source);
  1523. node=_st(compiler)._parse_(source);
  1524. $1=_st(node)._isParseFailure();
  1525. if(smalltalk.assert($1)){
  1526. $2=_st(window)._alert_(_st(_st(_st("PARSE ERROR: ").__comma(_st(node)._reason())).__comma(", position: ")).__comma(_st(_st(node)._position())._asString()));
  1527. return $2;
  1528. };
  1529. _st(compiler)._currentClass_(aClass);
  1530. method=_st(compiler)._eval_(_st(compiler)._compileNode_(node));
  1531. _st(method)._category_(self["@selectedProtocol"]);
  1532. _st(_st(compiler)._unknownVariables())._do_((function(each){
  1533. $3=_st(window)._at_(each);
  1534. if(($receiver = $3) == nil || $receiver == undefined){
  1535. $4=_st(window)._confirm_(_st(_st("Declare '").__comma(each)).__comma("' as instance variable?"));
  1536. if(smalltalk.assert($4)){
  1537. _st(self)._addInstanceVariableNamed_toClass_(each,aClass);
  1538. $5=_st(self)._compileMethodDefinitionFor_(aClass);
  1539. throw $early=[$5];
  1540. };
  1541. } else {
  1542. return $3;
  1543. };
  1544. }));
  1545. _st(aClass)._addCompiledMethod_(method);
  1546. _st(compiler)._setupClass_(aClass);
  1547. _st(self)._updateMethodsList();
  1548. _st(self)._selectMethod_(method);
  1549. return self}
  1550. catch(e) {if(e===$early)return e[0]; throw e}
  1551. }, self, "compileMethodDefinitionFor:", [aClass], smalltalk.Browser)}
  1552. }),
  1553. smalltalk.Browser);
  1554. smalltalk.addMethod(
  1555. "_copyClass",
  1556. smalltalk.method({
  1557. selector: "copyClass",
  1558. fn: function (){
  1559. var self=this;
  1560. return smalltalk.withContext(function($ctx) { var $1,$2;
  1561. var className;
  1562. className=_st(window)._prompt_("Copy class");
  1563. $1=_st(_st(className)._notNil())._and_((function(){
  1564. return _st(className)._notEmpty();
  1565. }));
  1566. if(smalltalk.assert($1)){
  1567. _st(_st((smalltalk.ClassBuilder || ClassBuilder))._new())._copyClass_named_(_st(self)._selectedClass(),className);
  1568. _st(self)._resetClassesList();
  1569. $2=_st(self)._updateClassesList();
  1570. $2;
  1571. _st(self)._selectClass_(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(className));
  1572. };
  1573. return self}, self, "copyClass", [], smalltalk.Browser)}
  1574. }),
  1575. smalltalk.Browser);
  1576. smalltalk.addMethod(
  1577. "_declarationSource",
  1578. smalltalk.method({
  1579. selector: "declarationSource",
  1580. fn: function (){
  1581. var self=this;
  1582. return smalltalk.withContext(function($ctx) { var $2,$1;
  1583. $2=_st(self["@selectedTab"]).__eq(smalltalk.symbolFor("instance"));
  1584. if(smalltalk.assert($2)){
  1585. $1=_st(self)._classDeclarationSource();
  1586. } else {
  1587. $1=_st(self)._metaclassDeclarationSource();
  1588. };
  1589. return $1;
  1590. }, self, "declarationSource", [], smalltalk.Browser)}
  1591. }),
  1592. smalltalk.Browser);
  1593. smalltalk.addMethod(
  1594. "_disableSaveButton",
  1595. smalltalk.method({
  1596. selector: "disableSaveButton",
  1597. fn: function (){
  1598. var self=this;
  1599. return smalltalk.withContext(function($ctx) { if(($receiver = self["@saveButton"]) == nil || $receiver == undefined){
  1600. self["@saveButton"];
  1601. } else {
  1602. _st(self["@saveButton"])._at_put_("disabled",true);
  1603. };
  1604. self["@unsavedChanges"]=false;
  1605. return self}, self, "disableSaveButton", [], smalltalk.Browser)}
  1606. }),
  1607. smalltalk.Browser);
  1608. smalltalk.addMethod(
  1609. "_dummyMethodSource",
  1610. smalltalk.method({
  1611. selector: "dummyMethodSource",
  1612. fn: function (){
  1613. var self=this;
  1614. return smalltalk.withContext(function($ctx) { return "messageSelectorAndArgumentNames\x0a\x09\x22comment stating purpose of message\x22\x0a\x0a\x09| temporary variable names |\x0a\x09statements";
  1615. }, self, "dummyMethodSource", [], smalltalk.Browser)}
  1616. }),
  1617. smalltalk.Browser);
  1618. smalltalk.addMethod(
  1619. "_handleSourceAreaKeyDown_",
  1620. smalltalk.method({
  1621. selector: "handleSourceAreaKeyDown:",
  1622. fn: function (anEvent){
  1623. var self=this;
  1624. return smalltalk.withContext(function($ctx) { if(anEvent.ctrlKey) {
  1625. if(anEvent.keyCode === 83) { //ctrl+s
  1626. self._compile();
  1627. anEvent.preventDefault();
  1628. return false;
  1629. }
  1630. }
  1631. ;
  1632. ;
  1633. return self}, self, "handleSourceAreaKeyDown:", [anEvent], smalltalk.Browser)}
  1634. }),
  1635. smalltalk.Browser);
  1636. smalltalk.addMethod(
  1637. "_hideClassButtons",
  1638. smalltalk.method({
  1639. selector: "hideClassButtons",
  1640. fn: function (){
  1641. var self=this;
  1642. return smalltalk.withContext(function($ctx) { _st(_st(self["@classButtons"])._asJQuery())._hide();
  1643. return self}, self, "hideClassButtons", [], smalltalk.Browser)}
  1644. }),
  1645. smalltalk.Browser);
  1646. smalltalk.addMethod(
  1647. "_hideMethodButtons",
  1648. smalltalk.method({
  1649. selector: "hideMethodButtons",
  1650. fn: function (){
  1651. var self=this;
  1652. return smalltalk.withContext(function($ctx) { _st(_st(self["@methodButtons"])._asJQuery())._hide();
  1653. return self}, self, "hideMethodButtons", [], smalltalk.Browser)}
  1654. }),
  1655. smalltalk.Browser);
  1656. smalltalk.addMethod(
  1657. "_initialize",
  1658. smalltalk.method({
  1659. selector: "initialize",
  1660. fn: function (){
  1661. var self=this;
  1662. return smalltalk.withContext(function($ctx) { smalltalk.TabWidget.fn.prototype._initialize.apply(_st(self), []);
  1663. self["@selectedTab"]=smalltalk.symbolFor("instance");
  1664. self["@selectedPackage"]=_st(_st(self)._packages())._first();
  1665. self["@unsavedChanges"]=false;
  1666. return self}, self, "initialize", [], smalltalk.Browser)}
  1667. }),
  1668. smalltalk.Browser);
  1669. smalltalk.addMethod(
  1670. "_label",
  1671. smalltalk.method({
  1672. selector: "label",
  1673. fn: function (){
  1674. var self=this;
  1675. return smalltalk.withContext(function($ctx) { var $1;
  1676. if(($receiver = self["@selectedClass"]) == nil || $receiver == undefined){
  1677. $1="Browser (nil)";
  1678. } else {
  1679. $1=_st("Browser: ").__comma(_st(self["@selectedClass"])._name());
  1680. };
  1681. return $1;
  1682. }, self, "label", [], smalltalk.Browser)}
  1683. }),
  1684. smalltalk.Browser);
  1685. smalltalk.addMethod(
  1686. "_metaclassDeclarationSource",
  1687. smalltalk.method({
  1688. selector: "metaclassDeclarationSource",
  1689. fn: function (){
  1690. var self=this;
  1691. return smalltalk.withContext(function($ctx) { var $1,$2;
  1692. var stream;
  1693. stream=_st("")._writeStream();
  1694. if(($receiver = self["@selectedClass"]) == nil || $receiver == undefined){
  1695. self["@selectedClass"];
  1696. } else {
  1697. _st(stream)._nextPutAll_(_st(self["@selectedClass"])._asString());
  1698. _st(stream)._nextPutAll_(" class ");
  1699. $1=_st(stream)._nextPutAll_("instanceVariableNames: '");
  1700. $1;
  1701. _st(_st(_st(self["@selectedClass"])._class())._instanceVariableNames())._do_separatedBy_((function(each){
  1702. return _st(stream)._nextPutAll_(each);
  1703. }),(function(){
  1704. return _st(stream)._nextPutAll_(" ");
  1705. }));
  1706. _st(stream)._nextPutAll_("'");
  1707. };
  1708. $2=_st(stream)._contents();
  1709. return $2;
  1710. }, self, "metaclassDeclarationSource", [], smalltalk.Browser)}
  1711. }),
  1712. smalltalk.Browser);
  1713. smalltalk.addMethod(
  1714. "_methodSource",
  1715. smalltalk.method({
  1716. selector: "methodSource",
  1717. fn: function (){
  1718. var self=this;
  1719. return smalltalk.withContext(function($ctx) { var $1;
  1720. if(($receiver = self["@selectedMethod"]) == nil || $receiver == undefined){
  1721. $1=_st(self)._dummyMethodSource();
  1722. } else {
  1723. $1=_st(self["@selectedMethod"])._source();
  1724. };
  1725. return $1;
  1726. }, self, "methodSource", [], smalltalk.Browser)}
  1727. }),
  1728. smalltalk.Browser);
  1729. smalltalk.addMethod(
  1730. "_methods",
  1731. smalltalk.method({
  1732. selector: "methods",
  1733. fn: function (){
  1734. var self=this;
  1735. return smalltalk.withContext(function($ctx) { var $1,$2,$4,$3;
  1736. var klass;
  1737. $1=_st(self["@selectedTab"]).__eq(smalltalk.symbolFor("comment"));
  1738. if(smalltalk.assert($1)){
  1739. return [];
  1740. };
  1741. if(($receiver = self["@selectedClass"]) == nil || $receiver == undefined){
  1742. self["@selectedClass"];
  1743. } else {
  1744. $2=_st(self["@selectedTab"]).__eq(smalltalk.symbolFor("instance"));
  1745. if(smalltalk.assert($2)){
  1746. klass=self["@selectedClass"];
  1747. } else {
  1748. klass=_st(self["@selectedClass"])._class();
  1749. };
  1750. klass;
  1751. };
  1752. if(($receiver = self["@selectedProtocol"]) == nil || $receiver == undefined){
  1753. if(($receiver = klass) == nil || $receiver == undefined){
  1754. $4=[];
  1755. } else {
  1756. $4=_st(_st(klass)._methodDictionary())._values();
  1757. };
  1758. } else {
  1759. $4=_st(_st(_st(klass)._methodDictionary())._values())._select_((function(each){
  1760. return _st(_st(each)._category()).__eq(self["@selectedProtocol"]);
  1761. }));
  1762. };
  1763. $3=_st($4)._sort_((function(a,b){
  1764. return _st(_st(a)._selector()).__lt(_st(b)._selector());
  1765. }));
  1766. return $3;
  1767. }, self, "methods", [], smalltalk.Browser)}
  1768. }),
  1769. smalltalk.Browser);
  1770. smalltalk.addMethod(
  1771. "_packages",
  1772. smalltalk.method({
  1773. selector: "packages",
  1774. fn: function (){
  1775. var self=this;
  1776. return smalltalk.withContext(function($ctx) { var $1,$2;
  1777. var packages;
  1778. packages=_st((smalltalk.Array || Array))._new();
  1779. _st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._do_((function(each){
  1780. $1=_st(packages)._includes_(_st(each)._category());
  1781. if(! smalltalk.assert($1)){
  1782. return _st(packages)._add_(_st(each)._category());
  1783. };
  1784. }));
  1785. $2=_st(packages)._sort();
  1786. return $2;
  1787. }, self, "packages", [], smalltalk.Browser)}
  1788. }),
  1789. smalltalk.Browser);
  1790. smalltalk.addMethod(
  1791. "_protocols",
  1792. smalltalk.method({
  1793. selector: "protocols",
  1794. fn: function (){
  1795. var self=this;
  1796. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4,$5,$6;
  1797. var klass;
  1798. if(($receiver = self["@selectedClass"]) == nil || $receiver == undefined){
  1799. self["@selectedClass"];
  1800. } else {
  1801. $1=_st(self["@selectedTab"]).__eq(smalltalk.symbolFor("comment"));
  1802. if(smalltalk.assert($1)){
  1803. return [];
  1804. };
  1805. $2=_st(self["@selectedTab"]).__eq(smalltalk.symbolFor("instance"));
  1806. if(smalltalk.assert($2)){
  1807. klass=self["@selectedClass"];
  1808. } else {
  1809. klass=_st(self["@selectedClass"])._class();
  1810. };
  1811. klass;
  1812. $3=_st(_st(klass)._methodDictionary())._isEmpty();
  1813. if(smalltalk.assert($3)){
  1814. $4=_st((smalltalk.Array || Array))._with_("not yet classified");
  1815. return $4;
  1816. };
  1817. $5=_st(klass)._protocols();
  1818. return $5;
  1819. };
  1820. $6=_st((smalltalk.Array || Array))._new();
  1821. return $6;
  1822. }, self, "protocols", [], smalltalk.Browser)}
  1823. }),
  1824. smalltalk.Browser);
  1825. smalltalk.addMethod(
  1826. "_removeClass",
  1827. smalltalk.method({
  1828. selector: "removeClass",
  1829. fn: function (){
  1830. var self=this;
  1831. return smalltalk.withContext(function($ctx) { var $1;
  1832. $1=_st(window)._confirm_(_st(_st("Do you really want to remove ").__comma(_st(self["@selectedClass"])._name())).__comma("?"));
  1833. if(smalltalk.assert($1)){
  1834. _st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removeClass_(self["@selectedClass"]);
  1835. _st(self)._resetClassesList();
  1836. _st(self)._selectClass_(nil);
  1837. };
  1838. return self}, self, "removeClass", [], smalltalk.Browser)}
  1839. }),
  1840. smalltalk.Browser);
  1841. smalltalk.addMethod(
  1842. "_removeMethod",
  1843. smalltalk.method({
  1844. selector: "removeMethod",
  1845. fn: function (){
  1846. var self=this;
  1847. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  1848. $1=_st(self)._cancelChanges();
  1849. if(smalltalk.assert($1)){
  1850. $2=_st(window)._confirm_(_st(_st("Do you really want to remove #").__comma(_st(self["@selectedMethod"])._selector())).__comma("?"));
  1851. if(smalltalk.assert($2)){
  1852. $3=_st(self["@selectedTab"]).__eq(smalltalk.symbolFor("instance"));
  1853. if(smalltalk.assert($3)){
  1854. _st(self["@selectedClass"])._removeCompiledMethod_(self["@selectedMethod"]);
  1855. } else {
  1856. _st(_st(self["@selectedClass"])._class())._removeCompiledMethod_(self["@selectedMethod"]);
  1857. };
  1858. _st(self)._selectMethod_(nil);
  1859. };
  1860. };
  1861. return self}, self, "removeMethod", [], smalltalk.Browser)}
  1862. }),
  1863. smalltalk.Browser);
  1864. smalltalk.addMethod(
  1865. "_removePackage",
  1866. smalltalk.method({
  1867. selector: "removePackage",
  1868. fn: function (){
  1869. var self=this;
  1870. return smalltalk.withContext(function($ctx) { var $1;
  1871. $1=_st(window)._confirm_(_st(_st("Do you really want to remove the whole package ").__comma(self["@selectedPackage"])).__comma(" with all its classes?"));
  1872. if(smalltalk.assert($1)){
  1873. _st(_st((smalltalk.Smalltalk || Smalltalk))._current())._removePackage_(self["@selectedPackage"]);
  1874. _st(self)._updateCategoriesList();
  1875. };
  1876. return self}, self, "removePackage", [], smalltalk.Browser)}
  1877. }),
  1878. smalltalk.Browser);
  1879. smalltalk.addMethod(
  1880. "_renameClass",
  1881. smalltalk.method({
  1882. selector: "renameClass",
  1883. fn: function (){
  1884. var self=this;
  1885. return smalltalk.withContext(function($ctx) { var $1,$2;
  1886. var newName;
  1887. newName=_st(window)._prompt_(_st("Rename class ").__comma(_st(self["@selectedClass"])._name()));
  1888. $1=_st(_st(newName)._notNil())._and_((function(){
  1889. return _st(newName)._notEmpty();
  1890. }));
  1891. if(smalltalk.assert($1)){
  1892. _st(self["@selectedClass"])._rename_(newName);
  1893. _st(self)._updateClassesList();
  1894. $2=_st(self)._updateSourceAndButtons();
  1895. $2;
  1896. };
  1897. return self}, self, "renameClass", [], smalltalk.Browser)}
  1898. }),
  1899. smalltalk.Browser);
  1900. smalltalk.addMethod(
  1901. "_renamePackage",
  1902. smalltalk.method({
  1903. selector: "renamePackage",
  1904. fn: function (){
  1905. var self=this;
  1906. return smalltalk.withContext(function($ctx) { var $1;
  1907. var newName;
  1908. newName=_st(window)._prompt_(_st("Rename package ").__comma(self["@selectedPackage"]));
  1909. if(($receiver = newName) == nil || $receiver == undefined){
  1910. newName;
  1911. } else {
  1912. $1=_st(newName)._notEmpty();
  1913. if(smalltalk.assert($1)){
  1914. _st(_st((smalltalk.Smalltalk || Smalltalk))._current())._renamePackage_to_(self["@selectedPackage"],newName);
  1915. _st(self)._updateCategoriesList();
  1916. };
  1917. };
  1918. return self}, self, "renamePackage", [], smalltalk.Browser)}
  1919. }),
  1920. smalltalk.Browser);
  1921. smalltalk.addMethod(
  1922. "_renderBottomPanelOn_",
  1923. smalltalk.method({
  1924. selector: "renderBottomPanelOn:",
  1925. fn: function (html){
  1926. var self=this;
  1927. return smalltalk.withContext(function($ctx) { var $1,$2;
  1928. $1=_st(html)._div();
  1929. _st($1)._class_("amber_sourceCode");
  1930. $2=_st($1)._with_((function(){
  1931. self["@sourceArea"]=_st((smalltalk.SourceArea || SourceArea))._new();
  1932. self["@sourceArea"];
  1933. _st(self["@sourceArea"])._renderOn_(html);
  1934. _st(self["@sourceArea"])._onKeyDown_((function(e){
  1935. return _st(self)._handleSourceAreaKeyDown_(e);
  1936. }));
  1937. return _st(self["@sourceArea"])._onKeyUp_((function(){
  1938. return _st(self)._updateStatus();
  1939. }));
  1940. }));
  1941. return self}, self, "renderBottomPanelOn:", [html], smalltalk.Browser)}
  1942. }),
  1943. smalltalk.Browser);
  1944. smalltalk.addMethod(
  1945. "_renderBoxOn_",
  1946. smalltalk.method({
  1947. selector: "renderBoxOn:",
  1948. fn: function (html){
  1949. var self=this;
  1950. return smalltalk.withContext(function($ctx) { var $1;
  1951. _st(self)._renderTopPanelOn_(html);
  1952. _st(self)._renderTabsOn_(html);
  1953. $1=_st(self)._renderBottomPanelOn_(html);
  1954. return self}, self, "renderBoxOn:", [html], smalltalk.Browser)}
  1955. }),
  1956. smalltalk.Browser);
  1957. smalltalk.addMethod(
  1958. "_renderButtonsOn_",
  1959. smalltalk.method({
  1960. selector: "renderButtonsOn:",
  1961. fn: function (html){
  1962. var self=this;
  1963. return smalltalk.withContext(function($ctx) { var $1,$2,$4,$5,$6,$7,$8,$9,$3;
  1964. self["@saveButton"]=_st(html)._button();
  1965. _st(self["@saveButton"])._with_("Save");
  1966. $1=_st(self["@saveButton"])._onClick_((function(){
  1967. return _st(self)._compile();
  1968. }));
  1969. self["@methodButtons"]=_st(html)._span();
  1970. self["@classButtons"]=_st(html)._span();
  1971. $2=_st(html)._div();
  1972. _st($2)._class_("right");
  1973. $3=_st($2)._with_((function(){
  1974. $4=_st(html)._button();
  1975. _st($4)._with_("DoIt");
  1976. $5=_st($4)._onClick_((function(){
  1977. return _st(self["@sourceArea"])._doIt();
  1978. }));
  1979. $5;
  1980. $6=_st(html)._button();
  1981. _st($6)._with_("PrintIt");
  1982. $7=_st($6)._onClick_((function(){
  1983. return _st(self["@sourceArea"])._printIt();
  1984. }));
  1985. $7;
  1986. $8=_st(html)._button();
  1987. _st($8)._with_("InspectIt");
  1988. $9=_st($8)._onClick_((function(){
  1989. return _st(self["@sourceArea"])._inspectIt();
  1990. }));
  1991. return $9;
  1992. }));
  1993. _st(self)._updateSourceAndButtons();
  1994. return self}, self, "renderButtonsOn:", [html], smalltalk.Browser)}
  1995. }),
  1996. smalltalk.Browser);
  1997. smalltalk.addMethod(
  1998. "_renderTabsOn_",
  1999. smalltalk.method({
  2000. selector: "renderTabsOn:",
  2001. fn: function (html){
  2002. var self=this;
  2003. return smalltalk.withContext(function($ctx) { self["@tabsList"]=_st(_st(html)._ul())._class_("amber_tabs amber_browser");
  2004. _st(self)._updateTabsList();
  2005. return self}, self, "renderTabsOn:", [html], smalltalk.Browser)}
  2006. }),
  2007. smalltalk.Browser);
  2008. smalltalk.addMethod(
  2009. "_renderTopPanelOn_",
  2010. smalltalk.method({
  2011. selector: "renderTopPanelOn:",
  2012. fn: function (html){
  2013. var self=this;
  2014. return smalltalk.withContext(function($ctx) { var $1,$3,$5,$6,$7,$8,$9,$10,$4,$11,$2;
  2015. $1=_st(html)._div();
  2016. _st($1)._class_("top");
  2017. $2=_st($1)._with_((function(){
  2018. self["@packagesList"]=_st(_st(html)._ul())._class_("amber_column browser packages");
  2019. self["@packagesList"];
  2020. $3=_st(html)._div();
  2021. _st($3)._class_("amber_packagesButtons");
  2022. $4=_st($3)._with_((function(){
  2023. $5=_st(html)._button();
  2024. _st($5)._title_("Commit classes in this package to disk");
  2025. _st($5)._onClick_((function(){
  2026. return _st(self)._commitPackage();
  2027. }));
  2028. $6=_st($5)._with_("Commit");
  2029. $6;
  2030. $7=_st(html)._button();
  2031. _st($7)._title_("Rename package");
  2032. _st($7)._onClick_((function(){
  2033. return _st(self)._renamePackage();
  2034. }));
  2035. $8=_st($7)._with_("Rename");
  2036. $8;
  2037. $9=_st(html)._button();
  2038. _st($9)._title_("Remove this package from the system");
  2039. _st($9)._onClick_((function(){
  2040. return _st(self)._removePackage();
  2041. }));
  2042. $10=_st($9)._with_("Remove");
  2043. return $10;
  2044. }));
  2045. $4;
  2046. self["@classesList"]=_st((smalltalk.ClassesList || ClassesList))._on_(self);
  2047. self["@classesList"];
  2048. _st(self["@classesList"])._renderOn_(html);
  2049. self["@protocolsList"]=_st(_st(html)._ul())._class_("amber_column browser protocols");
  2050. self["@protocolsList"];
  2051. self["@methodsList"]=_st(_st(html)._ul())._class_("amber_column browser methods");
  2052. self["@methodsList"];
  2053. _st(self)._updateCategoriesList();
  2054. _st(self)._updateClassesList();
  2055. _st(self)._updateProtocolsList();
  2056. $11=_st(self)._updateMethodsList();
  2057. $11;
  2058. return _st(_st(html)._div())._class_("amber_clear");
  2059. }));
  2060. return self}, self, "renderTopPanelOn:", [html], smalltalk.Browser)}
  2061. }),
  2062. smalltalk.Browser);
  2063. smalltalk.addMethod(
  2064. "_resetClassesList",
  2065. smalltalk.method({
  2066. selector: "resetClassesList",
  2067. fn: function (){
  2068. var self=this;
  2069. return smalltalk.withContext(function($ctx) { _st(self["@classesList"])._resetNodes();
  2070. return self}, self, "resetClassesList", [], smalltalk.Browser)}
  2071. }),
  2072. smalltalk.Browser);
  2073. smalltalk.addMethod(
  2074. "_search_",
  2075. smalltalk.method({
  2076. selector: "search:",
  2077. fn: function (aString){
  2078. var self=this;
  2079. return smalltalk.withContext(function($ctx) { var $1,$2;
  2080. $1=_st(self)._cancelChanges();
  2081. if(smalltalk.assert($1)){
  2082. var searchedClass;
  2083. searchedClass=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._at_(aString);
  2084. searchedClass;
  2085. $2=_st(searchedClass)._isClass();
  2086. if(smalltalk.assert($2)){
  2087. _st(_st(self)._class())._openOn_(searchedClass);
  2088. } else {
  2089. _st(self)._searchReferencesOf_(aString);
  2090. };
  2091. };
  2092. return self}, self, "search:", [aString], smalltalk.Browser)}
  2093. }),
  2094. smalltalk.Browser);
  2095. smalltalk.addMethod(
  2096. "_searchClassReferences",
  2097. smalltalk.method({
  2098. selector: "searchClassReferences",
  2099. fn: function (){
  2100. var self=this;
  2101. return smalltalk.withContext(function($ctx) { _st((smalltalk.ReferencesBrowser || ReferencesBrowser))._search_(_st(self["@selectedClass"])._name());
  2102. return self}, self, "searchClassReferences", [], smalltalk.Browser)}
  2103. }),
  2104. smalltalk.Browser);
  2105. smalltalk.addMethod(
  2106. "_searchReferencesOf_",
  2107. smalltalk.method({
  2108. selector: "searchReferencesOf:",
  2109. fn: function (aString){
  2110. var self=this;
  2111. return smalltalk.withContext(function($ctx) { _st((smalltalk.ReferencesBrowser || ReferencesBrowser))._search_(aString);
  2112. return self}, self, "searchReferencesOf:", [aString], smalltalk.Browser)}
  2113. }),
  2114. smalltalk.Browser);
  2115. smalltalk.addMethod(
  2116. "_selectCategory_",
  2117. smalltalk.method({
  2118. selector: "selectCategory:",
  2119. fn: function (aCategory){
  2120. var self=this;
  2121. return smalltalk.withContext(function($ctx) { var $1,$2;
  2122. $1=_st(self)._cancelChanges();
  2123. if(smalltalk.assert($1)){
  2124. self["@selectedPackage"]=aCategory;
  2125. self["@selectedPackage"];
  2126. self["@selectedMethod"]=nil;
  2127. self["@selectedProtocol"]=self["@selectedMethod"];
  2128. self["@selectedClass"]=self["@selectedProtocol"];
  2129. self["@selectedClass"];
  2130. _st(self)._resetClassesList();
  2131. _st(self)._updateCategoriesList();
  2132. _st(self)._updateClassesList();
  2133. _st(self)._updateProtocolsList();
  2134. _st(self)._updateMethodsList();
  2135. $2=_st(self)._updateSourceAndButtons();
  2136. $2;
  2137. };
  2138. return self}, self, "selectCategory:", [aCategory], smalltalk.Browser)}
  2139. }),
  2140. smalltalk.Browser);
  2141. smalltalk.addMethod(
  2142. "_selectClass_",
  2143. smalltalk.method({
  2144. selector: "selectClass:",
  2145. fn: function (aClass){
  2146. var self=this;
  2147. return smalltalk.withContext(function($ctx) { var $1,$2;
  2148. $1=_st(self)._cancelChanges();
  2149. if(smalltalk.assert($1)){
  2150. self["@selectedClass"]=aClass;
  2151. self["@selectedClass"];
  2152. self["@selectedMethod"]=nil;
  2153. self["@selectedProtocol"]=self["@selectedMethod"];
  2154. self["@selectedProtocol"];
  2155. _st(self)._updateClassesList();
  2156. _st(self)._updateProtocolsList();
  2157. _st(self)._updateMethodsList();
  2158. $2=_st(self)._updateSourceAndButtons();
  2159. $2;
  2160. };
  2161. return self}, self, "selectClass:", [aClass], smalltalk.Browser)}
  2162. }),
  2163. smalltalk.Browser);
  2164. smalltalk.addMethod(
  2165. "_selectMethod_",
  2166. smalltalk.method({
  2167. selector: "selectMethod:",
  2168. fn: function (aMethod){
  2169. var self=this;
  2170. return smalltalk.withContext(function($ctx) { var $1,$2;
  2171. $1=_st(self)._cancelChanges();
  2172. if(smalltalk.assert($1)){
  2173. self["@selectedMethod"]=aMethod;
  2174. self["@selectedMethod"];
  2175. _st(self)._updateProtocolsList();
  2176. _st(self)._updateMethodsList();
  2177. $2=_st(self)._updateSourceAndButtons();
  2178. $2;
  2179. };
  2180. return self}, self, "selectMethod:", [aMethod], smalltalk.Browser)}
  2181. }),
  2182. smalltalk.Browser);
  2183. smalltalk.addMethod(
  2184. "_selectProtocol_",
  2185. smalltalk.method({
  2186. selector: "selectProtocol:",
  2187. fn: function (aString){
  2188. var self=this;
  2189. return smalltalk.withContext(function($ctx) { var $1,$2;
  2190. $1=_st(self)._cancelChanges();
  2191. if(smalltalk.assert($1)){
  2192. self["@selectedProtocol"]=aString;
  2193. self["@selectedProtocol"];
  2194. self["@selectedMethod"]=nil;
  2195. self["@selectedMethod"];
  2196. _st(self)._updateProtocolsList();
  2197. _st(self)._updateMethodsList();
  2198. $2=_st(self)._updateSourceAndButtons();
  2199. $2;
  2200. };
  2201. return self}, self, "selectProtocol:", [aString], smalltalk.Browser)}
  2202. }),
  2203. smalltalk.Browser);
  2204. smalltalk.addMethod(
  2205. "_selectTab_",
  2206. smalltalk.method({
  2207. selector: "selectTab:",
  2208. fn: function (aString){
  2209. var self=this;
  2210. return smalltalk.withContext(function($ctx) { var $1;
  2211. $1=_st(self)._cancelChanges();
  2212. if(smalltalk.assert($1)){
  2213. self["@selectedTab"]=aString;
  2214. self["@selectedTab"];
  2215. _st(self)._selectProtocol_(nil);
  2216. _st(self)._updateTabsList();
  2217. };
  2218. return self}, self, "selectTab:", [aString], smalltalk.Browser)}
  2219. }),
  2220. smalltalk.Browser);
  2221. smalltalk.addMethod(
  2222. "_selectedClass",
  2223. smalltalk.method({
  2224. selector: "selectedClass",
  2225. fn: function (){
  2226. var self=this;
  2227. return smalltalk.withContext(function($ctx) { return self["@selectedClass"];
  2228. }, self, "selectedClass", [], smalltalk.Browser)}
  2229. }),
  2230. smalltalk.Browser);
  2231. smalltalk.addMethod(
  2232. "_selectedPackage",
  2233. smalltalk.method({
  2234. selector: "selectedPackage",
  2235. fn: function (){
  2236. var self=this;
  2237. return smalltalk.withContext(function($ctx) { return self["@selectedPackage"];
  2238. }, self, "selectedPackage", [], smalltalk.Browser)}
  2239. }),
  2240. smalltalk.Browser);
  2241. smalltalk.addMethod(
  2242. "_setMethodProtocol_",
  2243. smalltalk.method({
  2244. selector: "setMethodProtocol:",
  2245. fn: function (aString){
  2246. var self=this;
  2247. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  2248. $1=_st(self)._cancelChanges();
  2249. if(smalltalk.assert($1)){
  2250. $2=_st(_st(self)._protocols())._includes_(aString);
  2251. if(smalltalk.assert($2)){
  2252. _st(self["@selectedMethod"])._category_(aString);
  2253. self["@selectedProtocol"]=aString;
  2254. self["@selectedProtocol"];
  2255. self["@selectedMethod"]=self["@selectedMethod"];
  2256. self["@selectedMethod"];
  2257. _st(self)._updateProtocolsList();
  2258. _st(self)._updateMethodsList();
  2259. $3=_st(self)._updateSourceAndButtons();
  2260. $3;
  2261. } else {
  2262. _st(self)._addNewProtocol();
  2263. };
  2264. };
  2265. return self}, self, "setMethodProtocol:", [aString], smalltalk.Browser)}
  2266. }),
  2267. smalltalk.Browser);
  2268. smalltalk.addMethod(
  2269. "_showClassButtons",
  2270. smalltalk.method({
  2271. selector: "showClassButtons",
  2272. fn: function (){
  2273. var self=this;
  2274. return smalltalk.withContext(function($ctx) { _st(_st(self["@classButtons"])._asJQuery())._show();
  2275. return self}, self, "showClassButtons", [], smalltalk.Browser)}
  2276. }),
  2277. smalltalk.Browser);
  2278. smalltalk.addMethod(
  2279. "_showMethodButtons",
  2280. smalltalk.method({
  2281. selector: "showMethodButtons",
  2282. fn: function (){
  2283. var self=this;
  2284. return smalltalk.withContext(function($ctx) { _st(_st(self["@methodButtons"])._asJQuery())._show();
  2285. return self}, self, "showMethodButtons", [], smalltalk.Browser)}
  2286. }),
  2287. smalltalk.Browser);
  2288. smalltalk.addMethod(
  2289. "_source",
  2290. smalltalk.method({
  2291. selector: "source",
  2292. fn: function (){
  2293. var self=this;
  2294. return smalltalk.withContext(function($ctx) { var $1,$3,$2,$4;
  2295. $1=_st(self["@selectedTab"]).__eq(smalltalk.symbolFor("comment"));
  2296. if(! smalltalk.assert($1)){
  2297. $3=_st(_st(self["@selectedProtocol"])._notNil())._or_((function(){
  2298. return _st(self["@selectedMethod"])._notNil();
  2299. }));
  2300. if(smalltalk.assert($3)){
  2301. $2=_st(self)._methodSource();
  2302. } else {
  2303. $2=_st(self)._declarationSource();
  2304. };
  2305. return $2;
  2306. };
  2307. if(($receiver = self["@selectedClass"]) == nil || $receiver == undefined){
  2308. $4="";
  2309. } else {
  2310. $4=_st(self)._classCommentSource();
  2311. };
  2312. return $4;
  2313. }, self, "source", [], smalltalk.Browser)}
  2314. }),
  2315. smalltalk.Browser);
  2316. smalltalk.addMethod(
  2317. "_updateCategoriesList",
  2318. smalltalk.method({
  2319. selector: "updateCategoriesList",
  2320. fn: function (){
  2321. var self=this;
  2322. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  2323. _st(self["@packagesList"])._contents_((function(html){
  2324. return _st(_st(self)._packages())._do_((function(each){
  2325. var li;
  2326. var label;
  2327. $1=_st(each)._isEmpty();
  2328. if(smalltalk.assert($1)){
  2329. label="Unclassified";
  2330. label;
  2331. } else {
  2332. label=each;
  2333. label;
  2334. };
  2335. li=_st(html)._li();
  2336. li;
  2337. $2=_st(self["@selectedPackage"]).__eq(each);
  2338. if(smalltalk.assert($2)){
  2339. _st(li)._class_("selected");
  2340. };
  2341. _st(li)._with_(label);
  2342. $3=_st(li)._onClick_((function(){
  2343. return _st(self)._selectCategory_(each);
  2344. }));
  2345. return $3;
  2346. }));
  2347. }));
  2348. return self}, self, "updateCategoriesList", [], smalltalk.Browser)}
  2349. }),
  2350. smalltalk.Browser);
  2351. smalltalk.addMethod(
  2352. "_updateClassesList",
  2353. smalltalk.method({
  2354. selector: "updateClassesList",
  2355. fn: function (){
  2356. var self=this;
  2357. return smalltalk.withContext(function($ctx) { _st(_st((smalltalk.TabManager || TabManager))._current())._update();
  2358. _st(self["@classesList"])._updateNodes();
  2359. return self}, self, "updateClassesList", [], smalltalk.Browser)}
  2360. }),
  2361. smalltalk.Browser);
  2362. smalltalk.addMethod(
  2363. "_updateMethodsList",
  2364. smalltalk.method({
  2365. selector: "updateMethodsList",
  2366. fn: function (){
  2367. var self=this;
  2368. return smalltalk.withContext(function($ctx) { var $1,$2;
  2369. _st(self["@methodsList"])._contents_((function(html){
  2370. return _st(_st(self)._methods())._do_((function(each){
  2371. var li;
  2372. li=_st(html)._li();
  2373. li;
  2374. $1=_st(self["@selectedMethod"]).__eq(each);
  2375. if(smalltalk.assert($1)){
  2376. _st(li)._class_("selected");
  2377. };
  2378. _st(li)._with_(_st(each)._selector());
  2379. $2=_st(li)._onClick_((function(){
  2380. return _st(self)._selectMethod_(each);
  2381. }));
  2382. return $2;
  2383. }));
  2384. }));
  2385. return self}, self, "updateMethodsList", [], smalltalk.Browser)}
  2386. }),
  2387. smalltalk.Browser);
  2388. smalltalk.addMethod(
  2389. "_updateProtocolsList",
  2390. smalltalk.method({
  2391. selector: "updateProtocolsList",
  2392. fn: function (){
  2393. var self=this;
  2394. return smalltalk.withContext(function($ctx) { var $1,$2;
  2395. _st(self["@protocolsList"])._contents_((function(html){
  2396. return _st(_st(self)._protocols())._do_((function(each){
  2397. var li;
  2398. li=_st(html)._li();
  2399. li;
  2400. $1=_st(self["@selectedProtocol"]).__eq(each);
  2401. if(smalltalk.assert($1)){
  2402. _st(li)._class_("selected");
  2403. };
  2404. _st(li)._with_(each);
  2405. $2=_st(li)._onClick_((function(){
  2406. return _st(self)._selectProtocol_(each);
  2407. }));
  2408. return $2;
  2409. }));
  2410. }));
  2411. return self}, self, "updateProtocolsList", [], smalltalk.Browser)}
  2412. }),
  2413. smalltalk.Browser);
  2414. smalltalk.addMethod(
  2415. "_updateSourceAndButtons",
  2416. smalltalk.method({
  2417. selector: "updateSourceAndButtons",
  2418. fn: function (){
  2419. var self=this;
  2420. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$14,$15,$16,$17,$18,$19,$13,$20,$22,$23,$24,$25,$21,$26,$27;
  2421. var currentProtocol;
  2422. _st(self)._disableSaveButton();
  2423. _st(self["@classButtons"])._contents_((function(html){
  2424. $1=_st(html)._button();
  2425. _st($1)._title_("Create a new class");
  2426. _st($1)._onClick_((function(){
  2427. return _st(self)._addNewClass();
  2428. }));
  2429. $2=_st($1)._with_("New class");
  2430. $2;
  2431. $3=_st(html)._button();
  2432. _st($3)._with_("Rename class");
  2433. $4=_st($3)._onClick_((function(){
  2434. return _st(self)._renameClass();
  2435. }));
  2436. $4;
  2437. $5=_st(html)._button();
  2438. _st($5)._with_("Copy class");
  2439. $6=_st($5)._onClick_((function(){
  2440. return _st(self)._copyClass();
  2441. }));
  2442. $6;
  2443. $7=_st(html)._button();
  2444. _st($7)._with_("Remove class");
  2445. $8=_st($7)._onClick_((function(){
  2446. return _st(self)._removeClass();
  2447. }));
  2448. $8;
  2449. $9=_st(html)._button();
  2450. _st($9)._with_("References");
  2451. $10=_st($9)._onClick_((function(){
  2452. return _st(self)._searchClassReferences();
  2453. }));
  2454. return $10;
  2455. }));
  2456. _st(self["@methodButtons"])._contents_((function(html){
  2457. var protocolSelect;
  2458. var referencesSelect;
  2459. $11=_st(html)._button();
  2460. _st($11)._with_("Remove method");
  2461. $12=_st($11)._onClick_((function(){
  2462. return _st(self)._removeMethod();
  2463. }));
  2464. $12;
  2465. protocolSelect=_st(html)._select();
  2466. protocolSelect;
  2467. _st(protocolSelect)._onChange_((function(){
  2468. return _st(self)._setMethodProtocol_(_st(_st(protocolSelect)._asJQuery())._val());
  2469. }));
  2470. $13=_st(protocolSelect)._with_((function(){
  2471. $14=_st(html)._option();
  2472. _st($14)._with_("Method protocol");
  2473. $15=_st($14)._at_put_("disabled","disabled");
  2474. $15;
  2475. $16=_st(html)._option();
  2476. _st($16)._class_("important");
  2477. $17=_st($16)._with_("New...");
  2478. $17;
  2479. currentProtocol=self["@selectedProtocol"];
  2480. currentProtocol;
  2481. $18=_st(_st(currentProtocol)._isNil())._and_((function(){
  2482. return _st(self["@selectedMethod"])._notNil();
  2483. }));
  2484. if(smalltalk.assert($18)){
  2485. currentProtocol=_st(self["@selectedMethod"])._category();
  2486. currentProtocol;
  2487. };
  2488. return _st(_st(self)._protocols())._do_((function(each){
  2489. option=_st(_st(html)._option())._with_(each);
  2490. option;
  2491. $19=_st(currentProtocol).__eq(each);
  2492. if(smalltalk.assert($19)){
  2493. return _st(option)._at_put_("selected","selected");
  2494. };
  2495. }));
  2496. }));
  2497. $13;
  2498. $20=_st(self["@selectedMethod"])._isNil();
  2499. if(! smalltalk.assert($20)){
  2500. referencesSelect=_st(html)._select();
  2501. referencesSelect;
  2502. _st(referencesSelect)._onChange_((function(){
  2503. return _st(self)._searchReferencesOf_(_st(_st(referencesSelect)._asJQuery())._val());
  2504. }));
  2505. $21=_st(referencesSelect)._with_((function(){
  2506. var option;
  2507. $22=_st(html)._option();
  2508. _st($22)._with_("References");
  2509. _st($22)._at_put_("disabled","disabled");
  2510. $23=_st($22)._at_put_("selected","selected");
  2511. $23;
  2512. $24=_st(html)._option();
  2513. _st($24)._class_("important");
  2514. $25=_st($24)._with_(_st(self["@selectedMethod"])._selector());
  2515. $25;
  2516. return _st(_st(_st(self["@selectedMethod"])._messageSends())._sorted())._do_((function(each){
  2517. return _st(_st(html)._option())._with_(each);
  2518. }));
  2519. }));
  2520. return $21;
  2521. };
  2522. }));
  2523. $26=_st(self["@selectedMethod"])._isNil();
  2524. if(smalltalk.assert($26)){
  2525. _st(self)._hideMethodButtons();
  2526. $27=_st(_st(self["@selectedClass"])._isNil())._or_((function(){
  2527. return _st(self["@selectedProtocol"])._notNil();
  2528. }));
  2529. if(smalltalk.assert($27)){
  2530. _st(self)._hideClassButtons();
  2531. } else {
  2532. _st(self)._showClassButtons();
  2533. };
  2534. } else {
  2535. _st(self)._hideClassButtons();
  2536. _st(self)._showMethodButtons();
  2537. };
  2538. _st(self["@sourceArea"])._val_(_st(self)._source());
  2539. return self}, self, "updateSourceAndButtons", [], smalltalk.Browser)}
  2540. }),
  2541. smalltalk.Browser);
  2542. smalltalk.addMethod(
  2543. "_updateStatus",
  2544. smalltalk.method({
  2545. selector: "updateStatus",
  2546. fn: function (){
  2547. var self=this;
  2548. return smalltalk.withContext(function($ctx) { var $1;
  2549. $1=_st(_st(self["@sourceArea"])._val()).__eq(_st(self)._source());
  2550. if(smalltalk.assert($1)){
  2551. if(($receiver = self["@saveButton"]) == nil || $receiver == undefined){
  2552. self["@saveButton"];
  2553. } else {
  2554. _st(self["@saveButton"])._at_put_("disabled",true);
  2555. };
  2556. self["@unsavedChanges"]=false;
  2557. self["@unsavedChanges"];
  2558. } else {
  2559. if(($receiver = self["@saveButton"]) == nil || $receiver == undefined){
  2560. self["@saveButton"];
  2561. } else {
  2562. _st(self["@saveButton"])._removeAt_("disabled");
  2563. };
  2564. self["@unsavedChanges"]=true;
  2565. self["@unsavedChanges"];
  2566. };
  2567. return self}, self, "updateStatus", [], smalltalk.Browser)}
  2568. }),
  2569. smalltalk.Browser);
  2570. smalltalk.addMethod(
  2571. "_updateTabsList",
  2572. smalltalk.method({
  2573. selector: "updateTabsList",
  2574. fn: function (){
  2575. var self=this;
  2576. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12;
  2577. _st(self["@tabsList"])._contents_((function(html){
  2578. var li;
  2579. li=_st(html)._li();
  2580. li;
  2581. $1=_st(self["@selectedTab"]).__eq(smalltalk.symbolFor("instance"));
  2582. if(smalltalk.assert($1)){
  2583. _st(li)._class_("selected");
  2584. };
  2585. _st(li)._with_((function(){
  2586. _st(_st(html)._span())._class_("ltab");
  2587. $2=_st(html)._span();
  2588. _st($2)._class_("mtab");
  2589. $3=_st($2)._with_("Instance");
  2590. $3;
  2591. return _st(_st(html)._span())._class_("rtab");
  2592. }));
  2593. $4=_st(li)._onClick_((function(){
  2594. return _st(self)._selectTab_(smalltalk.symbolFor("instance"));
  2595. }));
  2596. $4;
  2597. li=_st(html)._li();
  2598. li;
  2599. $5=_st(self["@selectedTab"]).__eq(smalltalk.symbolFor("class"));
  2600. if(smalltalk.assert($5)){
  2601. _st(li)._class_("selected");
  2602. };
  2603. _st(li)._with_((function(){
  2604. _st(_st(html)._span())._class_("ltab");
  2605. $6=_st(html)._span();
  2606. _st($6)._class_("mtab");
  2607. $7=_st($6)._with_("Class");
  2608. $7;
  2609. return _st(_st(html)._span())._class_("rtab");
  2610. }));
  2611. $8=_st(li)._onClick_((function(){
  2612. return _st(self)._selectTab_(smalltalk.symbolFor("class"));
  2613. }));
  2614. $8;
  2615. li=_st(html)._li();
  2616. li;
  2617. $9=_st(self["@selectedTab"]).__eq(smalltalk.symbolFor("comment"));
  2618. if(smalltalk.assert($9)){
  2619. _st(li)._class_("selected");
  2620. };
  2621. _st(li)._with_((function(){
  2622. _st(_st(html)._span())._class_("ltab");
  2623. $10=_st(html)._span();
  2624. _st($10)._class_("mtab");
  2625. $11=_st($10)._with_("Comment");
  2626. $11;
  2627. return _st(_st(html)._span())._class_("rtab");
  2628. }));
  2629. $12=_st(li)._onClick_((function(){
  2630. return _st(self)._selectTab_(smalltalk.symbolFor("comment"));
  2631. }));
  2632. return $12;
  2633. }));
  2634. return self}, self, "updateTabsList", [], smalltalk.Browser)}
  2635. }),
  2636. smalltalk.Browser);
  2637. smalltalk.addMethod(
  2638. "_commitPathJs",
  2639. smalltalk.method({
  2640. selector: "commitPathJs",
  2641. fn: function (){
  2642. var self=this;
  2643. return smalltalk.withContext(function($ctx) { return "js";
  2644. }, self, "commitPathJs", [], smalltalk.Browser.klass)}
  2645. }),
  2646. smalltalk.Browser.klass);
  2647. smalltalk.addMethod(
  2648. "_commitPathSt",
  2649. smalltalk.method({
  2650. selector: "commitPathSt",
  2651. fn: function (){
  2652. var self=this;
  2653. return smalltalk.withContext(function($ctx) { return "st";
  2654. }, self, "commitPathSt", [], smalltalk.Browser.klass)}
  2655. }),
  2656. smalltalk.Browser.klass);
  2657. smalltalk.addMethod(
  2658. "_open",
  2659. smalltalk.method({
  2660. selector: "open",
  2661. fn: function (){
  2662. var self=this;
  2663. return smalltalk.withContext(function($ctx) { _st(_st(self)._new())._open();
  2664. return self}, self, "open", [], smalltalk.Browser.klass)}
  2665. }),
  2666. smalltalk.Browser.klass);
  2667. smalltalk.addMethod(
  2668. "_openOn_",
  2669. smalltalk.method({
  2670. selector: "openOn:",
  2671. fn: function (aClass){
  2672. var self=this;
  2673. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  2674. $2=_st(self)._new();
  2675. _st($2)._open();
  2676. _st($2)._selectCategory_(_st(aClass)._category());
  2677. $3=_st($2)._selectClass_(aClass);
  2678. $1=$3;
  2679. return $1;
  2680. }, self, "openOn:", [aClass], smalltalk.Browser.klass)}
  2681. }),
  2682. smalltalk.Browser.klass);
  2683. smalltalk.addClass('Debugger', smalltalk.TabWidget, ['error', 'selectedContext', 'sourceArea', 'ul', 'ul2', 'inspector', 'saveButton', 'unsavedChanges', 'selectedVariable', 'selectedVariableName', 'inspectButton'], 'IDE');
  2684. smalltalk.addMethod(
  2685. "_arguments",
  2686. smalltalk.method({
  2687. selector: "arguments",
  2688. fn: function (){
  2689. var self=this;
  2690. return smalltalk.withContext(function($ctx) { var $2,$1;
  2691. $2=_st(self)._method();
  2692. if(($receiver = $2) == nil || $receiver == undefined){
  2693. $1=_st(_st(self["@selectedContext"])._temps())._collect_((function(each){
  2694. return nil;
  2695. }));
  2696. } else {
  2697. $1=_st(_st(self)._method())._arguments();
  2698. };
  2699. return $1;
  2700. }, self, "arguments", [], smalltalk.Debugger)}
  2701. }),
  2702. smalltalk.Debugger);
  2703. smalltalk.addMethod(
  2704. "_canBeClosed",
  2705. smalltalk.method({
  2706. selector: "canBeClosed",
  2707. fn: function (){
  2708. var self=this;
  2709. return smalltalk.withContext(function($ctx) { return true;
  2710. }, self, "canBeClosed", [], smalltalk.Debugger)}
  2711. }),
  2712. smalltalk.Debugger);
  2713. smalltalk.addMethod(
  2714. "_error",
  2715. smalltalk.method({
  2716. selector: "error",
  2717. fn: function (){
  2718. var self=this;
  2719. return smalltalk.withContext(function($ctx) { return self["@error"];
  2720. }, self, "error", [], smalltalk.Debugger)}
  2721. }),
  2722. smalltalk.Debugger);
  2723. smalltalk.addMethod(
  2724. "_error_",
  2725. smalltalk.method({
  2726. selector: "error:",
  2727. fn: function (anError){
  2728. var self=this;
  2729. return smalltalk.withContext(function($ctx) { self["@error"]=anError;
  2730. return self}, self, "error:", [anError], smalltalk.Debugger)}
  2731. }),
  2732. smalltalk.Debugger);
  2733. smalltalk.addMethod(
  2734. "_initialize",
  2735. smalltalk.method({
  2736. selector: "initialize",
  2737. fn: function (){
  2738. var self=this;
  2739. return smalltalk.withContext(function($ctx) { smalltalk.TabWidget.fn.prototype._initialize.apply(_st(self), []);
  2740. _st(self["@unsavedChanges"]).__eq(false);
  2741. return self}, self, "initialize", [], smalltalk.Debugger)}
  2742. }),
  2743. smalltalk.Debugger);
  2744. smalltalk.addMethod(
  2745. "_inspectSelectedVariable",
  2746. smalltalk.method({
  2747. selector: "inspectSelectedVariable",
  2748. fn: function (){
  2749. var self=this;
  2750. return smalltalk.withContext(function($ctx) { _st(self["@selectedVariable"])._inspect();
  2751. return self}, self, "inspectSelectedVariable", [], smalltalk.Debugger)}
  2752. }),
  2753. smalltalk.Debugger);
  2754. smalltalk.addMethod(
  2755. "_label",
  2756. smalltalk.method({
  2757. selector: "label",
  2758. fn: function (){
  2759. var self=this;
  2760. return smalltalk.withContext(function($ctx) { return "[Debugger]";
  2761. }, self, "label", [], smalltalk.Debugger)}
  2762. }),
  2763. smalltalk.Debugger);
  2764. smalltalk.addMethod(
  2765. "_method",
  2766. smalltalk.method({
  2767. selector: "method",
  2768. fn: function (){
  2769. var self=this;
  2770. return smalltalk.withContext(function($ctx) { var $1;
  2771. $1=_st(self["@selectedContext"])._method();
  2772. return $1;
  2773. }, self, "method", [], smalltalk.Debugger)}
  2774. }),
  2775. smalltalk.Debugger);
  2776. smalltalk.addMethod(
  2777. "_proceed",
  2778. smalltalk.method({
  2779. selector: "proceed",
  2780. fn: function (){
  2781. var self=this;
  2782. return smalltalk.withContext(function($ctx) { _st(self)._close();
  2783. _st(_st(self["@selectedContext"])._receiver())._perform_withArguments_(_st(self["@selectedContext"])._selector(),_st(self["@selectedContext"])._temps());
  2784. return self}, self, "proceed", [], smalltalk.Debugger)}
  2785. }),
  2786. smalltalk.Debugger);
  2787. smalltalk.addMethod(
  2788. "_receiver",
  2789. smalltalk.method({
  2790. selector: "receiver",
  2791. fn: function (){
  2792. var self=this;
  2793. return smalltalk.withContext(function($ctx) { var $1;
  2794. $1=_st(self["@selectedContext"])._receiver();
  2795. return $1;
  2796. }, self, "receiver", [], smalltalk.Debugger)}
  2797. }),
  2798. smalltalk.Debugger);
  2799. smalltalk.addMethod(
  2800. "_renderBottomPanelOn_",
  2801. smalltalk.method({
  2802. selector: "renderBottomPanelOn:",
  2803. fn: function (html){
  2804. var self=this;
  2805. return smalltalk.withContext(function($ctx) { var $1,$2;
  2806. $1=_st(html)._div();
  2807. _st($1)._class_("amber_sourceCode debugger");
  2808. $2=_st($1)._with_((function(){
  2809. self["@sourceArea"]=_st((smalltalk.SourceArea || SourceArea))._new();
  2810. self["@sourceArea"];
  2811. return _st(self["@sourceArea"])._renderOn_(html);
  2812. }));
  2813. self["@ul2"]=_st(_st(html)._ul())._class_("amber_column debugger variables");
  2814. self["@inspector"]=_st(_st(html)._div())._class_("amber_column debugger inspector");
  2815. _st(self["@sourceArea"])._onKeyUp_((function(){
  2816. return _st(self)._updateStatus();
  2817. }));
  2818. return self}, self, "renderBottomPanelOn:", [html], smalltalk.Debugger)}
  2819. }),
  2820. smalltalk.Debugger);
  2821. smalltalk.addMethod(
  2822. "_renderBoxOn_",
  2823. smalltalk.method({
  2824. selector: "renderBoxOn:",
  2825. fn: function (html){
  2826. var self=this;
  2827. return smalltalk.withContext(function($ctx) { var $1;
  2828. _st(self)._renderTopPanelOn_(html);
  2829. $1=_st(self)._renderBottomPanelOn_(html);
  2830. return self}, self, "renderBoxOn:", [html], smalltalk.Debugger)}
  2831. }),
  2832. smalltalk.Debugger);
  2833. smalltalk.addMethod(
  2834. "_renderButtonsOn_",
  2835. smalltalk.method({
  2836. selector: "renderButtonsOn:",
  2837. fn: function (html){
  2838. var self=this;
  2839. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15;
  2840. $1=_st(html)._button();
  2841. _st($1)._with_("Save");
  2842. $2=_st($1)._onClick_((function(){
  2843. return _st(self)._save();
  2844. }));
  2845. self["@saveButton"]=$2;
  2846. $3=_st(html)._button();
  2847. _st($3)._with_("DoIt");
  2848. $4=_st($3)._onClick_((function(){
  2849. return _st(self["@sourceArea"])._doIt();
  2850. }));
  2851. $5=_st(html)._button();
  2852. _st($5)._with_("PrintIt");
  2853. $6=_st($5)._onClick_((function(){
  2854. return _st(self["@sourceArea"])._printIt();
  2855. }));
  2856. $7=_st(html)._button();
  2857. _st($7)._with_("InspectIt");
  2858. $8=_st($7)._onClick_((function(){
  2859. return _st(self["@sourceArea"])._inspectIt();
  2860. }));
  2861. $9=_st(html)._button();
  2862. _st($9)._with_("Proceed");
  2863. $10=_st($9)._onClick_((function(){
  2864. return _st(self)._proceed();
  2865. }));
  2866. $11=_st(html)._button();
  2867. _st($11)._with_("Abandon");
  2868. $12=_st($11)._onClick_((function(){
  2869. return _st(self)._close();
  2870. }));
  2871. $13=_st(html)._button();
  2872. _st($13)._class_("amber_button debugger inspect");
  2873. _st($13)._with_("Inspect");
  2874. $14=_st($13)._onClick_((function(){
  2875. return _st(self)._inspectSelectedVariable();
  2876. }));
  2877. self["@inspectButton"]=$14;
  2878. _st(self)._updateSourceArea();
  2879. _st(self)._updateStatus();
  2880. _st(self)._updateVariablesList();
  2881. $15=_st(self)._updateInspector();
  2882. return self}, self, "renderButtonsOn:", [html], smalltalk.Debugger)}
  2883. }),
  2884. smalltalk.Debugger);
  2885. smalltalk.addMethod(
  2886. "_renderContext_on_",
  2887. smalltalk.method({
  2888. selector: "renderContext:on:",
  2889. fn: function (aContext,html){
  2890. var self=this;
  2891. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  2892. var li;
  2893. li=_st(html)._li();
  2894. $1=_st(self["@selectedContext"]).__eq(aContext);
  2895. if(smalltalk.assert($1)){
  2896. _st(li)._class_("selected");
  2897. };
  2898. _st(li)._with_(_st(aContext)._asString());
  2899. $2=_st(li)._onClick_((function(){
  2900. return _st(self)._selectContext_(aContext);
  2901. }));
  2902. $3=_st(aContext)._home();
  2903. if(($receiver = $3) == nil || $receiver == undefined){
  2904. $3;
  2905. } else {
  2906. _st(self)._renderContext_on_(_st(aContext)._home(),html);
  2907. };
  2908. return self}, self, "renderContext:on:", [aContext,html], smalltalk.Debugger)}
  2909. }),
  2910. smalltalk.Debugger);
  2911. smalltalk.addMethod(
  2912. "_renderTopPanelOn_",
  2913. smalltalk.method({
  2914. selector: "renderTopPanelOn:",
  2915. fn: function (html){
  2916. var self=this;
  2917. return smalltalk.withContext(function($ctx) { var $1,$3,$4,$5,$6,$2;
  2918. self["@selectedContext"]=_st(_st(self)._error())._context();
  2919. $1=_st(html)._div();
  2920. _st($1)._class_("top");
  2921. $2=_st($1)._with_((function(){
  2922. $3=_st(html)._div();
  2923. _st($3)._class_("label");
  2924. $4=_st($3)._with_(_st(_st(self)._error())._messageText());
  2925. $4;
  2926. $5=_st(html)._ul();
  2927. _st($5)._class_("amber_column debugger contexts");
  2928. $6=_st($5)._with_((function(){
  2929. return _st(self)._renderContext_on_(_st(_st(self)._error())._context(),html);
  2930. }));
  2931. self["@ul"]=$6;
  2932. return self["@ul"];
  2933. }));
  2934. return self}, self, "renderTopPanelOn:", [html], smalltalk.Debugger)}
  2935. }),
  2936. smalltalk.Debugger);
  2937. smalltalk.addMethod(
  2938. "_save",
  2939. smalltalk.method({
  2940. selector: "save",
  2941. fn: function (){
  2942. var self=this;
  2943. return smalltalk.withContext(function($ctx) { var protocol;
  2944. protocol=_st(_st(_st(_st(_st(self["@selectedContext"])._receiver())._class())._methodDictionary())._at_(_st(self["@selectedContext"])._selector()))._category();
  2945. _st(_st(_st(self["@selectedContext"])._receiver())._class())._compile_category_(_st(self["@sourceArea"])._val(),protocol);
  2946. _st(self)._updateStatus();
  2947. return self}, self, "save", [], smalltalk.Debugger)}
  2948. }),
  2949. smalltalk.Debugger);
  2950. smalltalk.addMethod(
  2951. "_selectContext_",
  2952. smalltalk.method({
  2953. selector: "selectContext:",
  2954. fn: function (aContext){
  2955. var self=this;
  2956. return smalltalk.withContext(function($ctx) { var $1;
  2957. self["@selectedContext"]=aContext;
  2958. self["@selectedVariable"]=nil;
  2959. self["@selectedVariableName"]=nil;
  2960. _st(self)._updateContextsList();
  2961. _st(self)._updateSourceArea();
  2962. _st(self)._updateInspector();
  2963. _st(self)._updateVariablesList();
  2964. $1=_st(self)._updateStatus();
  2965. return self}, self, "selectContext:", [aContext], smalltalk.Debugger)}
  2966. }),
  2967. smalltalk.Debugger);
  2968. smalltalk.addMethod(
  2969. "_selectVariable_named_",
  2970. smalltalk.method({
  2971. selector: "selectVariable:named:",
  2972. fn: function (anObject,aString){
  2973. var self=this;
  2974. return smalltalk.withContext(function($ctx) { self["@selectedVariable"]=anObject;
  2975. self["@selectedVariableName"]=aString;
  2976. _st(self["@inspector"])._contents_((function(html){
  2977. return _st(html)._with_(_st(anObject)._printString());
  2978. }));
  2979. _st(self)._updateVariablesList();
  2980. return self}, self, "selectVariable:named:", [anObject,aString], smalltalk.Debugger)}
  2981. }),
  2982. smalltalk.Debugger);
  2983. smalltalk.addMethod(
  2984. "_source",
  2985. smalltalk.method({
  2986. selector: "source",
  2987. fn: function (){
  2988. var self=this;
  2989. return smalltalk.withContext(function($ctx) { var $2,$1;
  2990. $2=_st(self)._method();
  2991. if(($receiver = $2) == nil || $receiver == undefined){
  2992. $1="Method doesn't exist!";
  2993. } else {
  2994. $1=_st(_st(self)._method())._source();
  2995. };
  2996. return $1;
  2997. }, self, "source", [], smalltalk.Debugger)}
  2998. }),
  2999. smalltalk.Debugger);
  3000. smalltalk.addMethod(
  3001. "_updateContextsList",
  3002. smalltalk.method({
  3003. selector: "updateContextsList",
  3004. fn: function (){
  3005. var self=this;
  3006. return smalltalk.withContext(function($ctx) { _st(self["@ul"])._contents_((function(html){
  3007. return _st(self)._renderContext_on_(_st(_st(self)._error())._context(),html);
  3008. }));
  3009. return self}, self, "updateContextsList", [], smalltalk.Debugger)}
  3010. }),
  3011. smalltalk.Debugger);
  3012. smalltalk.addMethod(
  3013. "_updateInspector",
  3014. smalltalk.method({
  3015. selector: "updateInspector",
  3016. fn: function (){
  3017. var self=this;
  3018. return smalltalk.withContext(function($ctx) { _st(self["@inspector"])._contents_((function(html){
  3019. }));
  3020. return self}, self, "updateInspector", [], smalltalk.Debugger)}
  3021. }),
  3022. smalltalk.Debugger);
  3023. smalltalk.addMethod(
  3024. "_updateSourceArea",
  3025. smalltalk.method({
  3026. selector: "updateSourceArea",
  3027. fn: function (){
  3028. var self=this;
  3029. return smalltalk.withContext(function($ctx) { _st(self["@sourceArea"])._val_(_st(self)._source());
  3030. return self}, self, "updateSourceArea", [], smalltalk.Debugger)}
  3031. }),
  3032. smalltalk.Debugger);
  3033. smalltalk.addMethod(
  3034. "_updateStatus",
  3035. smalltalk.method({
  3036. selector: "updateStatus",
  3037. fn: function (){
  3038. var self=this;
  3039. return smalltalk.withContext(function($ctx) { var $1;
  3040. $1=_st(_st(self["@sourceArea"])._val()).__eq(_st(self)._source());
  3041. if(smalltalk.assert($1)){
  3042. if(($receiver = self["@saveButton"]) == nil || $receiver == undefined){
  3043. self["@saveButton"];
  3044. } else {
  3045. _st(self["@saveButton"])._at_put_("disabled",true);
  3046. };
  3047. self["@unsavedChanges"]=false;
  3048. self["@unsavedChanges"];
  3049. } else {
  3050. if(($receiver = self["@saveButton"]) == nil || $receiver == undefined){
  3051. self["@saveButton"];
  3052. } else {
  3053. _st(self["@saveButton"])._removeAt_("disabled");
  3054. };
  3055. self["@unsavedChanges"]=true;
  3056. self["@unsavedChanges"];
  3057. };
  3058. return self}, self, "updateStatus", [], smalltalk.Debugger)}
  3059. }),
  3060. smalltalk.Debugger);
  3061. smalltalk.addMethod(
  3062. "_updateVariablesList",
  3063. smalltalk.method({
  3064. selector: "updateVariablesList",
  3065. fn: function (){
  3066. var self=this;
  3067. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4,$5,$6,$7,$8,$9;
  3068. _st(self["@ul2"])._contents_((function(html){
  3069. var li;
  3070. $1=_st(html)._li();
  3071. _st($1)._with_("self");
  3072. $2=_st($1)._onClick_((function(){
  3073. return _st(self)._selectVariable_named_(_st(self)._receiver(),"self");
  3074. }));
  3075. li=$2;
  3076. li;
  3077. $3=_st(self["@selectedVariableName"]).__eq("self");
  3078. if(smalltalk.assert($3)){
  3079. _st(li)._class_("selected");
  3080. };
  3081. _st(_st(self)._arguments())._withIndexDo_((function(each,index){
  3082. var param;
  3083. param=_st(_st(self["@selectedContext"])._temps())._at_(index);
  3084. param;
  3085. $4=_st(html)._li();
  3086. _st($4)._with_(each);
  3087. $5=_st($4)._onClick_((function(){
  3088. return _st(self)._selectVariable_named_(param,each);
  3089. }));
  3090. li=$5;
  3091. li;
  3092. $6=_st(self["@selectedVariableName"]).__eq(each);
  3093. if(smalltalk.assert($6)){
  3094. return _st(li)._class_("selected");
  3095. };
  3096. }));
  3097. return _st(_st(_st(_st(self)._receiver())._class())._allInstanceVariableNames())._do_((function(each){
  3098. var ivar;
  3099. ivar=_st(_st(self)._receiver())._instVarAt_(each);
  3100. ivar;
  3101. $7=_st(html)._li();
  3102. _st($7)._with_(each);
  3103. $8=_st($7)._onClick_((function(){
  3104. return _st(self)._selectVariable_named_(ivar,each);
  3105. }));
  3106. li=$8;
  3107. li;
  3108. $9=_st(self["@selectedVariableName"]).__eq(each);
  3109. if(smalltalk.assert($9)){
  3110. return _st(li)._class_("selected");
  3111. };
  3112. }));
  3113. }));
  3114. if(($receiver = self["@selectedVariable"]) == nil || $receiver == undefined){
  3115. _st(self["@inspectButton"])._at_put_("disabled",true);
  3116. } else {
  3117. _st(self["@inspectButton"])._removeAt_("disabled");
  3118. };
  3119. return self}, self, "updateVariablesList", [], smalltalk.Debugger)}
  3120. }),
  3121. smalltalk.Debugger);
  3122. smalltalk.addClass('IDETranscript', smalltalk.TabWidget, ['textarea'], 'IDE');
  3123. smalltalk.addMethod(
  3124. "_clear",
  3125. smalltalk.method({
  3126. selector: "clear",
  3127. fn: function (){
  3128. var self=this;
  3129. return smalltalk.withContext(function($ctx) { _st(_st(self["@textarea"])._asJQuery())._val_("");
  3130. return self}, self, "clear", [], smalltalk.IDETranscript)}
  3131. }),
  3132. smalltalk.IDETranscript);
  3133. smalltalk.addMethod(
  3134. "_cr",
  3135. smalltalk.method({
  3136. selector: "cr",
  3137. fn: function (){
  3138. var self=this;
  3139. return smalltalk.withContext(function($ctx) { _st(_st(self["@textarea"])._asJQuery())._val_(_st(_st(_st(self["@textarea"])._asJQuery())._val()).__comma(_st((smalltalk.String || String))._cr()));
  3140. return self}, self, "cr", [], smalltalk.IDETranscript)}
  3141. }),
  3142. smalltalk.IDETranscript);
  3143. smalltalk.addMethod(
  3144. "_label",
  3145. smalltalk.method({
  3146. selector: "label",
  3147. fn: function (){
  3148. var self=this;
  3149. return smalltalk.withContext(function($ctx) { return "Transcript";
  3150. }, self, "label", [], smalltalk.IDETranscript)}
  3151. }),
  3152. smalltalk.IDETranscript);
  3153. smalltalk.addMethod(
  3154. "_open",
  3155. smalltalk.method({
  3156. selector: "open",
  3157. fn: function (){
  3158. var self=this;
  3159. return smalltalk.withContext(function($ctx) { var $1,$2;
  3160. $1=_st((smalltalk.TabManager || TabManager))._current();
  3161. _st($1)._open();
  3162. $2=_st($1)._selectTab_(self);
  3163. return self}, self, "open", [], smalltalk.IDETranscript)}
  3164. }),
  3165. smalltalk.IDETranscript);
  3166. smalltalk.addMethod(
  3167. "_renderBoxOn_",
  3168. smalltalk.method({
  3169. selector: "renderBoxOn:",
  3170. fn: function (html){
  3171. var self=this;
  3172. return smalltalk.withContext(function($ctx) { var $1;
  3173. self["@textarea"]=_st(html)._textarea();
  3174. _st(self["@textarea"])._class_("amber_transcript");
  3175. $1=_st(self["@textarea"])._at_put_("spellcheck","false");
  3176. return self}, self, "renderBoxOn:", [html], smalltalk.IDETranscript)}
  3177. }),
  3178. smalltalk.IDETranscript);
  3179. smalltalk.addMethod(
  3180. "_renderButtonsOn_",
  3181. smalltalk.method({
  3182. selector: "renderButtonsOn:",
  3183. fn: function (html){
  3184. var self=this;
  3185. return smalltalk.withContext(function($ctx) { var $1,$2;
  3186. $1=_st(html)._button();
  3187. _st($1)._with_("Clear transcript");
  3188. $2=_st($1)._onClick_((function(){
  3189. return _st(self)._clear();
  3190. }));
  3191. return self}, self, "renderButtonsOn:", [html], smalltalk.IDETranscript)}
  3192. }),
  3193. smalltalk.IDETranscript);
  3194. smalltalk.addMethod(
  3195. "_show_",
  3196. smalltalk.method({
  3197. selector: "show:",
  3198. fn: function (anObject){
  3199. var self=this;
  3200. return smalltalk.withContext(function($ctx) { if(($receiver = self["@textarea"]) == nil || $receiver == undefined){
  3201. _st(self)._open();
  3202. } else {
  3203. self["@textarea"];
  3204. };
  3205. _st(_st(self["@textarea"])._asJQuery())._val_(_st(_st(_st(self["@textarea"])._asJQuery())._val()).__comma(_st(anObject)._asString()));
  3206. return self}, self, "show:", [anObject], smalltalk.IDETranscript)}
  3207. }),
  3208. smalltalk.IDETranscript);
  3209. smalltalk.IDETranscript.klass.iVarNames = ['current'];
  3210. smalltalk.addMethod(
  3211. "_current",
  3212. smalltalk.method({
  3213. selector: "current",
  3214. fn: function (){
  3215. var self=this;
  3216. return smalltalk.withContext(function($ctx) { var $1;
  3217. if(($receiver = self["@current"]) == nil || $receiver == undefined){
  3218. self["@current"]=smalltalk.TabWidget.klass.fn.prototype._new.apply(_st(self), []);
  3219. $1=self["@current"];
  3220. } else {
  3221. $1=self["@current"];
  3222. };
  3223. return $1;
  3224. }, self, "current", [], smalltalk.IDETranscript.klass)}
  3225. }),
  3226. smalltalk.IDETranscript.klass);
  3227. smalltalk.addMethod(
  3228. "_initialize",
  3229. smalltalk.method({
  3230. selector: "initialize",
  3231. fn: function (){
  3232. var self=this;
  3233. return smalltalk.withContext(function($ctx) { _st((smalltalk.Transcript || Transcript))._register_(_st(self)._current());
  3234. return self}, self, "initialize", [], smalltalk.IDETranscript.klass)}
  3235. }),
  3236. smalltalk.IDETranscript.klass);
  3237. smalltalk.addMethod(
  3238. "_new",
  3239. smalltalk.method({
  3240. selector: "new",
  3241. fn: function (){
  3242. var self=this;
  3243. return smalltalk.withContext(function($ctx) { _st(self)._shouldNotImplement();
  3244. return self}, self, "new", [], smalltalk.IDETranscript.klass)}
  3245. }),
  3246. smalltalk.IDETranscript.klass);
  3247. smalltalk.addMethod(
  3248. "_open",
  3249. smalltalk.method({
  3250. selector: "open",
  3251. fn: function (){
  3252. var self=this;
  3253. return smalltalk.withContext(function($ctx) { var $1,$2;
  3254. $1=_st((smalltalk.TabManager || TabManager))._current();
  3255. _st($1)._open();
  3256. $2=_st($1)._selectTab_(_st(self)._current());
  3257. return self}, self, "open", [], smalltalk.IDETranscript.klass)}
  3258. }),
  3259. smalltalk.IDETranscript.klass);
  3260. smalltalk.addClass('Inspector', smalltalk.TabWidget, ['label', 'variables', 'object', 'selectedVariable', 'variablesList', 'valueTextarea', 'diveButton', 'sourceArea'], 'IDE');
  3261. smalltalk.addMethod(
  3262. "_canBeClosed",
  3263. smalltalk.method({
  3264. selector: "canBeClosed",
  3265. fn: function (){
  3266. var self=this;
  3267. return smalltalk.withContext(function($ctx) { return true;
  3268. }, self, "canBeClosed", [], smalltalk.Inspector)}
  3269. }),
  3270. smalltalk.Inspector);
  3271. smalltalk.addMethod(
  3272. "_dive",
  3273. smalltalk.method({
  3274. selector: "dive",
  3275. fn: function (){
  3276. var self=this;
  3277. return smalltalk.withContext(function($ctx) { _st(_st(_st(self)._variables())._at_(_st(self)._selectedVariable()))._inspect();
  3278. return self}, self, "dive", [], smalltalk.Inspector)}
  3279. }),
  3280. smalltalk.Inspector);
  3281. smalltalk.addMethod(
  3282. "_inspect_",
  3283. smalltalk.method({
  3284. selector: "inspect:",
  3285. fn: function (anObject){
  3286. var self=this;
  3287. return smalltalk.withContext(function($ctx) { self["@object"]=anObject;
  3288. self["@variables"]=[];
  3289. _st(self["@object"])._inspectOn_(self);
  3290. return self}, self, "inspect:", [anObject], smalltalk.Inspector)}
  3291. }),
  3292. smalltalk.Inspector);
  3293. smalltalk.addMethod(
  3294. "_label",
  3295. smalltalk.method({
  3296. selector: "label",
  3297. fn: function (){
  3298. var self=this;
  3299. return smalltalk.withContext(function($ctx) { var $1;
  3300. if(($receiver = self["@label"]) == nil || $receiver == undefined){
  3301. $1="Inspector (nil)";
  3302. } else {
  3303. $1=self["@label"];
  3304. };
  3305. return $1;
  3306. }, self, "label", [], smalltalk.Inspector)}
  3307. }),
  3308. smalltalk.Inspector);
  3309. smalltalk.addMethod(
  3310. "_refresh",
  3311. smalltalk.method({
  3312. selector: "refresh",
  3313. fn: function (){
  3314. var self=this;
  3315. return smalltalk.withContext(function($ctx) { var $1;
  3316. _st(self)._inspect_(self["@object"]);
  3317. _st(self)._updateVariablesList();
  3318. $1=_st(self)._updateValueTextarea();
  3319. return self}, self, "refresh", [], smalltalk.Inspector)}
  3320. }),
  3321. smalltalk.Inspector);
  3322. smalltalk.addMethod(
  3323. "_renderBottomPanelOn_",
  3324. smalltalk.method({
  3325. selector: "renderBottomPanelOn:",
  3326. fn: function (html){
  3327. var self=this;
  3328. return smalltalk.withContext(function($ctx) { var $1,$3,$4,$2;
  3329. $1=_st(html)._div();
  3330. _st($1)._class_("amber_sourceCode");
  3331. $2=_st($1)._with_((function(){
  3332. $3=_st((smalltalk.SourceArea || SourceArea))._new();
  3333. _st($3)._receiver_(self["@object"]);
  3334. _st($3)._onDoIt_((function(){
  3335. return _st(self)._refresh();
  3336. }));
  3337. $4=_st($3)._yourself();
  3338. self["@sourceArea"]=$4;
  3339. self["@sourceArea"];
  3340. return _st(self["@sourceArea"])._renderOn_(html);
  3341. }));
  3342. return self}, self, "renderBottomPanelOn:", [html], smalltalk.Inspector)}
  3343. }),
  3344. smalltalk.Inspector);
  3345. smalltalk.addMethod(
  3346. "_renderBoxOn_",
  3347. smalltalk.method({
  3348. selector: "renderBoxOn:",
  3349. fn: function (html){
  3350. var self=this;
  3351. return smalltalk.withContext(function($ctx) { var $1;
  3352. _st(self)._renderTopPanelOn_(html);
  3353. $1=_st(self)._renderBottomPanelOn_(html);
  3354. return self}, self, "renderBoxOn:", [html], smalltalk.Inspector)}
  3355. }),
  3356. smalltalk.Inspector);
  3357. smalltalk.addMethod(
  3358. "_renderButtonsOn_",
  3359. smalltalk.method({
  3360. selector: "renderButtonsOn:",
  3361. fn: function (html){
  3362. var self=this;
  3363. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4,$5,$6;
  3364. $1=_st(html)._button();
  3365. _st($1)._with_("DoIt");
  3366. $2=_st($1)._onClick_((function(){
  3367. return _st(_st(self)._sourceArea())._doIt();
  3368. }));
  3369. $3=_st(html)._button();
  3370. _st($3)._with_("PrintIt");
  3371. $4=_st($3)._onClick_((function(){
  3372. return _st(_st(self)._sourceArea())._printIt();
  3373. }));
  3374. $5=_st(html)._button();
  3375. _st($5)._with_("InspectIt");
  3376. $6=_st($5)._onClick_((function(){
  3377. return _st(_st(self)._sourceArea())._inspectIt();
  3378. }));
  3379. _st(self)._updateButtons();
  3380. return self}, self, "renderButtonsOn:", [html], smalltalk.Inspector)}
  3381. }),
  3382. smalltalk.Inspector);
  3383. smalltalk.addMethod(
  3384. "_renderTopPanelOn_",
  3385. smalltalk.method({
  3386. selector: "renderTopPanelOn:",
  3387. fn: function (html){
  3388. var self=this;
  3389. return smalltalk.withContext(function($ctx) { var $1,$3,$4,$5,$7,$8,$9,$10,$6,$2,$11;
  3390. $1=_st(html)._div();
  3391. _st($1)._class_("top");
  3392. $2=_st($1)._with_((function(){
  3393. self["@variablesList"]=_st(_st(html)._ul())._class_("amber_column variables");
  3394. self["@variablesList"];
  3395. $3=_st(html)._textarea();
  3396. _st($3)._class_("amber_column value");
  3397. $4=_st($3)._at_put_("readonly","readonly");
  3398. self["@valueTextarea"]=$4;
  3399. self["@valueTextarea"];
  3400. $5=_st(html)._div();
  3401. _st($5)._class_("amber_tabs inspector");
  3402. $6=_st($5)._with_((function(){
  3403. $7=_st(html)._button();
  3404. _st($7)._class_("amber_button inspector refresh");
  3405. _st($7)._with_("Refresh");
  3406. $8=_st($7)._onClick_((function(){
  3407. return _st(self)._refresh();
  3408. }));
  3409. $8;
  3410. $9=_st(html)._button();
  3411. _st($9)._class_("amber_button inspector dive");
  3412. _st($9)._with_("Dive");
  3413. $10=_st($9)._onClick_((function(){
  3414. return _st(self)._dive();
  3415. }));
  3416. self["@diveButton"]=$10;
  3417. return self["@diveButton"];
  3418. }));
  3419. $6;
  3420. return _st(_st(html)._div())._class_("amber_clear");
  3421. }));
  3422. _st(self)._updateVariablesList();
  3423. $11=_st(self)._updateValueTextarea();
  3424. return self}, self, "renderTopPanelOn:", [html], smalltalk.Inspector)}
  3425. }),
  3426. smalltalk.Inspector);
  3427. smalltalk.addMethod(
  3428. "_selectVariable_",
  3429. smalltalk.method({
  3430. selector: "selectVariable:",
  3431. fn: function (aString){
  3432. var self=this;
  3433. return smalltalk.withContext(function($ctx) { var $1;
  3434. _st(self)._selectedVariable_(aString);
  3435. _st(self)._updateVariablesList();
  3436. _st(self)._updateValueTextarea();
  3437. $1=_st(self)._updateButtons();
  3438. return self}, self, "selectVariable:", [aString], smalltalk.Inspector)}
  3439. }),
  3440. smalltalk.Inspector);
  3441. smalltalk.addMethod(
  3442. "_selectedVariable",
  3443. smalltalk.method({
  3444. selector: "selectedVariable",
  3445. fn: function (){
  3446. var self=this;
  3447. return smalltalk.withContext(function($ctx) { return self["@selectedVariable"];
  3448. }, self, "selectedVariable", [], smalltalk.Inspector)}
  3449. }),
  3450. smalltalk.Inspector);
  3451. smalltalk.addMethod(
  3452. "_selectedVariable_",
  3453. smalltalk.method({
  3454. selector: "selectedVariable:",
  3455. fn: function (aString){
  3456. var self=this;
  3457. return smalltalk.withContext(function($ctx) { self["@selectedVariable"]=aString;
  3458. return self}, self, "selectedVariable:", [aString], smalltalk.Inspector)}
  3459. }),
  3460. smalltalk.Inspector);
  3461. smalltalk.addMethod(
  3462. "_setLabel_",
  3463. smalltalk.method({
  3464. selector: "setLabel:",
  3465. fn: function (aString){
  3466. var self=this;
  3467. return smalltalk.withContext(function($ctx) { self["@label"]=aString;
  3468. return self}, self, "setLabel:", [aString], smalltalk.Inspector)}
  3469. }),
  3470. smalltalk.Inspector);
  3471. smalltalk.addMethod(
  3472. "_setVariables_",
  3473. smalltalk.method({
  3474. selector: "setVariables:",
  3475. fn: function (aCollection){
  3476. var self=this;
  3477. return smalltalk.withContext(function($ctx) { self["@variables"]=aCollection;
  3478. return self}, self, "setVariables:", [aCollection], smalltalk.Inspector)}
  3479. }),
  3480. smalltalk.Inspector);
  3481. smalltalk.addMethod(
  3482. "_sourceArea",
  3483. smalltalk.method({
  3484. selector: "sourceArea",
  3485. fn: function (){
  3486. var self=this;
  3487. return smalltalk.withContext(function($ctx) { return self["@sourceArea"];
  3488. }, self, "sourceArea", [], smalltalk.Inspector)}
  3489. }),
  3490. smalltalk.Inspector);
  3491. smalltalk.addMethod(
  3492. "_updateButtons",
  3493. smalltalk.method({
  3494. selector: "updateButtons",
  3495. fn: function (){
  3496. var self=this;
  3497. return smalltalk.withContext(function($ctx) { var $1;
  3498. $1=_st(_st(_st(self)._selectedVariable())._notNil())._and_((function(){
  3499. return _st(_st(_st(self)._variables())._at_(_st(self)._selectedVariable()))._notNil();
  3500. }));
  3501. if(smalltalk.assert($1)){
  3502. _st(self["@diveButton"])._removeAt_("disabled");
  3503. } else {
  3504. _st(self["@diveButton"])._at_put_("disabled",true);
  3505. };
  3506. return self}, self, "updateButtons", [], smalltalk.Inspector)}
  3507. }),
  3508. smalltalk.Inspector);
  3509. smalltalk.addMethod(
  3510. "_updateValueTextarea",
  3511. smalltalk.method({
  3512. selector: "updateValueTextarea",
  3513. fn: function (){
  3514. var self=this;
  3515. return smalltalk.withContext(function($ctx) { var $2,$1;
  3516. $2=_st(_st(self)._selectedVariable())._isNil();
  3517. if(smalltalk.assert($2)){
  3518. $1="";
  3519. } else {
  3520. $1=_st(_st(_st(self)._variables())._at_(_st(self)._selectedVariable()))._printString();
  3521. };
  3522. _st(_st(self["@valueTextarea"])._asJQuery())._val_($1);
  3523. return self}, self, "updateValueTextarea", [], smalltalk.Inspector)}
  3524. }),
  3525. smalltalk.Inspector);
  3526. smalltalk.addMethod(
  3527. "_updateVariablesList",
  3528. smalltalk.method({
  3529. selector: "updateVariablesList",
  3530. fn: function (){
  3531. var self=this;
  3532. return smalltalk.withContext(function($ctx) { var $1,$2;
  3533. _st(self["@variablesList"])._contents_((function(html){
  3534. return _st(_st(_st(self)._variables())._keys())._do_((function(each){
  3535. var li;
  3536. li=_st(html)._li();
  3537. li;
  3538. _st(li)._with_(each);
  3539. $1=_st(li)._onClick_((function(){
  3540. return _st(self)._selectVariable_(each);
  3541. }));
  3542. $1;
  3543. $2=_st(_st(self)._selectedVariable()).__eq(each);
  3544. if(smalltalk.assert($2)){
  3545. return _st(li)._class_("selected");
  3546. };
  3547. }));
  3548. }));
  3549. return self}, self, "updateVariablesList", [], smalltalk.Inspector)}
  3550. }),
  3551. smalltalk.Inspector);
  3552. smalltalk.addMethod(
  3553. "_variables",
  3554. smalltalk.method({
  3555. selector: "variables",
  3556. fn: function (){
  3557. var self=this;
  3558. return smalltalk.withContext(function($ctx) { return self["@variables"];
  3559. }, self, "variables", [], smalltalk.Inspector)}
  3560. }),
  3561. smalltalk.Inspector);
  3562. smalltalk.addMethod(
  3563. "_on_",
  3564. smalltalk.method({
  3565. selector: "on:",
  3566. fn: function (anObject){
  3567. var self=this;
  3568. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  3569. $2=_st(self)._new();
  3570. _st($2)._inspect_(anObject);
  3571. $3=_st($2)._yourself();
  3572. $1=$3;
  3573. return $1;
  3574. }, self, "on:", [anObject], smalltalk.Inspector.klass)}
  3575. }),
  3576. smalltalk.Inspector.klass);
  3577. smalltalk.addClass('ProgressBar', smalltalk.TabWidget, ['percent', 'progressDiv', 'div'], 'IDE');
  3578. smalltalk.addMethod(
  3579. "_percent",
  3580. smalltalk.method({
  3581. selector: "percent",
  3582. fn: function (){
  3583. var self=this;
  3584. return smalltalk.withContext(function($ctx) { var $1;
  3585. if(($receiver = self["@percent"]) == nil || $receiver == undefined){
  3586. $1=(0);
  3587. } else {
  3588. $1=self["@percent"];
  3589. };
  3590. return $1;
  3591. }, self, "percent", [], smalltalk.ProgressBar)}
  3592. }),
  3593. smalltalk.ProgressBar);
  3594. smalltalk.addMethod(
  3595. "_percent_",
  3596. smalltalk.method({
  3597. selector: "percent:",
  3598. fn: function (aNumber){
  3599. var self=this;
  3600. return smalltalk.withContext(function($ctx) { self["@percent"]=aNumber;
  3601. return self}, self, "percent:", [aNumber], smalltalk.ProgressBar)}
  3602. }),
  3603. smalltalk.ProgressBar);
  3604. smalltalk.addMethod(
  3605. "_renderOn_",
  3606. smalltalk.method({
  3607. selector: "renderOn:",
  3608. fn: function (html){
  3609. var self=this;
  3610. return smalltalk.withContext(function($ctx) { var $1,$2;
  3611. $1=_st(html)._div();
  3612. _st($1)._class_("progress_bar");
  3613. $2=_st($1)._yourself();
  3614. self["@div"]=$2;
  3615. _st(self)._renderProgressBar();
  3616. return self}, self, "renderOn:", [html], smalltalk.ProgressBar)}
  3617. }),
  3618. smalltalk.ProgressBar);
  3619. smalltalk.addMethod(
  3620. "_renderProgressBar",
  3621. smalltalk.method({
  3622. selector: "renderProgressBar",
  3623. fn: function (){
  3624. var self=this;
  3625. return smalltalk.withContext(function($ctx) { var $1,$2;
  3626. _st(self["@div"])._contents_((function(html){
  3627. $1=_st(html)._div();
  3628. _st($1)._class_("progress");
  3629. $2=_st($1)._style_(_st(_st("width:").__comma(_st(_st(self)._percent())._asString())).__comma("%"));
  3630. return $2;
  3631. }));
  3632. return self}, self, "renderProgressBar", [], smalltalk.ProgressBar)}
  3633. }),
  3634. smalltalk.ProgressBar);
  3635. smalltalk.addMethod(
  3636. "_updatePercent_",
  3637. smalltalk.method({
  3638. selector: "updatePercent:",
  3639. fn: function (aNumber){
  3640. var self=this;
  3641. return smalltalk.withContext(function($ctx) { _st(self)._percent_(aNumber);
  3642. _st(self)._renderProgressBar();
  3643. return self}, self, "updatePercent:", [aNumber], smalltalk.ProgressBar)}
  3644. }),
  3645. smalltalk.ProgressBar);
  3646. smalltalk.addClass('ReferencesBrowser', smalltalk.TabWidget, ['implementors', 'senders', 'implementorsList', 'input', 'timer', 'selector', 'sendersList', 'referencedClasses', 'referencedClassesList', 'matches', 'matchesList'], 'IDE');
  3647. smalltalk.addMethod(
  3648. "_canBeClosed",
  3649. smalltalk.method({
  3650. selector: "canBeClosed",
  3651. fn: function (){
  3652. var self=this;
  3653. return smalltalk.withContext(function($ctx) { return true;
  3654. }, self, "canBeClosed", [], smalltalk.ReferencesBrowser)}
  3655. }),
  3656. smalltalk.ReferencesBrowser);
  3657. smalltalk.addMethod(
  3658. "_classesAndMetaclasses",
  3659. smalltalk.method({
  3660. selector: "classesAndMetaclasses",
  3661. fn: function (){
  3662. var self=this;
  3663. return smalltalk.withContext(function($ctx) { var $1;
  3664. $1=_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes()).__comma(_st(_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._classes())._collect_((function(each){
  3665. return _st(each)._class();
  3666. })));
  3667. return $1;
  3668. }, self, "classesAndMetaclasses", [], smalltalk.ReferencesBrowser)}
  3669. }),
  3670. smalltalk.ReferencesBrowser);
  3671. smalltalk.addMethod(
  3672. "_implementors",
  3673. smalltalk.method({
  3674. selector: "implementors",
  3675. fn: function (){
  3676. var self=this;
  3677. return smalltalk.withContext(function($ctx) { var $1;
  3678. if(($receiver = self["@implementors"]) == nil || $receiver == undefined){
  3679. self["@implementors"]=_st((smalltalk.Array || Array))._new();
  3680. $1=self["@implementors"];
  3681. } else {
  3682. $1=self["@implementors"];
  3683. };
  3684. return $1;
  3685. }, self, "implementors", [], smalltalk.ReferencesBrowser)}
  3686. }),
  3687. smalltalk.ReferencesBrowser);
  3688. smalltalk.addMethod(
  3689. "_initialize",
  3690. smalltalk.method({
  3691. selector: "initialize",
  3692. fn: function (){
  3693. var self=this;
  3694. return smalltalk.withContext(function($ctx) { smalltalk.TabWidget.fn.prototype._initialize.apply(_st(self), []);
  3695. self["@selector"]="";
  3696. return self}, self, "initialize", [], smalltalk.ReferencesBrowser)}
  3697. }),
  3698. smalltalk.ReferencesBrowser);
  3699. smalltalk.addMethod(
  3700. "_label",
  3701. smalltalk.method({
  3702. selector: "label",
  3703. fn: function (){
  3704. var self=this;
  3705. return smalltalk.withContext(function($ctx) { return "[References]";
  3706. }, self, "label", [], smalltalk.ReferencesBrowser)}
  3707. }),
  3708. smalltalk.ReferencesBrowser);
  3709. smalltalk.addMethod(
  3710. "_matches",
  3711. smalltalk.method({
  3712. selector: "matches",
  3713. fn: function (){
  3714. var self=this;
  3715. return smalltalk.withContext(function($ctx) { var $1;
  3716. if(($receiver = self["@matches"]) == nil || $receiver == undefined){
  3717. self["@matches"]=_st((smalltalk.Array || Array))._new();
  3718. $1=self["@matches"];
  3719. } else {
  3720. $1=self["@matches"];
  3721. };
  3722. return $1;
  3723. }, self, "matches", [], smalltalk.ReferencesBrowser)}
  3724. }),
  3725. smalltalk.ReferencesBrowser);
  3726. smalltalk.addMethod(
  3727. "_openBrowserOn_",
  3728. smalltalk.method({
  3729. selector: "openBrowserOn:",
  3730. fn: function (aMethod){
  3731. var self=this;
  3732. return smalltalk.withContext(function($ctx) { var $2,$1,$3,$4;
  3733. var browser;
  3734. $2=_st(_st(aMethod)._methodClass())._isMetaclass();
  3735. if(smalltalk.assert($2)){
  3736. $1=_st(_st(aMethod)._methodClass())._instanceClass();
  3737. } else {
  3738. $1=_st(aMethod)._methodClass();
  3739. };
  3740. browser=_st((smalltalk.Browser || Browser))._openOn_($1);
  3741. $3=_st(_st(aMethod)._methodClass())._isMetaclass();
  3742. if(smalltalk.assert($3)){
  3743. _st(browser)._selectTab_(smalltalk.symbolFor("class"));
  3744. };
  3745. _st(browser)._selectProtocol_(_st(aMethod)._category());
  3746. $4=_st(browser)._selectMethod_(aMethod);
  3747. return self}, self, "openBrowserOn:", [aMethod], smalltalk.ReferencesBrowser)}
  3748. }),
  3749. smalltalk.ReferencesBrowser);
  3750. smalltalk.addMethod(
  3751. "_referencedClasses",
  3752. smalltalk.method({
  3753. selector: "referencedClasses",
  3754. fn: function (){
  3755. var self=this;
  3756. return smalltalk.withContext(function($ctx) { var $1;
  3757. if(($receiver = self["@referencedClasses"]) == nil || $receiver == undefined){
  3758. self["@referencedClasses"]=_st((smalltalk.Array || Array))._new();
  3759. $1=self["@referencedClasses"];
  3760. } else {
  3761. $1=self["@referencedClasses"];
  3762. };
  3763. return $1;
  3764. }, self, "referencedClasses", [], smalltalk.ReferencesBrowser)}
  3765. }),
  3766. smalltalk.ReferencesBrowser);
  3767. smalltalk.addMethod(
  3768. "_renderBoxOn_",
  3769. smalltalk.method({
  3770. selector: "renderBoxOn:",
  3771. fn: function (html){
  3772. var self=this;
  3773. return smalltalk.withContext(function($ctx) { var $1;
  3774. _st(self)._renderInputOn_(html);
  3775. _st(self)._renderImplementorsOn_(html);
  3776. _st(self)._renderSendersOn_(html);
  3777. _st(self)._renderReferencedClassesOn_(html);
  3778. $1=_st(self)._renderMatchesOn_(html);
  3779. return self}, self, "renderBoxOn:", [html], smalltalk.ReferencesBrowser)}
  3780. }),
  3781. smalltalk.ReferencesBrowser);
  3782. smalltalk.addMethod(
  3783. "_renderImplementorsOn_",
  3784. smalltalk.method({
  3785. selector: "renderImplementorsOn:",
  3786. fn: function (html){
  3787. var self=this;
  3788. return smalltalk.withContext(function($ctx) { self["@implementorsList"]=_st(_st(html)._ul())._class_("amber_column implementors");
  3789. _st(self)._updateImplementorsList();
  3790. return self}, self, "renderImplementorsOn:", [html], smalltalk.ReferencesBrowser)}
  3791. }),
  3792. smalltalk.ReferencesBrowser);
  3793. smalltalk.addMethod(
  3794. "_renderInputOn_",
  3795. smalltalk.method({
  3796. selector: "renderInputOn:",
  3797. fn: function (html){
  3798. var self=this;
  3799. return smalltalk.withContext(function($ctx) { var $1,$2;
  3800. $1=_st(html)._input();
  3801. _st($1)._class_("implementors");
  3802. $2=_st($1)._yourself();
  3803. self["@input"]=$2;
  3804. _st(_st(self["@input"])._asJQuery())._val_(self["@selector"]);
  3805. _st(self)._setInputEvents();
  3806. return self}, self, "renderInputOn:", [html], smalltalk.ReferencesBrowser)}
  3807. }),
  3808. smalltalk.ReferencesBrowser);
  3809. smalltalk.addMethod(
  3810. "_renderMatchesOn_",
  3811. smalltalk.method({
  3812. selector: "renderMatchesOn:",
  3813. fn: function (html){
  3814. var self=this;
  3815. return smalltalk.withContext(function($ctx) { self["@matchesList"]=_st(_st(html)._ul())._class_("amber_column matches");
  3816. _st(self)._updateMatchesList();
  3817. return self}, self, "renderMatchesOn:", [html], smalltalk.ReferencesBrowser)}
  3818. }),
  3819. smalltalk.ReferencesBrowser);
  3820. smalltalk.addMethod(
  3821. "_renderReferencedClassesOn_",
  3822. smalltalk.method({
  3823. selector: "renderReferencedClassesOn:",
  3824. fn: function (html){
  3825. var self=this;
  3826. return smalltalk.withContext(function($ctx) { self["@referencedClassesList"]=_st(_st(html)._ul())._class_("amber_column referenced_classes");
  3827. _st(self)._updateReferencedClassesList();
  3828. return self}, self, "renderReferencedClassesOn:", [html], smalltalk.ReferencesBrowser)}
  3829. }),
  3830. smalltalk.ReferencesBrowser);
  3831. smalltalk.addMethod(
  3832. "_renderSendersOn_",
  3833. smalltalk.method({
  3834. selector: "renderSendersOn:",
  3835. fn: function (html){
  3836. var self=this;
  3837. return smalltalk.withContext(function($ctx) { self["@sendersList"]=_st(_st(html)._ul())._class_("amber_column senders");
  3838. _st(self)._updateSendersList();
  3839. return self}, self, "renderSendersOn:", [html], smalltalk.ReferencesBrowser)}
  3840. }),
  3841. smalltalk.ReferencesBrowser);
  3842. smalltalk.addMethod(
  3843. "_search_",
  3844. smalltalk.method({
  3845. selector: "search:",
  3846. fn: function (aString){
  3847. var self=this;
  3848. return smalltalk.withContext(function($ctx) { var $1;
  3849. _st(self)._searchReferencesFor_(aString);
  3850. _st(self)._updateImplementorsList();
  3851. _st(self)._updateSendersList();
  3852. _st(self)._updateReferencedClassesList();
  3853. $1=_st(self)._updateMatchesList();
  3854. return self}, self, "search:", [aString], smalltalk.ReferencesBrowser)}
  3855. }),
  3856. smalltalk.ReferencesBrowser);
  3857. smalltalk.addMethod(
  3858. "_searchMethodSource",
  3859. smalltalk.method({
  3860. selector: "searchMethodSource",
  3861. fn: function (){
  3862. var self=this;
  3863. return smalltalk.withContext(function($ctx) { var $1;
  3864. var regex;
  3865. regex=_st(self["@selector"])._allButFirst();
  3866. _st(_st(self)._classesAndMetaclasses())._do_((function(each){
  3867. return _st(_st(_st(each)._methodDictionary())._values())._do_((function(value){
  3868. $1=_st(_st(value)._source())._match_(regex);
  3869. if(smalltalk.assert($1)){
  3870. return _st(_st(self)._matches())._add_(value);
  3871. };
  3872. }));
  3873. }));
  3874. return self}, self, "searchMethodSource", [], smalltalk.ReferencesBrowser)}
  3875. }),
  3876. smalltalk.ReferencesBrowser);
  3877. smalltalk.addMethod(
  3878. "_searchReferencedClasses",
  3879. smalltalk.method({
  3880. selector: "searchReferencedClasses",
  3881. fn: function (){
  3882. var self=this;
  3883. return smalltalk.withContext(function($ctx) { var $1;
  3884. _st(_st(self)._classesAndMetaclasses())._do_((function(each){
  3885. return _st(_st(_st(each)._methodDictionary())._values())._do_((function(value){
  3886. $1=_st(_st(value)._referencedClasses())._includes_(self["@selector"]);
  3887. if(smalltalk.assert($1)){
  3888. return _st(_st(self)._referencedClasses())._add_(value);
  3889. };
  3890. }));
  3891. }));
  3892. return self}, self, "searchReferencedClasses", [], smalltalk.ReferencesBrowser)}
  3893. }),
  3894. smalltalk.ReferencesBrowser);
  3895. smalltalk.addMethod(
  3896. "_searchReferencesFor_",
  3897. smalltalk.method({
  3898. selector: "searchReferencesFor:",
  3899. fn: function (aString){
  3900. var self=this;
  3901. return smalltalk.withContext(function($ctx) { var $1;
  3902. self["@selector"]=aString;
  3903. self["@implementors"]=_st((smalltalk.Array || Array))._new();
  3904. self["@senders"]=_st((smalltalk.Array || Array))._new();
  3905. self["@referencedClasses"]=_st((smalltalk.Array || Array))._new();
  3906. self["@matches"]=_st((smalltalk.Array || Array))._new();
  3907. _st(self)._searchMethodSource();
  3908. $1=_st(self["@selector"])._match_("^[A-Z]");
  3909. if(smalltalk.assert($1)){
  3910. _st(self)._searchReferencedClasses();
  3911. } else {
  3912. _st(self)._searchSelectorReferences();
  3913. };
  3914. return self}, self, "searchReferencesFor:", [aString], smalltalk.ReferencesBrowser)}
  3915. }),
  3916. smalltalk.ReferencesBrowser);
  3917. smalltalk.addMethod(
  3918. "_searchSelectorReferences",
  3919. smalltalk.method({
  3920. selector: "searchSelectorReferences",
  3921. fn: function (){
  3922. var self=this;
  3923. return smalltalk.withContext(function($ctx) { var $1,$2;
  3924. _st(_st(self)._classesAndMetaclasses())._do_((function(each){
  3925. return _st(_st(each)._methodDictionary())._keysAndValuesDo_((function(key,value){
  3926. $1=_st(key).__eq(self["@selector"]);
  3927. if(smalltalk.assert($1)){
  3928. _st(_st(self)._implementors())._add_(value);
  3929. };
  3930. $2=_st(_st(value)._messageSends())._includes_(self["@selector"]);
  3931. if(smalltalk.assert($2)){
  3932. return _st(_st(self)._senders())._add_(value);
  3933. };
  3934. }));
  3935. }));
  3936. return self}, self, "searchSelectorReferences", [], smalltalk.ReferencesBrowser)}
  3937. }),
  3938. smalltalk.ReferencesBrowser);
  3939. smalltalk.addMethod(
  3940. "_selector",
  3941. smalltalk.method({
  3942. selector: "selector",
  3943. fn: function (){
  3944. var self=this;
  3945. return smalltalk.withContext(function($ctx) { return self["@selector"];
  3946. }, self, "selector", [], smalltalk.ReferencesBrowser)}
  3947. }),
  3948. smalltalk.ReferencesBrowser);
  3949. smalltalk.addMethod(
  3950. "_senders",
  3951. smalltalk.method({
  3952. selector: "senders",
  3953. fn: function (){
  3954. var self=this;
  3955. return smalltalk.withContext(function($ctx) { var $1;
  3956. if(($receiver = self["@senders"]) == nil || $receiver == undefined){
  3957. self["@senders"]=_st((smalltalk.Array || Array))._new();
  3958. $1=self["@senders"];
  3959. } else {
  3960. $1=self["@senders"];
  3961. };
  3962. return $1;
  3963. }, self, "senders", [], smalltalk.ReferencesBrowser)}
  3964. }),
  3965. smalltalk.ReferencesBrowser);
  3966. smalltalk.addMethod(
  3967. "_setInputEvents",
  3968. smalltalk.method({
  3969. selector: "setInputEvents",
  3970. fn: function (){
  3971. var self=this;
  3972. return smalltalk.withContext(function($ctx) { var $1;
  3973. _st(self["@input"])._onKeyUp_((function(){
  3974. self["@timer"]=_st((function(){
  3975. return _st(self)._search_(_st(_st(self["@input"])._asJQuery())._val());
  3976. }))._valueWithTimeout_((100));
  3977. return self["@timer"];
  3978. }));
  3979. $1=_st(self["@input"])._onKeyDown_((function(){
  3980. if(($receiver = self["@timer"]) == nil || $receiver == undefined){
  3981. return self["@timer"];
  3982. } else {
  3983. return _st(self["@timer"])._clearTimeout();
  3984. };
  3985. }));
  3986. return self}, self, "setInputEvents", [], smalltalk.ReferencesBrowser)}
  3987. }),
  3988. smalltalk.ReferencesBrowser);
  3989. smalltalk.addMethod(
  3990. "_updateImplementorsList",
  3991. smalltalk.method({
  3992. selector: "updateImplementorsList",
  3993. fn: function (){
  3994. var self=this;
  3995. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  3996. _st(self["@implementorsList"])._contents_((function(html){
  3997. $1=_st(html)._li();
  3998. _st($1)._class_("column_label");
  3999. _st($1)._with_(_st(_st("Implementors (").__comma(_st(_st(_st(self)._implementors())._size())._asString())).__comma(")"));
  4000. $2=_st($1)._style_("font-weight: bold");
  4001. $2;
  4002. return _st(_st(self)._implementors())._do_((function(each){
  4003. var li;
  4004. li=_st(html)._li();
  4005. li;
  4006. _st(li)._with_(_st(_st(_st(_st(each)._methodClass())._asString()).__comma(" >> ")).__comma(_st(self)._selector()));
  4007. $3=_st(li)._onClick_((function(){
  4008. return _st(self)._openBrowserOn_(each);
  4009. }));
  4010. return $3;
  4011. }));
  4012. }));
  4013. return self}, self, "updateImplementorsList", [], smalltalk.ReferencesBrowser)}
  4014. }),
  4015. smalltalk.ReferencesBrowser);
  4016. smalltalk.addMethod(
  4017. "_updateMatchesList",
  4018. smalltalk.method({
  4019. selector: "updateMatchesList",
  4020. fn: function (){
  4021. var self=this;
  4022. return smalltalk.withContext(function($ctx) { var $1,$2,$3;
  4023. _st(self["@matchesList"])._contents_((function(html){
  4024. $1=_st(html)._li();
  4025. _st($1)._class_("column_label");
  4026. _st($1)._with_(_st(_st("Regex matches (").__comma(_st(_st(_st(self)._matches())._size())._asString())).__comma(")"));
  4027. $2=_st($1)._style_("font-weight: bold");
  4028. $2;
  4029. return _st(_st(self)._matches())._do_((function(each){
  4030. var li;
  4031. li=_st(html)._li();
  4032. li;
  4033. _st(li)._with_(_st(_st(_st(_st(each)._methodClass())._asString()).__comma(" >> ")).__comma(_st(each)._selector()));
  4034. $3=_st(li)._onClick_((function(){
  4035. return _st(self)._openBrowserOn_(each);
  4036. }));
  4037. return $3;
  4038. }));
  4039. }));
  4040. return self}, self, "updateMatchesList", [], smalltalk.ReferencesBrowser)}
  4041. }),
  4042. smalltalk.ReferencesBrowser);
  4043. smalltalk.addMethod(
  4044. "_updateReferencedClassesList",
  4045. smalltalk.method({
  4046. selector: "updateReferencedClassesList",
  4047. fn: function (){
  4048. var self=this;
  4049. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4;
  4050. _st(self["@referencedClassesList"])._contents_((function(html){
  4051. $1=_st(html)._li();
  4052. _st($1)._class_("column_label");
  4053. _st($1)._with_(_st(_st("Class references (").__comma(_st(_st(_st(self)._referencedClasses())._size())._asString())).__comma(")"));
  4054. $2=_st($1)._style_("font-weight: bold");
  4055. $2;
  4056. return _st(_st(self)._referencedClasses())._do_((function(each){
  4057. $3=_st(html)._li();
  4058. _st($3)._with_(_st(_st(_st(_st(each)._methodClass())._asString()).__comma(" >> ")).__comma(_st(each)._selector()));
  4059. $4=_st($3)._onClick_((function(){
  4060. return _st(self)._openBrowserOn_(each);
  4061. }));
  4062. return $4;
  4063. }));
  4064. }));
  4065. return self}, self, "updateReferencedClassesList", [], smalltalk.ReferencesBrowser)}
  4066. }),
  4067. smalltalk.ReferencesBrowser);
  4068. smalltalk.addMethod(
  4069. "_updateSendersList",
  4070. smalltalk.method({
  4071. selector: "updateSendersList",
  4072. fn: function (){
  4073. var self=this;
  4074. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4;
  4075. _st(self["@sendersList"])._contents_((function(html){
  4076. $1=_st(html)._li();
  4077. _st($1)._class_("column_label");
  4078. _st($1)._with_(_st(_st("Senders (").__comma(_st(_st(_st(self)._senders())._size())._asString())).__comma(")"));
  4079. $2=_st($1)._style_("font-weight: bold");
  4080. $2;
  4081. return _st(_st(self)._senders())._do_((function(each){
  4082. $3=_st(html)._li();
  4083. _st($3)._with_(_st(_st(_st(_st(each)._methodClass())._asString()).__comma(" >> ")).__comma(_st(each)._selector()));
  4084. $4=_st($3)._onClick_((function(){
  4085. return _st(self)._openBrowserOn_(each);
  4086. }));
  4087. return $4;
  4088. }));
  4089. }));
  4090. return self}, self, "updateSendersList", [], smalltalk.ReferencesBrowser)}
  4091. }),
  4092. smalltalk.ReferencesBrowser);
  4093. smalltalk.addMethod(
  4094. "_search_",
  4095. smalltalk.method({
  4096. selector: "search:",
  4097. fn: function (aString){
  4098. var self=this;
  4099. return smalltalk.withContext(function($ctx) { var $2,$3,$1;
  4100. $2=_st(self)._new();
  4101. _st($2)._searchReferencesFor_(aString);
  4102. $3=_st($2)._open();
  4103. $1=$3;
  4104. return $1;
  4105. }, self, "search:", [aString], smalltalk.ReferencesBrowser.klass)}
  4106. }),
  4107. smalltalk.ReferencesBrowser.klass);
  4108. smalltalk.addClass('TestRunner', smalltalk.TabWidget, ['selectedCategories', 'packagesList', 'selectedClasses', 'classesList', 'selectedMethods', 'progressBar', 'methodsList', 'result', 'statusDiv'], 'IDE');
  4109. smalltalk.addMethod(
  4110. "_allClasses",
  4111. smalltalk.method({
  4112. selector: "allClasses",
  4113. fn: function (){
  4114. var self=this;
  4115. return smalltalk.withContext(function($ctx) { var $1;
  4116. $1=_st(_st((smalltalk.TestCase || TestCase))._allSubclasses())._select_((function(each){
  4117. return _st(_st(each)._isAbstract())._not();
  4118. }));
  4119. return $1;
  4120. }, self, "allClasses", [], smalltalk.TestRunner)}
  4121. }),
  4122. smalltalk.TestRunner);
  4123. smalltalk.addMethod(
  4124. "_classes",
  4125. smalltalk.method({
  4126. selector: "classes",
  4127. fn: function (){
  4128. var self=this;
  4129. return smalltalk.withContext(function($ctx) { var $1;
  4130. $1=_st(_st(_st(self)._allClasses())._select_((function(each){
  4131. return _st(_st(self)._selectedCategories())._includes_(_st(each)._category());
  4132. })))._sort_((function(a,b){
  4133. return _st(_st(a)._name()).__gt(_st(b)._name());
  4134. }));
  4135. return $1;
  4136. }, self, "classes", [], smalltalk.TestRunner)}
  4137. }),
  4138. smalltalk.TestRunner);
  4139. smalltalk.addMethod(
  4140. "_initialize",
  4141. smalltalk.method({
  4142. selector: "initialize",
  4143. fn: function (){
  4144. var self=this;
  4145. return smalltalk.withContext(function($ctx) { smalltalk.TabWidget.fn.prototype._initialize.apply(_st(self), []);
  4146. self["@result"]=_st((smalltalk.TestResult || TestResult))._new();
  4147. return self}, self, "initialize", [], smalltalk.TestRunner)}
  4148. }),
  4149. smalltalk.TestRunner);
  4150. smalltalk.addMethod(
  4151. "_isSelectedCategory_",
  4152. smalltalk.method({
  4153. selector: "isSelectedCategory:",
  4154. fn: function (aCategory){
  4155. var self=this;
  4156. return smalltalk.withContext(function($ctx) { var $1;
  4157. $1=_st(_st(self)._selectedCategories())._includes_(aCategory);
  4158. return $1;
  4159. }, self, "isSelectedCategory:", [aCategory], smalltalk.TestRunner)}
  4160. }),
  4161. smalltalk.TestRunner);
  4162. smalltalk.addMethod(
  4163. "_isSelectedClass_",
  4164. smalltalk.method({
  4165. selector: "isSelectedClass:",
  4166. fn: function (aClass){
  4167. var self=this;
  4168. return smalltalk.withContext(function($ctx) { var $1;
  4169. $1=_st(_st(self)._selectedClasses())._includes_(aClass);
  4170. return $1;
  4171. }, self, "isSelectedClass:", [aClass], smalltalk.TestRunner)}
  4172. }),
  4173. smalltalk.TestRunner);
  4174. smalltalk.addMethod(
  4175. "_label",
  4176. smalltalk.method({
  4177. selector: "label",
  4178. fn: function (){
  4179. var self=this;
  4180. return smalltalk.withContext(function($ctx) { return "SUnit";
  4181. }, self, "label", [], smalltalk.TestRunner)}
  4182. }),
  4183. smalltalk.TestRunner);
  4184. smalltalk.addMethod(
  4185. "_packages",
  4186. smalltalk.method({
  4187. selector: "packages",
  4188. fn: function (){
  4189. var self=this;
  4190. return smalltalk.withContext(function($ctx) { var $1,$2;
  4191. var packages;
  4192. packages=_st((smalltalk.Array || Array))._new();
  4193. _st(_st(self)._allClasses())._do_((function(each){
  4194. $1=_st(packages)._includes_(_st(each)._category());
  4195. if(! smalltalk.assert($1)){
  4196. return _st(packages)._add_(_st(each)._category());
  4197. };
  4198. }));
  4199. $2=_st(packages)._sort();
  4200. return $2;
  4201. }, self, "packages", [], smalltalk.TestRunner)}
  4202. }),
  4203. smalltalk.TestRunner);
  4204. smalltalk.addMethod(
  4205. "_performFailure_",
  4206. smalltalk.method({
  4207. selector: "performFailure:",
  4208. fn: function (aTestCase){
  4209. var self=this;
  4210. return smalltalk.withContext(function($ctx) { _st(aTestCase)._setUp();
  4211. _st((function(){
  4212. return _st(aTestCase)._perform_(_st(aTestCase)._selector());
  4213. }))._ensure_((function(){
  4214. return _st(aTestCase)._tearDown();
  4215. }));
  4216. return self}, self, "performFailure:", [aTestCase], smalltalk.TestRunner)}
  4217. }),
  4218. smalltalk.TestRunner);
  4219. smalltalk.addMethod(
  4220. "_printErrors",
  4221. smalltalk.method({
  4222. selector: "printErrors",
  4223. fn: function (){
  4224. var self=this;
  4225. return smalltalk.withContext(function($ctx) { var $1;
  4226. $1=_st(_st(_st(_st(_st(self)._result())._errors())._size())._asString()).__comma(" errors, ");
  4227. return $1;
  4228. }, self, "printErrors", [], smalltalk.TestRunner)}
  4229. }),
  4230. smalltalk.TestRunner);
  4231. smalltalk.addMethod(
  4232. "_printFailures",
  4233. smalltalk.method({
  4234. selector: "printFailures",
  4235. fn: function (){
  4236. var self=this;
  4237. return smalltalk.withContext(function($ctx) { var $1;
  4238. $1=_st(_st(_st(_st(_st(self)._result())._failures())._size())._asString()).__comma(" failures");
  4239. return $1;
  4240. }, self, "printFailures", [], smalltalk.TestRunner)}
  4241. }),
  4242. smalltalk.TestRunner);
  4243. smalltalk.addMethod(
  4244. "_printPasses",
  4245. smalltalk.method({
  4246. selector: "printPasses",
  4247. fn: function (){
  4248. var self=this;
  4249. return smalltalk.withContext(function($ctx) { var $1;
  4250. $1=_st(_st(_st(_st(_st(_st(self)._result())._runs()).__minus(_st(_st(_st(self)._result())._errors())._size())).__minus(_st(_st(_st(self)._result())._failures())._size()))._asString()).__comma(" passes, ");
  4251. return $1;
  4252. }, self, "printPasses", [], smalltalk.TestRunner)}
  4253. }),
  4254. smalltalk.TestRunner);
  4255. smalltalk.addMethod(
  4256. "_printTotal",
  4257. smalltalk.method({
  4258. selector: "printTotal",
  4259. fn: function (){
  4260. var self=this;
  4261. return smalltalk.withContext(function($ctx) { var $1;
  4262. $1=_st(_st(_st(_st(self)._result())._total())._asString()).__comma(" runs, ");
  4263. return $1;
  4264. }, self, "printTotal", [], smalltalk.TestRunner)}
  4265. }),
  4266. smalltalk.TestRunner);
  4267. smalltalk.addMethod(
  4268. "_progressBar",
  4269. smalltalk.method({
  4270. selector: "progressBar",
  4271. fn: function (){
  4272. var self=this;
  4273. return smalltalk.withContext(function($ctx) { var $1;
  4274. if(($receiver = self["@progressBar"]) == nil || $receiver == undefined){
  4275. self["@progressBar"]=_st((smalltalk.ProgressBar || ProgressBar))._new();
  4276. $1=self["@progressBar"];
  4277. } else {
  4278. $1=self["@progressBar"];
  4279. };
  4280. return $1;
  4281. }, self, "progressBar", [], smalltalk.TestRunner)}
  4282. }),
  4283. smalltalk.TestRunner);
  4284. smalltalk.addMethod(
  4285. "_renderBoxOn_",
  4286. smalltalk.method({
  4287. selector: "renderBoxOn:",
  4288. fn: function (html){
  4289. var self=this;
  4290. return smalltalk.withContext(function($ctx) { var $1;
  4291. _st(self)._renderCategoriesOn_(html);
  4292. _st(self)._renderClassesOn_(html);
  4293. $1=_st(self)._renderResultsOn_(html);
  4294. return self}, self, "renderBoxOn:", [html], smalltalk.TestRunner)}
  4295. }),
  4296. smalltalk.TestRunner);
  4297. smalltalk.addMethod(
  4298. "_renderButtonsOn_",
  4299. smalltalk.method({
  4300. selector: "renderButtonsOn:",
  4301. fn: function (html){
  4302. var self=this;
  4303. return smalltalk.withContext(function($ctx) { var $1,$2;
  4304. $1=_st(html)._button();
  4305. _st($1)._with_("Run selected");
  4306. $2=_st($1)._onClick_((function(){
  4307. return _st(self)._run_(_st(self)._testCases());
  4308. }));
  4309. return self}, self, "renderButtonsOn:", [html], smalltalk.TestRunner)}
  4310. }),
  4311. smalltalk.TestRunner);
  4312. smalltalk.addMethod(
  4313. "_renderCategoriesOn_",
  4314. smalltalk.method({
  4315. selector: "renderCategoriesOn:",
  4316. fn: function (html){
  4317. var self=this;
  4318. return smalltalk.withContext(function($ctx) { self["@packagesList"]=_st(_st(html)._ul())._class_("amber_column sunit packages");
  4319. _st(self)._updateCategoriesList();
  4320. return self}, self, "renderCategoriesOn:", [html], smalltalk.TestRunner)}
  4321. }),
  4322. smalltalk.TestRunner);
  4323. smalltalk.addMethod(
  4324. "_renderClassesOn_",
  4325. smalltalk.method({
  4326. selector: "renderClassesOn:",
  4327. fn: function (html){
  4328. var self=this;
  4329. return smalltalk.withContext(function($ctx) { self["@classesList"]=_st(_st(html)._ul())._class_("amber_column sunit classes");
  4330. _st(self)._updateClassesList();
  4331. return self}, self, "renderClassesOn:", [html], smalltalk.TestRunner)}
  4332. }),
  4333. smalltalk.TestRunner);
  4334. smalltalk.addMethod(
  4335. "_renderErrorsOn_",
  4336. smalltalk.method({
  4337. selector: "renderErrorsOn:",
  4338. fn: function (html){
  4339. var self=this;
  4340. return smalltalk.withContext(function($ctx) { var $1,$2;
  4341. _st(_st(_st(self)._result())._errors())._do_((function(each){
  4342. $1=_st(html)._li();
  4343. _st($1)._class_("errors");
  4344. _st($1)._with_(_st(_st(_st(_st(each)._class())._name()).__comma(" >> ")).__comma(_st(each)._selector()));
  4345. $2=_st($1)._onClick_((function(){
  4346. return _st(self)._performFailure_(each);
  4347. }));
  4348. return $2;
  4349. }));
  4350. return self}, self, "renderErrorsOn:", [html], smalltalk.TestRunner)}
  4351. }),
  4352. smalltalk.TestRunner);
  4353. smalltalk.addMethod(
  4354. "_renderFailuresOn_",
  4355. smalltalk.method({
  4356. selector: "renderFailuresOn:",
  4357. fn: function (html){
  4358. var self=this;
  4359. return smalltalk.withContext(function($ctx) { var $1,$2;
  4360. _st(_st(_st(self)._result())._failures())._do_((function(each){
  4361. $1=_st(html)._li();
  4362. _st($1)._class_("failures");
  4363. _st($1)._with_(_st(_st(_st(_st(each)._class())._name()).__comma(" >> ")).__comma(_st(each)._selector()));
  4364. $2=_st($1)._onClick_((function(){
  4365. return _st(self)._performFailure_(each);
  4366. }));
  4367. return $2;
  4368. }));
  4369. return self}, self, "renderFailuresOn:", [html], smalltalk.TestRunner)}
  4370. }),
  4371. smalltalk.TestRunner);
  4372. smalltalk.addMethod(
  4373. "_renderResultsOn_",
  4374. smalltalk.method({
  4375. selector: "renderResultsOn:",
  4376. fn: function (html){
  4377. var self=this;
  4378. return smalltalk.withContext(function($ctx) { self["@statusDiv"]=_st(html)._div();
  4379. _st(html)._with_(_st(self)._progressBar());
  4380. self["@methodsList"]=_st(_st(html)._ul())._class_("amber_column sunit results");
  4381. _st(self)._updateMethodsList();
  4382. _st(self)._updateStatusDiv();
  4383. return self}, self, "renderResultsOn:", [html], smalltalk.TestRunner)}
  4384. }),
  4385. smalltalk.TestRunner);
  4386. smalltalk.addMethod(
  4387. "_result",
  4388. smalltalk.method({
  4389. selector: "result",
  4390. fn: function (){
  4391. var self=this;
  4392. return smalltalk.withContext(function($ctx) { return self["@result"];
  4393. }, self, "result", [], smalltalk.TestRunner)}
  4394. }),
  4395. smalltalk.TestRunner);
  4396. smalltalk.addMethod(
  4397. "_run_",
  4398. smalltalk.method({
  4399. selector: "run:",
  4400. fn: function (aCollection){
  4401. var self=this;
  4402. return smalltalk.withContext(function($ctx) { var $1;
  4403. var worker;
  4404. worker=_st((smalltalk.TestSuiteRunner || TestSuiteRunner))._on_(aCollection);
  4405. self["@result"]=_st(worker)._result();
  4406. _st(_st(worker)._announcer())._on_do_((smalltalk.ResultAnnouncement || ResultAnnouncement),(function(ann){
  4407. $1=_st(_st(ann)._result()).__eq_eq(self["@result"]);
  4408. if(smalltalk.assert($1)){
  4409. _st(_st(self)._progressBar())._updatePercent_(_st(_st(_st(self["@result"])._runs()).__slash(_st(self["@result"])._total())).__star((100)));
  4410. _st(self)._updateStatusDiv();
  4411. return _st(self)._updateMethodsList();
  4412. };
  4413. }));
  4414. _st(worker)._run();
  4415. return self}, self, "run:", [aCollection], smalltalk.TestRunner)}
  4416. }),
  4417. smalltalk.TestRunner);
  4418. smalltalk.addMethod(
  4419. "_selectAllCategories",
  4420. smalltalk.method({
  4421. selector: "selectAllCategories",
  4422. fn: function (){
  4423. var self=this;
  4424. return smalltalk.withContext(function($ctx) { var $1,$2;
  4425. _st(_st(self)._packages())._do_((function(each){
  4426. $1=_st(self["@selectedCategories"])._includes_(each);
  4427. if(! smalltalk.assert($1)){
  4428. return _st(_st(self)._selectedCategories())._add_(each);
  4429. };
  4430. }));
  4431. _st(self)._updateCategoriesList();
  4432. $2=_st(self)._updateClassesList();
  4433. return self}, self, "selectAllCategories", [], smalltalk.TestRunner)}
  4434. }),
  4435. smalltalk.TestRunner);
  4436. smalltalk.addMethod(
  4437. "_selectAllClasses",
  4438. smalltalk.method({
  4439. selector: "selectAllClasses",
  4440. fn: function (){
  4441. var self=this;
  4442. return smalltalk.withContext(function($ctx) { var $1,$2;
  4443. _st(_st(self)._classes())._do_((function(each){
  4444. $1=_st(self["@selectedClasses"])._includes_(each);
  4445. if(! smalltalk.assert($1)){
  4446. return _st(_st(self)._selectedClasses())._add_(each);
  4447. };
  4448. }));
  4449. _st(self)._updateCategoriesList();
  4450. $2=_st(self)._updateClassesList();
  4451. return self}, self, "selectAllClasses", [], smalltalk.TestRunner)}
  4452. }),
  4453. smalltalk.TestRunner);
  4454. smalltalk.addMethod(
  4455. "_selectedCategories",
  4456. smalltalk.method({
  4457. selector: "selectedCategories",
  4458. fn: function (){
  4459. var self=this;
  4460. return smalltalk.withContext(function($ctx) { var $1;
  4461. if(($receiver = self["@selectedCategories"]) == nil || $receiver == undefined){
  4462. self["@selectedCategories"]=_st((smalltalk.Array || Array))._new();
  4463. $1=self["@selectedCategories"];
  4464. } else {
  4465. $1=self["@selectedCategories"];
  4466. };
  4467. return $1;
  4468. }, self, "selectedCategories", [], smalltalk.TestRunner)}
  4469. }),
  4470. smalltalk.TestRunner);
  4471. smalltalk.addMethod(
  4472. "_selectedClasses",
  4473. smalltalk.method({
  4474. selector: "selectedClasses",
  4475. fn: function (){
  4476. var self=this;
  4477. return smalltalk.withContext(function($ctx) { var $1;
  4478. if(($receiver = self["@selectedClasses"]) == nil || $receiver == undefined){
  4479. self["@selectedClasses"]=_st((smalltalk.Array || Array))._new();
  4480. $1=self["@selectedClasses"];
  4481. } else {
  4482. $1=self["@selectedClasses"];
  4483. };
  4484. return $1;
  4485. }, self, "selectedClasses", [], smalltalk.TestRunner)}
  4486. }),
  4487. smalltalk.TestRunner);
  4488. smalltalk.addMethod(
  4489. "_statusInfo",
  4490. smalltalk.method({
  4491. selector: "statusInfo",
  4492. fn: function (){
  4493. var self=this;
  4494. return smalltalk.withContext(function($ctx) { var $1;
  4495. $1=_st(_st(_st(_st(self)._printTotal()).__comma(_st(self)._printPasses())).__comma(_st(self)._printErrors())).__comma(_st(self)._printFailures());
  4496. return $1;
  4497. }, self, "statusInfo", [], smalltalk.TestRunner)}
  4498. }),
  4499. smalltalk.TestRunner);
  4500. smalltalk.addMethod(
  4501. "_testCases",
  4502. smalltalk.method({
  4503. selector: "testCases",
  4504. fn: function (){
  4505. var self=this;
  4506. return smalltalk.withContext(function($ctx) { var testCases;
  4507. testCases=[];
  4508. _st(_st(_st(self)._selectedClasses())._select_((function(each){
  4509. return _st(_st(self)._selectedCategories())._includes_(_st(each)._category());
  4510. })))._do_((function(each){
  4511. return _st(testCases)._addAll_(_st(each)._buildSuite());
  4512. }));
  4513. return testCases;
  4514. }, self, "testCases", [], smalltalk.TestRunner)}
  4515. }),
  4516. smalltalk.TestRunner);
  4517. smalltalk.addMethod(
  4518. "_toggleCategory_",
  4519. smalltalk.method({
  4520. selector: "toggleCategory:",
  4521. fn: function (aCategory){
  4522. var self=this;
  4523. return smalltalk.withContext(function($ctx) { var $1,$2;
  4524. $1=_st(self)._isSelectedCategory_(aCategory);
  4525. if(smalltalk.assert($1)){
  4526. _st(self["@selectedCategories"])._remove_(aCategory);
  4527. } else {
  4528. _st(self["@selectedCategories"])._add_(aCategory);
  4529. };
  4530. _st(self)._updateCategoriesList();
  4531. $2=_st(self)._updateClassesList();
  4532. return self}, self, "toggleCategory:", [aCategory], smalltalk.TestRunner)}
  4533. }),
  4534. smalltalk.TestRunner);
  4535. smalltalk.addMethod(
  4536. "_toggleClass_",
  4537. smalltalk.method({
  4538. selector: "toggleClass:",
  4539. fn: function (aClass){
  4540. var self=this;
  4541. return smalltalk.withContext(function($ctx) { var $1;
  4542. $1=_st(self)._isSelectedClass_(aClass);
  4543. if(smalltalk.assert($1)){
  4544. _st(self["@selectedClasses"])._remove_(aClass);
  4545. } else {
  4546. _st(self["@selectedClasses"])._add_(aClass);
  4547. };
  4548. _st(self)._updateClassesList();
  4549. return self}, self, "toggleClass:", [aClass], smalltalk.TestRunner)}
  4550. }),
  4551. smalltalk.TestRunner);
  4552. smalltalk.addMethod(
  4553. "_updateCategoriesList",
  4554. smalltalk.method({
  4555. selector: "updateCategoriesList",
  4556. fn: function (){
  4557. var self=this;
  4558. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4;
  4559. _st(self["@packagesList"])._contents_((function(html){
  4560. $1=_st(html)._li();
  4561. _st($1)._class_("all");
  4562. _st($1)._with_("All");
  4563. $2=_st($1)._onClick_((function(){
  4564. return _st(self)._selectAllCategories();
  4565. }));
  4566. $2;
  4567. return _st(_st(self)._packages())._do_((function(each){
  4568. var li;
  4569. li=_st(html)._li();
  4570. li;
  4571. $3=_st(_st(self)._selectedCategories())._includes_(each);
  4572. if(smalltalk.assert($3)){
  4573. _st(li)._class_("selected");
  4574. };
  4575. _st(li)._with_(each);
  4576. $4=_st(li)._onClick_((function(){
  4577. return _st(self)._toggleCategory_(each);
  4578. }));
  4579. return $4;
  4580. }));
  4581. }));
  4582. return self}, self, "updateCategoriesList", [], smalltalk.TestRunner)}
  4583. }),
  4584. smalltalk.TestRunner);
  4585. smalltalk.addMethod(
  4586. "_updateClassesList",
  4587. smalltalk.method({
  4588. selector: "updateClassesList",
  4589. fn: function (){
  4590. var self=this;
  4591. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4,$5;
  4592. _st(self["@classesList"])._contents_((function(html){
  4593. $1=_st(_st(self)._selectedCategories())._isEmpty();
  4594. if(! smalltalk.assert($1)){
  4595. $2=_st(html)._li();
  4596. _st($2)._class_("all");
  4597. _st($2)._with_("All");
  4598. $3=_st($2)._onClick_((function(){
  4599. return _st(self)._selectAllClasses();
  4600. }));
  4601. $3;
  4602. };
  4603. return _st(_st(self)._classes())._do_((function(each){
  4604. var li;
  4605. li=_st(html)._li();
  4606. li;
  4607. $4=_st(_st(self)._selectedClasses())._includes_(each);
  4608. if(smalltalk.assert($4)){
  4609. _st(li)._class_("selected");
  4610. };
  4611. _st(li)._with_(_st(each)._name());
  4612. $5=_st(li)._onClick_((function(){
  4613. return _st(self)._toggleClass_(each);
  4614. }));
  4615. return $5;
  4616. }));
  4617. }));
  4618. return self}, self, "updateClassesList", [], smalltalk.TestRunner)}
  4619. }),
  4620. smalltalk.TestRunner);
  4621. smalltalk.addMethod(
  4622. "_updateMethodsList",
  4623. smalltalk.method({
  4624. selector: "updateMethodsList",
  4625. fn: function (){
  4626. var self=this;
  4627. return smalltalk.withContext(function($ctx) { _st(self["@methodsList"])._contents_((function(html){
  4628. _st(self)._renderErrorsOn_(html);
  4629. return _st(self)._renderFailuresOn_(html);
  4630. }));
  4631. return self}, self, "updateMethodsList", [], smalltalk.TestRunner)}
  4632. }),
  4633. smalltalk.TestRunner);
  4634. smalltalk.addMethod(
  4635. "_updateStatusDiv",
  4636. smalltalk.method({
  4637. selector: "updateStatusDiv",
  4638. fn: function (){
  4639. var self=this;
  4640. return smalltalk.withContext(function($ctx) { _st(self["@statusDiv"])._class_(_st("sunit status ").__comma(_st(self["@result"])._status()));
  4641. _st(self["@statusDiv"])._contents_((function(html){
  4642. return _st(_st(html)._span())._with_(_st(self)._statusInfo());
  4643. }));
  4644. return self}, self, "updateStatusDiv", [], smalltalk.TestRunner)}
  4645. }),
  4646. smalltalk.TestRunner);
  4647. smalltalk.addClass('Workspace', smalltalk.TabWidget, ['sourceArea'], 'IDE');
  4648. smalltalk.addMethod(
  4649. "_clearWorkspace",
  4650. smalltalk.method({
  4651. selector: "clearWorkspace",
  4652. fn: function (){
  4653. var self=this;
  4654. return smalltalk.withContext(function($ctx) { _st(self["@sourceArea"])._clear();
  4655. return self}, self, "clearWorkspace", [], smalltalk.Workspace)}
  4656. }),
  4657. smalltalk.Workspace);
  4658. smalltalk.addMethod(
  4659. "_doIt",
  4660. smalltalk.method({
  4661. selector: "doIt",
  4662. fn: function (){
  4663. var self=this;
  4664. return smalltalk.withContext(function($ctx) { _st(self["@sourceArea"])._doIt();
  4665. return self}, self, "doIt", [], smalltalk.Workspace)}
  4666. }),
  4667. smalltalk.Workspace);
  4668. smalltalk.addMethod(
  4669. "_fileIn",
  4670. smalltalk.method({
  4671. selector: "fileIn",
  4672. fn: function (){
  4673. var self=this;
  4674. return smalltalk.withContext(function($ctx) { _st(self["@sourceArea"])._fileIn();
  4675. return self}, self, "fileIn", [], smalltalk.Workspace)}
  4676. }),
  4677. smalltalk.Workspace);
  4678. smalltalk.addMethod(
  4679. "_inspectIt",
  4680. smalltalk.method({
  4681. selector: "inspectIt",
  4682. fn: function (){
  4683. var self=this;
  4684. return smalltalk.withContext(function($ctx) { _st(self["@sourceArea"])._inspectIt();
  4685. return self}, self, "inspectIt", [], smalltalk.Workspace)}
  4686. }),
  4687. smalltalk.Workspace);
  4688. smalltalk.addMethod(
  4689. "_label",
  4690. smalltalk.method({
  4691. selector: "label",
  4692. fn: function (){
  4693. var self=this;
  4694. return smalltalk.withContext(function($ctx) { return "Workspace";
  4695. }, self, "label", [], smalltalk.Workspace)}
  4696. }),
  4697. smalltalk.Workspace);
  4698. smalltalk.addMethod(
  4699. "_printIt",
  4700. smalltalk.method({
  4701. selector: "printIt",
  4702. fn: function (){
  4703. var self=this;
  4704. return smalltalk.withContext(function($ctx) { _st(self["@sourceArea"])._printIt();
  4705. return self}, self, "printIt", [], smalltalk.Workspace)}
  4706. }),
  4707. smalltalk.Workspace);
  4708. smalltalk.addMethod(
  4709. "_renderBoxOn_",
  4710. smalltalk.method({
  4711. selector: "renderBoxOn:",
  4712. fn: function (html){
  4713. var self=this;
  4714. return smalltalk.withContext(function($ctx) { self["@sourceArea"]=_st((smalltalk.SourceArea || SourceArea))._new();
  4715. _st(self["@sourceArea"])._renderOn_(html);
  4716. return self}, self, "renderBoxOn:", [html], smalltalk.Workspace)}
  4717. }),
  4718. smalltalk.Workspace);
  4719. smalltalk.addMethod(
  4720. "_renderButtonsOn_",
  4721. smalltalk.method({
  4722. selector: "renderButtonsOn:",
  4723. fn: function (html){
  4724. var self=this;
  4725. return smalltalk.withContext(function($ctx) { var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10;
  4726. $1=_st(html)._button();
  4727. _st($1)._with_("DoIt");
  4728. _st($1)._title_("ctrl+d");
  4729. $2=_st($1)._onClick_((function(){
  4730. return _st(self)._doIt();
  4731. }));
  4732. $3=_st(html)._button();
  4733. _st($3)._with_("PrintIt");
  4734. _st($3)._title_("ctrl+p");
  4735. $4=_st($3)._onClick_((function(){
  4736. return _st(self)._printIt();
  4737. }));
  4738. $5=_st(html)._button();
  4739. _st($5)._with_("InspectIt");
  4740. _st($5)._title_("ctrl+i");
  4741. $6=_st($5)._onClick_((function(){
  4742. return _st(self)._inspectIt();
  4743. }));
  4744. $7=_st(html)._button();
  4745. _st($7)._with_("FileIn");
  4746. _st($7)._title_("ctrl+f");
  4747. $8=_st($7)._onClick_((function(){
  4748. return _st(self)._fileIn();
  4749. }));
  4750. $9=_st(html)._button();
  4751. _st($9)._with_("Clear workspace");
  4752. $10=_st($9)._onClick_((function(){
  4753. return _st(self)._clearWorkspace();
  4754. }));
  4755. return self}, self, "renderButtonsOn:", [html], smalltalk.Workspace)}
  4756. }),
  4757. smalltalk.Workspace);
  4758. smalltalk.addMethod(
  4759. "_show",
  4760. smalltalk.method({
  4761. selector: "show",
  4762. fn: function (){
  4763. var self=this;
  4764. return smalltalk.withContext(function($ctx) { smalltalk.TabWidget.fn.prototype._show.apply(_st(self), []);
  4765. _st(self["@sourceArea"])._focus();
  4766. return self}, self, "show", [], smalltalk.Workspace)}
  4767. }),
  4768. smalltalk.Workspace);
  4769. smalltalk.addMethod(
  4770. "_inspect",
  4771. smalltalk.method({
  4772. selector: "inspect",
  4773. fn: function (){
  4774. var self=this;
  4775. return smalltalk.withContext(function($ctx) { var $1,$2;
  4776. $1=_st((smalltalk.Inspector || Inspector))._new();
  4777. _st($1)._inspect_(self);
  4778. $2=_st($1)._open();
  4779. return self}, self, "inspect", [], smalltalk.Object)}
  4780. }),
  4781. smalltalk.Object);
  4782. smalltalk.addMethod(
  4783. "_inspectOn_",
  4784. smalltalk.method({
  4785. selector: "inspectOn:",
  4786. fn: function (anInspector){
  4787. var self=this;
  4788. return smalltalk.withContext(function($ctx) { var $1;
  4789. var variables;
  4790. variables=_st((smalltalk.Dictionary || Dictionary))._new();
  4791. _st(variables)._at_put_("#self",self);
  4792. _st(_st(_st(self)._class())._allInstanceVariableNames())._do_((function(each){
  4793. return _st(variables)._at_put_(each,_st(self)._instVarAt_(each));
  4794. }));
  4795. _st(anInspector)._setLabel_(_st(self)._printString());
  4796. $1=_st(anInspector)._setVariables_(variables);
  4797. return self}, self, "inspectOn:", [anInspector], smalltalk.Object)}
  4798. }),
  4799. smalltalk.Object);
  4800. smalltalk.addMethod(
  4801. "_inspectOn_",
  4802. smalltalk.method({
  4803. selector: "inspectOn:",
  4804. fn: function (anInspector){
  4805. var self=this;
  4806. return smalltalk.withContext(function($ctx) { var $1;
  4807. var variables;
  4808. variables=_st((smalltalk.Dictionary || Dictionary))._new();
  4809. _st(variables)._at_put_("#self",self);
  4810. _st(self)._withIndexDo_((function(each,i){
  4811. return _st(variables)._at_put_(i,each);
  4812. }));
  4813. _st(anInspector)._setLabel_(_st(self)._printString());
  4814. $1=_st(anInspector)._setVariables_(variables);
  4815. return self}, self, "inspectOn:", [anInspector], smalltalk.Collection)}
  4816. }),
  4817. smalltalk.Collection);
  4818. smalltalk.addMethod(
  4819. "_inspectOn_",
  4820. smalltalk.method({
  4821. selector: "inspectOn:",
  4822. fn: function (anInspector){
  4823. var self=this;
  4824. return smalltalk.withContext(function($ctx) { var $1;
  4825. var variables;
  4826. variables=_st((smalltalk.Dictionary || Dictionary))._new();
  4827. _st(variables)._at_put_("#self",self);
  4828. _st(variables)._at_put_("#keys",_st(self)._keys());
  4829. _st(self)._keysAndValuesDo_((function(key,value){
  4830. return _st(variables)._at_put_(key,value);
  4831. }));
  4832. _st(anInspector)._setLabel_(_st(self)._printString());
  4833. $1=_st(anInspector)._setVariables_(variables);
  4834. return self}, self, "inspectOn:", [anInspector], smalltalk.HashedCollection)}
  4835. }),
  4836. smalltalk.HashedCollection);
  4837. smalltalk.addMethod(
  4838. "_inspectOn_",
  4839. smalltalk.method({
  4840. selector: "inspectOn:",
  4841. fn: function (anInspector){
  4842. var self=this;
  4843. return smalltalk.withContext(function($ctx) { var $1;
  4844. var label;
  4845. smalltalk.CharacterArray.fn.prototype._inspectOn_.apply(_st(self), [anInspector]);
  4846. $1=_st(_st(_st(self)._printString())._size()).__gt((30));
  4847. if(smalltalk.assert($1)){
  4848. label=_st(_st(_st(self)._printString())._copyFrom_to_((1),(30))).__comma("...'");
  4849. label;
  4850. } else {
  4851. label=_st(self)._printString();
  4852. label;
  4853. };
  4854. _st(anInspector)._setLabel_(label);
  4855. return self}, self, "inspectOn:", [anInspector], smalltalk.String)}
  4856. }),
  4857. smalltalk.String);
  4858. smalltalk.addMethod(
  4859. "_inspectOn_",
  4860. smalltalk.method({
  4861. selector: "inspectOn:",
  4862. fn: function (anInspector){
  4863. var self=this;
  4864. return smalltalk.withContext(function($ctx) { var $1;
  4865. var variables;
  4866. variables=_st((smalltalk.Dictionary || Dictionary))._new();
  4867. _st(variables)._at_put_("#self",self);
  4868. _st(self["@elements"])._withIndexDo_((function(each,i){
  4869. return _st(variables)._at_put_(i,each);
  4870. }));
  4871. _st(anInspector)._setLabel_(_st(self)._printString());
  4872. $1=_st(anInspector)._setVariables_(variables);
  4873. return self}, self, "inspectOn:", [anInspector], smalltalk.Set)}
  4874. }),
  4875. smalltalk.Set);
  4876. smalltalk.addMethod(
  4877. "_inspectOn_",
  4878. smalltalk.method({
  4879. selector: "inspectOn:",
  4880. fn: function (anInspector){
  4881. var self=this;
  4882. return smalltalk.withContext(function($ctx) { var $1;
  4883. var variables;
  4884. variables=_st((smalltalk.Dictionary || Dictionary))._new();
  4885. _st(variables)._at_put_("#self",self);
  4886. _st(variables)._at_put_("#year",_st(self)._year());
  4887. _st(variables)._at_put_("#month",_st(self)._month());
  4888. _st(variables)._at_put_("#day",_st(self)._day());
  4889. _st(variables)._at_put_("#hours",_st(self)._hours());
  4890. _st(variables)._at_put_("#minutes",_st(self)._minutes());
  4891. _st(variables)._at_put_("#seconds",_st(self)._seconds());
  4892. _st(variables)._at_put_("#milliseconds",_st(self)._milliseconds());
  4893. _st(anInspector)._setLabel_(_st(self)._printString());
  4894. $1=_st(anInspector)._setVariables_(variables);
  4895. return self}, self, "inspectOn:", [anInspector], smalltalk.Date)}
  4896. }),
  4897. smalltalk.Date);
  4898. smalltalk.addMethod(
  4899. "_inspectOn_",
  4900. smalltalk.method({
  4901. selector: "inspectOn:",
  4902. fn: function (anInspector){
  4903. var self=this;
  4904. return smalltalk.withContext(function($ctx) { var $1;
  4905. var variables;
  4906. variables=_st((smalltalk.Dictionary || Dictionary))._new();
  4907. _st(variables)._at_put_("#self",self);
  4908. _st(variables)._at_put_("#home",_st(self)._home());
  4909. _st(variables)._at_put_("#receiver",_st(self)._receiver());
  4910. _st(variables)._at_put_("#selector",_st(self)._selector());
  4911. _st(variables)._at_put_("#temps",_st(self)._temps());
  4912. _st(_st(_st(self)._class())._instanceVariableNames())._do_((function(each){
  4913. return _st(variables)._at_put_(each,_st(self)._instVarAt_(each));
  4914. }));
  4915. _st(anInspector)._setLabel_(_st(self)._printString());
  4916. $1=_st(anInspector)._setVariables_(variables);
  4917. return self}, self, "inspectOn:", [anInspector], smalltalk.MethodContext)}
  4918. }),
  4919. smalltalk.MethodContext);