IDE.js 250 KB

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