IDE.js 249 KB

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