IDE.js 253 KB

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