1
0

IDE.js 234 KB

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