IDE.js 262 KB

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