IDE.js 249 KB

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