1
0

IDE.js 239 KB

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