IDE.js 261 KB

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