1
0

IDE.js 253 KB

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