IDE.js 275 KB

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