1
0

IDE.js 261 KB

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