IDE.js 253 KB

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