IDE.js 267 KB

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