IDE.js 261 KB

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