IDE.js 274 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477
  1. define("amber_core/IDE", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Canvas", "amber_core/Kernel-Exceptions", "amber_core/Kernel-Objects", "amber_core/Kernel-Collections", "amber_core/Kernel-Methods"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('IDE');
  3. smalltalk.packages["IDE"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('ClassesList', smalltalk.Widget, ['browser', 'ul', 'nodes'], 'IDE');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "browser",
  8. protocol: 'accessing',
  9. fn: function (){
  10. var self=this;
  11. return smalltalk.withContext(function($ctx1) {
  12. var $1;
  13. $1=self["@browser"];
  14. return $1;
  15. }, function($ctx1) {$ctx1.fill(self,"browser",{},smalltalk.ClassesList)})},
  16. args: [],
  17. source: "browser\x0a\x09^ browser",
  18. messageSends: [],
  19. referencedClasses: []
  20. }),
  21. smalltalk.ClassesList);
  22. smalltalk.addMethod(
  23. smalltalk.method({
  24. selector: "browser:",
  25. protocol: 'accessing',
  26. fn: function (aBrowser){
  27. var self=this;
  28. return smalltalk.withContext(function($ctx1) {
  29. self["@browser"]=aBrowser;
  30. return self}, function($ctx1) {$ctx1.fill(self,"browser:",{aBrowser:aBrowser},smalltalk.ClassesList)})},
  31. args: ["aBrowser"],
  32. source: "browser: aBrowser\x0a\x09browser := aBrowser",
  33. messageSends: [],
  34. referencedClasses: []
  35. }),
  36. smalltalk.ClassesList);
  37. smalltalk.addMethod(
  38. smalltalk.method({
  39. selector: "category",
  40. protocol: 'accessing',
  41. fn: function (){
  42. var self=this;
  43. return smalltalk.withContext(function($ctx1) {
  44. var $1;
  45. $1=_st(self._browser())._selectedPackage();
  46. return $1;
  47. }, function($ctx1) {$ctx1.fill(self,"category",{},smalltalk.ClassesList)})},
  48. args: [],
  49. source: "category\x0a\x09^ self browser selectedPackage",
  50. messageSends: ["selectedPackage", "browser"],
  51. referencedClasses: []
  52. }),
  53. smalltalk.ClassesList);
  54. smalltalk.addMethod(
  55. smalltalk.method({
  56. selector: "getNodes",
  57. protocol: 'accessing',
  58. fn: function (){
  59. var self=this;
  60. var classes,children,others;
  61. function $ClassesListNode(){return smalltalk.ClassesListNode||(typeof ClassesListNode=="undefined"?nil:ClassesListNode)}
  62. return smalltalk.withContext(function($ctx1) {
  63. var $1,$2,$3;
  64. $1=self._browser();
  65. $ctx1.sendIdx["browser"]=1;
  66. classes=_st($1)._classes();
  67. children=[];
  68. others=[];
  69. _st(classes)._do_((function(each){
  70. return smalltalk.withContext(function($ctx2) {
  71. $2=_st(classes)._includes_(_st(each)._superclass());
  72. if(smalltalk.assert($2)){
  73. return _st(others)._add_(each);
  74. } else {
  75. return _st(children)._add_(each);
  76. $ctx2.sendIdx["add:"]=1;
  77. };
  78. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  79. $3=_st(children)._collect_((function(each){
  80. return smalltalk.withContext(function($ctx2) {
  81. return _st($ClassesListNode())._on_browser_classes_level_(each,self._browser(),others,(0));
  82. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
  83. return $3;
  84. }, function($ctx1) {$ctx1.fill(self,"getNodes",{classes:classes,children:children,others:others},smalltalk.ClassesList)})},
  85. args: [],
  86. 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 ]",
  87. messageSends: ["classes", "browser", "do:", "ifFalse:ifTrue:", "includes:", "superclass", "add:", "collect:", "on:browser:classes:level:"],
  88. referencedClasses: ["ClassesListNode"]
  89. }),
  90. smalltalk.ClassesList);
  91. smalltalk.addMethod(
  92. smalltalk.method({
  93. selector: "nodes",
  94. protocol: 'accessing',
  95. fn: function (){
  96. var self=this;
  97. return smalltalk.withContext(function($ctx1) {
  98. var $1,$2;
  99. $1=self["@nodes"];
  100. if(($receiver = $1) == nil || $receiver == null){
  101. self["@nodes"]=self._getNodes();
  102. self["@nodes"];
  103. } else {
  104. $1;
  105. };
  106. $2=self["@nodes"];
  107. return $2;
  108. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.ClassesList)})},
  109. args: [],
  110. source: "nodes\x0a\x09nodes ifNil: [ nodes := self getNodes ].\x0a\x09^ nodes",
  111. messageSends: ["ifNil:", "getNodes"],
  112. referencedClasses: []
  113. }),
  114. smalltalk.ClassesList);
  115. smalltalk.addMethod(
  116. smalltalk.method({
  117. selector: "renderOn:",
  118. protocol: 'rendering',
  119. fn: function (html){
  120. var self=this;
  121. return smalltalk.withContext(function($ctx1) {
  122. var $1,$2;
  123. $1=_st(html)._ul();
  124. _st($1)._class_("amber_column browser classes");
  125. $2=_st($1)._yourself();
  126. self["@ul"]=$2;
  127. self._updateNodes();
  128. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.ClassesList)})},
  129. args: ["html"],
  130. source: "renderOn: html\x0a\x09ul := html ul\x0a\x09\x09class: 'amber_column browser classes';\x0a\x09\x09yourself.\x0a\x09self updateNodes",
  131. messageSends: ["class:", "ul", "yourself", "updateNodes"],
  132. referencedClasses: []
  133. }),
  134. smalltalk.ClassesList);
  135. smalltalk.addMethod(
  136. smalltalk.method({
  137. selector: "resetNodes",
  138. protocol: 'accessing',
  139. fn: function (){
  140. var self=this;
  141. return smalltalk.withContext(function($ctx1) {
  142. self["@nodes"]=nil;
  143. return self}, function($ctx1) {$ctx1.fill(self,"resetNodes",{},smalltalk.ClassesList)})},
  144. args: [],
  145. source: "resetNodes\x0a\x09nodes := nil",
  146. messageSends: [],
  147. referencedClasses: []
  148. }),
  149. smalltalk.ClassesList);
  150. smalltalk.addMethod(
  151. smalltalk.method({
  152. selector: "updateNodes",
  153. protocol: 'rendering',
  154. fn: function (){
  155. var self=this;
  156. return smalltalk.withContext(function($ctx1) {
  157. _st(self["@ul"])._contents_((function(html){
  158. return smalltalk.withContext(function($ctx2) {
  159. return _st(self._nodes())._do_((function(each){
  160. return smalltalk.withContext(function($ctx3) {
  161. return _st(each)._renderOn_(html);
  162. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  163. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  164. return self}, function($ctx1) {$ctx1.fill(self,"updateNodes",{},smalltalk.ClassesList)})},
  165. args: [],
  166. source: "updateNodes\x0a\x09ul contents: [ :html |\x0a\x09\x09self nodes do: [ :each |\x0a\x09\x09\x09each renderOn: html ]]",
  167. messageSends: ["contents:", "do:", "nodes", "renderOn:"],
  168. referencedClasses: []
  169. }),
  170. smalltalk.ClassesList);
  171. smalltalk.addMethod(
  172. smalltalk.method({
  173. selector: "on:",
  174. protocol: 'instance creation',
  175. fn: function (aBrowser){
  176. var self=this;
  177. return smalltalk.withContext(function($ctx1) {
  178. var $2,$3,$1;
  179. $2=self._new();
  180. _st($2)._browser_(aBrowser);
  181. $3=_st($2)._yourself();
  182. $1=$3;
  183. return $1;
  184. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowser:aBrowser},smalltalk.ClassesList.klass)})},
  185. args: ["aBrowser"],
  186. source: "on: aBrowser\x0a\x09^ self new\x0a\x09\x09browser: aBrowser;\x0a\x09\x09yourself",
  187. messageSends: ["browser:", "new", "yourself"],
  188. referencedClasses: []
  189. }),
  190. smalltalk.ClassesList.klass);
  191. smalltalk.addClass('ClassesListNode', smalltalk.Widget, ['browser', 'theClass', 'level', 'nodes'], 'IDE');
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "browser",
  195. protocol: 'accessing',
  196. fn: function (){
  197. var self=this;
  198. return smalltalk.withContext(function($ctx1) {
  199. var $1;
  200. $1=self["@browser"];
  201. return $1;
  202. }, function($ctx1) {$ctx1.fill(self,"browser",{},smalltalk.ClassesListNode)})},
  203. args: [],
  204. source: "browser\x0a\x09^ browser",
  205. messageSends: [],
  206. referencedClasses: []
  207. }),
  208. smalltalk.ClassesListNode);
  209. smalltalk.addMethod(
  210. smalltalk.method({
  211. selector: "browser:",
  212. protocol: 'accessing',
  213. fn: function (aBrowser){
  214. var self=this;
  215. return smalltalk.withContext(function($ctx1) {
  216. self["@browser"]=aBrowser;
  217. return self}, function($ctx1) {$ctx1.fill(self,"browser:",{aBrowser:aBrowser},smalltalk.ClassesListNode)})},
  218. args: ["aBrowser"],
  219. source: "browser: aBrowser\x0a\x09browser := aBrowser",
  220. messageSends: [],
  221. referencedClasses: []
  222. }),
  223. smalltalk.ClassesListNode);
  224. smalltalk.addMethod(
  225. smalltalk.method({
  226. selector: "getNodesFrom:",
  227. protocol: 'accessing',
  228. fn: function (aCollection){
  229. var self=this;
  230. var children,others;
  231. function $ClassesListNode(){return smalltalk.ClassesListNode||(typeof ClassesListNode=="undefined"?nil:ClassesListNode)}
  232. return smalltalk.withContext(function($ctx1) {
  233. var $1;
  234. children=[];
  235. others=[];
  236. _st(aCollection)._do_((function(each){
  237. return smalltalk.withContext(function($ctx2) {
  238. $1=_st(_st(each)._superclass()).__eq(self._theClass());
  239. if(smalltalk.assert($1)){
  240. return _st(children)._add_(each);
  241. $ctx2.sendIdx["add:"]=1;
  242. } else {
  243. return _st(others)._add_(each);
  244. };
  245. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  246. self["@nodes"]=_st(children)._collect_((function(each){
  247. return smalltalk.withContext(function($ctx2) {
  248. return _st($ClassesListNode())._on_browser_classes_level_(each,self._browser(),others,_st(self._level()).__plus((1)));
  249. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
  250. return self}, function($ctx1) {$ctx1.fill(self,"getNodesFrom:",{aCollection:aCollection,children:children,others:others},smalltalk.ClassesListNode)})},
  251. args: ["aCollection"],
  252. 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 ]",
  253. messageSends: ["do:", "ifTrue:ifFalse:", "=", "superclass", "theClass", "add:", "collect:", "on:browser:classes:level:", "browser", "+", "level"],
  254. referencedClasses: ["ClassesListNode"]
  255. }),
  256. smalltalk.ClassesListNode);
  257. smalltalk.addMethod(
  258. smalltalk.method({
  259. selector: "label",
  260. protocol: 'accessing',
  261. fn: function (){
  262. var self=this;
  263. var str;
  264. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  265. return smalltalk.withContext(function($ctx1) {
  266. var $1;
  267. str=_st(_st($String())._new())._writeStream();
  268. _st(self._level())._timesRepeat_((function(){
  269. return smalltalk.withContext(function($ctx2) {
  270. return _st(str)._nextPutAll_("    ");
  271. $ctx2.sendIdx["nextPutAll:"]=1;
  272. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  273. _st(str)._nextPutAll_(_st(self._theClass())._name());
  274. $1=_st(str)._contents();
  275. return $1;
  276. }, function($ctx1) {$ctx1.fill(self,"label",{str:str},smalltalk.ClassesListNode)})},
  277. args: [],
  278. 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",
  279. messageSends: ["writeStream", "new", "timesRepeat:", "level", "nextPutAll:", "name", "theClass", "contents"],
  280. referencedClasses: ["String"]
  281. }),
  282. smalltalk.ClassesListNode);
  283. smalltalk.addMethod(
  284. smalltalk.method({
  285. selector: "level",
  286. protocol: 'accessing',
  287. fn: function (){
  288. var self=this;
  289. return smalltalk.withContext(function($ctx1) {
  290. var $1;
  291. $1=self["@level"];
  292. return $1;
  293. }, function($ctx1) {$ctx1.fill(self,"level",{},smalltalk.ClassesListNode)})},
  294. args: [],
  295. source: "level\x0a\x09^ level",
  296. messageSends: [],
  297. referencedClasses: []
  298. }),
  299. smalltalk.ClassesListNode);
  300. smalltalk.addMethod(
  301. smalltalk.method({
  302. selector: "level:",
  303. protocol: 'accessing',
  304. fn: function (anInteger){
  305. var self=this;
  306. return smalltalk.withContext(function($ctx1) {
  307. self["@level"]=anInteger;
  308. return self}, function($ctx1) {$ctx1.fill(self,"level:",{anInteger:anInteger},smalltalk.ClassesListNode)})},
  309. args: ["anInteger"],
  310. source: "level: anInteger\x0a\x09level := anInteger",
  311. messageSends: [],
  312. referencedClasses: []
  313. }),
  314. smalltalk.ClassesListNode);
  315. smalltalk.addMethod(
  316. smalltalk.method({
  317. selector: "nodes",
  318. protocol: 'accessing',
  319. fn: function (){
  320. var self=this;
  321. return smalltalk.withContext(function($ctx1) {
  322. var $1;
  323. $1=self["@nodes"];
  324. return $1;
  325. }, function($ctx1) {$ctx1.fill(self,"nodes",{},smalltalk.ClassesListNode)})},
  326. args: [],
  327. source: "nodes\x0a\x09^ nodes",
  328. messageSends: [],
  329. referencedClasses: []
  330. }),
  331. smalltalk.ClassesListNode);
  332. smalltalk.addMethod(
  333. smalltalk.method({
  334. selector: "renderOn:",
  335. protocol: 'rendering',
  336. fn: function (html){
  337. var self=this;
  338. var li,cssClass;
  339. return smalltalk.withContext(function($ctx1) {
  340. var $1,$2,$4,$5,$3,$6;
  341. cssClass="";
  342. li=_st(_st(html)._li())._onClick_((function(){
  343. return smalltalk.withContext(function($ctx2) {
  344. $1=self._browser();
  345. $ctx2.sendIdx["browser"]=1;
  346. $2=self._theClass();
  347. $ctx2.sendIdx["theClass"]=1;
  348. return _st($1)._selectClass_($2);
  349. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  350. _st(_st(li)._asJQuery())._html_(self._label());
  351. $4=_st(self._browser())._selectedClass();
  352. $5=self._theClass();
  353. $ctx1.sendIdx["theClass"]=2;
  354. $3=_st($4).__eq($5);
  355. if(smalltalk.assert($3)){
  356. cssClass=_st(cssClass).__comma(" selected");
  357. $ctx1.sendIdx[","]=1;
  358. cssClass;
  359. };
  360. $6=_st(_st(self._theClass())._comment())._isEmpty();
  361. if(! smalltalk.assert($6)){
  362. cssClass=_st(cssClass).__comma(" commented");
  363. cssClass;
  364. };
  365. _st(li)._class_(cssClass);
  366. _st(self._nodes())._do_((function(each){
  367. return smalltalk.withContext(function($ctx2) {
  368. return _st(each)._renderOn_(html);
  369. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
  370. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html,li:li,cssClass:cssClass},smalltalk.ClassesListNode)})},
  371. args: ["html"],
  372. 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 ]",
  373. messageSends: ["onClick:", "li", "selectClass:", "browser", "theClass", "html:", "asJQuery", "label", "ifTrue:", "=", "selectedClass", ",", "ifFalse:", "isEmpty", "comment", "class:", "do:", "nodes", "renderOn:"],
  374. referencedClasses: []
  375. }),
  376. smalltalk.ClassesListNode);
  377. smalltalk.addMethod(
  378. smalltalk.method({
  379. selector: "theClass",
  380. protocol: 'accessing',
  381. fn: function (){
  382. var self=this;
  383. return smalltalk.withContext(function($ctx1) {
  384. var $1;
  385. $1=self["@theClass"];
  386. return $1;
  387. }, function($ctx1) {$ctx1.fill(self,"theClass",{},smalltalk.ClassesListNode)})},
  388. args: [],
  389. source: "theClass\x0a\x09^ theClass",
  390. messageSends: [],
  391. referencedClasses: []
  392. }),
  393. smalltalk.ClassesListNode);
  394. smalltalk.addMethod(
  395. smalltalk.method({
  396. selector: "theClass:",
  397. protocol: 'accessing',
  398. fn: function (aClass){
  399. var self=this;
  400. return smalltalk.withContext(function($ctx1) {
  401. self["@theClass"]=aClass;
  402. return self}, function($ctx1) {$ctx1.fill(self,"theClass:",{aClass:aClass},smalltalk.ClassesListNode)})},
  403. args: ["aClass"],
  404. source: "theClass: aClass\x0a\x09theClass := aClass",
  405. messageSends: [],
  406. referencedClasses: []
  407. }),
  408. smalltalk.ClassesListNode);
  409. smalltalk.addMethod(
  410. smalltalk.method({
  411. selector: "on:browser:classes:level:",
  412. protocol: 'instance creation',
  413. fn: function (aClass,aBrowser,aCollection,anInteger){
  414. var self=this;
  415. return smalltalk.withContext(function($ctx1) {
  416. var $2,$3,$1;
  417. $2=self._new();
  418. _st($2)._theClass_(aClass);
  419. _st($2)._browser_(aBrowser);
  420. _st($2)._level_(anInteger);
  421. _st($2)._getNodesFrom_(aCollection);
  422. $3=_st($2)._yourself();
  423. $1=$3;
  424. return $1;
  425. }, function($ctx1) {$ctx1.fill(self,"on:browser:classes:level:",{aClass:aClass,aBrowser:aBrowser,aCollection:aCollection,anInteger:anInteger},smalltalk.ClassesListNode.klass)})},
  426. args: ["aClass", "aBrowser", "aCollection", "anInteger"],
  427. 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",
  428. messageSends: ["theClass:", "new", "browser:", "level:", "getNodesFrom:", "yourself"],
  429. referencedClasses: []
  430. }),
  431. smalltalk.ClassesListNode.klass);
  432. smalltalk.addClass('DebugErrorHandler', smalltalk.ErrorHandler, [], 'IDE');
  433. smalltalk.addMethod(
  434. smalltalk.method({
  435. selector: "handleError:",
  436. protocol: 'error handling',
  437. fn: function (anError){
  438. var self=this;
  439. function $Debugger(){return smalltalk.Debugger||(typeof Debugger=="undefined"?nil:Debugger)}
  440. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  441. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  442. return smalltalk.withContext(function($ctx1) {
  443. var $1,$2;
  444. _st((function(){
  445. return smalltalk.withContext(function($ctx2) {
  446. $1=_st($Debugger())._new();
  447. $ctx2.sendIdx["new"]=1;
  448. _st($1)._error_(anError);
  449. $2=_st($1)._open();
  450. return $2;
  451. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(error){
  452. return smalltalk.withContext(function($ctx2) {
  453. return _st(_st($ErrorHandler())._new())._handleError_(error);
  454. }, function($ctx2) {$ctx2.fillBlock({error:error},$ctx1,2)})}));
  455. return self}, function($ctx1) {$ctx1.fill(self,"handleError:",{anError:anError},smalltalk.DebugErrorHandler)})},
  456. args: ["anError"],
  457. 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 ]",
  458. messageSends: ["on:do:", "error:", "new", "open", "handleError:"],
  459. referencedClasses: ["Debugger", "Error", "ErrorHandler"]
  460. }),
  461. smalltalk.DebugErrorHandler);
  462. smalltalk.addMethod(
  463. smalltalk.method({
  464. selector: "initialize",
  465. protocol: 'initialization',
  466. fn: function (){
  467. var self=this;
  468. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  469. return smalltalk.withContext(function($ctx1) {
  470. var $1;
  471. $1=_st($ErrorHandler())._current();
  472. if(($receiver = $1) == nil || $receiver == null){
  473. self._register();
  474. } else {
  475. $1;
  476. };
  477. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.DebugErrorHandler.klass)})},
  478. args: [],
  479. source: "initialize\x0a\x09ErrorHandler current ifNil: [ self register ]",
  480. messageSends: ["ifNil:", "current", "register"],
  481. referencedClasses: ["ErrorHandler"]
  482. }),
  483. smalltalk.DebugErrorHandler.klass);
  484. smalltalk.addClass('SourceArea', smalltalk.Widget, ['editor', 'div', 'receiver', 'onDoIt'], 'IDE');
  485. smalltalk.addMethod(
  486. smalltalk.method({
  487. selector: "clear",
  488. protocol: 'actions',
  489. fn: function (){
  490. var self=this;
  491. return smalltalk.withContext(function($ctx1) {
  492. self._val_("");
  493. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.SourceArea)})},
  494. args: [],
  495. source: "clear\x0a\x09self val: ''",
  496. messageSends: ["val:"],
  497. referencedClasses: []
  498. }),
  499. smalltalk.SourceArea);
  500. smalltalk.addMethod(
  501. smalltalk.method({
  502. selector: "currentLine",
  503. protocol: 'accessing',
  504. fn: function (){
  505. var self=this;
  506. return smalltalk.withContext(function($ctx1) {
  507. var $1;
  508. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  509. return $1;
  510. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},smalltalk.SourceArea)})},
  511. args: [],
  512. source: "currentLine\x0a\x09^ editor getLine: (editor getCursor line)",
  513. messageSends: ["getLine:", "line", "getCursor"],
  514. referencedClasses: []
  515. }),
  516. smalltalk.SourceArea);
  517. smalltalk.addMethod(
  518. smalltalk.method({
  519. selector: "currentLineOrSelection",
  520. protocol: 'accessing',
  521. fn: function (){
  522. var self=this;
  523. return smalltalk.withContext(function($ctx1) {
  524. var $2,$1;
  525. $2=_st(self["@editor"])._somethingSelected();
  526. if(smalltalk.assert($2)){
  527. $1=self._selection();
  528. } else {
  529. $1=self._currentLine();
  530. };
  531. return $1;
  532. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},smalltalk.SourceArea)})},
  533. args: [],
  534. source: "currentLineOrSelection\x0a\x09^ editor somethingSelected\x0a\x09ifFalse: [ self currentLine ]\x0a\x09ifTrue: [ self selection ]",
  535. messageSends: ["ifFalse:ifTrue:", "somethingSelected", "currentLine", "selection"],
  536. referencedClasses: []
  537. }),
  538. smalltalk.SourceArea);
  539. smalltalk.addMethod(
  540. smalltalk.method({
  541. selector: "doIt",
  542. protocol: 'actions',
  543. fn: function (){
  544. var self=this;
  545. var result;
  546. return smalltalk.withContext(function($ctx1) {
  547. var $1,$2;
  548. result=self._eval_(self._currentLineOrSelection());
  549. $1=self._onDoIt();
  550. $ctx1.sendIdx["onDoIt"]=1;
  551. if(($receiver = $1) == nil || $receiver == null){
  552. $1;
  553. } else {
  554. _st(self._onDoIt())._value();
  555. };
  556. $2=result;
  557. return $2;
  558. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},smalltalk.SourceArea)})},
  559. args: [],
  560. source: "doIt\x0a\x09| result |\x0a\x09result := self eval: self currentLineOrSelection.\x0a\x09self onDoIt ifNotNil: [ self onDoIt value ].\x0a\x09^ result",
  561. messageSends: ["eval:", "currentLineOrSelection", "ifNotNil:", "onDoIt", "value"],
  562. referencedClasses: []
  563. }),
  564. smalltalk.SourceArea);
  565. smalltalk.addMethod(
  566. smalltalk.method({
  567. selector: "editor",
  568. protocol: 'accessing',
  569. fn: function (){
  570. var self=this;
  571. return smalltalk.withContext(function($ctx1) {
  572. var $1;
  573. $1=self["@editor"];
  574. return $1;
  575. }, function($ctx1) {$ctx1.fill(self,"editor",{},smalltalk.SourceArea)})},
  576. args: [],
  577. source: "editor\x0a\x09^ editor",
  578. messageSends: [],
  579. referencedClasses: []
  580. }),
  581. smalltalk.SourceArea);
  582. smalltalk.addMethod(
  583. smalltalk.method({
  584. selector: "eval:",
  585. protocol: 'actions',
  586. fn: function (aString){
  587. var self=this;
  588. var compiler;
  589. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  590. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  591. return smalltalk.withContext(function($ctx1) {
  592. var $1,$2;
  593. var $early={};
  594. try {
  595. compiler=_st($Compiler())._new();
  596. _st((function(){
  597. return smalltalk.withContext(function($ctx2) {
  598. return _st(compiler)._parseExpression_(aString);
  599. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(ex){
  600. return smalltalk.withContext(function($ctx2) {
  601. $1=self._alert_(_st(ex)._messageText());
  602. throw $early=[$1];
  603. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})}));
  604. $2=_st(compiler)._evaluateExpression_on_(aString,self._receiver());
  605. return $2;
  606. }
  607. catch(e) {if(e===$early)return e[0]; throw e}
  608. }, function($ctx1) {$ctx1.fill(self,"eval:",{aString:aString,compiler:compiler},smalltalk.SourceArea)})},
  609. args: ["aString"],
  610. source: "eval: aString\x0a\x09| compiler |\x0a\x09compiler := Compiler new.\x0a\x09[ compiler parseExpression: aString ] on: Error do: [ :ex |\x0a\x09\x09^ self alert: ex messageText ].\x0a\x09^ compiler evaluateExpression: aString on: self receiver",
  611. messageSends: ["new", "on:do:", "parseExpression:", "alert:", "messageText", "evaluateExpression:on:", "receiver"],
  612. referencedClasses: ["Compiler", "Error"]
  613. }),
  614. smalltalk.SourceArea);
  615. smalltalk.addMethod(
  616. smalltalk.method({
  617. selector: "fileIn",
  618. protocol: 'actions',
  619. fn: function (){
  620. var self=this;
  621. function $Importer(){return smalltalk.Importer||(typeof Importer=="undefined"?nil:Importer)}
  622. return smalltalk.withContext(function($ctx1) {
  623. _st(_st($Importer())._new())._import_(_st(self._currentLineOrSelection())._readStream());
  624. return self}, function($ctx1) {$ctx1.fill(self,"fileIn",{},smalltalk.SourceArea)})},
  625. args: [],
  626. source: "fileIn\x0a\x09Importer new import: self currentLineOrSelection readStream",
  627. messageSends: ["import:", "new", "readStream", "currentLineOrSelection"],
  628. referencedClasses: ["Importer"]
  629. }),
  630. smalltalk.SourceArea);
  631. smalltalk.addMethod(
  632. smalltalk.method({
  633. selector: "focus",
  634. protocol: 'actions',
  635. fn: function (){
  636. var self=this;
  637. return smalltalk.withContext(function($ctx1) {
  638. _st(self._editor())._focus();
  639. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.SourceArea)})},
  640. args: [],
  641. source: "focus\x0a\x09self editor focus.",
  642. messageSends: ["focus", "editor"],
  643. referencedClasses: []
  644. }),
  645. smalltalk.SourceArea);
  646. smalltalk.addMethod(
  647. smalltalk.method({
  648. selector: "handleKeyDown:",
  649. protocol: 'actions',
  650. fn: function (anEvent){
  651. var self=this;
  652. return smalltalk.withContext(function($ctx1) {
  653. if(anEvent.ctrlKey) {
  654. if(anEvent.keyCode === 80) { //ctrl+p
  655. self._printIt();
  656. anEvent.preventDefault();
  657. return false;
  658. }
  659. if(anEvent.keyCode === 68) { //ctrl+d
  660. self._doIt();
  661. anEvent.preventDefault();
  662. return false;
  663. }
  664. if(anEvent.keyCode === 73) { //ctrl+i
  665. self._inspectIt();
  666. anEvent.preventDefault();
  667. return false;
  668. }
  669. };
  670. return self}, function($ctx1) {$ctx1.fill(self,"handleKeyDown:",{anEvent:anEvent},smalltalk.SourceArea)})},
  671. args: ["anEvent"],
  672. source: "handleKeyDown: anEvent\x0a\x09<if(anEvent.ctrlKey) {\x0a\x09\x09if(anEvent.keyCode === 80) { //ctrl+p\x0a\x09\x09\x09self._printIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09\x09if(anEvent.keyCode === 68) { //ctrl+d\x0a\x09\x09\x09self._doIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09\x09if(anEvent.keyCode === 73) { //ctrl+i\x0a\x09\x09\x09self._inspectIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09}>",
  673. messageSends: [],
  674. referencedClasses: []
  675. }),
  676. smalltalk.SourceArea);
  677. smalltalk.addMethod(
  678. smalltalk.method({
  679. selector: "inspectIt",
  680. protocol: 'actions',
  681. fn: function (){
  682. var self=this;
  683. return smalltalk.withContext(function($ctx1) {
  684. _st(self._doIt())._inspect();
  685. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{},smalltalk.SourceArea)})},
  686. args: [],
  687. source: "inspectIt\x0a\x09self doIt inspect",
  688. messageSends: ["inspect", "doIt"],
  689. referencedClasses: []
  690. }),
  691. smalltalk.SourceArea);
  692. smalltalk.addMethod(
  693. smalltalk.method({
  694. selector: "onDoIt",
  695. protocol: 'accessing',
  696. fn: function (){
  697. var self=this;
  698. return smalltalk.withContext(function($ctx1) {
  699. var $1;
  700. $1=self["@onDoIt"];
  701. return $1;
  702. }, function($ctx1) {$ctx1.fill(self,"onDoIt",{},smalltalk.SourceArea)})},
  703. args: [],
  704. source: "onDoIt\x0a\x09^ onDoIt",
  705. messageSends: [],
  706. referencedClasses: []
  707. }),
  708. smalltalk.SourceArea);
  709. smalltalk.addMethod(
  710. smalltalk.method({
  711. selector: "onDoIt:",
  712. protocol: 'accessing',
  713. fn: function (aBlock){
  714. var self=this;
  715. return smalltalk.withContext(function($ctx1) {
  716. self["@onDoIt"]=aBlock;
  717. return self}, function($ctx1) {$ctx1.fill(self,"onDoIt:",{aBlock:aBlock},smalltalk.SourceArea)})},
  718. args: ["aBlock"],
  719. source: "onDoIt: aBlock\x0a\x09onDoIt := aBlock",
  720. messageSends: [],
  721. referencedClasses: []
  722. }),
  723. smalltalk.SourceArea);
  724. smalltalk.addMethod(
  725. smalltalk.method({
  726. selector: "onKeyDown:",
  727. protocol: 'events',
  728. fn: function (aBlock){
  729. var self=this;
  730. return smalltalk.withContext(function($ctx1) {
  731. _st(self["@div"])._onKeyDown_(aBlock);
  732. return self}, function($ctx1) {$ctx1.fill(self,"onKeyDown:",{aBlock:aBlock},smalltalk.SourceArea)})},
  733. args: ["aBlock"],
  734. source: "onKeyDown: aBlock\x0a\x09div onKeyDown: aBlock",
  735. messageSends: ["onKeyDown:"],
  736. referencedClasses: []
  737. }),
  738. smalltalk.SourceArea);
  739. smalltalk.addMethod(
  740. smalltalk.method({
  741. selector: "onKeyUp:",
  742. protocol: 'events',
  743. fn: function (aBlock){
  744. var self=this;
  745. return smalltalk.withContext(function($ctx1) {
  746. _st(self["@div"])._onKeyUp_(aBlock);
  747. return self}, function($ctx1) {$ctx1.fill(self,"onKeyUp:",{aBlock:aBlock},smalltalk.SourceArea)})},
  748. args: ["aBlock"],
  749. source: "onKeyUp: aBlock\x0a\x09div onKeyUp: aBlock",
  750. messageSends: ["onKeyUp:"],
  751. referencedClasses: []
  752. }),
  753. smalltalk.SourceArea);
  754. smalltalk.addMethod(
  755. smalltalk.method({
  756. selector: "print:",
  757. protocol: 'actions',
  758. fn: function (aString){
  759. var self=this;
  760. var start,stop,currentLine;
  761. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  762. return smalltalk.withContext(function($ctx1) {
  763. var $1,$2,$4,$3,$5,$6,$7,$8,$10,$9,$11,$12,$13,$15,$14;
  764. $1=_st(self["@editor"])._getCursor_(false);
  765. $ctx1.sendIdx["getCursor:"]=1;
  766. currentLine=_st($1)._line();
  767. start=_st($HashedCollection())._new();
  768. $ctx1.sendIdx["new"]=1;
  769. _st(start)._at_put_("line",currentLine);
  770. $ctx1.sendIdx["at:put:"]=1;
  771. $2=start;
  772. $4=_st(self["@editor"])._getCursor_(false);
  773. $ctx1.sendIdx["getCursor:"]=2;
  774. $3=_st($4)._ch();
  775. _st($2)._at_put_("ch",$3);
  776. $ctx1.sendIdx["at:put:"]=2;
  777. $5=_st(self["@editor"])._getSelection();
  778. $ctx1.sendIdx["getSelection"]=1;
  779. _st($5)._ifEmpty_((function(){
  780. return smalltalk.withContext(function($ctx2) {
  781. $6=start;
  782. $7=_st(_st(self["@editor"])._getLine_(currentLine))._size();
  783. $ctx2.sendIdx["size"]=1;
  784. _st($6)._at_put_("ch",$7);
  785. $ctx2.sendIdx["at:put:"]=3;
  786. $8=self["@editor"];
  787. $10="line".__minus_gt(currentLine);
  788. $ctx2.sendIdx["->"]=1;
  789. $9=smalltalk.HashedCollection._from_([$10,"ch".__minus_gt((0))]);
  790. return _st($8)._setSelection_end_($9,start);
  791. $ctx2.sendIdx["setSelection:end:"]=1;
  792. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  793. stop=_st($HashedCollection())._new();
  794. _st(stop)._at_put_("line",currentLine);
  795. $ctx1.sendIdx["at:put:"]=4;
  796. $11=stop;
  797. $12=_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2));
  798. $ctx1.sendIdx["+"]=1;
  799. _st($11)._at_put_("ch",$12);
  800. $13=self["@editor"];
  801. $15=_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString);
  802. $ctx1.sendIdx[","]=2;
  803. $14=_st($15).__comma(" ");
  804. $ctx1.sendIdx[","]=1;
  805. _st($13)._replaceSelection_($14);
  806. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  807. _st(self["@editor"])._setSelection_end_(stop,start);
  808. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},smalltalk.SourceArea)})},
  809. args: ["aString"],
  810. source: "print: aString\x0a\x09| start stop currentLine |\x0a\x09currentLine := (editor getCursor: false) line.\x0a\x09start := HashedCollection new.\x0a\x09start at: 'line' put: currentLine.\x0a\x09start at: 'ch' put: (editor getCursor: false) ch.\x0a\x09(editor getSelection) ifEmpty: [\x0a\x09\x09\x22select current line if selection is empty\x22\x0a\x09\x09start at: 'ch' put: (editor getLine: currentLine) size.\x0a\x09\x09editor setSelection: #{'line' -> currentLine. 'ch' -> 0} end: start.\x0a\x09].\x0a\x09stop := HashedCollection new.\x0a\x09stop at: 'line' put: currentLine.\x0a\x09stop at: 'ch' put: ((start at: 'ch') + aString size + 2).\x0a\x0a\x09editor replaceSelection: (editor getSelection, ' ', aString, ' ').\x0a\x09editor setCursor: (editor getCursor: true).\x0a\x09editor setSelection: stop end: start",
  811. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "getSelection", "size", "getLine:", "setSelection:end:", "->", "+", "at:", "replaceSelection:", ",", "setCursor:"],
  812. referencedClasses: ["HashedCollection"]
  813. }),
  814. smalltalk.SourceArea);
  815. smalltalk.addMethod(
  816. smalltalk.method({
  817. selector: "printIt",
  818. protocol: 'actions',
  819. fn: function (){
  820. var self=this;
  821. return smalltalk.withContext(function($ctx1) {
  822. self._print_(_st(self._doIt())._printString());
  823. self._focus();
  824. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{},smalltalk.SourceArea)})},
  825. args: [],
  826. source: "printIt\x0a\x09self print: self doIt printString.\x0a\x09self focus.",
  827. messageSends: ["print:", "printString", "doIt", "focus"],
  828. referencedClasses: []
  829. }),
  830. smalltalk.SourceArea);
  831. smalltalk.addMethod(
  832. smalltalk.method({
  833. selector: "receiver",
  834. protocol: 'accessing',
  835. fn: function (){
  836. var self=this;
  837. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  838. return smalltalk.withContext(function($ctx1) {
  839. var $2,$1;
  840. $2=self["@receiver"];
  841. if(($receiver = $2) == nil || $receiver == null){
  842. $1=_st($DoIt())._new();
  843. } else {
  844. $1=$2;
  845. };
  846. return $1;
  847. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.SourceArea)})},
  848. args: [],
  849. source: "receiver\x0a\x09^ receiver ifNil: [ DoIt new ]",
  850. messageSends: ["ifNil:", "new"],
  851. referencedClasses: ["DoIt"]
  852. }),
  853. smalltalk.SourceArea);
  854. smalltalk.addMethod(
  855. smalltalk.method({
  856. selector: "receiver:",
  857. protocol: 'accessing',
  858. fn: function (anObject){
  859. var self=this;
  860. return smalltalk.withContext(function($ctx1) {
  861. self["@receiver"]=anObject;
  862. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.SourceArea)})},
  863. args: ["anObject"],
  864. source: "receiver: anObject\x0a\x09receiver := anObject",
  865. messageSends: [],
  866. referencedClasses: []
  867. }),
  868. smalltalk.SourceArea);
  869. smalltalk.addMethod(
  870. smalltalk.method({
  871. selector: "renderOn:",
  872. protocol: 'rendering',
  873. fn: function (html){
  874. var self=this;
  875. var textarea;
  876. return smalltalk.withContext(function($ctx1) {
  877. self["@div"]=_st(_st(html)._div())._class_("source");
  878. _st(self["@div"])._with_((function(){
  879. return smalltalk.withContext(function($ctx2) {
  880. textarea=_st(html)._textarea();
  881. return textarea;
  882. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  883. self._setEditorOn_(_st(textarea)._element());
  884. _st(self["@div"])._onKeyDown_((function(e){
  885. return smalltalk.withContext(function($ctx2) {
  886. return self._handleKeyDown_(e);
  887. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,2)})}));
  888. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html,textarea:textarea},smalltalk.SourceArea)})},
  889. args: ["html"],
  890. source: "renderOn: html\x0a\x09| textarea |\x0a\x09div := html div class: 'source'.\x0a\x09div with: [ textarea := html textarea ].\x0a\x09self setEditorOn: textarea element.\x0a\x09div onKeyDown: [ :e | self handleKeyDown: e ]",
  891. messageSends: ["class:", "div", "with:", "textarea", "setEditorOn:", "element", "onKeyDown:", "handleKeyDown:"],
  892. referencedClasses: []
  893. }),
  894. smalltalk.SourceArea);
  895. smalltalk.addMethod(
  896. smalltalk.method({
  897. selector: "selection",
  898. protocol: 'accessing',
  899. fn: function (){
  900. var self=this;
  901. return smalltalk.withContext(function($ctx1) {
  902. var $1;
  903. $1=_st(self["@editor"])._getSelection();
  904. return $1;
  905. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.SourceArea)})},
  906. args: [],
  907. source: "selection\x0a\x09^ editor getSelection",
  908. messageSends: ["getSelection"],
  909. referencedClasses: []
  910. }),
  911. smalltalk.SourceArea);
  912. smalltalk.addMethod(
  913. smalltalk.method({
  914. selector: "setEditorOn:",
  915. protocol: 'accessing',
  916. fn: function (aTextarea){
  917. var self=this;
  918. return smalltalk.withContext(function($ctx1) {
  919. self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
  920. theme: 'amber',
  921. lineNumbers: true,
  922. enterMode: 'flat',
  923. indentWithTabs: true,
  924. indentUnit: 4,
  925. matchBrackets: true,
  926. electricChars: false
  927. });
  928. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},smalltalk.SourceArea)})},
  929. args: ["aTextarea"],
  930. source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {\x0a\x09\x09theme: 'amber',\x0a\x09\x09\x09\x09lineNumbers: true,\x0a\x09\x09\x09\x09enterMode: 'flat',\x0a\x09\x09\x09\x09indentWithTabs: true,\x0a\x09\x09\x09\x09indentUnit: 4,\x0a\x09\x09\x09\x09matchBrackets: true,\x0a\x09\x09\x09\x09electricChars: false\x0a\x09})>",
  931. messageSends: [],
  932. referencedClasses: []
  933. }),
  934. smalltalk.SourceArea);
  935. smalltalk.addMethod(
  936. smalltalk.method({
  937. selector: "val",
  938. protocol: 'accessing',
  939. fn: function (){
  940. var self=this;
  941. return smalltalk.withContext(function($ctx1) {
  942. var $1;
  943. $1=_st(self["@editor"])._getValue();
  944. return $1;
  945. }, function($ctx1) {$ctx1.fill(self,"val",{},smalltalk.SourceArea)})},
  946. args: [],
  947. source: "val\x0a\x09^ editor getValue",
  948. messageSends: ["getValue"],
  949. referencedClasses: []
  950. }),
  951. smalltalk.SourceArea);
  952. smalltalk.addMethod(
  953. smalltalk.method({
  954. selector: "val:",
  955. protocol: 'accessing',
  956. fn: function (aString){
  957. var self=this;
  958. return smalltalk.withContext(function($ctx1) {
  959. _st(self["@editor"])._setValue_(aString);
  960. return self}, function($ctx1) {$ctx1.fill(self,"val:",{aString:aString},smalltalk.SourceArea)})},
  961. args: ["aString"],
  962. source: "val: aString\x0a\x09editor setValue: aString",
  963. messageSends: ["setValue:"],
  964. referencedClasses: []
  965. }),
  966. smalltalk.SourceArea);
  967. smalltalk.addMethod(
  968. smalltalk.method({
  969. selector: "initialize",
  970. protocol: 'initialization',
  971. fn: function (){
  972. var self=this;
  973. return smalltalk.withContext(function($ctx1) {
  974. smalltalk.SourceArea.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  975. self._setupCodeMirror();
  976. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.SourceArea.klass)})},
  977. args: [],
  978. source: "initialize\x0a\x09super initialize.\x0a\x09self setupCodeMirror",
  979. messageSends: ["initialize", "setupCodeMirror"],
  980. referencedClasses: []
  981. }),
  982. smalltalk.SourceArea.klass);
  983. smalltalk.addMethod(
  984. smalltalk.method({
  985. selector: "setupCodeMirror",
  986. protocol: 'initialization',
  987. fn: function (){
  988. var self=this;
  989. return smalltalk.withContext(function($ctx1) {
  990. CodeMirror.keyMap["default"].fallthrough = ["basic"] ;
  991. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.SourceArea.klass)})},
  992. args: [],
  993. source: "setupCodeMirror\x0a\x09< CodeMirror.keyMap[\x22default\x22].fallthrough = [\x22basic\x22] >",
  994. messageSends: [],
  995. referencedClasses: []
  996. }),
  997. smalltalk.SourceArea.klass);
  998. smalltalk.addClass('TabManager', smalltalk.Widget, ['selectedTab', 'tabs', 'opened', 'ul', 'input'], 'IDE');
  999. smalltalk.addMethod(
  1000. smalltalk.method({
  1001. selector: "addTab:",
  1002. protocol: 'adding/Removing',
  1003. fn: function (aWidget){
  1004. var self=this;
  1005. return smalltalk.withContext(function($ctx1) {
  1006. _st(self._tabs())._add_(aWidget);
  1007. _st(aWidget)._appendToJQuery_("#amber"._asJQuery());
  1008. _st(aWidget)._hide();
  1009. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aWidget:aWidget},smalltalk.TabManager)})},
  1010. args: ["aWidget"],
  1011. source: "addTab: aWidget\x0a\x09self tabs add: aWidget.\x0a\x09aWidget appendToJQuery: '#amber' asJQuery.\x0a\x09aWidget hide",
  1012. messageSends: ["add:", "tabs", "appendToJQuery:", "asJQuery", "hide"],
  1013. referencedClasses: []
  1014. }),
  1015. smalltalk.TabManager);
  1016. smalltalk.addMethod(
  1017. smalltalk.method({
  1018. selector: "close",
  1019. protocol: 'actions',
  1020. fn: function (){
  1021. var self=this;
  1022. return smalltalk.withContext(function($ctx1) {
  1023. var $1,$2,$3;
  1024. $1=self["@opened"];
  1025. if(smalltalk.assert($1)){
  1026. $2="#amber"._asJQuery();
  1027. $ctx1.sendIdx["asJQuery"]=1;
  1028. _st($2)._hide();
  1029. $ctx1.sendIdx["hide"]=1;
  1030. $3=_st(self["@ul"])._asJQuery();
  1031. $ctx1.sendIdx["asJQuery"]=2;
  1032. _st($3)._hide();
  1033. $ctx1.sendIdx["hide"]=2;
  1034. _st(self["@selectedTab"])._hide();
  1035. self._removeBodyMargin();
  1036. _st("body"._asJQuery())._removeClass_("amberBody");
  1037. self["@opened"]=false;
  1038. self["@opened"];
  1039. };
  1040. return self}, function($ctx1) {$ctx1.fill(self,"close",{},smalltalk.TabManager)})},
  1041. args: [],
  1042. source: "close\x0a\x09opened ifTrue: [\x0a\x09'#amber' asJQuery hide.\x0a\x09ul asJQuery hide.\x0a\x09selectedTab hide.\x0a\x09self removeBodyMargin.\x0a\x09'body' asJQuery removeClass: 'amberBody'.\x0a\x09opened := false ]",
  1043. messageSends: ["ifTrue:", "hide", "asJQuery", "removeBodyMargin", "removeClass:"],
  1044. referencedClasses: []
  1045. }),
  1046. smalltalk.TabManager);
  1047. smalltalk.addMethod(
  1048. smalltalk.method({
  1049. selector: "closeTab:",
  1050. protocol: 'actions',
  1051. fn: function (aWidget){
  1052. var self=this;
  1053. return smalltalk.withContext(function($ctx1) {
  1054. self._removeTab_(aWidget);
  1055. self._selectTab_(_st(self._tabs())._last());
  1056. _st(aWidget)._remove();
  1057. self._update();
  1058. return self}, function($ctx1) {$ctx1.fill(self,"closeTab:",{aWidget:aWidget},smalltalk.TabManager)})},
  1059. args: ["aWidget"],
  1060. source: "closeTab: aWidget\x0a\x09self removeTab: aWidget.\x0a\x09self selectTab: self tabs last.\x0a\x09aWidget remove.\x0a\x09self update",
  1061. messageSends: ["removeTab:", "selectTab:", "last", "tabs", "remove", "update"],
  1062. referencedClasses: []
  1063. }),
  1064. smalltalk.TabManager);
  1065. smalltalk.addMethod(
  1066. smalltalk.method({
  1067. selector: "initialize",
  1068. protocol: 'initialization',
  1069. fn: function (){
  1070. var self=this;
  1071. function $InspectorHandler(){return smalltalk.InspectorHandler||(typeof InspectorHandler=="undefined"?nil:InspectorHandler)}
  1072. function $Inspector(){return smalltalk.Inspector||(typeof Inspector=="undefined"?nil:Inspector)}
  1073. function $IDETranscript(){return smalltalk.IDETranscript||(typeof IDETranscript=="undefined"?nil:IDETranscript)}
  1074. function $Workspace(){return smalltalk.Workspace||(typeof Workspace=="undefined"?nil:Workspace)}
  1075. function $TestRunner(){return smalltalk.TestRunner||(typeof TestRunner=="undefined"?nil:TestRunner)}
  1076. return smalltalk.withContext(function($ctx1) {
  1077. var $1,$2,$3,$4,$5,$6,$7;
  1078. smalltalk.TabManager.superclass.fn.prototype._initialize.apply(_st(self), []);
  1079. _st($InspectorHandler())._register_($Inspector());
  1080. self["@opened"]=true;
  1081. $1=(function(html){
  1082. return smalltalk.withContext(function($ctx2) {
  1083. return _st(_st(html)._div())._id_("amber");
  1084. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})});
  1085. $2="body"._asJQuery();
  1086. $ctx1.sendIdx["asJQuery"]=1;
  1087. _st($1)._appendToJQuery_($2);
  1088. $ctx1.sendIdx["appendToJQuery:"]=1;
  1089. $3="body"._asJQuery();
  1090. $ctx1.sendIdx["asJQuery"]=2;
  1091. _st($3)._addClass_("amberBody");
  1092. self._appendToJQuery_("#amber"._asJQuery());
  1093. self._addTab_(_st($IDETranscript())._current());
  1094. $ctx1.sendIdx["addTab:"]=1;
  1095. $4=_st($Workspace())._new();
  1096. $ctx1.sendIdx["new"]=1;
  1097. self._addTab_($4);
  1098. $ctx1.sendIdx["addTab:"]=2;
  1099. $5=self._addTab_(_st($TestRunner())._new());
  1100. self._selectTab_(_st(self._tabs())._last());
  1101. self._onResize_((function(){
  1102. return smalltalk.withContext(function($ctx2) {
  1103. self._updateBodyMargin();
  1104. $6=self._updatePosition();
  1105. $ctx2.sendIdx["updatePosition"]=1;
  1106. return $6;
  1107. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1108. $7=self._onWindowResize_((function(){
  1109. return smalltalk.withContext(function($ctx2) {
  1110. return self._updatePosition();
  1111. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  1112. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.TabManager)})},
  1113. args: [],
  1114. source: "initialize\x0a\x09super initialize.\x0a\x09InspectorHandler register: Inspector.\x0a\x09opened := true.\x0a\x09[ :html | html div id: 'amber' ] appendToJQuery: 'body' asJQuery.\x0a\x09'body' asJQuery\x0a\x09addClass: 'amberBody'.\x0a\x09self appendToJQuery: '#amber' asJQuery.\x0a\x09self\x0a\x09addTab: IDETranscript current;\x0a\x09addTab: Workspace new;\x0a\x09addTab: TestRunner new.\x0a\x09self selectTab: self tabs last.\x0a\x09self\x0a\x09onResize: [ self updateBodyMargin; updatePosition ];\x0a\x09onWindowResize: [ self updatePosition ]",
  1115. messageSends: ["initialize", "register:", "appendToJQuery:", "id:", "div", "asJQuery", "addClass:", "addTab:", "current", "new", "selectTab:", "last", "tabs", "onResize:", "updateBodyMargin", "updatePosition", "onWindowResize:"],
  1116. referencedClasses: ["InspectorHandler", "Inspector", "IDETranscript", "Workspace", "TestRunner"]
  1117. }),
  1118. smalltalk.TabManager);
  1119. smalltalk.addMethod(
  1120. smalltalk.method({
  1121. selector: "labelFor:",
  1122. protocol: 'accessing',
  1123. fn: function (aWidget){
  1124. var self=this;
  1125. var label,maxSize;
  1126. return smalltalk.withContext(function($ctx1) {
  1127. var $1,$4,$3,$2,$5,$6;
  1128. maxSize=(15);
  1129. $1=_st(aWidget)._label();
  1130. $ctx1.sendIdx["label"]=1;
  1131. $4=_st(aWidget)._label();
  1132. $ctx1.sendIdx["label"]=2;
  1133. $3=_st($4)._size();
  1134. $ctx1.sendIdx["size"]=1;
  1135. $2=_st($3)._min_(maxSize);
  1136. label=_st($1)._copyFrom_to_((0),$2);
  1137. $5=_st(_st(_st(aWidget)._label())._size()).__gt(maxSize);
  1138. if(smalltalk.assert($5)){
  1139. label=_st(label).__comma("...");
  1140. label;
  1141. };
  1142. $6=label;
  1143. return $6;
  1144. }, function($ctx1) {$ctx1.fill(self,"labelFor:",{aWidget:aWidget,label:label,maxSize:maxSize},smalltalk.TabManager)})},
  1145. args: ["aWidget"],
  1146. 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",
  1147. messageSends: ["copyFrom:to:", "label", "min:", "size", "ifTrue:", ">", ","],
  1148. referencedClasses: []
  1149. }),
  1150. smalltalk.TabManager);
  1151. smalltalk.addMethod(
  1152. smalltalk.method({
  1153. selector: "newBrowserTab",
  1154. protocol: 'actions',
  1155. fn: function (){
  1156. var self=this;
  1157. function $Browser(){return smalltalk.Browser||(typeof Browser=="undefined"?nil:Browser)}
  1158. return smalltalk.withContext(function($ctx1) {
  1159. _st($Browser())._open();
  1160. return self}, function($ctx1) {$ctx1.fill(self,"newBrowserTab",{},smalltalk.TabManager)})},
  1161. args: [],
  1162. source: "newBrowserTab\x0a\x09Browser open",
  1163. messageSends: ["open"],
  1164. referencedClasses: ["Browser"]
  1165. }),
  1166. smalltalk.TabManager);
  1167. smalltalk.addMethod(
  1168. smalltalk.method({
  1169. selector: "onResize:",
  1170. protocol: 'actions',
  1171. fn: function (aBlock){
  1172. var self=this;
  1173. return smalltalk.withContext(function($ctx1) {
  1174. var $1,$3,$4,$2;
  1175. $1="#amber"._asJQuery();
  1176. $3="handles".__minus_gt("n");
  1177. $ctx1.sendIdx["->"]=1;
  1178. $4="resize".__minus_gt(aBlock);
  1179. $ctx1.sendIdx["->"]=2;
  1180. $2=smalltalk.HashedCollection._from_([$3,$4,"minHeight".__minus_gt((230))]);
  1181. _st($1)._resizable_($2);
  1182. return self}, function($ctx1) {$ctx1.fill(self,"onResize:",{aBlock:aBlock},smalltalk.TabManager)})},
  1183. args: ["aBlock"],
  1184. source: "onResize: aBlock\x0a\x09'#amber' asJQuery resizable: #{\x0a\x09\x09'handles' -> 'n'.\x0a\x09\x09'resize' -> aBlock.\x0a\x09\x09'minHeight' -> 230\x0a\x09}",
  1185. messageSends: ["resizable:", "asJQuery", "->"],
  1186. referencedClasses: []
  1187. }),
  1188. smalltalk.TabManager);
  1189. smalltalk.addMethod(
  1190. smalltalk.method({
  1191. selector: "onWindowResize:",
  1192. protocol: 'actions',
  1193. fn: function (aBlock){
  1194. var self=this;
  1195. return smalltalk.withContext(function($ctx1) {
  1196. _st(_st(window)._asJQuery())._resize_(aBlock);
  1197. return self}, function($ctx1) {$ctx1.fill(self,"onWindowResize:",{aBlock:aBlock},smalltalk.TabManager)})},
  1198. args: ["aBlock"],
  1199. source: "onWindowResize: aBlock\x0a\x09window asJQuery resize: aBlock",
  1200. messageSends: ["resize:", "asJQuery"],
  1201. referencedClasses: []
  1202. }),
  1203. smalltalk.TabManager);
  1204. smalltalk.addMethod(
  1205. smalltalk.method({
  1206. selector: "open",
  1207. protocol: 'actions',
  1208. fn: function (){
  1209. var self=this;
  1210. return smalltalk.withContext(function($ctx1) {
  1211. var $1,$2,$3;
  1212. $1=self["@opened"];
  1213. if(! smalltalk.assert($1)){
  1214. $2="body"._asJQuery();
  1215. $ctx1.sendIdx["asJQuery"]=1;
  1216. _st($2)._addClass_("amberBody");
  1217. $3="#amber"._asJQuery();
  1218. $ctx1.sendIdx["asJQuery"]=2;
  1219. _st($3)._show();
  1220. $ctx1.sendIdx["show"]=1;
  1221. _st(_st(self["@ul"])._asJQuery())._show();
  1222. $ctx1.sendIdx["show"]=2;
  1223. self._updateBodyMargin();
  1224. _st(self["@selectedTab"])._show();
  1225. self["@opened"]=true;
  1226. self["@opened"];
  1227. };
  1228. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.TabManager)})},
  1229. args: [],
  1230. source: "open\x0a\x09opened ifFalse: [\x0a\x09'body' asJQuery addClass: 'amberBody'.\x0a\x09'#amber' asJQuery show.\x0a\x09ul asJQuery show.\x0a\x09self updateBodyMargin.\x0a\x09selectedTab show.\x0a\x09opened := true ]",
  1231. messageSends: ["ifFalse:", "addClass:", "asJQuery", "show", "updateBodyMargin"],
  1232. referencedClasses: []
  1233. }),
  1234. smalltalk.TabManager);
  1235. smalltalk.addMethod(
  1236. smalltalk.method({
  1237. selector: "removeBodyMargin",
  1238. protocol: 'actions',
  1239. fn: function (){
  1240. var self=this;
  1241. return smalltalk.withContext(function($ctx1) {
  1242. self._setBodyMargin_((0));
  1243. return self}, function($ctx1) {$ctx1.fill(self,"removeBodyMargin",{},smalltalk.TabManager)})},
  1244. args: [],
  1245. source: "removeBodyMargin\x0a\x09self setBodyMargin: 0",
  1246. messageSends: ["setBodyMargin:"],
  1247. referencedClasses: []
  1248. }),
  1249. smalltalk.TabManager);
  1250. smalltalk.addMethod(
  1251. smalltalk.method({
  1252. selector: "removeTab:",
  1253. protocol: 'adding/Removing',
  1254. fn: function (aWidget){
  1255. var self=this;
  1256. return smalltalk.withContext(function($ctx1) {
  1257. _st(self._tabs())._remove_(aWidget);
  1258. self._update();
  1259. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aWidget:aWidget},smalltalk.TabManager)})},
  1260. args: ["aWidget"],
  1261. source: "removeTab: aWidget\x0a\x09self tabs remove: aWidget.\x0a\x09self update",
  1262. messageSends: ["remove:", "tabs", "update"],
  1263. referencedClasses: []
  1264. }),
  1265. smalltalk.TabManager);
  1266. smalltalk.addMethod(
  1267. smalltalk.method({
  1268. selector: "renderOn:",
  1269. protocol: 'rendering',
  1270. fn: function (html){
  1271. var self=this;
  1272. return smalltalk.withContext(function($ctx1) {
  1273. var $1,$2;
  1274. _st(_st(html)._div())._id_("logo");
  1275. $ctx1.sendIdx["id:"]=1;
  1276. self._renderToolbarOn_(html);
  1277. $1=_st(html)._ul();
  1278. _st($1)._id_("amberTabs");
  1279. $2=_st($1)._yourself();
  1280. self["@ul"]=$2;
  1281. self._renderTabs();
  1282. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.TabManager)})},
  1283. args: ["html"],
  1284. 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",
  1285. messageSends: ["id:", "div", "renderToolbarOn:", "ul", "yourself", "renderTabs"],
  1286. referencedClasses: []
  1287. }),
  1288. smalltalk.TabManager);
  1289. smalltalk.addMethod(
  1290. smalltalk.method({
  1291. selector: "renderTabFor:on:",
  1292. protocol: 'rendering',
  1293. fn: function (aWidget,html){
  1294. var self=this;
  1295. var li;
  1296. return smalltalk.withContext(function($ctx1) {
  1297. var $1,$2,$3,$4,$6,$7,$8,$9,$5,$10;
  1298. li=_st(html)._li();
  1299. $1=_st(self["@selectedTab"]).__eq(aWidget);
  1300. if(smalltalk.assert($1)){
  1301. _st(li)._class_("selected");
  1302. $ctx1.sendIdx["class:"]=1;
  1303. };
  1304. $2=li;
  1305. _st($2)._with_((function(){
  1306. return smalltalk.withContext(function($ctx2) {
  1307. $3=_st(html)._span();
  1308. $ctx2.sendIdx["span"]=1;
  1309. _st($3)._class_("ltab");
  1310. $ctx2.sendIdx["class:"]=2;
  1311. $4=_st(html)._span();
  1312. $ctx2.sendIdx["span"]=2;
  1313. _st($4)._class_("mtab");
  1314. $ctx2.sendIdx["class:"]=3;
  1315. $5=_st($4)._with_((function(){
  1316. return smalltalk.withContext(function($ctx3) {
  1317. $6=_st(aWidget)._canBeClosed();
  1318. if(smalltalk.assert($6)){
  1319. $7=_st(html)._span();
  1320. $ctx3.sendIdx["span"]=3;
  1321. _st($7)._class_("close");
  1322. $ctx3.sendIdx["class:"]=4;
  1323. _st($7)._with_("x");
  1324. $ctx3.sendIdx["with:"]=3;
  1325. $8=_st($7)._onClick_((function(){
  1326. return smalltalk.withContext(function($ctx4) {
  1327. return self._closeTab_(aWidget);
  1328. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)})}));
  1329. $ctx3.sendIdx["onClick:"]=1;
  1330. $8;
  1331. };
  1332. $9=_st(html)._span();
  1333. $ctx3.sendIdx["span"]=4;
  1334. return _st($9)._with_(self._labelFor_(aWidget));
  1335. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  1336. $ctx2.sendIdx["with:"]=2;
  1337. $5;
  1338. return _st(_st(html)._span())._class_("rtab");
  1339. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1340. $ctx1.sendIdx["with:"]=1;
  1341. $10=_st($2)._onClick_((function(){
  1342. return smalltalk.withContext(function($ctx2) {
  1343. return self._selectTab_(aWidget);
  1344. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
  1345. return self}, function($ctx1) {$ctx1.fill(self,"renderTabFor:on:",{aWidget:aWidget,html:html,li:li},smalltalk.TabManager)})},
  1346. args: ["aWidget", "html"],
  1347. 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 ]",
  1348. messageSends: ["li", "ifTrue:", "=", "class:", "with:", "span", "canBeClosed", "onClick:", "closeTab:", "labelFor:", "selectTab:"],
  1349. referencedClasses: []
  1350. }),
  1351. smalltalk.TabManager);
  1352. smalltalk.addMethod(
  1353. smalltalk.method({
  1354. selector: "renderTabs",
  1355. protocol: 'rendering',
  1356. fn: function (){
  1357. var self=this;
  1358. return smalltalk.withContext(function($ctx1) {
  1359. var $1,$2,$3,$4,$5;
  1360. _st(self["@ul"])._contents_((function(html){
  1361. return smalltalk.withContext(function($ctx2) {
  1362. _st(self._tabs())._do_((function(each){
  1363. return smalltalk.withContext(function($ctx3) {
  1364. return self._renderTabFor_on_(each,html);
  1365. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  1366. $1=_st(html)._li();
  1367. _st($1)._class_("newtab");
  1368. $ctx2.sendIdx["class:"]=1;
  1369. _st($1)._with_((function(){
  1370. return smalltalk.withContext(function($ctx3) {
  1371. $2=_st(html)._span();
  1372. $ctx3.sendIdx["span"]=1;
  1373. _st($2)._class_("ltab");
  1374. $ctx3.sendIdx["class:"]=2;
  1375. $3=_st(html)._span();
  1376. $ctx3.sendIdx["span"]=2;
  1377. _st($3)._class_("mtab");
  1378. $ctx3.sendIdx["class:"]=3;
  1379. $4=_st($3)._with_(" + ");
  1380. $4;
  1381. return _st(_st(html)._span())._class_("rtab");
  1382. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  1383. $ctx2.sendIdx["with:"]=1;
  1384. $5=_st($1)._onClick_((function(){
  1385. return smalltalk.withContext(function($ctx3) {
  1386. return self._newBrowserTab();
  1387. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  1388. return $5;
  1389. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  1390. return self}, function($ctx1) {$ctx1.fill(self,"renderTabs",{},smalltalk.TabManager)})},
  1391. args: [],
  1392. source: "renderTabs\x0a\x09ul contents: [ :html |\x0a\x09\x09self tabs do: [ :each |\x0a\x09\x09self renderTabFor: each on: html ].\x0a\x09\x09html li\x0a\x09\x09class: 'newtab';\x0a\x09\x09with: [\x0a\x09\x09\x09html span class: 'ltab'.\x0a\x09\x09\x09html span class: 'mtab'; with: ' + '.\x0a\x09\x09\x09html span class: 'rtab' ];\x0a\x09\x09onClick: [ self newBrowserTab ]]",
  1393. messageSends: ["contents:", "do:", "tabs", "renderTabFor:on:", "class:", "li", "with:", "span", "onClick:", "newBrowserTab"],
  1394. referencedClasses: []
  1395. }),
  1396. smalltalk.TabManager);
  1397. smalltalk.addMethod(
  1398. smalltalk.method({
  1399. selector: "renderToolbarOn:",
  1400. protocol: 'rendering',
  1401. fn: function (html){
  1402. var self=this;
  1403. return smalltalk.withContext(function($ctx1) {
  1404. var $1,$3,$4,$5,$6,$7,$2;
  1405. $1=_st(html)._div();
  1406. $ctx1.sendIdx["div"]=1;
  1407. _st($1)._id_("amber_toolbar");
  1408. $ctx1.sendIdx["id:"]=1;
  1409. $2=_st($1)._with_((function(){
  1410. return smalltalk.withContext(function($ctx2) {
  1411. $3=_st(html)._input();
  1412. _st($3)._class_("implementors");
  1413. $4=_st($3)._yourself();
  1414. self["@input"]=$4;
  1415. self["@input"];
  1416. _st(self["@input"])._onKeyPress_((function(event){
  1417. return smalltalk.withContext(function($ctx3) {
  1418. $5=_st(_st(event)._keyCode()).__eq((13));
  1419. if(smalltalk.assert($5)){
  1420. return self._search_(_st(_st(self["@input"])._asJQuery())._val());
  1421. };
  1422. }, function($ctx3) {$ctx3.fillBlock({event:event},$ctx2,2)})}));
  1423. $6=_st(html)._div();
  1424. _st($6)._id_("amber_close");
  1425. $7=_st($6)._onClick_((function(){
  1426. return smalltalk.withContext(function($ctx3) {
  1427. return self._close();
  1428. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  1429. return $7;
  1430. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1431. return self}, function($ctx1) {$ctx1.fill(self,"renderToolbarOn:",{html:html},smalltalk.TabManager)})},
  1432. args: ["html"],
  1433. 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 ]]",
  1434. messageSends: ["id:", "div", "with:", "class:", "input", "yourself", "onKeyPress:", "ifTrue:", "=", "keyCode", "search:", "val", "asJQuery", "onClick:", "close"],
  1435. referencedClasses: []
  1436. }),
  1437. smalltalk.TabManager);
  1438. smalltalk.addMethod(
  1439. smalltalk.method({
  1440. selector: "search:",
  1441. protocol: 'actions',
  1442. fn: function (aString){
  1443. var self=this;
  1444. var searchedClass;
  1445. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1446. function $Browser(){return smalltalk.Browser||(typeof Browser=="undefined"?nil:Browser)}
  1447. function $ReferencesBrowser(){return smalltalk.ReferencesBrowser||(typeof ReferencesBrowser=="undefined"?nil:ReferencesBrowser)}
  1448. return smalltalk.withContext(function($ctx1) {
  1449. var $1;
  1450. searchedClass=_st(_st($Smalltalk())._current())._at_(aString);
  1451. $1=_st(searchedClass)._isClass();
  1452. if(smalltalk.assert($1)){
  1453. _st($Browser())._openOn_(searchedClass);
  1454. } else {
  1455. _st($ReferencesBrowser())._search_(aString);
  1456. };
  1457. return self}, function($ctx1) {$ctx1.fill(self,"search:",{aString:aString,searchedClass:searchedClass},smalltalk.TabManager)})},
  1458. args: ["aString"],
  1459. 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 ]",
  1460. messageSends: ["at:", "current", "ifTrue:ifFalse:", "isClass", "openOn:", "search:"],
  1461. referencedClasses: ["Smalltalk", "Browser", "ReferencesBrowser"]
  1462. }),
  1463. smalltalk.TabManager);
  1464. smalltalk.addMethod(
  1465. smalltalk.method({
  1466. selector: "selectTab:",
  1467. protocol: 'actions',
  1468. fn: function (aWidget){
  1469. var self=this;
  1470. return smalltalk.withContext(function($ctx1) {
  1471. self._open();
  1472. self["@selectedTab"]=aWidget;
  1473. _st(self._tabs())._do_((function(each){
  1474. return smalltalk.withContext(function($ctx2) {
  1475. return _st(each)._hide();
  1476. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1477. _st(aWidget)._show();
  1478. self._update();
  1479. return self}, function($ctx1) {$ctx1.fill(self,"selectTab:",{aWidget:aWidget},smalltalk.TabManager)})},
  1480. args: ["aWidget"],
  1481. source: "selectTab: aWidget\x0a\x09self open.\x0a\x09selectedTab := aWidget.\x0a\x09self tabs do: [ :each |\x0a\x09each hide ].\x0a\x09aWidget show.\x0a\x09\x0a\x09self update",
  1482. messageSends: ["open", "do:", "tabs", "hide", "show", "update"],
  1483. referencedClasses: []
  1484. }),
  1485. smalltalk.TabManager);
  1486. smalltalk.addMethod(
  1487. smalltalk.method({
  1488. selector: "setBodyMargin:",
  1489. protocol: 'actions',
  1490. fn: function (anInteger){
  1491. var self=this;
  1492. return smalltalk.withContext(function($ctx1) {
  1493. _st(".amberBody"._asJQuery())._css_put_("margin-bottom",_st(_st(anInteger)._asString()).__comma("px"));
  1494. return self}, function($ctx1) {$ctx1.fill(self,"setBodyMargin:",{anInteger:anInteger},smalltalk.TabManager)})},
  1495. args: ["anInteger"],
  1496. source: "setBodyMargin: anInteger\x0a\x09'.amberBody' asJQuery css: 'margin-bottom' put: anInteger asString, 'px'",
  1497. messageSends: ["css:put:", "asJQuery", ",", "asString"],
  1498. referencedClasses: []
  1499. }),
  1500. smalltalk.TabManager);
  1501. smalltalk.addMethod(
  1502. smalltalk.method({
  1503. selector: "tabs",
  1504. protocol: 'accessing',
  1505. fn: function (){
  1506. var self=this;
  1507. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  1508. return smalltalk.withContext(function($ctx1) {
  1509. var $2,$1;
  1510. $2=self["@tabs"];
  1511. if(($receiver = $2) == nil || $receiver == null){
  1512. self["@tabs"]=_st($Array())._new();
  1513. $1=self["@tabs"];
  1514. } else {
  1515. $1=$2;
  1516. };
  1517. return $1;
  1518. }, function($ctx1) {$ctx1.fill(self,"tabs",{},smalltalk.TabManager)})},
  1519. args: [],
  1520. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := Array new ]",
  1521. messageSends: ["ifNil:", "new"],
  1522. referencedClasses: ["Array"]
  1523. }),
  1524. smalltalk.TabManager);
  1525. smalltalk.addMethod(
  1526. smalltalk.method({
  1527. selector: "update",
  1528. protocol: 'updating',
  1529. fn: function (){
  1530. var self=this;
  1531. return smalltalk.withContext(function($ctx1) {
  1532. self._renderTabs();
  1533. return self}, function($ctx1) {$ctx1.fill(self,"update",{},smalltalk.TabManager)})},
  1534. args: [],
  1535. source: "update\x0a\x09self renderTabs",
  1536. messageSends: ["renderTabs"],
  1537. referencedClasses: []
  1538. }),
  1539. smalltalk.TabManager);
  1540. smalltalk.addMethod(
  1541. smalltalk.method({
  1542. selector: "updateBodyMargin",
  1543. protocol: 'actions',
  1544. fn: function (){
  1545. var self=this;
  1546. return smalltalk.withContext(function($ctx1) {
  1547. self._setBodyMargin_(_st("#amber"._asJQuery())._height());
  1548. return self}, function($ctx1) {$ctx1.fill(self,"updateBodyMargin",{},smalltalk.TabManager)})},
  1549. args: [],
  1550. source: "updateBodyMargin\x0a\x09self setBodyMargin: '#amber' asJQuery height",
  1551. messageSends: ["setBodyMargin:", "height", "asJQuery"],
  1552. referencedClasses: []
  1553. }),
  1554. smalltalk.TabManager);
  1555. smalltalk.addMethod(
  1556. smalltalk.method({
  1557. selector: "updatePosition",
  1558. protocol: 'actions',
  1559. fn: function (){
  1560. var self=this;
  1561. return smalltalk.withContext(function($ctx1) {
  1562. var $1,$2;
  1563. $1="#amber"._asJQuery();
  1564. _st($1)._css_put_("top","");
  1565. $ctx1.sendIdx["css:put:"]=1;
  1566. $2=_st($1)._css_put_("bottom","0px");
  1567. return self}, function($ctx1) {$ctx1.fill(self,"updatePosition",{},smalltalk.TabManager)})},
  1568. args: [],
  1569. source: "updatePosition\x0a\x09'#amber' asJQuery\x0a\x09\x09css: 'top' put: '';\x0a\x09\x09css: 'bottom' put: '0px'",
  1570. messageSends: ["css:put:", "asJQuery"],
  1571. referencedClasses: []
  1572. }),
  1573. smalltalk.TabManager);
  1574. smalltalk.TabManager.klass.iVarNames = ['current'];
  1575. smalltalk.addMethod(
  1576. smalltalk.method({
  1577. selector: "current",
  1578. protocol: 'instance creation',
  1579. fn: function (){
  1580. var self=this;
  1581. return smalltalk.withContext(function($ctx1) {
  1582. var $2,$1;
  1583. $2=self["@current"];
  1584. if(($receiver = $2) == nil || $receiver == null){
  1585. self["@current"]=smalltalk.TabManager.klass.superclass.fn.prototype._new.apply(_st(self), []);
  1586. $1=self["@current"];
  1587. } else {
  1588. $1=$2;
  1589. };
  1590. return $1;
  1591. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.TabManager.klass)})},
  1592. args: [],
  1593. source: "current\x0a\x09^ current ifNil: [ current := super new ]",
  1594. messageSends: ["ifNil:", "new"],
  1595. referencedClasses: []
  1596. }),
  1597. smalltalk.TabManager.klass);
  1598. smalltalk.addMethod(
  1599. smalltalk.method({
  1600. selector: "new",
  1601. protocol: 'instance creation',
  1602. fn: function (){
  1603. var self=this;
  1604. return smalltalk.withContext(function($ctx1) {
  1605. self._shouldNotImplement();
  1606. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.TabManager.klass)})},
  1607. args: [],
  1608. source: "new\x0a\x09self shouldNotImplement",
  1609. messageSends: ["shouldNotImplement"],
  1610. referencedClasses: []
  1611. }),
  1612. smalltalk.TabManager.klass);
  1613. smalltalk.addMethod(
  1614. smalltalk.method({
  1615. selector: "toggleAmberIDE",
  1616. protocol: 'actions',
  1617. fn: function (){
  1618. var self=this;
  1619. function $Browser(){return smalltalk.Browser||(typeof Browser=="undefined"?nil:Browser)}
  1620. function $TabManager(){return smalltalk.TabManager||(typeof TabManager=="undefined"?nil:TabManager)}
  1621. return smalltalk.withContext(function($ctx1) {
  1622. var $3,$2,$1,$4,$5;
  1623. $3="#amber"._asJQuery();
  1624. $ctx1.sendIdx["asJQuery"]=1;
  1625. $2=_st($3)._length();
  1626. $1=_st($2).__eq((0));
  1627. if(smalltalk.assert($1)){
  1628. _st($Browser())._open();
  1629. $ctx1.sendIdx["open"]=1;
  1630. } else {
  1631. $4=_st("#amber"._asJQuery())._is_(":visible");
  1632. if(smalltalk.assert($4)){
  1633. $5=_st($TabManager())._current();
  1634. $ctx1.sendIdx["current"]=1;
  1635. _st($5)._close();
  1636. } else {
  1637. _st(_st($TabManager())._current())._open();
  1638. };
  1639. };
  1640. return self}, function($ctx1) {$ctx1.fill(self,"toggleAmberIDE",{},smalltalk.TabManager.klass)})},
  1641. args: [],
  1642. source: "toggleAmberIDE\x0a\x09'#amber' asJQuery length = 0\x0a\x09\x09ifTrue: [ Browser open ]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09('#amber' asJQuery is: ':visible')\x0a\x09\x09\x09\x09ifTrue: [ TabManager current close ]\x0a\x09\x09\x09\x09ifFalse: [ TabManager current open ] ]",
  1643. messageSends: ["ifTrue:ifFalse:", "=", "length", "asJQuery", "open", "is:", "close", "current"],
  1644. referencedClasses: ["Browser", "TabManager"]
  1645. }),
  1646. smalltalk.TabManager.klass);
  1647. smalltalk.addClass('TabWidget', smalltalk.Widget, ['div'], 'IDE');
  1648. smalltalk.addMethod(
  1649. smalltalk.method({
  1650. selector: "canBeClosed",
  1651. protocol: 'testing',
  1652. fn: function (){
  1653. var self=this;
  1654. return smalltalk.withContext(function($ctx1) {
  1655. return false;
  1656. }, function($ctx1) {$ctx1.fill(self,"canBeClosed",{},smalltalk.TabWidget)})},
  1657. args: [],
  1658. source: "canBeClosed\x0a\x09^ false",
  1659. messageSends: [],
  1660. referencedClasses: []
  1661. }),
  1662. smalltalk.TabWidget);
  1663. smalltalk.addMethod(
  1664. smalltalk.method({
  1665. selector: "close",
  1666. protocol: 'actions',
  1667. fn: function (){
  1668. var self=this;
  1669. function $TabManager(){return smalltalk.TabManager||(typeof TabManager=="undefined"?nil:TabManager)}
  1670. return smalltalk.withContext(function($ctx1) {
  1671. _st(_st($TabManager())._current())._closeTab_(self);
  1672. return self}, function($ctx1) {$ctx1.fill(self,"close",{},smalltalk.TabWidget)})},
  1673. args: [],
  1674. source: "close\x0a\x09TabManager current closeTab: self",
  1675. messageSends: ["closeTab:", "current"],
  1676. referencedClasses: ["TabManager"]
  1677. }),
  1678. smalltalk.TabWidget);
  1679. smalltalk.addMethod(
  1680. smalltalk.method({
  1681. selector: "hide",
  1682. protocol: 'actions',
  1683. fn: function (){
  1684. var self=this;
  1685. return smalltalk.withContext(function($ctx1) {
  1686. _st(_st(self["@div"])._asJQuery())._hide();
  1687. return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.TabWidget)})},
  1688. args: [],
  1689. source: "hide\x0a\x09div asJQuery hide",
  1690. messageSends: ["hide", "asJQuery"],
  1691. referencedClasses: []
  1692. }),
  1693. smalltalk.TabWidget);
  1694. smalltalk.addMethod(
  1695. smalltalk.method({
  1696. selector: "label",
  1697. protocol: 'accessing',
  1698. fn: function (){
  1699. var self=this;
  1700. return smalltalk.withContext(function($ctx1) {
  1701. self._subclassResponsibility();
  1702. return self}, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.TabWidget)})},
  1703. args: [],
  1704. source: "label\x0a\x09self subclassResponsibility",
  1705. messageSends: ["subclassResponsibility"],
  1706. referencedClasses: []
  1707. }),
  1708. smalltalk.TabWidget);
  1709. smalltalk.addMethod(
  1710. smalltalk.method({
  1711. selector: "open",
  1712. protocol: 'actions',
  1713. fn: function (){
  1714. var self=this;
  1715. function $TabManager(){return smalltalk.TabManager||(typeof TabManager=="undefined"?nil:TabManager)}
  1716. return smalltalk.withContext(function($ctx1) {
  1717. var $1;
  1718. $1=_st($TabManager())._current();
  1719. $ctx1.sendIdx["current"]=1;
  1720. _st($1)._addTab_(self);
  1721. _st(_st($TabManager())._current())._selectTab_(self);
  1722. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.TabWidget)})},
  1723. args: [],
  1724. source: "open\x0a\x09TabManager current addTab: self.\x0a\x09TabManager current selectTab: self",
  1725. messageSends: ["addTab:", "current", "selectTab:"],
  1726. referencedClasses: ["TabManager"]
  1727. }),
  1728. smalltalk.TabWidget);
  1729. smalltalk.addMethod(
  1730. smalltalk.method({
  1731. selector: "remove",
  1732. protocol: 'actions',
  1733. fn: function (){
  1734. var self=this;
  1735. return smalltalk.withContext(function($ctx1) {
  1736. _st(_st(self["@div"])._asJQuery())._remove();
  1737. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.TabWidget)})},
  1738. args: [],
  1739. source: "remove\x0a\x09div asJQuery remove",
  1740. messageSends: ["remove", "asJQuery"],
  1741. referencedClasses: []
  1742. }),
  1743. smalltalk.TabWidget);
  1744. smalltalk.addMethod(
  1745. smalltalk.method({
  1746. selector: "renderBoxOn:",
  1747. protocol: 'rendering',
  1748. fn: function (html){
  1749. var self=this;
  1750. return smalltalk.withContext(function($ctx1) {
  1751. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.TabWidget)})},
  1752. args: ["html"],
  1753. source: "renderBoxOn: html",
  1754. messageSends: [],
  1755. referencedClasses: []
  1756. }),
  1757. smalltalk.TabWidget);
  1758. smalltalk.addMethod(
  1759. smalltalk.method({
  1760. selector: "renderButtonsOn:",
  1761. protocol: 'rendering',
  1762. fn: function (html){
  1763. var self=this;
  1764. return smalltalk.withContext(function($ctx1) {
  1765. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.TabWidget)})},
  1766. args: ["html"],
  1767. source: "renderButtonsOn: html",
  1768. messageSends: [],
  1769. referencedClasses: []
  1770. }),
  1771. smalltalk.TabWidget);
  1772. smalltalk.addMethod(
  1773. smalltalk.method({
  1774. selector: "renderOn:",
  1775. protocol: 'rendering',
  1776. fn: function (html){
  1777. var self=this;
  1778. return smalltalk.withContext(function($ctx1) {
  1779. var $1,$2;
  1780. $1=_st(html)._div();
  1781. _st($1)._class_("amberTool");
  1782. $2=_st($1)._yourself();
  1783. self["@div"]=$2;
  1784. self._renderTab();
  1785. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.TabWidget)})},
  1786. args: ["html"],
  1787. source: "renderOn: html\x0a\x09div := html div\x0a\x09\x09class: 'amberTool';\x0a\x09\x09yourself.\x0a\x09self renderTab",
  1788. messageSends: ["class:", "div", "yourself", "renderTab"],
  1789. referencedClasses: []
  1790. }),
  1791. smalltalk.TabWidget);
  1792. smalltalk.addMethod(
  1793. smalltalk.method({
  1794. selector: "renderTab",
  1795. protocol: 'rendering',
  1796. fn: function (){
  1797. var self=this;
  1798. return smalltalk.withContext(function($ctx1) {
  1799. var $1,$2,$3,$4;
  1800. _st(self["@div"])._contents_((function(html){
  1801. return smalltalk.withContext(function($ctx2) {
  1802. $1=_st(html)._div();
  1803. $ctx2.sendIdx["div"]=1;
  1804. _st($1)._class_("amber_box");
  1805. $ctx2.sendIdx["class:"]=1;
  1806. $2=_st($1)._with_((function(){
  1807. return smalltalk.withContext(function($ctx3) {
  1808. return self._renderBoxOn_(html);
  1809. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  1810. $ctx2.sendIdx["with:"]=1;
  1811. $2;
  1812. $3=_st(html)._div();
  1813. _st($3)._class_("amber_buttons");
  1814. $4=_st($3)._with_((function(){
  1815. return smalltalk.withContext(function($ctx3) {
  1816. return self._renderButtonsOn_(html);
  1817. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  1818. return $4;
  1819. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  1820. return self}, function($ctx1) {$ctx1.fill(self,"renderTab",{},smalltalk.TabWidget)})},
  1821. args: [],
  1822. source: "renderTab\x0a\x09div contents: [ :html |\x0a\x09\x09html div\x0a\x09\x09class: 'amber_box';\x0a\x09\x09with: [ self renderBoxOn: html ].\x0a\x09\x09html div\x0a\x09\x09class: 'amber_buttons';\x0a\x09\x09with: [ self renderButtonsOn: html ]]",
  1823. messageSends: ["contents:", "class:", "div", "with:", "renderBoxOn:", "renderButtonsOn:"],
  1824. referencedClasses: []
  1825. }),
  1826. smalltalk.TabWidget);
  1827. smalltalk.addMethod(
  1828. smalltalk.method({
  1829. selector: "show",
  1830. protocol: 'actions',
  1831. fn: function (){
  1832. var self=this;
  1833. return smalltalk.withContext(function($ctx1) {
  1834. _st(_st(self["@div"])._asJQuery())._show();
  1835. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.TabWidget)})},
  1836. args: [],
  1837. source: "show\x0a\x09div asJQuery show",
  1838. messageSends: ["show", "asJQuery"],
  1839. referencedClasses: []
  1840. }),
  1841. smalltalk.TabWidget);
  1842. smalltalk.addMethod(
  1843. smalltalk.method({
  1844. selector: "update",
  1845. protocol: 'rendering',
  1846. fn: function (){
  1847. var self=this;
  1848. return smalltalk.withContext(function($ctx1) {
  1849. self._renderTab();
  1850. return self}, function($ctx1) {$ctx1.fill(self,"update",{},smalltalk.TabWidget)})},
  1851. args: [],
  1852. source: "update\x0a\x09self renderTab",
  1853. messageSends: ["renderTab"],
  1854. referencedClasses: []
  1855. }),
  1856. smalltalk.TabWidget);
  1857. smalltalk.addMethod(
  1858. smalltalk.method({
  1859. selector: "open",
  1860. protocol: 'instance creation',
  1861. fn: function (){
  1862. var self=this;
  1863. return smalltalk.withContext(function($ctx1) {
  1864. var $1;
  1865. $1=_st(self._new())._open();
  1866. return $1;
  1867. }, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.TabWidget.klass)})},
  1868. args: [],
  1869. source: "open\x0a\x09^ self new open",
  1870. messageSends: ["open", "new"],
  1871. referencedClasses: []
  1872. }),
  1873. smalltalk.TabWidget.klass);
  1874. smalltalk.addClass('Browser', smalltalk.TabWidget, ['selectedPackage', 'selectedClass', 'selectedProtocol', 'selectedMethod', 'packagesList', 'classesList', 'protocolsList', 'methodsList', 'sourceArea', 'tabsList', 'selectedTab', 'saveButton', 'classButtons', 'methodButtons', 'unsavedChanges'], 'IDE');
  1875. smalltalk.addMethod(
  1876. smalltalk.method({
  1877. selector: "addInstanceVariableNamed:toClass:",
  1878. protocol: 'actions',
  1879. fn: function (aString,aClass){
  1880. var self=this;
  1881. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  1882. return smalltalk.withContext(function($ctx1) {
  1883. var $1,$2,$3,$4,$5;
  1884. $1=_st($ClassBuilder())._new();
  1885. $2=_st(aClass)._superclass();
  1886. $3=_st(aClass)._name();
  1887. $ctx1.sendIdx["name"]=1;
  1888. $4=_st(_st(aClass)._instanceVariableNames())._copy();
  1889. _st($4)._add_(aString);
  1890. $5=_st($4)._yourself();
  1891. _st($1)._addSubclassOf_named_instanceVariableNames_package_($2,$3,$5,_st(_st(aClass)._package())._name());
  1892. return self}, function($ctx1) {$ctx1.fill(self,"addInstanceVariableNamed:toClass:",{aString:aString,aClass:aClass},smalltalk.Browser)})},
  1893. args: ["aString", "aClass"],
  1894. 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",
  1895. messageSends: ["addSubclassOf:named:instanceVariableNames:package:", "new", "superclass", "name", "add:", "copy", "instanceVariableNames", "yourself", "package"],
  1896. referencedClasses: ["ClassBuilder"]
  1897. }),
  1898. smalltalk.Browser);
  1899. smalltalk.addMethod(
  1900. smalltalk.method({
  1901. selector: "addNewClass",
  1902. protocol: 'actions',
  1903. fn: function (){
  1904. var self=this;
  1905. var className;
  1906. function $Object(){return smalltalk.Object||(typeof Object=="undefined"?nil:Object)}
  1907. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1908. return smalltalk.withContext(function($ctx1) {
  1909. var $1,$2;
  1910. className=self._prompt_("New class");
  1911. $1=_st(_st(className)._notNil())._and_((function(){
  1912. return smalltalk.withContext(function($ctx2) {
  1913. return _st(className)._notEmpty();
  1914. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1915. if(smalltalk.assert($1)){
  1916. _st($Object())._subclass_instanceVariableNames_package_(className,"",self._selectedPackage());
  1917. self._resetClassesList();
  1918. $2=self._updateClassesList();
  1919. $2;
  1920. self._selectClass_(_st(_st($Smalltalk())._current())._at_(className));
  1921. };
  1922. return self}, function($ctx1) {$ctx1.fill(self,"addNewClass",{className:className},smalltalk.Browser)})},
  1923. args: [],
  1924. source: "addNewClass\x0a\x09| className |\x0a\x09className := self prompt: 'New class'.\x0a\x09(className notNil and: [ className notEmpty ]) ifTrue: [\x0a\x09\x09Object subclass: className instanceVariableNames: '' package: self selectedPackage.\x0a\x09\x09\x09self\x0a\x09\x09\x09resetClassesList;\x0a\x09\x09\x09updateClassesList.\x0a\x09\x09self selectClass: (Smalltalk current at: className) ]",
  1925. messageSends: ["prompt:", "ifTrue:", "and:", "notNil", "notEmpty", "subclass:instanceVariableNames:package:", "selectedPackage", "resetClassesList", "updateClassesList", "selectClass:", "at:", "current"],
  1926. referencedClasses: ["Object", "Smalltalk"]
  1927. }),
  1928. smalltalk.Browser);
  1929. smalltalk.addMethod(
  1930. smalltalk.method({
  1931. selector: "addNewProtocol",
  1932. protocol: 'actions',
  1933. fn: function (){
  1934. var self=this;
  1935. var newProtocol;
  1936. return smalltalk.withContext(function($ctx1) {
  1937. var $1;
  1938. newProtocol=self._prompt_("New method protocol");
  1939. $1=_st(_st(newProtocol)._notNil())._and_((function(){
  1940. return smalltalk.withContext(function($ctx2) {
  1941. return _st(newProtocol)._notEmpty();
  1942. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1943. if(smalltalk.assert($1)){
  1944. _st(self["@selectedMethod"])._protocol_(newProtocol);
  1945. self._setMethodProtocol_(newProtocol);
  1946. };
  1947. return self}, function($ctx1) {$ctx1.fill(self,"addNewProtocol",{newProtocol:newProtocol},smalltalk.Browser)})},
  1948. args: [],
  1949. source: "addNewProtocol\x0a\x09| newProtocol |\x0a\x09\x0a\x09newProtocol := self prompt: 'New method protocol'.\x0a\x09\x0a\x09(newProtocol notNil and: [ newProtocol notEmpty ]) ifTrue: [\x0a\x09\x09selectedMethod protocol: newProtocol.\x0a\x09\x09self setMethodProtocol: newProtocol ]",
  1950. messageSends: ["prompt:", "ifTrue:", "and:", "notNil", "notEmpty", "protocol:", "setMethodProtocol:"],
  1951. referencedClasses: []
  1952. }),
  1953. smalltalk.Browser);
  1954. smalltalk.addMethod(
  1955. smalltalk.method({
  1956. selector: "canBeClosed",
  1957. protocol: 'testing',
  1958. fn: function (){
  1959. var self=this;
  1960. return smalltalk.withContext(function($ctx1) {
  1961. return true;
  1962. }, function($ctx1) {$ctx1.fill(self,"canBeClosed",{},smalltalk.Browser)})},
  1963. args: [],
  1964. source: "canBeClosed\x0a\x09^ true",
  1965. messageSends: [],
  1966. referencedClasses: []
  1967. }),
  1968. smalltalk.Browser);
  1969. smalltalk.addMethod(
  1970. smalltalk.method({
  1971. selector: "cancelChanges",
  1972. protocol: 'actions',
  1973. fn: function (){
  1974. var self=this;
  1975. return smalltalk.withContext(function($ctx1) {
  1976. var $2,$1;
  1977. $2=self["@unsavedChanges"];
  1978. if(smalltalk.assert($2)){
  1979. $1=self._confirm_("Cancel changes?");
  1980. } else {
  1981. $1=true;
  1982. };
  1983. return $1;
  1984. }, function($ctx1) {$ctx1.fill(self,"cancelChanges",{},smalltalk.Browser)})},
  1985. args: [],
  1986. source: "cancelChanges\x0a\x09^ unsavedChanges\x0a\x09ifTrue: [ self confirm: 'Cancel changes?' ]\x0a\x09ifFalse: [ true ]",
  1987. messageSends: ["ifTrue:ifFalse:", "confirm:"],
  1988. referencedClasses: []
  1989. }),
  1990. smalltalk.Browser);
  1991. smalltalk.addMethod(
  1992. smalltalk.method({
  1993. selector: "classCommentSource",
  1994. protocol: 'accessing',
  1995. fn: function (){
  1996. var self=this;
  1997. return smalltalk.withContext(function($ctx1) {
  1998. var $1;
  1999. $1=_st(self["@selectedClass"])._comment();
  2000. return $1;
  2001. }, function($ctx1) {$ctx1.fill(self,"classCommentSource",{},smalltalk.Browser)})},
  2002. args: [],
  2003. source: "classCommentSource\x0a\x09^ selectedClass comment",
  2004. messageSends: ["comment"],
  2005. referencedClasses: []
  2006. }),
  2007. smalltalk.Browser);
  2008. smalltalk.addMethod(
  2009. smalltalk.method({
  2010. selector: "classDeclarationSource",
  2011. protocol: 'accessing',
  2012. fn: function (){
  2013. var self=this;
  2014. var stream;
  2015. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  2016. return smalltalk.withContext(function($ctx1) {
  2017. var $1,$2,$3,$4,$6,$7,$5,$8,$9,$10,$11,$12,$13;
  2018. stream=""._writeStream();
  2019. $1=self["@selectedClass"];
  2020. if(($receiver = $1) == nil || $receiver == null){
  2021. $2=self._classDeclarationTemplate();
  2022. return $2;
  2023. } else {
  2024. $1;
  2025. };
  2026. $3=stream;
  2027. _st($3)._nextPutAll_(_st(_st(self["@selectedClass"])._superclass())._asString());
  2028. $ctx1.sendIdx["nextPutAll:"]=1;
  2029. _st($3)._nextPutAll_(" subclass: #");
  2030. $ctx1.sendIdx["nextPutAll:"]=2;
  2031. _st($3)._nextPutAll_(_st(self["@selectedClass"])._name());
  2032. $ctx1.sendIdx["nextPutAll:"]=3;
  2033. $4=$3;
  2034. $6=_st($String())._lf();
  2035. $ctx1.sendIdx["lf"]=1;
  2036. $7=_st($String())._tab();
  2037. $ctx1.sendIdx["tab"]=1;
  2038. $5=_st($6).__comma($7);
  2039. $ctx1.sendIdx[","]=1;
  2040. _st($4)._nextPutAll_($5);
  2041. $ctx1.sendIdx["nextPutAll:"]=4;
  2042. $8=_st($3)._nextPutAll_("instanceVariableNames: '");
  2043. $ctx1.sendIdx["nextPutAll:"]=5;
  2044. _st(_st(self["@selectedClass"])._instanceVariableNames())._do_separatedBy_((function(each){
  2045. return smalltalk.withContext(function($ctx2) {
  2046. return _st(stream)._nextPutAll_(each);
  2047. $ctx2.sendIdx["nextPutAll:"]=6;
  2048. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}),(function(){
  2049. return smalltalk.withContext(function($ctx2) {
  2050. return _st(stream)._nextPutAll_(" ");
  2051. $ctx2.sendIdx["nextPutAll:"]=7;
  2052. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  2053. $9=stream;
  2054. $10=$9;
  2055. $11=_st("'".__comma(_st($String())._lf())).__comma(_st($String())._tab());
  2056. $ctx1.sendIdx[","]=2;
  2057. _st($10)._nextPutAll_($11);
  2058. $ctx1.sendIdx["nextPutAll:"]=8;
  2059. _st($9)._nextPutAll_("package: '");
  2060. $ctx1.sendIdx["nextPutAll:"]=9;
  2061. _st($9)._nextPutAll_(_st(self["@selectedClass"])._category());
  2062. $ctx1.sendIdx["nextPutAll:"]=10;
  2063. $12=_st($9)._nextPutAll_("'");
  2064. $13=_st(stream)._contents();
  2065. return $13;
  2066. }, function($ctx1) {$ctx1.fill(self,"classDeclarationSource",{stream:stream},smalltalk.Browser)})},
  2067. args: [],
  2068. source: "classDeclarationSource\x0a\x09| stream |\x0a\x09stream := '' writeStream.\x0a\x09selectedClass ifNil: [ ^ self classDeclarationTemplate ].\x0a\x09stream\x0a\x09\x09nextPutAll: selectedClass superclass asString;\x0a\x09\x09nextPutAll: ' subclass: #';\x0a\x09\x09nextPutAll: selectedClass name;\x0a\x09\x09nextPutAll: String lf, String tab;\x0a\x09\x09nextPutAll: 'instanceVariableNames: '''.\x0a\x09selectedClass instanceVariableNames\x0a\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09stream\x0a\x09\x09nextPutAll: '''', String lf, String tab;\x0a\x09\x09nextPutAll: 'package: ''';\x0a\x09\x09nextPutAll: selectedClass category;\x0a\x09\x09nextPutAll: ''''.\x0a\x09^ stream contents",
  2069. messageSends: ["writeStream", "ifNil:", "classDeclarationTemplate", "nextPutAll:", "asString", "superclass", "name", ",", "lf", "tab", "do:separatedBy:", "instanceVariableNames", "category", "contents"],
  2070. referencedClasses: ["String"]
  2071. }),
  2072. smalltalk.Browser);
  2073. smalltalk.addMethod(
  2074. smalltalk.method({
  2075. selector: "classDeclarationTemplate",
  2076. protocol: 'accessing',
  2077. fn: function (){
  2078. var self=this;
  2079. return smalltalk.withContext(function($ctx1) {
  2080. var $1;
  2081. $1=_st("Object subclass: #NameOfSubclass\x0a\x09instanceVariableNames: ''\x0a\x09package: '".__comma(self._selectedPackage())).__comma("'");
  2082. $ctx1.sendIdx[","]=1;
  2083. return $1;
  2084. }, function($ctx1) {$ctx1.fill(self,"classDeclarationTemplate",{},smalltalk.Browser)})},
  2085. args: [],
  2086. source: "classDeclarationTemplate\x0a\x09^ 'Object subclass: #NameOfSubclass\x0a\x09instanceVariableNames: ''''\x0a\x09package: ''', self selectedPackage, ''''",
  2087. messageSends: [",", "selectedPackage"],
  2088. referencedClasses: []
  2089. }),
  2090. smalltalk.Browser);
  2091. smalltalk.addMethod(
  2092. smalltalk.method({
  2093. selector: "classes",
  2094. protocol: 'accessing',
  2095. fn: function (){
  2096. var self=this;
  2097. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2098. return smalltalk.withContext(function($ctx1) {
  2099. var $2,$1;
  2100. $1=_st(_st(_st(_st(_st($Smalltalk())._current())._classes())._select_((function(each){
  2101. return smalltalk.withContext(function($ctx2) {
  2102. return _st(_st(each)._category()).__eq(self["@selectedPackage"]);
  2103. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._sort_((function(a,b){
  2104. return smalltalk.withContext(function($ctx2) {
  2105. $2=_st(a)._name();
  2106. $ctx2.sendIdx["name"]=1;
  2107. return _st($2).__lt(_st(b)._name());
  2108. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,2)})})))._asSet();
  2109. return $1;
  2110. }, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.Browser)})},
  2111. args: [],
  2112. source: "classes\x0a\x09^ ((Smalltalk current classes\x0a\x09select: [ :each | each category = selectedPackage ])\x0a\x09sort: [ :a :b | a name < b name ]) asSet",
  2113. messageSends: ["asSet", "sort:", "select:", "classes", "current", "=", "category", "<", "name"],
  2114. referencedClasses: ["Smalltalk"]
  2115. }),
  2116. smalltalk.Browser);
  2117. smalltalk.addMethod(
  2118. smalltalk.method({
  2119. selector: "commitPackage",
  2120. protocol: 'actions',
  2121. fn: function (){
  2122. var self=this;
  2123. function $Package(){return smalltalk.Package||(typeof Package=="undefined"?nil:Package)}
  2124. return smalltalk.withContext(function($ctx1) {
  2125. var $1;
  2126. $1=self["@selectedPackage"];
  2127. if(($receiver = $1) == nil || $receiver == null){
  2128. $1;
  2129. } else {
  2130. _st(_st($Package())._named_(self["@selectedPackage"]))._commit();
  2131. };
  2132. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage",{},smalltalk.Browser)})},
  2133. args: [],
  2134. source: "commitPackage\x0a\x09selectedPackage ifNotNil: [\x0a\x09\x09(Package named: selectedPackage) commit ]",
  2135. messageSends: ["ifNotNil:", "commit", "named:"],
  2136. referencedClasses: ["Package"]
  2137. }),
  2138. smalltalk.Browser);
  2139. smalltalk.addMethod(
  2140. smalltalk.method({
  2141. selector: "compile",
  2142. protocol: 'actions',
  2143. fn: function (){
  2144. var self=this;
  2145. var currentEditLine;
  2146. return smalltalk.withContext(function($ctx1) {
  2147. var $1,$2,$3,$5,$4;
  2148. self._disableSaveButton();
  2149. $1=_st(self["@sourceArea"])._editor();
  2150. $ctx1.sendIdx["editor"]=1;
  2151. currentEditLine=_st($1)._getCursor();
  2152. $2=_st(self["@selectedTab"]).__eq("comment");
  2153. if(smalltalk.assert($2)){
  2154. $3=self["@selectedClass"];
  2155. if(($receiver = $3) == nil || $receiver == null){
  2156. $3;
  2157. } else {
  2158. self._compileClassComment();
  2159. };
  2160. } else {
  2161. $5=_st(self["@selectedProtocol"])._notNil();
  2162. $ctx1.sendIdx["notNil"]=1;
  2163. $4=_st($5)._or_((function(){
  2164. return smalltalk.withContext(function($ctx2) {
  2165. return _st(self["@selectedMethod"])._notNil();
  2166. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
  2167. if(smalltalk.assert($4)){
  2168. self._compileMethodDefinition();
  2169. } else {
  2170. self._compileDefinition();
  2171. };
  2172. };
  2173. _st(_st(self["@sourceArea"])._editor())._setCursor_(currentEditLine);
  2174. return self}, function($ctx1) {$ctx1.fill(self,"compile",{currentEditLine:currentEditLine},smalltalk.Browser)})},
  2175. args: [],
  2176. source: "compile\x0a\x09| currentEditLine |\x0a\x09self disableSaveButton.\x0a\x09currentEditLine := sourceArea editor getCursor.\x0a\x09selectedTab = #comment\x0a\x09ifTrue: [\x0a\x09\x09\x09selectedClass ifNotNil: [\x0a\x09\x09\x09\x09self compileClassComment ]]\x0a\x09ifFalse: [\x0a\x09\x09\x09(selectedProtocol notNil or: [ selectedMethod notNil ])\x0a\x09\x09\x09\x09ifFalse: [ self compileDefinition ]\x0a\x09\x09\x09\x09ifTrue: [ self compileMethodDefinition ]].\x0a\x09sourceArea editor setCursor: currentEditLine.",
  2177. messageSends: ["disableSaveButton", "getCursor", "editor", "ifTrue:ifFalse:", "=", "ifNotNil:", "compileClassComment", "ifFalse:ifTrue:", "or:", "notNil", "compileDefinition", "compileMethodDefinition", "setCursor:"],
  2178. referencedClasses: []
  2179. }),
  2180. smalltalk.Browser);
  2181. smalltalk.addMethod(
  2182. smalltalk.method({
  2183. selector: "compileClassComment",
  2184. protocol: 'actions',
  2185. fn: function (){
  2186. var self=this;
  2187. return smalltalk.withContext(function($ctx1) {
  2188. _st(self["@selectedClass"])._comment_(_st(self["@sourceArea"])._val());
  2189. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment",{},smalltalk.Browser)})},
  2190. args: [],
  2191. source: "compileClassComment\x0a\x09selectedClass comment: sourceArea val",
  2192. messageSends: ["comment:", "val"],
  2193. referencedClasses: []
  2194. }),
  2195. smalltalk.Browser);
  2196. smalltalk.addMethod(
  2197. smalltalk.method({
  2198. selector: "compileDefinition",
  2199. protocol: 'actions',
  2200. fn: function (){
  2201. var self=this;
  2202. var newClass;
  2203. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  2204. return smalltalk.withContext(function($ctx1) {
  2205. var $1;
  2206. newClass=_st(_st($Compiler())._new())._evaluateExpression_(_st(self["@sourceArea"])._val());
  2207. self._resetClassesList();
  2208. self._updateCategoriesList();
  2209. $1=self._updateClassesList();
  2210. self._selectClass_(newClass);
  2211. return self}, function($ctx1) {$ctx1.fill(self,"compileDefinition",{newClass:newClass},smalltalk.Browser)})},
  2212. args: [],
  2213. source: "compileDefinition\x0a\x09| newClass |\x0a\x09newClass := Compiler new evaluateExpression: sourceArea val.\x0a\x09self\x0a\x09resetClassesList;\x0a\x09updateCategoriesList;\x0a\x09updateClassesList.\x0a\x09self selectClass: newClass",
  2214. messageSends: ["evaluateExpression:", "new", "val", "resetClassesList", "updateCategoriesList", "updateClassesList", "selectClass:"],
  2215. referencedClasses: ["Compiler"]
  2216. }),
  2217. smalltalk.Browser);
  2218. smalltalk.addMethod(
  2219. smalltalk.method({
  2220. selector: "compileMethodDefinition",
  2221. protocol: 'actions',
  2222. fn: function (){
  2223. var self=this;
  2224. return smalltalk.withContext(function($ctx1) {
  2225. var $1;
  2226. $1=_st(self["@selectedTab"]).__eq("instance");
  2227. if(smalltalk.assert($1)){
  2228. self._compileMethodDefinitionFor_(self["@selectedClass"]);
  2229. $ctx1.sendIdx["compileMethodDefinitionFor:"]=1;
  2230. } else {
  2231. self._compileMethodDefinitionFor_(_st(self["@selectedClass"])._class());
  2232. };
  2233. return self}, function($ctx1) {$ctx1.fill(self,"compileMethodDefinition",{},smalltalk.Browser)})},
  2234. args: [],
  2235. source: "compileMethodDefinition\x0a\x09selectedTab = #instance\x0a\x09ifTrue: [ self compileMethodDefinitionFor: selectedClass ]\x0a\x09ifFalse: [ self compileMethodDefinitionFor: selectedClass class ]",
  2236. messageSends: ["ifTrue:ifFalse:", "=", "compileMethodDefinitionFor:", "class"],
  2237. referencedClasses: []
  2238. }),
  2239. smalltalk.Browser);
  2240. smalltalk.addMethod(
  2241. smalltalk.method({
  2242. selector: "compileMethodDefinitionFor:",
  2243. protocol: 'actions',
  2244. fn: function (aClass){
  2245. var self=this;
  2246. var compiler,method,source,node;
  2247. function $Compiler(){return smalltalk.Compiler||(typeof Compiler=="undefined"?nil:Compiler)}
  2248. function $PlatformInterface(){return smalltalk.PlatformInterface||(typeof PlatformInterface=="undefined"?nil:PlatformInterface)}
  2249. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  2250. return smalltalk.withContext(function($ctx1) {
  2251. var $1,$2,$6,$5,$4,$3,$7,$9,$8,$10;
  2252. var $early={};
  2253. try {
  2254. source=_st(self["@sourceArea"])._val();
  2255. $1=self["@selectedProtocol"];
  2256. if(($receiver = $1) == nil || $receiver == null){
  2257. self["@selectedProtocol"]=_st(self["@selectedMethod"])._protocol();
  2258. self["@selectedProtocol"];
  2259. } else {
  2260. $1;
  2261. };
  2262. compiler=_st($Compiler())._new();
  2263. $ctx1.sendIdx["new"]=1;
  2264. _st(compiler)._source_(source);
  2265. node=_st(compiler)._parse_(source);
  2266. $2=_st(node)._isParseFailure();
  2267. if(smalltalk.assert($2)){
  2268. $6="PARSE ERROR: ".__comma(_st(node)._reason());
  2269. $ctx1.sendIdx[","]=3;
  2270. $5=_st($6).__comma(", position: ");
  2271. $ctx1.sendIdx[","]=2;
  2272. $4=_st($5).__comma(_st(_st(node)._position())._asString());
  2273. $ctx1.sendIdx[","]=1;
  2274. $3=self._alert_($4);
  2275. return $3;
  2276. };
  2277. _st(compiler)._currentClass_(aClass);
  2278. method=_st(compiler)._eval_(_st(compiler)._compileNode_(node));
  2279. _st(_st(compiler)._unknownVariables())._do_((function(each){
  2280. return smalltalk.withContext(function($ctx2) {
  2281. $7=_st($PlatformInterface())._existsGlobal_(each);
  2282. if(! smalltalk.assert($7)){
  2283. $9=_st("Declare '".__comma(each)).__comma("' as instance variable?");
  2284. $ctx2.sendIdx[","]=4;
  2285. $8=self._confirm_($9);
  2286. if(smalltalk.assert($8)){
  2287. self._addInstanceVariableNamed_toClass_(each,aClass);
  2288. $10=self._compileMethodDefinitionFor_(aClass);
  2289. throw $early=[$10];
  2290. };
  2291. };
  2292. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})}));
  2293. _st(_st($ClassBuilder())._new())._installMethod_forClass_protocol_(method,aClass,self["@selectedProtocol"]);
  2294. self._updateMethodsList();
  2295. self._selectMethod_(method);
  2296. return self}
  2297. catch(e) {if(e===$early)return e[0]; throw e}
  2298. }, function($ctx1) {$ctx1.fill(self,"compileMethodDefinitionFor:",{aClass:aClass,compiler:compiler,method:method,source:source,node:node},smalltalk.Browser)})},
  2299. args: ["aClass"],
  2300. source: "compileMethodDefinitionFor: aClass\x0a\x09| compiler method source node |\x0a\x09source := sourceArea val.\x0a\x09selectedProtocol ifNil: [ selectedProtocol := selectedMethod protocol ].\x0a\x09compiler := Compiler new.\x0a\x09compiler source: source.\x0a\x09node := compiler parse: source.\x0a\x09node isParseFailure ifTrue: [\x0a\x09^ self alert: 'PARSE ERROR: ', node reason, ', position: ', node position asString ].\x0a\x09compiler currentClass: aClass.\x0a\x09method := compiler eval: (compiler compileNode: node).\x0a\x09compiler unknownVariables do: [ :each |\x0a\x09\x09\x22Do not try to redeclare javascript's objects\x22\x0a\x09\x09(PlatformInterface existsGlobal: each) ifFalse: [\x0a\x09\x09(self confirm: 'Declare ''', each, ''' as instance variable?') ifTrue: [\x0a\x09\x09\x09self addInstanceVariableNamed: each toClass: aClass.\x0a\x09\x09\x09^ self compileMethodDefinitionFor: aClass ]] ].\x0a\x09ClassBuilder new installMethod: method forClass: aClass protocol: selectedProtocol.\x0a\x09self updateMethodsList.\x0a\x09self selectMethod: method",
  2301. messageSends: ["val", "ifNil:", "protocol", "new", "source:", "parse:", "ifTrue:", "isParseFailure", "alert:", ",", "reason", "asString", "position", "currentClass:", "eval:", "compileNode:", "do:", "unknownVariables", "ifFalse:", "existsGlobal:", "confirm:", "addInstanceVariableNamed:toClass:", "compileMethodDefinitionFor:", "installMethod:forClass:protocol:", "updateMethodsList", "selectMethod:"],
  2302. referencedClasses: ["Compiler", "PlatformInterface", "ClassBuilder"]
  2303. }),
  2304. smalltalk.Browser);
  2305. smalltalk.addMethod(
  2306. smalltalk.method({
  2307. selector: "copyClass",
  2308. protocol: 'actions',
  2309. fn: function (){
  2310. var self=this;
  2311. var className;
  2312. function $ClassBuilder(){return smalltalk.ClassBuilder||(typeof ClassBuilder=="undefined"?nil:ClassBuilder)}
  2313. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2314. return smalltalk.withContext(function($ctx1) {
  2315. var $1,$2;
  2316. className=self._prompt_("Copy class");
  2317. $1=_st(_st(className)._notNil())._and_((function(){
  2318. return smalltalk.withContext(function($ctx2) {
  2319. return _st(className)._notEmpty();
  2320. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2321. if(smalltalk.assert($1)){
  2322. _st(_st($ClassBuilder())._new())._copyClass_named_(self._selectedClass(),className);
  2323. self._resetClassesList();
  2324. $2=self._updateClassesList();
  2325. $2;
  2326. self._selectClass_(_st(_st($Smalltalk())._current())._at_(className));
  2327. };
  2328. return self}, function($ctx1) {$ctx1.fill(self,"copyClass",{className:className},smalltalk.Browser)})},
  2329. args: [],
  2330. source: "copyClass\x0a\x09| className |\x0a\x09className := self prompt: 'Copy class'.\x0a\x09(className notNil and: [ className notEmpty ]) ifTrue: [\x0a\x09\x09ClassBuilder new copyClass: self selectedClass named: className.\x0a\x09\x09\x09self\x0a\x09\x09\x09resetClassesList;\x0a\x09\x09\x09updateClassesList.\x0a\x09\x09self selectClass: (Smalltalk current at: className) ]",
  2331. messageSends: ["prompt:", "ifTrue:", "and:", "notNil", "notEmpty", "copyClass:named:", "new", "selectedClass", "resetClassesList", "updateClassesList", "selectClass:", "at:", "current"],
  2332. referencedClasses: ["ClassBuilder", "Smalltalk"]
  2333. }),
  2334. smalltalk.Browser);
  2335. smalltalk.addMethod(
  2336. smalltalk.method({
  2337. selector: "declarationSource",
  2338. protocol: 'accessing',
  2339. fn: function (){
  2340. var self=this;
  2341. return smalltalk.withContext(function($ctx1) {
  2342. var $2,$1;
  2343. $2=_st(self["@selectedTab"]).__eq("instance");
  2344. if(smalltalk.assert($2)){
  2345. $1=self._classDeclarationSource();
  2346. } else {
  2347. $1=self._metaclassDeclarationSource();
  2348. };
  2349. return $1;
  2350. }, function($ctx1) {$ctx1.fill(self,"declarationSource",{},smalltalk.Browser)})},
  2351. args: [],
  2352. source: "declarationSource\x0a\x09^ selectedTab = #instance\x0a\x09ifTrue: [ self classDeclarationSource ]\x0a\x09ifFalse: [ self metaclassDeclarationSource ]",
  2353. messageSends: ["ifTrue:ifFalse:", "=", "classDeclarationSource", "metaclassDeclarationSource"],
  2354. referencedClasses: []
  2355. }),
  2356. smalltalk.Browser);
  2357. smalltalk.addMethod(
  2358. smalltalk.method({
  2359. selector: "disableSaveButton",
  2360. protocol: 'actions',
  2361. fn: function (){
  2362. var self=this;
  2363. return smalltalk.withContext(function($ctx1) {
  2364. var $1;
  2365. $1=self["@saveButton"];
  2366. if(($receiver = $1) == nil || $receiver == null){
  2367. $1;
  2368. } else {
  2369. _st(self["@saveButton"])._at_put_("disabled",true);
  2370. };
  2371. self["@unsavedChanges"]=false;
  2372. return self}, function($ctx1) {$ctx1.fill(self,"disableSaveButton",{},smalltalk.Browser)})},
  2373. args: [],
  2374. source: "disableSaveButton\x0a\x09saveButton ifNotNil: [\x0a\x09saveButton at: 'disabled' put: true ].\x0a\x09unsavedChanges := false",
  2375. messageSends: ["ifNotNil:", "at:put:"],
  2376. referencedClasses: []
  2377. }),
  2378. smalltalk.Browser);
  2379. smalltalk.addMethod(
  2380. smalltalk.method({
  2381. selector: "dummyMethodSource",
  2382. protocol: 'accessing',
  2383. fn: function (){
  2384. var self=this;
  2385. return smalltalk.withContext(function($ctx1) {
  2386. return "messageSelectorAndArgumentNames\x0a\x09\x22comment stating purpose of message\x22\x0a\x0a\x09| temporary variable names |\x0a\x09statements";
  2387. }, function($ctx1) {$ctx1.fill(self,"dummyMethodSource",{},smalltalk.Browser)})},
  2388. args: [],
  2389. source: "dummyMethodSource\x0a\x09^ 'messageSelectorAndArgumentNames\x0a\x09\x22comment stating purpose of message\x22\x0a\x0a\x09| temporary variable names |\x0a\x09statements'",
  2390. messageSends: [],
  2391. referencedClasses: []
  2392. }),
  2393. smalltalk.Browser);
  2394. smalltalk.addMethod(
  2395. smalltalk.method({
  2396. selector: "handleSourceAreaKeyDown:",
  2397. protocol: 'actions',
  2398. fn: function (anEvent){
  2399. var self=this;
  2400. return smalltalk.withContext(function($ctx1) {
  2401. if(anEvent.ctrlKey) {
  2402. if(anEvent.keyCode === 83) { //ctrl+s
  2403. self._compile();
  2404. anEvent.preventDefault();
  2405. return false;
  2406. }
  2407. }
  2408. ;
  2409. return self}, function($ctx1) {$ctx1.fill(self,"handleSourceAreaKeyDown:",{anEvent:anEvent},smalltalk.Browser)})},
  2410. args: ["anEvent"],
  2411. 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>",
  2412. messageSends: [],
  2413. referencedClasses: []
  2414. }),
  2415. smalltalk.Browser);
  2416. smalltalk.addMethod(
  2417. smalltalk.method({
  2418. selector: "hideClassButtons",
  2419. protocol: 'actions',
  2420. fn: function (){
  2421. var self=this;
  2422. return smalltalk.withContext(function($ctx1) {
  2423. _st(_st(self["@classButtons"])._asJQuery())._hide();
  2424. return self}, function($ctx1) {$ctx1.fill(self,"hideClassButtons",{},smalltalk.Browser)})},
  2425. args: [],
  2426. source: "hideClassButtons\x0a\x09classButtons asJQuery hide",
  2427. messageSends: ["hide", "asJQuery"],
  2428. referencedClasses: []
  2429. }),
  2430. smalltalk.Browser);
  2431. smalltalk.addMethod(
  2432. smalltalk.method({
  2433. selector: "hideMethodButtons",
  2434. protocol: 'actions',
  2435. fn: function (){
  2436. var self=this;
  2437. return smalltalk.withContext(function($ctx1) {
  2438. _st(_st(self["@methodButtons"])._asJQuery())._hide();
  2439. return self}, function($ctx1) {$ctx1.fill(self,"hideMethodButtons",{},smalltalk.Browser)})},
  2440. args: [],
  2441. source: "hideMethodButtons\x0a\x09methodButtons asJQuery hide",
  2442. messageSends: ["hide", "asJQuery"],
  2443. referencedClasses: []
  2444. }),
  2445. smalltalk.Browser);
  2446. smalltalk.addMethod(
  2447. smalltalk.method({
  2448. selector: "initialize",
  2449. protocol: 'initialization',
  2450. fn: function (){
  2451. var self=this;
  2452. return smalltalk.withContext(function($ctx1) {
  2453. smalltalk.Browser.superclass.fn.prototype._initialize.apply(_st(self), []);
  2454. self["@selectedTab"]="instance";
  2455. self["@selectedPackage"]=_st(self._packages())._first();
  2456. self["@unsavedChanges"]=false;
  2457. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Browser)})},
  2458. args: [],
  2459. source: "initialize\x0a\x09super initialize.\x0a\x09selectedTab := #instance.\x0a\x09selectedPackage := self packages first.\x0a\x09unsavedChanges := false",
  2460. messageSends: ["initialize", "first", "packages"],
  2461. referencedClasses: []
  2462. }),
  2463. smalltalk.Browser);
  2464. smalltalk.addMethod(
  2465. smalltalk.method({
  2466. selector: "label",
  2467. protocol: 'accessing',
  2468. fn: function (){
  2469. var self=this;
  2470. return smalltalk.withContext(function($ctx1) {
  2471. var $2,$1;
  2472. $2=self["@selectedClass"];
  2473. if(($receiver = $2) == nil || $receiver == null){
  2474. $1="Browser (nil)";
  2475. } else {
  2476. $1="Browser: ".__comma(_st(self["@selectedClass"])._name());
  2477. };
  2478. return $1;
  2479. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.Browser)})},
  2480. args: [],
  2481. source: "label\x0a\x09^ selectedClass\x0a\x09ifNil: [ 'Browser (nil)' ]\x0a\x09ifNotNil: [ 'Browser: ', selectedClass name ]",
  2482. messageSends: ["ifNil:ifNotNil:", ",", "name"],
  2483. referencedClasses: []
  2484. }),
  2485. smalltalk.Browser);
  2486. smalltalk.addMethod(
  2487. smalltalk.method({
  2488. selector: "metaclassDeclarationSource",
  2489. protocol: 'accessing',
  2490. fn: function (){
  2491. var self=this;
  2492. var stream;
  2493. return smalltalk.withContext(function($ctx1) {
  2494. var $1,$2,$3,$4;
  2495. stream=""._writeStream();
  2496. $1=self["@selectedClass"];
  2497. if(($receiver = $1) == nil || $receiver == null){
  2498. $1;
  2499. } else {
  2500. $2=stream;
  2501. _st($2)._nextPutAll_(_st(self["@selectedClass"])._asString());
  2502. $ctx1.sendIdx["nextPutAll:"]=1;
  2503. _st($2)._nextPutAll_(" class ");
  2504. $ctx1.sendIdx["nextPutAll:"]=2;
  2505. $3=_st($2)._nextPutAll_("instanceVariableNames: '");
  2506. $ctx1.sendIdx["nextPutAll:"]=3;
  2507. $3;
  2508. _st(_st(_st(self["@selectedClass"])._class())._instanceVariableNames())._do_separatedBy_((function(each){
  2509. return smalltalk.withContext(function($ctx2) {
  2510. return _st(stream)._nextPutAll_(each);
  2511. $ctx2.sendIdx["nextPutAll:"]=4;
  2512. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}),(function(){
  2513. return smalltalk.withContext(function($ctx2) {
  2514. return _st(stream)._nextPutAll_(" ");
  2515. $ctx2.sendIdx["nextPutAll:"]=5;
  2516. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  2517. _st(stream)._nextPutAll_("'");
  2518. };
  2519. $4=_st(stream)._contents();
  2520. return $4;
  2521. }, function($ctx1) {$ctx1.fill(self,"metaclassDeclarationSource",{stream:stream},smalltalk.Browser)})},
  2522. args: [],
  2523. source: "metaclassDeclarationSource\x0a\x09| stream |\x0a\x09stream := '' writeStream.\x0a\x09selectedClass ifNotNil: [\x0a\x09stream\x0a\x09\x09nextPutAll: selectedClass asString;\x0a\x09\x09nextPutAll: ' class ';\x0a\x09\x09nextPutAll: 'instanceVariableNames: '''.\x0a\x09selectedClass class instanceVariableNames\x0a\x09\x09do: [ :each | stream nextPutAll: each ]\x0a\x09\x09separatedBy: [ stream nextPutAll: ' ' ].\x0a\x09stream nextPutAll: '''' ].\x0a\x09^ stream contents",
  2524. messageSends: ["writeStream", "ifNotNil:", "nextPutAll:", "asString", "do:separatedBy:", "instanceVariableNames", "class", "contents"],
  2525. referencedClasses: []
  2526. }),
  2527. smalltalk.Browser);
  2528. smalltalk.addMethod(
  2529. smalltalk.method({
  2530. selector: "methodSource",
  2531. protocol: 'accessing',
  2532. fn: function (){
  2533. var self=this;
  2534. return smalltalk.withContext(function($ctx1) {
  2535. var $2,$1;
  2536. $2=self["@selectedMethod"];
  2537. if(($receiver = $2) == nil || $receiver == null){
  2538. $1=self._dummyMethodSource();
  2539. } else {
  2540. $1=_st(self["@selectedMethod"])._source();
  2541. };
  2542. return $1;
  2543. }, function($ctx1) {$ctx1.fill(self,"methodSource",{},smalltalk.Browser)})},
  2544. args: [],
  2545. source: "methodSource\x0a\x09^ selectedMethod\x0a\x09ifNil: [ self dummyMethodSource ]\x0a\x09ifNotNil: [ selectedMethod source ]",
  2546. messageSends: ["ifNil:ifNotNil:", "dummyMethodSource", "source"],
  2547. referencedClasses: []
  2548. }),
  2549. smalltalk.Browser);
  2550. smalltalk.addMethod(
  2551. smalltalk.method({
  2552. selector: "methods",
  2553. protocol: 'accessing',
  2554. fn: function (){
  2555. var self=this;
  2556. var klass;
  2557. return smalltalk.withContext(function($ctx1) {
  2558. var $1,$2,$3,$4,$7,$8,$6,$9,$5;
  2559. $1=_st(self["@selectedTab"]).__eq("comment");
  2560. $ctx1.sendIdx["="]=1;
  2561. if(smalltalk.assert($1)){
  2562. $2=[];
  2563. return $2;
  2564. };
  2565. $3=self["@selectedClass"];
  2566. if(($receiver = $3) == nil || $receiver == null){
  2567. $3;
  2568. } else {
  2569. $4=_st(self["@selectedTab"]).__eq("instance");
  2570. if(smalltalk.assert($4)){
  2571. klass=self["@selectedClass"];
  2572. } else {
  2573. klass=_st(self["@selectedClass"])._class();
  2574. };
  2575. klass;
  2576. };
  2577. $7=self["@selectedProtocol"];
  2578. if(($receiver = $7) == nil || $receiver == null){
  2579. $8=klass;
  2580. if(($receiver = $8) == nil || $receiver == null){
  2581. $6=[];
  2582. } else {
  2583. $6=_st(_st(klass)._methodDictionary())._values();
  2584. };
  2585. } else {
  2586. $6=_st(klass)._methodsInProtocol_(self["@selectedProtocol"]);
  2587. };
  2588. $5=_st($6)._sort_((function(a,b){
  2589. return smalltalk.withContext(function($ctx2) {
  2590. $9=_st(a)._selector();
  2591. $ctx2.sendIdx["selector"]=1;
  2592. return _st($9).__lt(_st(b)._selector());
  2593. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,9)})}));
  2594. return $5;
  2595. }, function($ctx1) {$ctx1.fill(self,"methods",{klass:klass},smalltalk.Browser)})},
  2596. args: [],
  2597. source: "methods\x0a\x09| klass |\x0a\x09selectedTab = #comment ifTrue: [ ^ #() ].\x0a\x09selectedClass ifNotNil: [\x0a\x09klass := selectedTab = #instance\x0a\x09\x09ifTrue: [ selectedClass ]\x0a\x09\x09ifFalse: [ selectedClass class ]].\x0a\x09^ (selectedProtocol\x0a\x09ifNil: [\x0a\x09\x09klass\x0a\x09\x09ifNil: [ #() ]\x0a\x09\x09ifNotNil: [ klass methodDictionary values ]]\x0a\x09ifNotNil: [\x0a\x09\x09klass methodsInProtocol: selectedProtocol ]) \x0a\x09\x09\x09\x09sort: [ :a :b | a selector < b selector ]",
  2598. messageSends: ["ifTrue:", "=", "ifNotNil:", "ifTrue:ifFalse:", "class", "sort:", "ifNil:ifNotNil:", "values", "methodDictionary", "methodsInProtocol:", "<", "selector"],
  2599. referencedClasses: []
  2600. }),
  2601. smalltalk.Browser);
  2602. smalltalk.addMethod(
  2603. smalltalk.method({
  2604. selector: "packages",
  2605. protocol: 'accessing',
  2606. fn: function (){
  2607. var self=this;
  2608. var packages;
  2609. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  2610. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2611. return smalltalk.withContext(function($ctx1) {
  2612. var $2,$3,$1,$4;
  2613. packages=_st($Array())._new();
  2614. _st(_st(_st($Smalltalk())._current())._classes())._do_((function(each){
  2615. return smalltalk.withContext(function($ctx2) {
  2616. $2=packages;
  2617. $3=_st(each)._category();
  2618. $ctx2.sendIdx["category"]=1;
  2619. $1=_st($2)._includes_($3);
  2620. if(! smalltalk.assert($1)){
  2621. return _st(packages)._add_(_st(each)._category());
  2622. };
  2623. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  2624. $4=_st(packages)._sort();
  2625. return $4;
  2626. }, function($ctx1) {$ctx1.fill(self,"packages",{packages:packages},smalltalk.Browser)})},
  2627. args: [],
  2628. source: "packages\x0a\x09| packages |\x0a\x09packages := Array new.\x0a\x09Smalltalk current classes do: [ :each |\x0a\x09(packages includes: each category) ifFalse: [\x0a\x09\x09packages add: each category ]].\x0a\x09^ packages sort",
  2629. messageSends: ["new", "do:", "classes", "current", "ifFalse:", "includes:", "category", "add:", "sort"],
  2630. referencedClasses: ["Array", "Smalltalk"]
  2631. }),
  2632. smalltalk.Browser);
  2633. smalltalk.addMethod(
  2634. smalltalk.method({
  2635. selector: "protocols",
  2636. protocol: 'accessing',
  2637. fn: function (){
  2638. var self=this;
  2639. var klass;
  2640. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  2641. return smalltalk.withContext(function($ctx1) {
  2642. var $1,$2,$3,$4,$5,$6,$7,$8;
  2643. $1=self["@selectedClass"];
  2644. if(($receiver = $1) == nil || $receiver == null){
  2645. $1;
  2646. } else {
  2647. $2=_st(self["@selectedTab"]).__eq("comment");
  2648. $ctx1.sendIdx["="]=1;
  2649. if(smalltalk.assert($2)){
  2650. $3=[];
  2651. return $3;
  2652. };
  2653. $4=_st(self["@selectedTab"]).__eq("instance");
  2654. if(smalltalk.assert($4)){
  2655. klass=self["@selectedClass"];
  2656. } else {
  2657. klass=_st(self["@selectedClass"])._class();
  2658. };
  2659. klass;
  2660. $5=_st(_st(klass)._methodDictionary())._isEmpty();
  2661. if(smalltalk.assert($5)){
  2662. $6=_st($Array())._with_("not yet classified");
  2663. return $6;
  2664. };
  2665. $7=_st(klass)._protocols();
  2666. return $7;
  2667. };
  2668. $8=_st($Array())._new();
  2669. return $8;
  2670. }, function($ctx1) {$ctx1.fill(self,"protocols",{klass:klass},smalltalk.Browser)})},
  2671. args: [],
  2672. source: "protocols\x0a\x09| klass |\x0a\x09selectedClass ifNotNil: [\x0a\x09selectedTab = #comment ifTrue: [ ^ #() ].\x0a\x09klass := selectedTab = #instance\x0a\x09\x09ifTrue: [ selectedClass ]\x0a\x09\x09ifFalse: [ selectedClass class ].\x0a\x09klass methodDictionary isEmpty ifTrue: [\x0a\x09\x09^ Array with: 'not yet classified' ].\x0a\x09^ klass protocols ].\x0a\x09^ Array new",
  2673. messageSends: ["ifNotNil:", "ifTrue:", "=", "ifTrue:ifFalse:", "class", "isEmpty", "methodDictionary", "with:", "protocols", "new"],
  2674. referencedClasses: ["Array"]
  2675. }),
  2676. smalltalk.Browser);
  2677. smalltalk.addMethod(
  2678. smalltalk.method({
  2679. selector: "removeClass",
  2680. protocol: 'actions',
  2681. fn: function (){
  2682. var self=this;
  2683. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2684. return smalltalk.withContext(function($ctx1) {
  2685. var $2,$1;
  2686. $2=_st("Do you really want to remove ".__comma(_st(self["@selectedClass"])._name())).__comma("?");
  2687. $ctx1.sendIdx[","]=1;
  2688. $1=self._confirm_($2);
  2689. if(smalltalk.assert($1)){
  2690. _st(_st($Smalltalk())._current())._removeClass_(self["@selectedClass"]);
  2691. self._resetClassesList();
  2692. self._selectClass_(nil);
  2693. };
  2694. return self}, function($ctx1) {$ctx1.fill(self,"removeClass",{},smalltalk.Browser)})},
  2695. args: [],
  2696. source: "removeClass\x0a\x09(self confirm: 'Do you really want to remove ', selectedClass name, '?')\x0a\x09ifTrue: [\x0a\x09\x09Smalltalk current removeClass: selectedClass.\x0a\x09\x09self resetClassesList.\x0a\x09\x09self selectClass: nil ]",
  2697. messageSends: ["ifTrue:", "confirm:", ",", "name", "removeClass:", "current", "resetClassesList", "selectClass:"],
  2698. referencedClasses: ["Smalltalk"]
  2699. }),
  2700. smalltalk.Browser);
  2701. smalltalk.addMethod(
  2702. smalltalk.method({
  2703. selector: "removeMethod",
  2704. protocol: 'actions',
  2705. fn: function (){
  2706. var self=this;
  2707. return smalltalk.withContext(function($ctx1) {
  2708. var $1,$3,$2,$4;
  2709. $1=self._cancelChanges();
  2710. if(smalltalk.assert($1)){
  2711. $3=_st("Do you really want to remove #".__comma(_st(self["@selectedMethod"])._selector())).__comma("?");
  2712. $ctx1.sendIdx[","]=1;
  2713. $2=self._confirm_($3);
  2714. if(smalltalk.assert($2)){
  2715. $4=_st(self["@selectedTab"]).__eq("instance");
  2716. if(smalltalk.assert($4)){
  2717. _st(self["@selectedClass"])._removeCompiledMethod_(self["@selectedMethod"]);
  2718. $ctx1.sendIdx["removeCompiledMethod:"]=1;
  2719. } else {
  2720. _st(_st(self["@selectedClass"])._class())._removeCompiledMethod_(self["@selectedMethod"]);
  2721. };
  2722. self._selectMethod_(nil);
  2723. };
  2724. };
  2725. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod",{},smalltalk.Browser)})},
  2726. args: [],
  2727. source: "removeMethod\x0a\x09self cancelChanges ifTrue: [\x0a\x09(self confirm: 'Do you really want to remove #', selectedMethod selector, '?')\x0a\x09\x09ifTrue: [\x0a\x09\x09selectedTab = #instance\x0a\x09\x09\x09ifTrue: [ selectedClass removeCompiledMethod: selectedMethod ]\x0a\x09\x09\x09ifFalse: [ selectedClass class removeCompiledMethod: selectedMethod ].\x0a\x09\x09self selectMethod: nil ]]",
  2728. messageSends: ["ifTrue:", "cancelChanges", "confirm:", ",", "selector", "ifTrue:ifFalse:", "=", "removeCompiledMethod:", "class", "selectMethod:"],
  2729. referencedClasses: []
  2730. }),
  2731. smalltalk.Browser);
  2732. smalltalk.addMethod(
  2733. smalltalk.method({
  2734. selector: "removePackage",
  2735. protocol: 'actions',
  2736. fn: function (){
  2737. var self=this;
  2738. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2739. return smalltalk.withContext(function($ctx1) {
  2740. var $2,$1;
  2741. $2=_st("Do you really want to remove the whole package ".__comma(self["@selectedPackage"])).__comma(" with all its classes?");
  2742. $ctx1.sendIdx[","]=1;
  2743. $1=self._confirm_($2);
  2744. if(smalltalk.assert($1)){
  2745. _st(_st($Smalltalk())._current())._removePackage_(self["@selectedPackage"]);
  2746. self._updateCategoriesList();
  2747. };
  2748. return self}, function($ctx1) {$ctx1.fill(self,"removePackage",{},smalltalk.Browser)})},
  2749. args: [],
  2750. source: "removePackage\x0a\x0a\x09(self confirm: 'Do you really want to remove the whole package ', selectedPackage, ' with all its classes?')\x0a\x09ifTrue: [\x0a\x09\x09Smalltalk current removePackage: selectedPackage.\x0a\x09\x09self updateCategoriesList ]",
  2751. messageSends: ["ifTrue:", "confirm:", ",", "removePackage:", "current", "updateCategoriesList"],
  2752. referencedClasses: ["Smalltalk"]
  2753. }),
  2754. smalltalk.Browser);
  2755. smalltalk.addMethod(
  2756. smalltalk.method({
  2757. selector: "renameClass",
  2758. protocol: 'actions',
  2759. fn: function (){
  2760. var self=this;
  2761. var newName;
  2762. return smalltalk.withContext(function($ctx1) {
  2763. var $1,$2;
  2764. newName=self._prompt_("Rename class ".__comma(_st(self["@selectedClass"])._name()));
  2765. $1=_st(_st(newName)._notNil())._and_((function(){
  2766. return smalltalk.withContext(function($ctx2) {
  2767. return _st(newName)._notEmpty();
  2768. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2769. if(smalltalk.assert($1)){
  2770. _st(self["@selectedClass"])._rename_(newName);
  2771. self._updateClassesList();
  2772. $2=self._updateSourceAndButtons();
  2773. $2;
  2774. };
  2775. return self}, function($ctx1) {$ctx1.fill(self,"renameClass",{newName:newName},smalltalk.Browser)})},
  2776. args: [],
  2777. source: "renameClass\x0a\x09| newName |\x0a\x09newName := self prompt: 'Rename class ', selectedClass name.\x0a\x09(newName notNil and: [ newName notEmpty ]) ifTrue: [\x0a\x09selectedClass rename: newName.\x0a\x09self\x0a\x09\x09updateClassesList;\x0a\x09\x09updateSourceAndButtons ]",
  2778. messageSends: ["prompt:", ",", "name", "ifTrue:", "and:", "notNil", "notEmpty", "rename:", "updateClassesList", "updateSourceAndButtons"],
  2779. referencedClasses: []
  2780. }),
  2781. smalltalk.Browser);
  2782. smalltalk.addMethod(
  2783. smalltalk.method({
  2784. selector: "renamePackage",
  2785. protocol: 'actions',
  2786. fn: function (){
  2787. var self=this;
  2788. var newName;
  2789. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  2790. return smalltalk.withContext(function($ctx1) {
  2791. var $1,$2;
  2792. newName=self._prompt_("Rename package ".__comma(self["@selectedPackage"]));
  2793. $1=newName;
  2794. if(($receiver = $1) == nil || $receiver == null){
  2795. $1;
  2796. } else {
  2797. $2=_st(newName)._notEmpty();
  2798. if(smalltalk.assert($2)){
  2799. _st(_st($Smalltalk())._current())._renamePackage_to_(self["@selectedPackage"],newName);
  2800. self._updateCategoriesList();
  2801. };
  2802. };
  2803. return self}, function($ctx1) {$ctx1.fill(self,"renamePackage",{newName:newName},smalltalk.Browser)})},
  2804. args: [],
  2805. source: "renamePackage\x0a\x0a\x09| newName |\x0a\x09newName := self prompt: 'Rename package ', selectedPackage.\x0a\x09newName ifNotNil: [\x0a\x09newName notEmpty ifTrue: [\x0a\x09Smalltalk current renamePackage: selectedPackage to: newName.\x0a\x09self updateCategoriesList ]]",
  2806. messageSends: ["prompt:", ",", "ifNotNil:", "ifTrue:", "notEmpty", "renamePackage:to:", "current", "updateCategoriesList"],
  2807. referencedClasses: ["Smalltalk"]
  2808. }),
  2809. smalltalk.Browser);
  2810. smalltalk.addMethod(
  2811. smalltalk.method({
  2812. selector: "renderBottomPanelOn:",
  2813. protocol: 'rendering',
  2814. fn: function (html){
  2815. var self=this;
  2816. function $SourceArea(){return smalltalk.SourceArea||(typeof SourceArea=="undefined"?nil:SourceArea)}
  2817. return smalltalk.withContext(function($ctx1) {
  2818. var $1,$2;
  2819. $1=_st(html)._div();
  2820. _st($1)._class_("amber_sourceCode");
  2821. $2=_st($1)._with_((function(){
  2822. return smalltalk.withContext(function($ctx2) {
  2823. self["@sourceArea"]=_st($SourceArea())._new();
  2824. self["@sourceArea"];
  2825. _st(self["@sourceArea"])._renderOn_(html);
  2826. _st(self["@sourceArea"])._onKeyDown_((function(e){
  2827. return smalltalk.withContext(function($ctx3) {
  2828. return self._handleSourceAreaKeyDown_(e);
  2829. }, function($ctx3) {$ctx3.fillBlock({e:e},$ctx2,2)})}));
  2830. return _st(self["@sourceArea"])._onKeyUp_((function(){
  2831. return smalltalk.withContext(function($ctx3) {
  2832. return self._updateStatus();
  2833. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  2834. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2835. return self}, function($ctx1) {$ctx1.fill(self,"renderBottomPanelOn:",{html:html},smalltalk.Browser)})},
  2836. args: ["html"],
  2837. source: "renderBottomPanelOn: html\x0a\x09html div\x0a\x09class: 'amber_sourceCode';\x0a\x09with: [\x0a\x09\x09sourceArea := SourceArea new.\x0a\x09\x09sourceArea renderOn: html.\x0a\x09\x09\x09sourceArea onKeyDown: [ :e |\x0a\x09\x09\x09\x09self handleSourceAreaKeyDown: e ].\x0a\x09\x09sourceArea onKeyUp: [ self updateStatus ]]",
  2838. messageSends: ["class:", "div", "with:", "new", "renderOn:", "onKeyDown:", "handleSourceAreaKeyDown:", "onKeyUp:", "updateStatus"],
  2839. referencedClasses: ["SourceArea"]
  2840. }),
  2841. smalltalk.Browser);
  2842. smalltalk.addMethod(
  2843. smalltalk.method({
  2844. selector: "renderBoxOn:",
  2845. protocol: 'rendering',
  2846. fn: function (html){
  2847. var self=this;
  2848. return smalltalk.withContext(function($ctx1) {
  2849. var $1;
  2850. self._renderTopPanelOn_(html);
  2851. self._renderTabsOn_(html);
  2852. $1=self._renderBottomPanelOn_(html);
  2853. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.Browser)})},
  2854. args: ["html"],
  2855. source: "renderBoxOn: html\x0a\x09self\x0a\x09renderTopPanelOn: html;\x0a\x09renderTabsOn: html;\x0a\x09renderBottomPanelOn: html",
  2856. messageSends: ["renderTopPanelOn:", "renderTabsOn:", "renderBottomPanelOn:"],
  2857. referencedClasses: []
  2858. }),
  2859. smalltalk.Browser);
  2860. smalltalk.addMethod(
  2861. smalltalk.method({
  2862. selector: "renderButtonsOn:",
  2863. protocol: 'rendering',
  2864. fn: function (html){
  2865. var self=this;
  2866. return smalltalk.withContext(function($ctx1) {
  2867. var $1,$2,$3,$5,$6,$7,$8,$9,$10,$4;
  2868. self["@saveButton"]=_st(html)._button();
  2869. $ctx1.sendIdx["button"]=1;
  2870. $1=self["@saveButton"];
  2871. _st($1)._with_("Save");
  2872. $ctx1.sendIdx["with:"]=1;
  2873. $2=_st($1)._onClick_((function(){
  2874. return smalltalk.withContext(function($ctx2) {
  2875. return self._compile();
  2876. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2877. $ctx1.sendIdx["onClick:"]=1;
  2878. self["@methodButtons"]=_st(html)._span();
  2879. $ctx1.sendIdx["span"]=1;
  2880. self["@classButtons"]=_st(html)._span();
  2881. $3=_st(html)._div();
  2882. _st($3)._class_("right");
  2883. $4=_st($3)._with_((function(){
  2884. return smalltalk.withContext(function($ctx2) {
  2885. $5=_st(html)._button();
  2886. $ctx2.sendIdx["button"]=2;
  2887. _st($5)._with_("DoIt");
  2888. $ctx2.sendIdx["with:"]=3;
  2889. $6=_st($5)._onClick_((function(){
  2890. return smalltalk.withContext(function($ctx3) {
  2891. return _st(self["@sourceArea"])._doIt();
  2892. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  2893. $ctx2.sendIdx["onClick:"]=2;
  2894. $6;
  2895. $7=_st(html)._button();
  2896. $ctx2.sendIdx["button"]=3;
  2897. _st($7)._with_("PrintIt");
  2898. $ctx2.sendIdx["with:"]=4;
  2899. $8=_st($7)._onClick_((function(){
  2900. return smalltalk.withContext(function($ctx3) {
  2901. return _st(self["@sourceArea"])._printIt();
  2902. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  2903. $ctx2.sendIdx["onClick:"]=3;
  2904. $8;
  2905. $9=_st(html)._button();
  2906. _st($9)._with_("InspectIt");
  2907. $10=_st($9)._onClick_((function(){
  2908. return smalltalk.withContext(function($ctx3) {
  2909. return _st(self["@sourceArea"])._inspectIt();
  2910. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)})}));
  2911. return $10;
  2912. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  2913. $ctx1.sendIdx["with:"]=2;
  2914. self._updateSourceAndButtons();
  2915. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.Browser)})},
  2916. args: ["html"],
  2917. source: "renderButtonsOn: html\x0a\x09saveButton := html button.\x0a\x09saveButton\x0a\x09with: 'Save';\x0a\x09onClick: [ self compile ].\x0a\x09methodButtons := html span.\x0a\x09classButtons := html span.\x0a\x09html div\x0a\x09class: 'right';\x0a\x09with: [\x0a\x09\x09html button\x0a\x09\x09\x09with: 'DoIt';\x0a\x09\x09\x09onClick: [ sourceArea doIt ].\x0a\x09\x09html button\x0a\x09\x09\x09with: 'PrintIt';\x0a\x09\x09\x09onClick: [ sourceArea printIt ].\x0a\x09\x09html button with: 'InspectIt';\x0a\x09\x09\x09onClick: [ sourceArea inspectIt ]].\x0a\x09self updateSourceAndButtons",
  2918. messageSends: ["button", "with:", "onClick:", "compile", "span", "class:", "div", "doIt", "printIt", "inspectIt", "updateSourceAndButtons"],
  2919. referencedClasses: []
  2920. }),
  2921. smalltalk.Browser);
  2922. smalltalk.addMethod(
  2923. smalltalk.method({
  2924. selector: "renderTabsOn:",
  2925. protocol: 'rendering',
  2926. fn: function (html){
  2927. var self=this;
  2928. return smalltalk.withContext(function($ctx1) {
  2929. self["@tabsList"]=_st(_st(html)._ul())._class_("amber_tabs amber_browser");
  2930. self._updateTabsList();
  2931. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.Browser)})},
  2932. args: ["html"],
  2933. source: "renderTabsOn: html\x0a\x09tabsList := html ul class: 'amber_tabs amber_browser'.\x0a\x09self updateTabsList.",
  2934. messageSends: ["class:", "ul", "updateTabsList"],
  2935. referencedClasses: []
  2936. }),
  2937. smalltalk.Browser);
  2938. smalltalk.addMethod(
  2939. smalltalk.method({
  2940. selector: "renderTopPanelOn:",
  2941. protocol: 'rendering',
  2942. fn: function (html){
  2943. var self=this;
  2944. function $ClassesList(){return smalltalk.ClassesList||(typeof ClassesList=="undefined"?nil:ClassesList)}
  2945. return smalltalk.withContext(function($ctx1) {
  2946. var $1,$3,$4,$6,$7,$8,$9,$10,$11,$5,$12,$13,$2;
  2947. $1=_st(html)._div();
  2948. $ctx1.sendIdx["div"]=1;
  2949. _st($1)._class_("top");
  2950. $ctx1.sendIdx["class:"]=1;
  2951. $2=_st($1)._with_((function(){
  2952. return smalltalk.withContext(function($ctx2) {
  2953. $3=_st(html)._ul();
  2954. $ctx2.sendIdx["ul"]=1;
  2955. self["@packagesList"]=_st($3)._class_("amber_column browser packages");
  2956. $ctx2.sendIdx["class:"]=2;
  2957. self["@packagesList"];
  2958. $4=_st(html)._div();
  2959. $ctx2.sendIdx["div"]=2;
  2960. _st($4)._class_("amber_packagesButtons");
  2961. $ctx2.sendIdx["class:"]=3;
  2962. $5=_st($4)._with_((function(){
  2963. return smalltalk.withContext(function($ctx3) {
  2964. $6=_st(html)._button();
  2965. $ctx3.sendIdx["button"]=1;
  2966. _st($6)._title_("Commit classes in this package to disk");
  2967. $ctx3.sendIdx["title:"]=1;
  2968. _st($6)._onClick_((function(){
  2969. return smalltalk.withContext(function($ctx4) {
  2970. return self._commitPackage();
  2971. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
  2972. $ctx3.sendIdx["onClick:"]=1;
  2973. $7=_st($6)._with_("Commit");
  2974. $ctx3.sendIdx["with:"]=3;
  2975. $7;
  2976. $8=_st(html)._button();
  2977. $ctx3.sendIdx["button"]=2;
  2978. _st($8)._title_("Rename package");
  2979. $ctx3.sendIdx["title:"]=2;
  2980. _st($8)._onClick_((function(){
  2981. return smalltalk.withContext(function($ctx4) {
  2982. return self._renamePackage();
  2983. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)})}));
  2984. $ctx3.sendIdx["onClick:"]=2;
  2985. $9=_st($8)._with_("Rename");
  2986. $ctx3.sendIdx["with:"]=4;
  2987. $9;
  2988. $10=_st(html)._button();
  2989. _st($10)._title_("Remove this package from the system");
  2990. _st($10)._onClick_((function(){
  2991. return smalltalk.withContext(function($ctx4) {
  2992. return self._removePackage();
  2993. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)})}));
  2994. $11=_st($10)._with_("Remove");
  2995. return $11;
  2996. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  2997. $ctx2.sendIdx["with:"]=2;
  2998. $5;
  2999. self["@classesList"]=_st($ClassesList())._on_(self);
  3000. self["@classesList"];
  3001. _st(self["@classesList"])._renderOn_(html);
  3002. $12=_st(html)._ul();
  3003. $ctx2.sendIdx["ul"]=2;
  3004. self["@protocolsList"]=_st($12)._class_("amber_column browser protocols");
  3005. $ctx2.sendIdx["class:"]=4;
  3006. self["@protocolsList"];
  3007. self["@methodsList"]=_st(_st(html)._ul())._class_("amber_column browser methods");
  3008. $ctx2.sendIdx["class:"]=5;
  3009. self["@methodsList"];
  3010. self._updateCategoriesList();
  3011. self._updateClassesList();
  3012. self._updateProtocolsList();
  3013. $13=self._updateMethodsList();
  3014. $13;
  3015. return _st(_st(html)._div())._class_("amber_clear");
  3016. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  3017. $ctx1.sendIdx["with:"]=1;
  3018. return self}, function($ctx1) {$ctx1.fill(self,"renderTopPanelOn:",{html:html},smalltalk.Browser)})},
  3019. args: ["html"],
  3020. source: "renderTopPanelOn: html\x0a\x09html div\x0a\x09\x09class: 'top';\x0a\x09\x09with: [\x0a\x09\x09\x09packagesList := html ul class: 'amber_column browser packages'.\x0a\x09\x09\x09\x09html div class: 'amber_packagesButtons'; with: [\x0a\x09\x09\x09\x09html button\x0a\x09\x09\x09\x09\x09title: 'Commit classes in this package to disk';\x0a\x09\x09\x09\x09\x09onClick: [ self commitPackage ];\x0a\x09\x09\x09\x09\x09with: 'Commit'.\x0a\x09\x09\x09\x09\x09html button\x0a\x09\x09\x09\x09\x09title: 'Rename package';\x0a\x09\x09\x09\x09\x09onClick: [ self renamePackage ];\x0a\x09\x09\x09\x09\x09with: 'Rename'.\x0a\x09\x09\x09\x09\x09html button\x0a\x09\x09\x09\x09\x09title: 'Remove this package from the system';\x0a\x09\x09\x09\x09\x09onClick: [ self removePackage ];\x0a\x09\x09\x09\x09\x09with: 'Remove' ].\x0a\x09\x09\x09classesList := ClassesList on: self.\x0a\x09\x09\x09classesList renderOn: html.\x0a\x09\x09\x09protocolsList := html ul class: 'amber_column browser protocols'.\x0a\x09\x09\x09methodsList := html ul class: 'amber_column browser methods'.\x0a\x09\x09\x09self\x0a\x09\x09\x09\x09updateCategoriesList;\x0a\x09\x09\x09\x09updateClassesList;\x0a\x09\x09\x09\x09updateProtocolsList;\x0a\x09\x09\x09\x09updateMethodsList.\x0a\x09\x09\x09html div class: 'amber_clear' ]",
  3021. messageSends: ["class:", "div", "with:", "ul", "title:", "button", "onClick:", "commitPackage", "renamePackage", "removePackage", "on:", "renderOn:", "updateCategoriesList", "updateClassesList", "updateProtocolsList", "updateMethodsList"],
  3022. referencedClasses: ["ClassesList"]
  3023. }),
  3024. smalltalk.Browser);
  3025. smalltalk.addMethod(
  3026. smalltalk.method({
  3027. selector: "resetClassesList",
  3028. protocol: 'updating',
  3029. fn: function (){
  3030. var self=this;
  3031. return smalltalk.withContext(function($ctx1) {
  3032. _st(self["@classesList"])._resetNodes();
  3033. return self}, function($ctx1) {$ctx1.fill(self,"resetClassesList",{},smalltalk.Browser)})},
  3034. args: [],
  3035. source: "resetClassesList\x0a\x09classesList resetNodes",
  3036. messageSends: ["resetNodes"],
  3037. referencedClasses: []
  3038. }),
  3039. smalltalk.Browser);
  3040. smalltalk.addMethod(
  3041. smalltalk.method({
  3042. selector: "search:",
  3043. protocol: 'actions',
  3044. fn: function (aString){
  3045. var self=this;
  3046. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  3047. return smalltalk.withContext(function($ctx1) {
  3048. var $1,$2;
  3049. $1=self._cancelChanges();
  3050. if(smalltalk.assert($1)){
  3051. var searchedClass;
  3052. searchedClass=_st(_st($Smalltalk())._current())._at_(aString);
  3053. searchedClass;
  3054. $2=_st(searchedClass)._isClass();
  3055. if(smalltalk.assert($2)){
  3056. _st(self._class())._openOn_(searchedClass);
  3057. } else {
  3058. self._searchReferencesOf_(aString);
  3059. };
  3060. };
  3061. return self}, function($ctx1) {$ctx1.fill(self,"search:",{aString:aString},smalltalk.Browser)})},
  3062. args: ["aString"],
  3063. 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 ]]",
  3064. messageSends: ["ifTrue:", "cancelChanges", "at:", "current", "ifTrue:ifFalse:", "isClass", "openOn:", "class", "searchReferencesOf:"],
  3065. referencedClasses: ["Smalltalk"]
  3066. }),
  3067. smalltalk.Browser);
  3068. smalltalk.addMethod(
  3069. smalltalk.method({
  3070. selector: "searchClassReferences",
  3071. protocol: 'actions',
  3072. fn: function (){
  3073. var self=this;
  3074. function $ReferencesBrowser(){return smalltalk.ReferencesBrowser||(typeof ReferencesBrowser=="undefined"?nil:ReferencesBrowser)}
  3075. return smalltalk.withContext(function($ctx1) {
  3076. _st($ReferencesBrowser())._search_(_st(self["@selectedClass"])._name());
  3077. return self}, function($ctx1) {$ctx1.fill(self,"searchClassReferences",{},smalltalk.Browser)})},
  3078. args: [],
  3079. source: "searchClassReferences\x0a\x09ReferencesBrowser search: selectedClass name",
  3080. messageSends: ["search:", "name"],
  3081. referencedClasses: ["ReferencesBrowser"]
  3082. }),
  3083. smalltalk.Browser);
  3084. smalltalk.addMethod(
  3085. smalltalk.method({
  3086. selector: "searchReferencesOf:",
  3087. protocol: 'actions',
  3088. fn: function (aString){
  3089. var self=this;
  3090. function $ReferencesBrowser(){return smalltalk.ReferencesBrowser||(typeof ReferencesBrowser=="undefined"?nil:ReferencesBrowser)}
  3091. return smalltalk.withContext(function($ctx1) {
  3092. _st($ReferencesBrowser())._search_(aString);
  3093. return self}, function($ctx1) {$ctx1.fill(self,"searchReferencesOf:",{aString:aString},smalltalk.Browser)})},
  3094. args: ["aString"],
  3095. source: "searchReferencesOf: aString\x0a\x09ReferencesBrowser search: aString",
  3096. messageSends: ["search:"],
  3097. referencedClasses: ["ReferencesBrowser"]
  3098. }),
  3099. smalltalk.Browser);
  3100. smalltalk.addMethod(
  3101. smalltalk.method({
  3102. selector: "selectCategory:",
  3103. protocol: 'actions',
  3104. fn: function (aCategory){
  3105. var self=this;
  3106. return smalltalk.withContext(function($ctx1) {
  3107. var $1,$2;
  3108. $1=self._cancelChanges();
  3109. if(smalltalk.assert($1)){
  3110. self["@selectedPackage"]=aCategory;
  3111. self["@selectedPackage"];
  3112. self["@selectedMethod"]=nil;
  3113. self["@selectedProtocol"]=self["@selectedMethod"];
  3114. self["@selectedClass"]=self["@selectedProtocol"];
  3115. self["@selectedClass"];
  3116. self._resetClassesList();
  3117. self._updateCategoriesList();
  3118. self._updateClassesList();
  3119. self._updateProtocolsList();
  3120. self._updateMethodsList();
  3121. $2=self._updateSourceAndButtons();
  3122. $2;
  3123. };
  3124. return self}, function($ctx1) {$ctx1.fill(self,"selectCategory:",{aCategory:aCategory},smalltalk.Browser)})},
  3125. args: ["aCategory"],
  3126. source: "selectCategory: aCategory\x0a\x09self cancelChanges ifTrue: [\x0a\x09selectedPackage := aCategory.\x0a\x09selectedClass := selectedProtocol := selectedMethod := nil.\x0a\x09self resetClassesList.\x0a\x09self\x0a\x09\x09updateCategoriesList;\x0a\x09\x09updateClassesList;\x0a\x09\x09updateProtocolsList;\x0a\x09\x09updateMethodsList;\x0a\x09\x09updateSourceAndButtons ]",
  3127. messageSends: ["ifTrue:", "cancelChanges", "resetClassesList", "updateCategoriesList", "updateClassesList", "updateProtocolsList", "updateMethodsList", "updateSourceAndButtons"],
  3128. referencedClasses: []
  3129. }),
  3130. smalltalk.Browser);
  3131. smalltalk.addMethod(
  3132. smalltalk.method({
  3133. selector: "selectClass:",
  3134. protocol: 'actions',
  3135. fn: function (aClass){
  3136. var self=this;
  3137. return smalltalk.withContext(function($ctx1) {
  3138. var $1,$2;
  3139. $1=self._cancelChanges();
  3140. if(smalltalk.assert($1)){
  3141. self["@selectedClass"]=aClass;
  3142. self["@selectedClass"];
  3143. self["@selectedMethod"]=nil;
  3144. self["@selectedProtocol"]=self["@selectedMethod"];
  3145. self["@selectedProtocol"];
  3146. self._updateClassesList();
  3147. self._updateProtocolsList();
  3148. self._updateMethodsList();
  3149. $2=self._updateSourceAndButtons();
  3150. $2;
  3151. };
  3152. return self}, function($ctx1) {$ctx1.fill(self,"selectClass:",{aClass:aClass},smalltalk.Browser)})},
  3153. args: ["aClass"],
  3154. source: "selectClass: aClass\x0a\x09self cancelChanges ifTrue: [\x0a\x09selectedClass := aClass.\x0a\x09selectedProtocol := selectedMethod := nil.\x0a\x09self\x0a\x09\x09updateClassesList;\x0a\x09\x09updateProtocolsList;\x0a\x09\x09updateMethodsList;\x0a\x09\x09updateSourceAndButtons ]",
  3155. messageSends: ["ifTrue:", "cancelChanges", "updateClassesList", "updateProtocolsList", "updateMethodsList", "updateSourceAndButtons"],
  3156. referencedClasses: []
  3157. }),
  3158. smalltalk.Browser);
  3159. smalltalk.addMethod(
  3160. smalltalk.method({
  3161. selector: "selectMethod:",
  3162. protocol: 'actions',
  3163. fn: function (aMethod){
  3164. var self=this;
  3165. return smalltalk.withContext(function($ctx1) {
  3166. var $1,$2;
  3167. $1=self._cancelChanges();
  3168. if(smalltalk.assert($1)){
  3169. self["@selectedMethod"]=aMethod;
  3170. self["@selectedMethod"];
  3171. self._updateProtocolsList();
  3172. self._updateMethodsList();
  3173. $2=self._updateSourceAndButtons();
  3174. $2;
  3175. };
  3176. return self}, function($ctx1) {$ctx1.fill(self,"selectMethod:",{aMethod:aMethod},smalltalk.Browser)})},
  3177. args: ["aMethod"],
  3178. source: "selectMethod: aMethod\x0a\x09self cancelChanges ifTrue: [\x0a\x09selectedMethod := aMethod.\x0a\x09self\x0a\x09\x09updateProtocolsList;\x0a\x09\x09updateMethodsList;\x0a\x09\x09updateSourceAndButtons ]",
  3179. messageSends: ["ifTrue:", "cancelChanges", "updateProtocolsList", "updateMethodsList", "updateSourceAndButtons"],
  3180. referencedClasses: []
  3181. }),
  3182. smalltalk.Browser);
  3183. smalltalk.addMethod(
  3184. smalltalk.method({
  3185. selector: "selectProtocol:",
  3186. protocol: 'actions',
  3187. fn: function (aString){
  3188. var self=this;
  3189. return smalltalk.withContext(function($ctx1) {
  3190. var $1,$2;
  3191. $1=self._cancelChanges();
  3192. if(smalltalk.assert($1)){
  3193. self["@selectedProtocol"]=aString;
  3194. self["@selectedProtocol"];
  3195. self["@selectedMethod"]=nil;
  3196. self["@selectedMethod"];
  3197. self._updateProtocolsList();
  3198. self._updateMethodsList();
  3199. $2=self._updateSourceAndButtons();
  3200. $2;
  3201. };
  3202. return self}, function($ctx1) {$ctx1.fill(self,"selectProtocol:",{aString:aString},smalltalk.Browser)})},
  3203. args: ["aString"],
  3204. source: "selectProtocol: aString\x0a\x09self cancelChanges ifTrue: [\x0a\x09selectedProtocol := aString.\x0a\x09selectedMethod := nil.\x0a\x09self\x0a\x09\x09updateProtocolsList;\x0a\x09\x09updateMethodsList;\x0a\x09\x09updateSourceAndButtons ]",
  3205. messageSends: ["ifTrue:", "cancelChanges", "updateProtocolsList", "updateMethodsList", "updateSourceAndButtons"],
  3206. referencedClasses: []
  3207. }),
  3208. smalltalk.Browser);
  3209. smalltalk.addMethod(
  3210. smalltalk.method({
  3211. selector: "selectTab:",
  3212. protocol: 'actions',
  3213. fn: function (aString){
  3214. var self=this;
  3215. return smalltalk.withContext(function($ctx1) {
  3216. var $1;
  3217. $1=self._cancelChanges();
  3218. if(smalltalk.assert($1)){
  3219. self["@selectedTab"]=aString;
  3220. self["@selectedTab"];
  3221. self._selectProtocol_(nil);
  3222. self._updateTabsList();
  3223. };
  3224. return self}, function($ctx1) {$ctx1.fill(self,"selectTab:",{aString:aString},smalltalk.Browser)})},
  3225. args: ["aString"],
  3226. source: "selectTab: aString\x0a\x09self cancelChanges ifTrue: [\x0a\x09selectedTab := aString.\x0a\x09self selectProtocol: nil.\x0a\x09self updateTabsList ]",
  3227. messageSends: ["ifTrue:", "cancelChanges", "selectProtocol:", "updateTabsList"],
  3228. referencedClasses: []
  3229. }),
  3230. smalltalk.Browser);
  3231. smalltalk.addMethod(
  3232. smalltalk.method({
  3233. selector: "selectedClass",
  3234. protocol: 'accessing',
  3235. fn: function (){
  3236. var self=this;
  3237. return smalltalk.withContext(function($ctx1) {
  3238. var $1;
  3239. $1=self["@selectedClass"];
  3240. return $1;
  3241. }, function($ctx1) {$ctx1.fill(self,"selectedClass",{},smalltalk.Browser)})},
  3242. args: [],
  3243. source: "selectedClass\x0a\x09^ selectedClass",
  3244. messageSends: [],
  3245. referencedClasses: []
  3246. }),
  3247. smalltalk.Browser);
  3248. smalltalk.addMethod(
  3249. smalltalk.method({
  3250. selector: "selectedPackage",
  3251. protocol: 'accessing',
  3252. fn: function (){
  3253. var self=this;
  3254. return smalltalk.withContext(function($ctx1) {
  3255. var $1;
  3256. $1=self["@selectedPackage"];
  3257. return $1;
  3258. }, function($ctx1) {$ctx1.fill(self,"selectedPackage",{},smalltalk.Browser)})},
  3259. args: [],
  3260. source: "selectedPackage\x0a\x09^ selectedPackage",
  3261. messageSends: [],
  3262. referencedClasses: []
  3263. }),
  3264. smalltalk.Browser);
  3265. smalltalk.addMethod(
  3266. smalltalk.method({
  3267. selector: "setMethodProtocol:",
  3268. protocol: 'actions',
  3269. fn: function (aString){
  3270. var self=this;
  3271. return smalltalk.withContext(function($ctx1) {
  3272. var $1,$2,$3;
  3273. $1=self._cancelChanges();
  3274. if(smalltalk.assert($1)){
  3275. $2=_st(self._protocols())._includes_(aString);
  3276. if(smalltalk.assert($2)){
  3277. _st(self["@selectedMethod"])._protocol_(aString);
  3278. self["@selectedProtocol"]=aString;
  3279. self["@selectedProtocol"];
  3280. self["@selectedMethod"]=self["@selectedMethod"];
  3281. self["@selectedMethod"];
  3282. self._updateProtocolsList();
  3283. self._updateMethodsList();
  3284. $3=self._updateSourceAndButtons();
  3285. $3;
  3286. } else {
  3287. self._addNewProtocol();
  3288. };
  3289. };
  3290. return self}, function($ctx1) {$ctx1.fill(self,"setMethodProtocol:",{aString:aString},smalltalk.Browser)})},
  3291. args: ["aString"],
  3292. source: "setMethodProtocol: aString\x0a\x09self cancelChanges ifTrue: [\x0a\x09(self protocols includes: aString)\x0a\x09\x09ifFalse: [ self addNewProtocol ]\x0a\x09\x09ifTrue: [\x0a\x09\x09selectedMethod protocol: aString.\x0a\x09\x09selectedProtocol := aString.\x0a\x09\x09selectedMethod := selectedMethod.\x0a\x09\x09self\x0a\x09\x09\x09updateProtocolsList;\x0a\x09\x09\x09updateMethodsList;\x0a\x09\x09\x09updateSourceAndButtons ]]",
  3293. messageSends: ["ifTrue:", "cancelChanges", "ifFalse:ifTrue:", "includes:", "protocols", "addNewProtocol", "protocol:", "updateProtocolsList", "updateMethodsList", "updateSourceAndButtons"],
  3294. referencedClasses: []
  3295. }),
  3296. smalltalk.Browser);
  3297. smalltalk.addMethod(
  3298. smalltalk.method({
  3299. selector: "showClassButtons",
  3300. protocol: 'actions',
  3301. fn: function (){
  3302. var self=this;
  3303. return smalltalk.withContext(function($ctx1) {
  3304. _st(_st(self["@classButtons"])._asJQuery())._show();
  3305. return self}, function($ctx1) {$ctx1.fill(self,"showClassButtons",{},smalltalk.Browser)})},
  3306. args: [],
  3307. source: "showClassButtons\x0a\x09classButtons asJQuery show",
  3308. messageSends: ["show", "asJQuery"],
  3309. referencedClasses: []
  3310. }),
  3311. smalltalk.Browser);
  3312. smalltalk.addMethod(
  3313. smalltalk.method({
  3314. selector: "showMethodButtons",
  3315. protocol: 'actions',
  3316. fn: function (){
  3317. var self=this;
  3318. return smalltalk.withContext(function($ctx1) {
  3319. _st(_st(self["@methodButtons"])._asJQuery())._show();
  3320. return self}, function($ctx1) {$ctx1.fill(self,"showMethodButtons",{},smalltalk.Browser)})},
  3321. args: [],
  3322. source: "showMethodButtons\x0a\x09methodButtons asJQuery show",
  3323. messageSends: ["show", "asJQuery"],
  3324. referencedClasses: []
  3325. }),
  3326. smalltalk.Browser);
  3327. smalltalk.addMethod(
  3328. smalltalk.method({
  3329. selector: "source",
  3330. protocol: 'accessing',
  3331. fn: function (){
  3332. var self=this;
  3333. return smalltalk.withContext(function($ctx1) {
  3334. var $1,$4,$3,$2,$6,$5;
  3335. $1=_st(self["@selectedTab"]).__eq("comment");
  3336. if(! smalltalk.assert($1)){
  3337. $4=_st(self["@selectedProtocol"])._notNil();
  3338. $ctx1.sendIdx["notNil"]=1;
  3339. $3=_st($4)._or_((function(){
  3340. return smalltalk.withContext(function($ctx2) {
  3341. return _st(self["@selectedMethod"])._notNil();
  3342. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  3343. if(smalltalk.assert($3)){
  3344. $2=self._methodSource();
  3345. } else {
  3346. $2=self._declarationSource();
  3347. };
  3348. return $2;
  3349. };
  3350. $6=self["@selectedClass"];
  3351. if(($receiver = $6) == nil || $receiver == null){
  3352. $5="";
  3353. } else {
  3354. $5=self._classCommentSource();
  3355. };
  3356. return $5;
  3357. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.Browser)})},
  3358. args: [],
  3359. source: "source\x0a\x09selectedTab = #comment ifFalse: [\x0a\x09^ (selectedProtocol notNil or: [ selectedMethod notNil ])\x0a\x09\x09ifFalse: [ self declarationSource ]\x0a\x09\x09ifTrue: [ self methodSource ]].\x0a\x09^ selectedClass\x0a\x09ifNil: [ '' ]\x0a\x09ifNotNil: [ self classCommentSource ]",
  3360. messageSends: ["ifFalse:", "=", "ifFalse:ifTrue:", "or:", "notNil", "declarationSource", "methodSource", "ifNil:ifNotNil:", "classCommentSource"],
  3361. referencedClasses: []
  3362. }),
  3363. smalltalk.Browser);
  3364. smalltalk.addMethod(
  3365. smalltalk.method({
  3366. selector: "updateCategoriesList",
  3367. protocol: 'updating',
  3368. fn: function (){
  3369. var self=this;
  3370. return smalltalk.withContext(function($ctx1) {
  3371. var $1,$2,$3,$4;
  3372. _st(self["@packagesList"])._contents_((function(html){
  3373. return smalltalk.withContext(function($ctx2) {
  3374. return _st(self._packages())._do_((function(each){
  3375. var li,label;
  3376. return smalltalk.withContext(function($ctx3) {
  3377. $1=_st(each)._isEmpty();
  3378. if(smalltalk.assert($1)){
  3379. label="Unclassified";
  3380. label;
  3381. } else {
  3382. label=each;
  3383. label;
  3384. };
  3385. li=_st(html)._li();
  3386. li;
  3387. $2=_st(self["@selectedPackage"]).__eq(each);
  3388. if(smalltalk.assert($2)){
  3389. _st(li)._class_("selected");
  3390. };
  3391. $3=li;
  3392. _st($3)._with_(label);
  3393. $4=_st($3)._onClick_((function(){
  3394. return smalltalk.withContext(function($ctx4) {
  3395. return self._selectCategory_(each);
  3396. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,6)})}));
  3397. return $4;
  3398. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li,label:label},$ctx2,2)})}));
  3399. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  3400. return self}, function($ctx1) {$ctx1.fill(self,"updateCategoriesList",{},smalltalk.Browser)})},
  3401. args: [],
  3402. source: "updateCategoriesList\x0a\x09packagesList contents: [ :html |\x0a\x09self packages do: [ :each || li label |\x0a\x09\x09each isEmpty\x0a\x09\x09ifTrue: [ label := 'Unclassified' ]\x0a\x09\x09ifFalse: [ label := each ].\x0a\x09\x09li := html li.\x0a\x09\x09selectedPackage = each ifTrue: [\x0a\x09\x09li class: 'selected' ].\x0a\x09\x09li\x0a\x09\x09with: label;\x0a\x09\x09onClick: [ self selectCategory: each ]] ]",
  3403. messageSends: ["contents:", "do:", "packages", "ifTrue:ifFalse:", "isEmpty", "li", "ifTrue:", "=", "class:", "with:", "onClick:", "selectCategory:"],
  3404. referencedClasses: []
  3405. }),
  3406. smalltalk.Browser);
  3407. smalltalk.addMethod(
  3408. smalltalk.method({
  3409. selector: "updateClassesList",
  3410. protocol: 'updating',
  3411. fn: function (){
  3412. var self=this;
  3413. function $TabManager(){return smalltalk.TabManager||(typeof TabManager=="undefined"?nil:TabManager)}
  3414. return smalltalk.withContext(function($ctx1) {
  3415. _st(_st($TabManager())._current())._update();
  3416. _st(self["@classesList"])._updateNodes();
  3417. return self}, function($ctx1) {$ctx1.fill(self,"updateClassesList",{},smalltalk.Browser)})},
  3418. args: [],
  3419. source: "updateClassesList\x0a\x09TabManager current update.\x0a\x09classesList updateNodes",
  3420. messageSends: ["update", "current", "updateNodes"],
  3421. referencedClasses: ["TabManager"]
  3422. }),
  3423. smalltalk.Browser);
  3424. smalltalk.addMethod(
  3425. smalltalk.method({
  3426. selector: "updateMethodsList",
  3427. protocol: 'updating',
  3428. fn: function (){
  3429. var self=this;
  3430. return smalltalk.withContext(function($ctx1) {
  3431. var $1,$2,$3;
  3432. _st(self["@methodsList"])._contents_((function(html){
  3433. return smalltalk.withContext(function($ctx2) {
  3434. return _st(self._methods())._do_((function(each){
  3435. var li;
  3436. return smalltalk.withContext(function($ctx3) {
  3437. li=_st(html)._li();
  3438. li;
  3439. $1=_st(self["@selectedMethod"]).__eq(each);
  3440. if(smalltalk.assert($1)){
  3441. _st(li)._class_("selected");
  3442. };
  3443. $2=li;
  3444. _st($2)._with_(_st(each)._selector());
  3445. $3=_st($2)._onClick_((function(){
  3446. return smalltalk.withContext(function($ctx4) {
  3447. return self._selectMethod_(each);
  3448. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)})}));
  3449. return $3;
  3450. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2,2)})}));
  3451. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  3452. return self}, function($ctx1) {$ctx1.fill(self,"updateMethodsList",{},smalltalk.Browser)})},
  3453. args: [],
  3454. source: "updateMethodsList\x0a\x09methodsList contents: [ :html |\x0a\x09self methods do: [ :each || li |\x0a\x09\x09li := html li.\x0a\x09\x09selectedMethod = each ifTrue: [\x0a\x09\x09li class: 'selected' ].\x0a\x09\x09li\x0a\x09\x09with: each selector;\x0a\x09\x09onClick: [ self selectMethod: each ]] ]",
  3455. messageSends: ["contents:", "do:", "methods", "li", "ifTrue:", "=", "class:", "with:", "selector", "onClick:", "selectMethod:"],
  3456. referencedClasses: []
  3457. }),
  3458. smalltalk.Browser);
  3459. smalltalk.addMethod(
  3460. smalltalk.method({
  3461. selector: "updateProtocolsList",
  3462. protocol: 'updating',
  3463. fn: function (){
  3464. var self=this;
  3465. return smalltalk.withContext(function($ctx1) {
  3466. var $1,$2,$3;
  3467. _st(self["@protocolsList"])._contents_((function(html){
  3468. return smalltalk.withContext(function($ctx2) {
  3469. return _st(self._protocols())._do_((function(each){
  3470. var li;
  3471. return smalltalk.withContext(function($ctx3) {
  3472. li=_st(html)._li();
  3473. li;
  3474. $1=_st(self["@selectedProtocol"]).__eq(each);
  3475. if(smalltalk.assert($1)){
  3476. _st(li)._class_("selected");
  3477. };
  3478. $2=li;
  3479. _st($2)._with_(each);
  3480. $3=_st($2)._onClick_((function(){
  3481. return smalltalk.withContext(function($ctx4) {
  3482. return self._selectProtocol_(each);
  3483. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)})}));
  3484. return $3;
  3485. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2,2)})}));
  3486. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  3487. return self}, function($ctx1) {$ctx1.fill(self,"updateProtocolsList",{},smalltalk.Browser)})},
  3488. args: [],
  3489. source: "updateProtocolsList\x0a\x09protocolsList contents: [ :html |\x0a\x09self protocols do: [ :each || li |\x0a\x09\x09li := html li.\x0a\x09\x09selectedProtocol = each ifTrue: [\x0a\x09\x09li class: 'selected' ].\x0a\x09\x09li\x0a\x09\x09with: each;\x0a\x09\x09onClick: [ self selectProtocol: each ]] ]",
  3490. messageSends: ["contents:", "do:", "protocols", "li", "ifTrue:", "=", "class:", "with:", "onClick:", "selectProtocol:"],
  3491. referencedClasses: []
  3492. }),
  3493. smalltalk.Browser);
  3494. smalltalk.addMethod(
  3495. smalltalk.method({
  3496. selector: "updateSourceAndButtons",
  3497. protocol: 'updating',
  3498. fn: function (){
  3499. var self=this;
  3500. var currentProtocol;
  3501. return smalltalk.withContext(function($ctx1) {
  3502. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$15,$14,$17,$18,$19,$20,$22,$21,$23,$24,$16,$25,$26,$28,$29,$30,$31,$27,$32,$33;
  3503. self._disableSaveButton();
  3504. _st(self["@classButtons"])._contents_((function(html){
  3505. return smalltalk.withContext(function($ctx2) {
  3506. $1=_st(html)._button();
  3507. $ctx2.sendIdx["button"]=1;
  3508. _st($1)._title_("Create a new class");
  3509. _st($1)._onClick_((function(){
  3510. return smalltalk.withContext(function($ctx3) {
  3511. return self._addNewClass();
  3512. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  3513. $ctx2.sendIdx["onClick:"]=1;
  3514. $2=_st($1)._with_("New class");
  3515. $ctx2.sendIdx["with:"]=1;
  3516. $2;
  3517. $3=_st(html)._button();
  3518. $ctx2.sendIdx["button"]=2;
  3519. _st($3)._with_("Rename class");
  3520. $ctx2.sendIdx["with:"]=2;
  3521. $4=_st($3)._onClick_((function(){
  3522. return smalltalk.withContext(function($ctx3) {
  3523. return self._renameClass();
  3524. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  3525. $ctx2.sendIdx["onClick:"]=2;
  3526. $4;
  3527. $5=_st(html)._button();
  3528. $ctx2.sendIdx["button"]=3;
  3529. _st($5)._with_("Copy class");
  3530. $ctx2.sendIdx["with:"]=3;
  3531. $6=_st($5)._onClick_((function(){
  3532. return smalltalk.withContext(function($ctx3) {
  3533. return self._copyClass();
  3534. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  3535. $ctx2.sendIdx["onClick:"]=3;
  3536. $6;
  3537. $7=_st(html)._button();
  3538. $ctx2.sendIdx["button"]=4;
  3539. _st($7)._with_("Remove class");
  3540. $ctx2.sendIdx["with:"]=4;
  3541. $8=_st($7)._onClick_((function(){
  3542. return smalltalk.withContext(function($ctx3) {
  3543. return self._removeClass();
  3544. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)})}));
  3545. $ctx2.sendIdx["onClick:"]=4;
  3546. $8;
  3547. $9=_st(html)._button();
  3548. $ctx2.sendIdx["button"]=5;
  3549. _st($9)._with_("References");
  3550. $ctx2.sendIdx["with:"]=5;
  3551. $10=_st($9)._onClick_((function(){
  3552. return smalltalk.withContext(function($ctx3) {
  3553. return self._searchClassReferences();
  3554. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,6)})}));
  3555. $ctx2.sendIdx["onClick:"]=5;
  3556. return $10;
  3557. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  3558. $ctx1.sendIdx["contents:"]=1;
  3559. _st(self["@methodButtons"])._contents_((function(html){
  3560. var protocolSelect,referencesSelect;
  3561. return smalltalk.withContext(function($ctx2) {
  3562. $11=_st(html)._button();
  3563. _st($11)._with_("Remove method");
  3564. $ctx2.sendIdx["with:"]=6;
  3565. $12=_st($11)._onClick_((function(){
  3566. return smalltalk.withContext(function($ctx3) {
  3567. return self._removeMethod();
  3568. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,8)})}));
  3569. $12;
  3570. protocolSelect=_st(html)._select();
  3571. $ctx2.sendIdx["select"]=1;
  3572. protocolSelect;
  3573. $13=protocolSelect;
  3574. _st($13)._onChange_((function(){
  3575. return smalltalk.withContext(function($ctx3) {
  3576. $15=_st(protocolSelect)._asJQuery();
  3577. $ctx3.sendIdx["asJQuery"]=1;
  3578. $14=_st($15)._val();
  3579. $ctx3.sendIdx["val"]=1;
  3580. return self._setMethodProtocol_($14);
  3581. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,9)})}));
  3582. $ctx2.sendIdx["onChange:"]=1;
  3583. $16=_st($13)._with_((function(){
  3584. return smalltalk.withContext(function($ctx3) {
  3585. $17=_st(html)._option();
  3586. $ctx3.sendIdx["option"]=1;
  3587. _st($17)._with_("Method protocol");
  3588. $ctx3.sendIdx["with:"]=8;
  3589. $18=_st($17)._at_put_("disabled","disabled");
  3590. $ctx3.sendIdx["at:put:"]=1;
  3591. $18;
  3592. $19=_st(html)._option();
  3593. $ctx3.sendIdx["option"]=2;
  3594. _st($19)._class_("important");
  3595. $ctx3.sendIdx["class:"]=1;
  3596. $20=_st($19)._with_("New...");
  3597. $ctx3.sendIdx["with:"]=9;
  3598. $20;
  3599. currentProtocol=self["@selectedProtocol"];
  3600. currentProtocol;
  3601. $22=_st(currentProtocol)._isNil();
  3602. $ctx3.sendIdx["isNil"]=1;
  3603. $21=_st($22)._and_((function(){
  3604. return smalltalk.withContext(function($ctx4) {
  3605. return _st(self["@selectedMethod"])._notNil();
  3606. $ctx4.sendIdx["notNil"]=1;
  3607. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,11)})}));
  3608. if(smalltalk.assert($21)){
  3609. currentProtocol=_st(self["@selectedMethod"])._category();
  3610. currentProtocol;
  3611. };
  3612. return _st(self._protocols())._do_((function(each){
  3613. var option;
  3614. return smalltalk.withContext(function($ctx4) {
  3615. $23=_st(html)._option();
  3616. $ctx4.sendIdx["option"]=3;
  3617. option=_st($23)._with_(each);
  3618. $ctx4.sendIdx["with:"]=10;
  3619. option;
  3620. $24=_st(currentProtocol).__eq(each);
  3621. if(smalltalk.assert($24)){
  3622. return _st(option)._at_put_("selected","selected");
  3623. $ctx4.sendIdx["at:put:"]=2;
  3624. };
  3625. }, function($ctx4) {$ctx4.fillBlock({each:each,option:option},$ctx3,13)})}));
  3626. $ctx3.sendIdx["do:"]=1;
  3627. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,10)})}));
  3628. $ctx2.sendIdx["with:"]=7;
  3629. $16;
  3630. $25=_st(self["@selectedMethod"])._isNil();
  3631. $ctx2.sendIdx["isNil"]=2;
  3632. if(! smalltalk.assert($25)){
  3633. referencesSelect=_st(html)._select();
  3634. referencesSelect;
  3635. $26=referencesSelect;
  3636. _st($26)._onChange_((function(){
  3637. return smalltalk.withContext(function($ctx3) {
  3638. return self._searchReferencesOf_(_st(_st(referencesSelect)._asJQuery())._val());
  3639. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,16)})}));
  3640. $27=_st($26)._with_((function(){
  3641. var option;
  3642. return smalltalk.withContext(function($ctx3) {
  3643. $28=_st(html)._option();
  3644. $ctx3.sendIdx["option"]=4;
  3645. _st($28)._with_("References");
  3646. $ctx3.sendIdx["with:"]=12;
  3647. _st($28)._at_put_("disabled","disabled");
  3648. $ctx3.sendIdx["at:put:"]=3;
  3649. $29=_st($28)._at_put_("selected","selected");
  3650. $29;
  3651. $30=_st(html)._option();
  3652. $ctx3.sendIdx["option"]=5;
  3653. _st($30)._class_("important");
  3654. $31=_st($30)._with_(_st(self["@selectedMethod"])._selector());
  3655. $ctx3.sendIdx["with:"]=13;
  3656. $31;
  3657. return _st(_st(_st(self["@selectedMethod"])._messageSends())._sorted())._do_((function(each){
  3658. return smalltalk.withContext(function($ctx4) {
  3659. return _st(_st(html)._option())._with_(each);
  3660. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,18)})}));
  3661. }, function($ctx3) {$ctx3.fillBlock({option:option},$ctx2,17)})}));
  3662. $ctx2.sendIdx["with:"]=11;
  3663. return $27;
  3664. };
  3665. }, function($ctx2) {$ctx2.fillBlock({html:html,protocolSelect:protocolSelect,referencesSelect:referencesSelect},$ctx1,7)})}));
  3666. $32=_st(self["@selectedMethod"])._isNil();
  3667. $ctx1.sendIdx["isNil"]=3;
  3668. if(smalltalk.assert($32)){
  3669. self._hideMethodButtons();
  3670. $33=_st(_st(self["@selectedClass"])._isNil())._or_((function(){
  3671. return smalltalk.withContext(function($ctx2) {
  3672. return _st(self["@selectedProtocol"])._notNil();
  3673. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,20)})}));
  3674. if(smalltalk.assert($33)){
  3675. self._hideClassButtons();
  3676. $ctx1.sendIdx["hideClassButtons"]=1;
  3677. } else {
  3678. self._showClassButtons();
  3679. };
  3680. } else {
  3681. self._hideClassButtons();
  3682. self._showMethodButtons();
  3683. };
  3684. _st(self["@sourceArea"])._val_(self._source());
  3685. return self}, function($ctx1) {$ctx1.fill(self,"updateSourceAndButtons",{currentProtocol:currentProtocol},smalltalk.Browser)})},
  3686. args: [],
  3687. source: "updateSourceAndButtons\x0a\x09| currentProtocol |\x0a\x0a\x09self disableSaveButton.\x0a\x09classButtons contents: [ :html |\x0a\x09\x09html button\x0a\x09\x09\x09title: 'Create a new class';\x0a\x09\x09\x09onClick: [ self addNewClass ];\x0a\x09\x09\x09with: 'New class'.\x0a\x09\x09html button\x0a\x09\x09\x09with: 'Rename class';\x0a\x09\x09\x09onClick: [ self renameClass ].\x0a\x09\x09html button\x0a\x09\x09\x09with: 'Copy class';\x0a\x09\x09\x09onClick: [ self copyClass ].\x0a\x09\x09html button\x0a\x09\x09\x09with: 'Remove class';\x0a\x09\x09\x09onClick: [ self removeClass ].\x0a\x09\x09html button\x0a\x09\x09\x09with: 'References';\x0a\x09\x09\x09onClick: [ self searchClassReferences ]].\x0a\x09methodButtons contents: [ :html | | protocolSelect referencesSelect |\x0a\x09\x09html button\x0a\x09\x09\x09with: 'Remove method';\x0a\x09\x09\x09onClick: [ self removeMethod ].\x0a\x09\x09protocolSelect := html select.\x0a\x09\x09\x09\x09protocolSelect\x0a\x09\x09\x09onChange: [ self setMethodProtocol: protocolSelect asJQuery val ];\x0a\x09\x09\x09with: [\x0a\x09\x09\x09\x09html option\x0a\x09\x09\x09\x09\x09with: 'Method protocol';\x0a\x09\x09\x09\x09\x09at: 'disabled' put: 'disabled'.\x0a\x09\x09\x09\x09html option\x0a\x09\x09\x09\x09\x09class: 'important';\x0a\x09\x09\x09\x09\x09with: 'New...'.\x0a\x09\x09\x09\x09currentProtocol := selectedProtocol.\x0a\x09\x09\x09\x09(currentProtocol isNil and: [ selectedMethod notNil ])\x0a\x09\x09\x09\x09\x09ifTrue: [ currentProtocol := selectedMethod category ].\x0a\x09\x09\x09\x09self protocols do: [ :each | | option |\x0a\x09\x09\x09\x09\x09option := html option with: each.\x0a\x09\x09\x09\x09\x09currentProtocol = each ifTrue: [ option at: 'selected' put: 'selected' ] ] ].\x0a\x09\x09selectedMethod isNil ifFalse: [\x0a\x09\x09\x09referencesSelect := html select.\x0a\x09\x09\x09\x09\x09\x09referencesSelect\x0a\x09\x09\x09\x09onChange: [ self searchReferencesOf: referencesSelect asJQuery val ];\x0a\x09\x09\x09\x09with: [ |option|\x0a\x09\x09\x09\x09\x09html option\x0a\x09\x09\x09\x09\x09\x09with: 'References';\x0a\x09\x09\x09\x09\x09\x09at: 'disabled' put: 'disabled';\x0a\x09\x09\x09\x09\x09\x09at: 'selected' put: 'selected'.\x0a\x09\x09\x09\x09\x09html option\x0a\x09\x09\x09\x09\x09\x09class: 'important';\x0a\x09\x09\x09\x09\x09\x09with: selectedMethod selector.\x0a\x09\x09\x09\x09\x09selectedMethod messageSends sorted do: [ :each |\x0a\x09\x09\x09\x09\x09\x09html option with: each ]] ]].\x0a\x09selectedMethod isNil\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self hideMethodButtons.\x0a\x09\x09\x09\x09(selectedClass isNil or: [ selectedProtocol notNil ])\x0a\x09\x09\x09\x09\x09ifTrue: [ self hideClassButtons ]\x0a\x09\x09\x09\x09\x09ifFalse: [ self showClassButtons ]]\x0a\x09\x09ifFalse: [\x0a\x09\x09\x09self hideClassButtons.\x0a\x09\x09\x09self showMethodButtons ].\x0a\x09sourceArea val: self source",
  3688. messageSends: ["disableSaveButton", "contents:", "title:", "button", "onClick:", "addNewClass", "with:", "renameClass", "copyClass", "removeClass", "searchClassReferences", "removeMethod", "select", "onChange:", "setMethodProtocol:", "val", "asJQuery", "option", "at:put:", "class:", "ifTrue:", "and:", "isNil", "notNil", "category", "do:", "protocols", "=", "ifFalse:", "searchReferencesOf:", "selector", "sorted", "messageSends", "ifTrue:ifFalse:", "hideMethodButtons", "or:", "hideClassButtons", "showClassButtons", "showMethodButtons", "val:", "source"],
  3689. referencedClasses: []
  3690. }),
  3691. smalltalk.Browser);
  3692. smalltalk.addMethod(
  3693. smalltalk.method({
  3694. selector: "updateStatus",
  3695. protocol: 'updating',
  3696. fn: function (){
  3697. var self=this;
  3698. return smalltalk.withContext(function($ctx1) {
  3699. var $1,$2,$3;
  3700. $1=_st(_st(self["@sourceArea"])._val()).__eq(self._source());
  3701. if(smalltalk.assert($1)){
  3702. $2=self["@saveButton"];
  3703. if(($receiver = $2) == nil || $receiver == null){
  3704. $2;
  3705. } else {
  3706. _st(self["@saveButton"])._at_put_("disabled",true);
  3707. };
  3708. self["@unsavedChanges"]=false;
  3709. self["@unsavedChanges"];
  3710. } else {
  3711. $3=self["@saveButton"];
  3712. if(($receiver = $3) == nil || $receiver == null){
  3713. $3;
  3714. } else {
  3715. _st(self["@saveButton"])._removeAt_("disabled");
  3716. };
  3717. self["@unsavedChanges"]=true;
  3718. self["@unsavedChanges"];
  3719. };
  3720. return self}, function($ctx1) {$ctx1.fill(self,"updateStatus",{},smalltalk.Browser)})},
  3721. args: [],
  3722. 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 ]",
  3723. messageSends: ["ifTrue:ifFalse:", "=", "val", "source", "ifNotNil:", "at:put:", "removeAt:"],
  3724. referencedClasses: []
  3725. }),
  3726. smalltalk.Browser);
  3727. smalltalk.addMethod(
  3728. smalltalk.method({
  3729. selector: "updateTabsList",
  3730. protocol: 'updating',
  3731. fn: function (){
  3732. var self=this;
  3733. return smalltalk.withContext(function($ctx1) {
  3734. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20;
  3735. _st(self["@tabsList"])._contents_((function(html){
  3736. var li;
  3737. return smalltalk.withContext(function($ctx2) {
  3738. li=_st(html)._li();
  3739. $ctx2.sendIdx["li"]=1;
  3740. li;
  3741. $1=_st(self["@selectedTab"]).__eq("instance");
  3742. $ctx2.sendIdx["="]=1;
  3743. if(smalltalk.assert($1)){
  3744. _st(li)._class_("selected");
  3745. $ctx2.sendIdx["class:"]=1;
  3746. };
  3747. $2=li;
  3748. _st($2)._with_((function(){
  3749. return smalltalk.withContext(function($ctx3) {
  3750. $3=_st(html)._span();
  3751. $ctx3.sendIdx["span"]=1;
  3752. _st($3)._class_("ltab");
  3753. $ctx3.sendIdx["class:"]=2;
  3754. $4=_st(html)._span();
  3755. $ctx3.sendIdx["span"]=2;
  3756. _st($4)._class_("mtab");
  3757. $ctx3.sendIdx["class:"]=3;
  3758. $5=_st($4)._with_("Instance");
  3759. $ctx3.sendIdx["with:"]=2;
  3760. $5;
  3761. $6=_st(html)._span();
  3762. $ctx3.sendIdx["span"]=3;
  3763. return _st($6)._class_("rtab");
  3764. $ctx3.sendIdx["class:"]=4;
  3765. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  3766. $ctx2.sendIdx["with:"]=1;
  3767. $7=_st($2)._onClick_((function(){
  3768. return smalltalk.withContext(function($ctx3) {
  3769. return self._selectTab_("instance");
  3770. $ctx3.sendIdx["selectTab:"]=1;
  3771. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  3772. $ctx2.sendIdx["onClick:"]=1;
  3773. $7;
  3774. li=_st(html)._li();
  3775. $ctx2.sendIdx["li"]=2;
  3776. li;
  3777. $8=_st(self["@selectedTab"]).__eq("class");
  3778. $ctx2.sendIdx["="]=2;
  3779. if(smalltalk.assert($8)){
  3780. _st(li)._class_("selected");
  3781. $ctx2.sendIdx["class:"]=5;
  3782. };
  3783. $9=li;
  3784. _st($9)._with_((function(){
  3785. return smalltalk.withContext(function($ctx3) {
  3786. $10=_st(html)._span();
  3787. $ctx3.sendIdx["span"]=4;
  3788. _st($10)._class_("ltab");
  3789. $ctx3.sendIdx["class:"]=6;
  3790. $11=_st(html)._span();
  3791. $ctx3.sendIdx["span"]=5;
  3792. _st($11)._class_("mtab");
  3793. $ctx3.sendIdx["class:"]=7;
  3794. $12=_st($11)._with_("Class");
  3795. $ctx3.sendIdx["with:"]=4;
  3796. $12;
  3797. $13=_st(html)._span();
  3798. $ctx3.sendIdx["span"]=6;
  3799. return _st($13)._class_("rtab");
  3800. $ctx3.sendIdx["class:"]=8;
  3801. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,6)})}));
  3802. $ctx2.sendIdx["with:"]=3;
  3803. $14=_st($9)._onClick_((function(){
  3804. return smalltalk.withContext(function($ctx3) {
  3805. return self._selectTab_("class");
  3806. $ctx3.sendIdx["selectTab:"]=2;
  3807. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,7)})}));
  3808. $ctx2.sendIdx["onClick:"]=2;
  3809. $14;
  3810. li=_st(html)._li();
  3811. li;
  3812. $15=_st(self["@selectedTab"]).__eq("comment");
  3813. if(smalltalk.assert($15)){
  3814. _st(li)._class_("selected");
  3815. $ctx2.sendIdx["class:"]=9;
  3816. };
  3817. $16=li;
  3818. _st($16)._with_((function(){
  3819. return smalltalk.withContext(function($ctx3) {
  3820. $17=_st(html)._span();
  3821. $ctx3.sendIdx["span"]=7;
  3822. _st($17)._class_("ltab");
  3823. $ctx3.sendIdx["class:"]=10;
  3824. $18=_st(html)._span();
  3825. $ctx3.sendIdx["span"]=8;
  3826. _st($18)._class_("mtab");
  3827. $ctx3.sendIdx["class:"]=11;
  3828. $19=_st($18)._with_("Comment");
  3829. $19;
  3830. return _st(_st(html)._span())._class_("rtab");
  3831. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,9)})}));
  3832. $ctx2.sendIdx["with:"]=5;
  3833. $20=_st($16)._onClick_((function(){
  3834. return smalltalk.withContext(function($ctx3) {
  3835. return self._selectTab_("comment");
  3836. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,10)})}));
  3837. return $20;
  3838. }, function($ctx2) {$ctx2.fillBlock({html:html,li:li},$ctx1,1)})}));
  3839. return self}, function($ctx1) {$ctx1.fill(self,"updateTabsList",{},smalltalk.Browser)})},
  3840. args: [],
  3841. source: "updateTabsList\x0a\x09tabsList contents: [ :html || li |\x0a\x09li := html li.\x0a\x09selectedTab = #instance ifTrue: [ li class: 'selected' ].\x0a\x09li\x0a\x09\x09with: [\x0a\x09\x09html span class: 'ltab'.\x0a\x09\x09html span class: 'mtab'; with: 'Instance'.\x0a\x09\x09html span class: 'rtab' ];\x0a\x09\x09onClick: [ self selectTab: #instance ].\x0a\x09li := html li.\x0a\x09selectedTab = #class ifTrue: [ li class: 'selected' ].\x0a\x09li\x0a\x09\x09with: [\x0a\x09\x09html span class: 'ltab'.\x0a\x09\x09html span class: 'mtab'; with: 'Class'.\x0a\x09\x09html span class: 'rtab' ];\x0a\x09\x09onClick: [ self selectTab: #class ].\x0a\x09li := html li.\x0a\x09selectedTab = #comment ifTrue: [ li class: 'selected' ].\x0a\x09li\x0a\x09\x09with: [\x0a\x09\x09html span class: 'ltab'.\x0a\x09\x09html span class: 'mtab'; with: 'Comment'.\x0a\x09\x09html span class: 'rtab' ];\x0a\x09\x09onClick: [ self selectTab: #comment ]]",
  3842. messageSends: ["contents:", "li", "ifTrue:", "=", "class:", "with:", "span", "onClick:", "selectTab:"],
  3843. referencedClasses: []
  3844. }),
  3845. smalltalk.Browser);
  3846. smalltalk.addMethod(
  3847. smalltalk.method({
  3848. selector: "open",
  3849. protocol: 'convenience',
  3850. fn: function (){
  3851. var self=this;
  3852. return smalltalk.withContext(function($ctx1) {
  3853. _st(self._new())._open();
  3854. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.Browser.klass)})},
  3855. args: [],
  3856. source: "open\x0a\x09self new open",
  3857. messageSends: ["open", "new"],
  3858. referencedClasses: []
  3859. }),
  3860. smalltalk.Browser.klass);
  3861. smalltalk.addMethod(
  3862. smalltalk.method({
  3863. selector: "openOn:",
  3864. protocol: 'convenience',
  3865. fn: function (aClass){
  3866. var self=this;
  3867. return smalltalk.withContext(function($ctx1) {
  3868. var $2,$3,$1;
  3869. $2=self._new();
  3870. _st($2)._open();
  3871. _st($2)._selectCategory_(_st(aClass)._category());
  3872. $3=_st($2)._selectClass_(aClass);
  3873. $1=$3;
  3874. return $1;
  3875. }, function($ctx1) {$ctx1.fill(self,"openOn:",{aClass:aClass},smalltalk.Browser.klass)})},
  3876. args: ["aClass"],
  3877. source: "openOn: aClass\x0a\x09^ self new\x0a\x09open;\x0a\x09selectCategory: aClass category;\x0a\x09selectClass: aClass",
  3878. messageSends: ["open", "new", "selectCategory:", "category", "selectClass:"],
  3879. referencedClasses: []
  3880. }),
  3881. smalltalk.Browser.klass);
  3882. smalltalk.addClass('Debugger', smalltalk.TabWidget, ['error', 'selectedContext', 'sourceArea', 'ul', 'ul2', 'inspector', 'saveButton', 'unsavedChanges', 'selectedVariable', 'selectedVariableName', 'inspectButton'], 'IDE');
  3883. smalltalk.addMethod(
  3884. smalltalk.method({
  3885. selector: "allVariables",
  3886. protocol: 'accessing',
  3887. fn: function (){
  3888. var self=this;
  3889. var all;
  3890. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  3891. return smalltalk.withContext(function($ctx1) {
  3892. var $3,$2,$1,$4;
  3893. all=_st($Dictionary())._new();
  3894. $3=self._receiver();
  3895. $ctx1.sendIdx["receiver"]=1;
  3896. $2=_st($3)._class();
  3897. $1=_st($2)._allInstanceVariableNames();
  3898. _st($1)._do_((function(each){
  3899. return smalltalk.withContext(function($ctx2) {
  3900. return _st(all)._at_put_(each,_st(self._receiver())._instVarAt_(each));
  3901. $ctx2.sendIdx["at:put:"]=1;
  3902. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  3903. _st(_st(self["@selectedContext"])._locals())._keysAndValuesDo_((function(key,value){
  3904. return smalltalk.withContext(function($ctx2) {
  3905. return _st(all)._at_put_(key,value);
  3906. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,2)})}));
  3907. $4=all;
  3908. return $4;
  3909. }, function($ctx1) {$ctx1.fill(self,"allVariables",{all:all},smalltalk.Debugger)})},
  3910. args: [],
  3911. source: "allVariables\x0a\x09| all |\x0a\x09all := Dictionary new.\x0a\x0a\x09self receiver class allInstanceVariableNames do: [ :each |\x0a\x09\x09all at: each put: (self receiver instVarAt: each) ].\x0a\x09\x0a\x09selectedContext locals keysAndValuesDo: [ :key :value |\x0a\x09\x09all at: key put: value ].\x0a\x09\x0a\x09^ all",
  3912. messageSends: ["new", "do:", "allInstanceVariableNames", "class", "receiver", "at:put:", "instVarAt:", "keysAndValuesDo:", "locals"],
  3913. referencedClasses: ["Dictionary"]
  3914. }),
  3915. smalltalk.Debugger);
  3916. smalltalk.addMethod(
  3917. smalltalk.method({
  3918. selector: "canBeClosed",
  3919. protocol: 'testing',
  3920. fn: function (){
  3921. var self=this;
  3922. return smalltalk.withContext(function($ctx1) {
  3923. return true;
  3924. }, function($ctx1) {$ctx1.fill(self,"canBeClosed",{},smalltalk.Debugger)})},
  3925. args: [],
  3926. source: "canBeClosed\x0a\x09^ true",
  3927. messageSends: [],
  3928. referencedClasses: []
  3929. }),
  3930. smalltalk.Debugger);
  3931. smalltalk.addMethod(
  3932. smalltalk.method({
  3933. selector: "error",
  3934. protocol: 'accessing',
  3935. fn: function (){
  3936. var self=this;
  3937. return smalltalk.withContext(function($ctx1) {
  3938. var $1;
  3939. $1=self["@error"];
  3940. return $1;
  3941. }, function($ctx1) {$ctx1.fill(self,"error",{},smalltalk.Debugger)})},
  3942. args: [],
  3943. source: "error\x0a\x09^ error",
  3944. messageSends: [],
  3945. referencedClasses: []
  3946. }),
  3947. smalltalk.Debugger);
  3948. smalltalk.addMethod(
  3949. smalltalk.method({
  3950. selector: "error:",
  3951. protocol: 'accessing',
  3952. fn: function (anError){
  3953. var self=this;
  3954. return smalltalk.withContext(function($ctx1) {
  3955. self["@error"]=anError;
  3956. return self}, function($ctx1) {$ctx1.fill(self,"error:",{anError:anError},smalltalk.Debugger)})},
  3957. args: ["anError"],
  3958. source: "error: anError\x0a\x09error := anError",
  3959. messageSends: [],
  3960. referencedClasses: []
  3961. }),
  3962. smalltalk.Debugger);
  3963. smalltalk.addMethod(
  3964. smalltalk.method({
  3965. selector: "initialize",
  3966. protocol: 'initialization',
  3967. fn: function (){
  3968. var self=this;
  3969. return smalltalk.withContext(function($ctx1) {
  3970. smalltalk.Debugger.superclass.fn.prototype._initialize.apply(_st(self), []);
  3971. _st(self["@unsavedChanges"]).__eq(false);
  3972. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.Debugger)})},
  3973. args: [],
  3974. source: "initialize\x0a\x09super initialize.\x0a\x09unsavedChanges = false",
  3975. messageSends: ["initialize", "="],
  3976. referencedClasses: []
  3977. }),
  3978. smalltalk.Debugger);
  3979. smalltalk.addMethod(
  3980. smalltalk.method({
  3981. selector: "inspectSelectedVariable",
  3982. protocol: 'actions',
  3983. fn: function (){
  3984. var self=this;
  3985. return smalltalk.withContext(function($ctx1) {
  3986. _st(self["@selectedVariable"])._inspect();
  3987. return self}, function($ctx1) {$ctx1.fill(self,"inspectSelectedVariable",{},smalltalk.Debugger)})},
  3988. args: [],
  3989. source: "inspectSelectedVariable\x0a\x09selectedVariable inspect",
  3990. messageSends: ["inspect"],
  3991. referencedClasses: []
  3992. }),
  3993. smalltalk.Debugger);
  3994. smalltalk.addMethod(
  3995. smalltalk.method({
  3996. selector: "label",
  3997. protocol: 'accessing',
  3998. fn: function (){
  3999. var self=this;
  4000. return smalltalk.withContext(function($ctx1) {
  4001. return "[ Debugger ]";
  4002. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.Debugger)})},
  4003. args: [],
  4004. source: "label\x0a\x09^ '[ Debugger ]'",
  4005. messageSends: [],
  4006. referencedClasses: []
  4007. }),
  4008. smalltalk.Debugger);
  4009. smalltalk.addMethod(
  4010. smalltalk.method({
  4011. selector: "method",
  4012. protocol: 'accessing',
  4013. fn: function (){
  4014. var self=this;
  4015. return smalltalk.withContext(function($ctx1) {
  4016. var $1;
  4017. $1=_st(self["@selectedContext"])._method();
  4018. return $1;
  4019. }, function($ctx1) {$ctx1.fill(self,"method",{},smalltalk.Debugger)})},
  4020. args: [],
  4021. source: "method\x0a\x09^ selectedContext method",
  4022. messageSends: ["method"],
  4023. referencedClasses: []
  4024. }),
  4025. smalltalk.Debugger);
  4026. smalltalk.addMethod(
  4027. smalltalk.method({
  4028. selector: "proceed",
  4029. protocol: 'actions',
  4030. fn: function (){
  4031. var self=this;
  4032. return smalltalk.withContext(function($ctx1) {
  4033. self._close();
  4034. _st(_st(self["@selectedContext"])._receiver())._perform_withArguments_(_st(self["@selectedContext"])._selector(),_st(self["@selectedContext"])._temps());
  4035. return self}, function($ctx1) {$ctx1.fill(self,"proceed",{},smalltalk.Debugger)})},
  4036. args: [],
  4037. source: "proceed\x0a\x09self close.\x0a\x09selectedContext receiver perform: selectedContext selector withArguments: selectedContext temps",
  4038. messageSends: ["close", "perform:withArguments:", "receiver", "selector", "temps"],
  4039. referencedClasses: []
  4040. }),
  4041. smalltalk.Debugger);
  4042. smalltalk.addMethod(
  4043. smalltalk.method({
  4044. selector: "receiver",
  4045. protocol: 'accessing',
  4046. fn: function (){
  4047. var self=this;
  4048. return smalltalk.withContext(function($ctx1) {
  4049. var $1;
  4050. $1=_st(self["@selectedContext"])._receiver();
  4051. return $1;
  4052. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.Debugger)})},
  4053. args: [],
  4054. source: "receiver\x0a\x09^ selectedContext receiver",
  4055. messageSends: ["receiver"],
  4056. referencedClasses: []
  4057. }),
  4058. smalltalk.Debugger);
  4059. smalltalk.addMethod(
  4060. smalltalk.method({
  4061. selector: "renderBottomPanelOn:",
  4062. protocol: 'rendering',
  4063. fn: function (html){
  4064. var self=this;
  4065. function $SourceArea(){return smalltalk.SourceArea||(typeof SourceArea=="undefined"?nil:SourceArea)}
  4066. return smalltalk.withContext(function($ctx1) {
  4067. var $1,$2;
  4068. $1=_st(html)._div();
  4069. $ctx1.sendIdx["div"]=1;
  4070. _st($1)._class_("amber_sourceCode debugger");
  4071. $ctx1.sendIdx["class:"]=1;
  4072. $2=_st($1)._with_((function(){
  4073. return smalltalk.withContext(function($ctx2) {
  4074. self["@sourceArea"]=_st($SourceArea())._new();
  4075. self["@sourceArea"];
  4076. return _st(self["@sourceArea"])._renderOn_(html);
  4077. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4078. self["@ul2"]=_st(_st(html)._ul())._class_("amber_column debugger variables");
  4079. $ctx1.sendIdx["class:"]=2;
  4080. self["@inspector"]=_st(_st(html)._div())._class_("amber_column debugger inspector");
  4081. _st(self["@sourceArea"])._onKeyUp_((function(){
  4082. return smalltalk.withContext(function($ctx2) {
  4083. return self._updateStatus();
  4084. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  4085. return self}, function($ctx1) {$ctx1.fill(self,"renderBottomPanelOn:",{html:html},smalltalk.Debugger)})},
  4086. args: ["html"],
  4087. 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 ]",
  4088. messageSends: ["class:", "div", "with:", "new", "renderOn:", "ul", "onKeyUp:", "updateStatus"],
  4089. referencedClasses: ["SourceArea"]
  4090. }),
  4091. smalltalk.Debugger);
  4092. smalltalk.addMethod(
  4093. smalltalk.method({
  4094. selector: "renderBoxOn:",
  4095. protocol: 'rendering',
  4096. fn: function (html){
  4097. var self=this;
  4098. return smalltalk.withContext(function($ctx1) {
  4099. var $1;
  4100. self._renderTopPanelOn_(html);
  4101. $1=self._renderBottomPanelOn_(html);
  4102. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.Debugger)})},
  4103. args: ["html"],
  4104. source: "renderBoxOn: html\x0a\x09self\x0a\x09\x09renderTopPanelOn: html;\x0a\x09\x09renderBottomPanelOn: html",
  4105. messageSends: ["renderTopPanelOn:", "renderBottomPanelOn:"],
  4106. referencedClasses: []
  4107. }),
  4108. smalltalk.Debugger);
  4109. smalltalk.addMethod(
  4110. smalltalk.method({
  4111. selector: "renderButtonsOn:",
  4112. protocol: 'rendering',
  4113. fn: function (html){
  4114. var self=this;
  4115. return smalltalk.withContext(function($ctx1) {
  4116. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15;
  4117. $1=_st(html)._button();
  4118. $ctx1.sendIdx["button"]=1;
  4119. _st($1)._with_("Save");
  4120. $ctx1.sendIdx["with:"]=1;
  4121. $2=_st($1)._onClick_((function(){
  4122. return smalltalk.withContext(function($ctx2) {
  4123. return self._save();
  4124. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4125. $ctx1.sendIdx["onClick:"]=1;
  4126. self["@saveButton"]=$2;
  4127. $3=_st(html)._button();
  4128. $ctx1.sendIdx["button"]=2;
  4129. _st($3)._with_("DoIt");
  4130. $ctx1.sendIdx["with:"]=2;
  4131. $4=_st($3)._onClick_((function(){
  4132. return smalltalk.withContext(function($ctx2) {
  4133. return _st(self["@sourceArea"])._doIt();
  4134. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  4135. $ctx1.sendIdx["onClick:"]=2;
  4136. $5=_st(html)._button();
  4137. $ctx1.sendIdx["button"]=3;
  4138. _st($5)._with_("PrintIt");
  4139. $ctx1.sendIdx["with:"]=3;
  4140. $6=_st($5)._onClick_((function(){
  4141. return smalltalk.withContext(function($ctx2) {
  4142. return _st(self["@sourceArea"])._printIt();
  4143. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  4144. $ctx1.sendIdx["onClick:"]=3;
  4145. $7=_st(html)._button();
  4146. $ctx1.sendIdx["button"]=4;
  4147. _st($7)._with_("InspectIt");
  4148. $ctx1.sendIdx["with:"]=4;
  4149. $8=_st($7)._onClick_((function(){
  4150. return smalltalk.withContext(function($ctx2) {
  4151. return _st(self["@sourceArea"])._inspectIt();
  4152. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
  4153. $ctx1.sendIdx["onClick:"]=4;
  4154. $9=_st(html)._button();
  4155. $ctx1.sendIdx["button"]=5;
  4156. _st($9)._with_("Proceed");
  4157. $ctx1.sendIdx["with:"]=5;
  4158. $10=_st($9)._onClick_((function(){
  4159. return smalltalk.withContext(function($ctx2) {
  4160. return self._proceed();
  4161. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}));
  4162. $ctx1.sendIdx["onClick:"]=5;
  4163. $11=_st(html)._button();
  4164. $ctx1.sendIdx["button"]=6;
  4165. _st($11)._with_("Abandon");
  4166. $ctx1.sendIdx["with:"]=6;
  4167. $12=_st($11)._onClick_((function(){
  4168. return smalltalk.withContext(function($ctx2) {
  4169. return self._close();
  4170. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
  4171. $ctx1.sendIdx["onClick:"]=6;
  4172. $13=_st(html)._button();
  4173. _st($13)._class_("amber_button debugger inspect");
  4174. _st($13)._with_("Inspect");
  4175. $14=_st($13)._onClick_((function(){
  4176. return smalltalk.withContext(function($ctx2) {
  4177. return self._inspectSelectedVariable();
  4178. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,7)})}));
  4179. self["@inspectButton"]=$14;
  4180. self._updateSourceArea();
  4181. self._updateStatus();
  4182. self._updateVariablesList();
  4183. $15=self._updateInspector();
  4184. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.Debugger)})},
  4185. args: ["html"],
  4186. source: "renderButtonsOn: html\x0a\x09saveButton := html button\x0a\x09\x09with: 'Save';\x0a\x09\x09onClick: [ self save ].\x0a\x09html button\x0a\x09\x09with: 'DoIt';\x0a\x09\x09onClick: [ sourceArea doIt ].\x0a\x09html button\x0a\x09\x09with: 'PrintIt';\x0a\x09\x09onClick: [ sourceArea printIt ].\x0a\x09html button\x0a\x09\x09with: 'InspectIt';\x0a\x09\x09onClick: [ sourceArea inspectIt ].\x0a\x09html button\x0a\x09\x09with: 'Proceed';\x0a\x09\x09onClick: [ self proceed ].\x0a\x09html button\x0a\x09\x09with: 'Abandon';\x0a\x09\x09onClick: [ self close ].\x0a\x09inspectButton := html button\x0a\x09\x09class: 'amber_button debugger inspect';\x0a\x09\x09with: 'Inspect';\x0a\x09\x09onClick: [ self inspectSelectedVariable ].\x0a\x09self\x0a\x09\x09updateSourceArea;\x0a\x09\x09updateStatus;\x0a\x09\x09updateVariablesList;\x0a\x09\x09updateInspector",
  4187. messageSends: ["with:", "button", "onClick:", "save", "doIt", "printIt", "inspectIt", "proceed", "close", "class:", "inspectSelectedVariable", "updateSourceArea", "updateStatus", "updateVariablesList", "updateInspector"],
  4188. referencedClasses: []
  4189. }),
  4190. smalltalk.Debugger);
  4191. smalltalk.addMethod(
  4192. smalltalk.method({
  4193. selector: "renderContext:on:",
  4194. protocol: 'rendering',
  4195. fn: function (aContext,html){
  4196. var self=this;
  4197. var li;
  4198. return smalltalk.withContext(function($ctx1) {
  4199. var $1,$2,$3,$4;
  4200. li=_st(html)._li();
  4201. $1=_st(self["@selectedContext"]).__eq(aContext);
  4202. if(smalltalk.assert($1)){
  4203. _st(li)._class_("selected");
  4204. };
  4205. $2=li;
  4206. _st($2)._with_(_st(aContext)._asString());
  4207. $3=_st($2)._onClick_((function(){
  4208. return smalltalk.withContext(function($ctx2) {
  4209. return self._selectContext_(aContext);
  4210. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  4211. $4=_st(aContext)._outerContext();
  4212. $ctx1.sendIdx["outerContext"]=1;
  4213. if(($receiver = $4) == nil || $receiver == null){
  4214. $4;
  4215. } else {
  4216. self._renderContext_on_(_st(aContext)._outerContext(),html);
  4217. };
  4218. return self}, function($ctx1) {$ctx1.fill(self,"renderContext:on:",{aContext:aContext,html:html,li:li},smalltalk.Debugger)})},
  4219. args: ["aContext", "html"],
  4220. source: "renderContext: aContext on: html\x0a\x09| li |\x0a\x09li := html li.\x0a\x09selectedContext = aContext ifTrue: [\x0a\x09\x09li class: 'selected' ].\x0a\x09li\x0a\x09\x09with: aContext asString;\x0a\x09\x09onClick: [ self selectContext: aContext ].\x0a\x09aContext outerContext ifNotNil: [ self renderContext: aContext outerContext on: html ]",
  4221. messageSends: ["li", "ifTrue:", "=", "class:", "with:", "asString", "onClick:", "selectContext:", "ifNotNil:", "outerContext", "renderContext:on:"],
  4222. referencedClasses: []
  4223. }),
  4224. smalltalk.Debugger);
  4225. smalltalk.addMethod(
  4226. smalltalk.method({
  4227. selector: "renderTopPanelOn:",
  4228. protocol: 'rendering',
  4229. fn: function (html){
  4230. var self=this;
  4231. return smalltalk.withContext(function($ctx1) {
  4232. var $1,$2,$4,$6,$8,$7,$5,$9,$10,$3;
  4233. $1=self._error();
  4234. $ctx1.sendIdx["error"]=1;
  4235. self["@selectedContext"]=_st($1)._context();
  4236. $ctx1.sendIdx["context"]=1;
  4237. $2=_st(html)._div();
  4238. $ctx1.sendIdx["div"]=1;
  4239. _st($2)._class_("top");
  4240. $ctx1.sendIdx["class:"]=1;
  4241. $3=_st($2)._with_((function(){
  4242. return smalltalk.withContext(function($ctx2) {
  4243. $4=_st(html)._div();
  4244. _st($4)._class_("label");
  4245. $ctx2.sendIdx["class:"]=2;
  4246. $6=$4;
  4247. $8=self._error();
  4248. $ctx2.sendIdx["error"]=2;
  4249. $7=_st($8)._messageText();
  4250. $5=_st($6)._with_($7);
  4251. $ctx2.sendIdx["with:"]=2;
  4252. $5;
  4253. $9=_st(html)._ul();
  4254. _st($9)._class_("amber_column debugger contexts");
  4255. $10=_st($9)._with_((function(){
  4256. return smalltalk.withContext(function($ctx3) {
  4257. return self._renderContext_on_(_st(self._error())._context(),html);
  4258. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  4259. self["@ul"]=$10;
  4260. return self["@ul"];
  4261. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4262. $ctx1.sendIdx["with:"]=1;
  4263. return self}, function($ctx1) {$ctx1.fill(self,"renderTopPanelOn:",{html:html},smalltalk.Debugger)})},
  4264. args: ["html"],
  4265. 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 ]]",
  4266. messageSends: ["context", "error", "class:", "div", "with:", "messageText", "ul", "renderContext:on:"],
  4267. referencedClasses: []
  4268. }),
  4269. smalltalk.Debugger);
  4270. smalltalk.addMethod(
  4271. smalltalk.method({
  4272. selector: "save",
  4273. protocol: 'actions',
  4274. fn: function (){
  4275. var self=this;
  4276. var protocol;
  4277. return smalltalk.withContext(function($ctx1) {
  4278. var $4,$3,$2,$1;
  4279. $4=_st(self["@selectedContext"])._receiver();
  4280. $ctx1.sendIdx["receiver"]=1;
  4281. $3=_st($4)._class();
  4282. $ctx1.sendIdx["class"]=1;
  4283. $2=_st($3)._methodDictionary();
  4284. $1=_st($2)._at_(_st(self["@selectedContext"])._selector());
  4285. protocol=_st($1)._category();
  4286. _st(_st(_st(self["@selectedContext"])._receiver())._class())._compile_category_(_st(self["@sourceArea"])._val(),protocol);
  4287. self._updateStatus();
  4288. return self}, function($ctx1) {$ctx1.fill(self,"save",{protocol:protocol},smalltalk.Debugger)})},
  4289. args: [],
  4290. 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",
  4291. messageSends: ["category", "at:", "methodDictionary", "class", "receiver", "selector", "compile:category:", "val", "updateStatus"],
  4292. referencedClasses: []
  4293. }),
  4294. smalltalk.Debugger);
  4295. smalltalk.addMethod(
  4296. smalltalk.method({
  4297. selector: "selectContext:",
  4298. protocol: 'actions',
  4299. fn: function (aContext){
  4300. var self=this;
  4301. return smalltalk.withContext(function($ctx1) {
  4302. var $1;
  4303. self["@selectedContext"]=aContext;
  4304. self["@selectedVariable"]=nil;
  4305. self["@selectedVariableName"]=nil;
  4306. self._updateContextsList();
  4307. self._updateSourceArea();
  4308. self._updateInspector();
  4309. self._updateVariablesList();
  4310. $1=self._updateStatus();
  4311. return self}, function($ctx1) {$ctx1.fill(self,"selectContext:",{aContext:aContext},smalltalk.Debugger)})},
  4312. args: ["aContext"],
  4313. 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",
  4314. messageSends: ["updateContextsList", "updateSourceArea", "updateInspector", "updateVariablesList", "updateStatus"],
  4315. referencedClasses: []
  4316. }),
  4317. smalltalk.Debugger);
  4318. smalltalk.addMethod(
  4319. smalltalk.method({
  4320. selector: "selectVariable:named:",
  4321. protocol: 'actions',
  4322. fn: function (anObject,aString){
  4323. var self=this;
  4324. return smalltalk.withContext(function($ctx1) {
  4325. self["@selectedVariable"]=anObject;
  4326. self["@selectedVariableName"]=aString;
  4327. _st(self["@inspector"])._contents_((function(html){
  4328. return smalltalk.withContext(function($ctx2) {
  4329. return _st(html)._with_(_st(anObject)._printString());
  4330. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  4331. self._updateVariablesList();
  4332. return self}, function($ctx1) {$ctx1.fill(self,"selectVariable:named:",{anObject:anObject,aString:aString},smalltalk.Debugger)})},
  4333. args: ["anObject", "aString"],
  4334. source: "selectVariable: anObject named: aString\x0a\x09\x0a\x09selectedVariable := anObject.\x0a\x09selectedVariableName := aString.\x0a\x09inspector contents: [ :html | html with: anObject printString ].\x0a\x09self updateVariablesList",
  4335. messageSends: ["contents:", "with:", "printString", "updateVariablesList"],
  4336. referencedClasses: []
  4337. }),
  4338. smalltalk.Debugger);
  4339. smalltalk.addMethod(
  4340. smalltalk.method({
  4341. selector: "source",
  4342. protocol: 'accessing',
  4343. fn: function (){
  4344. var self=this;
  4345. return smalltalk.withContext(function($ctx1) {
  4346. var $2,$1;
  4347. $2=self._method();
  4348. $ctx1.sendIdx["method"]=1;
  4349. if(($receiver = $2) == nil || $receiver == null){
  4350. $1="Method doesn't exist!";
  4351. } else {
  4352. $1=_st(self._method())._source();
  4353. };
  4354. return $1;
  4355. }, function($ctx1) {$ctx1.fill(self,"source",{},smalltalk.Debugger)})},
  4356. args: [],
  4357. source: "source\x0a\x09^ self method\x0a\x09\x09ifNil: [ 'Method doesn''t exist!' ]\x0a\x09\x09ifNotNil: [ self method source ]",
  4358. messageSends: ["ifNil:ifNotNil:", "method", "source"],
  4359. referencedClasses: []
  4360. }),
  4361. smalltalk.Debugger);
  4362. smalltalk.addMethod(
  4363. smalltalk.method({
  4364. selector: "updateContextsList",
  4365. protocol: 'updating',
  4366. fn: function (){
  4367. var self=this;
  4368. return smalltalk.withContext(function($ctx1) {
  4369. _st(self["@ul"])._contents_((function(html){
  4370. return smalltalk.withContext(function($ctx2) {
  4371. return self._renderContext_on_(_st(self._error())._context(),html);
  4372. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  4373. return self}, function($ctx1) {$ctx1.fill(self,"updateContextsList",{},smalltalk.Debugger)})},
  4374. args: [],
  4375. source: "updateContextsList\x0a\x09ul contents: [ :html |\x0a\x09\x09self renderContext: self error context on: html ]",
  4376. messageSends: ["contents:", "renderContext:on:", "context", "error"],
  4377. referencedClasses: []
  4378. }),
  4379. smalltalk.Debugger);
  4380. smalltalk.addMethod(
  4381. smalltalk.method({
  4382. selector: "updateInspector",
  4383. protocol: 'updating',
  4384. fn: function (){
  4385. var self=this;
  4386. return smalltalk.withContext(function($ctx1) {
  4387. _st(self["@inspector"])._contents_((function(html){
  4388. return smalltalk.withContext(function($ctx2) {
  4389. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  4390. return self}, function($ctx1) {$ctx1.fill(self,"updateInspector",{},smalltalk.Debugger)})},
  4391. args: [],
  4392. source: "updateInspector\x0a\x09inspector contents: [ :html | ]",
  4393. messageSends: ["contents:"],
  4394. referencedClasses: []
  4395. }),
  4396. smalltalk.Debugger);
  4397. smalltalk.addMethod(
  4398. smalltalk.method({
  4399. selector: "updateSourceArea",
  4400. protocol: 'updating',
  4401. fn: function (){
  4402. var self=this;
  4403. return smalltalk.withContext(function($ctx1) {
  4404. _st(self["@sourceArea"])._val_(self._source());
  4405. return self}, function($ctx1) {$ctx1.fill(self,"updateSourceArea",{},smalltalk.Debugger)})},
  4406. args: [],
  4407. source: "updateSourceArea\x0a\x09sourceArea val: self source",
  4408. messageSends: ["val:", "source"],
  4409. referencedClasses: []
  4410. }),
  4411. smalltalk.Debugger);
  4412. smalltalk.addMethod(
  4413. smalltalk.method({
  4414. selector: "updateStatus",
  4415. protocol: 'updating',
  4416. fn: function (){
  4417. var self=this;
  4418. return smalltalk.withContext(function($ctx1) {
  4419. var $1,$2,$3;
  4420. $1=_st(_st(self["@sourceArea"])._val()).__eq(self._source());
  4421. if(smalltalk.assert($1)){
  4422. $2=self["@saveButton"];
  4423. if(($receiver = $2) == nil || $receiver == null){
  4424. $2;
  4425. } else {
  4426. _st(self["@saveButton"])._at_put_("disabled",true);
  4427. };
  4428. self["@unsavedChanges"]=false;
  4429. self["@unsavedChanges"];
  4430. } else {
  4431. $3=self["@saveButton"];
  4432. if(($receiver = $3) == nil || $receiver == null){
  4433. $3;
  4434. } else {
  4435. _st(self["@saveButton"])._removeAt_("disabled");
  4436. };
  4437. self["@unsavedChanges"]=true;
  4438. self["@unsavedChanges"];
  4439. };
  4440. return self}, function($ctx1) {$ctx1.fill(self,"updateStatus",{},smalltalk.Debugger)})},
  4441. args: [],
  4442. 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 ]",
  4443. messageSends: ["ifTrue:ifFalse:", "=", "val", "source", "ifNotNil:", "at:put:", "removeAt:"],
  4444. referencedClasses: []
  4445. }),
  4446. smalltalk.Debugger);
  4447. smalltalk.addMethod(
  4448. smalltalk.method({
  4449. selector: "updateVariablesList",
  4450. protocol: 'updating',
  4451. fn: function (){
  4452. var self=this;
  4453. return smalltalk.withContext(function($ctx1) {
  4454. var $1,$2,$3,$4,$5,$6,$7;
  4455. _st(self["@ul2"])._contents_((function(html){
  4456. var li;
  4457. return smalltalk.withContext(function($ctx2) {
  4458. $1=_st(html)._li();
  4459. $ctx2.sendIdx["li"]=1;
  4460. _st($1)._with_("self");
  4461. $ctx2.sendIdx["with:"]=1;
  4462. $2=_st($1)._onClick_((function(){
  4463. return smalltalk.withContext(function($ctx3) {
  4464. return self._selectVariable_named_(self._receiver(),"self");
  4465. $ctx3.sendIdx["selectVariable:named:"]=1;
  4466. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  4467. $ctx2.sendIdx["onClick:"]=1;
  4468. li=$2;
  4469. li;
  4470. $3=_st(self["@selectedVariableName"]).__eq("self");
  4471. $ctx2.sendIdx["="]=1;
  4472. if(smalltalk.assert($3)){
  4473. _st(li)._class_("selected");
  4474. $ctx2.sendIdx["class:"]=1;
  4475. };
  4476. return _st(self._allVariables())._keysAndValuesDo_((function(key,value){
  4477. return smalltalk.withContext(function($ctx3) {
  4478. $4=_st(html)._li();
  4479. _st($4)._with_(key);
  4480. $5=_st($4)._onClick_((function(){
  4481. return smalltalk.withContext(function($ctx4) {
  4482. return self._selectVariable_named_(value,key);
  4483. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)})}));
  4484. li=$5;
  4485. li;
  4486. $6=_st(self["@selectedVariableName"]).__eq(key);
  4487. if(smalltalk.assert($6)){
  4488. return _st(li)._class_("selected");
  4489. };
  4490. }, function($ctx3) {$ctx3.fillBlock({key:key,value:value},$ctx2,4)})}));
  4491. }, function($ctx2) {$ctx2.fillBlock({html:html,li:li},$ctx1,1)})}));
  4492. $7=self["@selectedVariable"];
  4493. if(($receiver = $7) == nil || $receiver == null){
  4494. _st(self["@inspectButton"])._at_put_("disabled",true);
  4495. } else {
  4496. _st(self["@inspectButton"])._removeAt_("disabled");
  4497. };
  4498. return self}, function($ctx1) {$ctx1.fill(self,"updateVariablesList",{},smalltalk.Debugger)})},
  4499. args: [],
  4500. source: "updateVariablesList\x0a\x09ul2 contents: [ :html | | li |\x0a\x09\x09li := html li\x0a\x09\x09\x09with: 'self';\x0a\x09\x09\x09onClick: [ self selectVariable: self receiver named: 'self' ].\x0a\x09\x09\x09\x09selectedVariableName = 'self' ifTrue: [ li class: 'selected' ].\x0a\x09\x09\x0a\x09\x09self allVariables keysAndValuesDo: [ :key :value |\x0a\x09\x09\x09\x09\x09\x09li := html li\x0a\x09\x09\x09\x09\x09\x09\x09with: key;\x0a\x09\x09\x09\x09\x09\x09\x09onClick: [ self selectVariable: value named: key ].\x0a\x09\x09\x09\x09\x09\x09selectedVariableName = key ifTrue: [\x0a\x09\x09\x09\x09\x09\x09\x09li class: 'selected' ] ] ].\x0a\x09\x09\x09\x09\x09\x09\x09\x0a\x09selectedVariable\x0a\x09\x09ifNil: [ inspectButton at: 'disabled' put: true ]\x0a\x09\x09ifNotNil: [ inspectButton removeAt: 'disabled' ]",
  4501. messageSends: ["contents:", "with:", "li", "onClick:", "selectVariable:named:", "receiver", "ifTrue:", "=", "class:", "keysAndValuesDo:", "allVariables", "ifNil:ifNotNil:", "at:put:", "removeAt:"],
  4502. referencedClasses: []
  4503. }),
  4504. smalltalk.Debugger);
  4505. smalltalk.addClass('IDETranscript', smalltalk.TabWidget, ['textarea'], 'IDE');
  4506. smalltalk.addMethod(
  4507. smalltalk.method({
  4508. selector: "clear",
  4509. protocol: 'actions',
  4510. fn: function (){
  4511. var self=this;
  4512. return smalltalk.withContext(function($ctx1) {
  4513. _st(_st(self["@textarea"])._asJQuery())._val_("");
  4514. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.IDETranscript)})},
  4515. args: [],
  4516. source: "clear\x0a\x09textarea asJQuery val: ''",
  4517. messageSends: ["val:", "asJQuery"],
  4518. referencedClasses: []
  4519. }),
  4520. smalltalk.IDETranscript);
  4521. smalltalk.addMethod(
  4522. smalltalk.method({
  4523. selector: "cr",
  4524. protocol: 'actions',
  4525. fn: function (){
  4526. var self=this;
  4527. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  4528. return smalltalk.withContext(function($ctx1) {
  4529. var $1;
  4530. $1=_st(self["@textarea"])._asJQuery();
  4531. $ctx1.sendIdx["asJQuery"]=1;
  4532. _st($1)._val_(_st(_st(_st(self["@textarea"])._asJQuery())._val()).__comma(_st($String())._cr()));
  4533. return self}, function($ctx1) {$ctx1.fill(self,"cr",{},smalltalk.IDETranscript)})},
  4534. args: [],
  4535. source: "cr\x0a\x09textarea asJQuery val: textarea asJQuery val, String cr.",
  4536. messageSends: ["val:", "asJQuery", ",", "val", "cr"],
  4537. referencedClasses: ["String"]
  4538. }),
  4539. smalltalk.IDETranscript);
  4540. smalltalk.addMethod(
  4541. smalltalk.method({
  4542. selector: "label",
  4543. protocol: 'accessing',
  4544. fn: function (){
  4545. var self=this;
  4546. return smalltalk.withContext(function($ctx1) {
  4547. return "Transcript";
  4548. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.IDETranscript)})},
  4549. args: [],
  4550. source: "label\x0a\x09^ 'Transcript'",
  4551. messageSends: [],
  4552. referencedClasses: []
  4553. }),
  4554. smalltalk.IDETranscript);
  4555. smalltalk.addMethod(
  4556. smalltalk.method({
  4557. selector: "open",
  4558. protocol: 'actions',
  4559. fn: function (){
  4560. var self=this;
  4561. function $TabManager(){return smalltalk.TabManager||(typeof TabManager=="undefined"?nil:TabManager)}
  4562. return smalltalk.withContext(function($ctx1) {
  4563. var $1,$2;
  4564. $1=_st($TabManager())._current();
  4565. _st($1)._open();
  4566. $2=_st($1)._selectTab_(self);
  4567. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.IDETranscript)})},
  4568. args: [],
  4569. source: "open\x0a\x09TabManager current\x0a\x09open;\x0a\x09selectTab: self",
  4570. messageSends: ["open", "current", "selectTab:"],
  4571. referencedClasses: ["TabManager"]
  4572. }),
  4573. smalltalk.IDETranscript);
  4574. smalltalk.addMethod(
  4575. smalltalk.method({
  4576. selector: "renderBoxOn:",
  4577. protocol: 'rendering',
  4578. fn: function (html){
  4579. var self=this;
  4580. return smalltalk.withContext(function($ctx1) {
  4581. var $1,$2;
  4582. self["@textarea"]=_st(html)._textarea();
  4583. $1=self["@textarea"];
  4584. _st($1)._class_("amber_transcript");
  4585. $2=_st($1)._at_put_("spellcheck","false");
  4586. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.IDETranscript)})},
  4587. args: ["html"],
  4588. source: "renderBoxOn: html\x0a\x09textarea := html textarea.\x0a\x09textarea\x0a\x09class: 'amber_transcript';\x0a\x09at: 'spellcheck' put: 'false'",
  4589. messageSends: ["textarea", "class:", "at:put:"],
  4590. referencedClasses: []
  4591. }),
  4592. smalltalk.IDETranscript);
  4593. smalltalk.addMethod(
  4594. smalltalk.method({
  4595. selector: "renderButtonsOn:",
  4596. protocol: 'rendering',
  4597. fn: function (html){
  4598. var self=this;
  4599. return smalltalk.withContext(function($ctx1) {
  4600. var $1,$2;
  4601. $1=_st(html)._button();
  4602. _st($1)._with_("Clear transcript");
  4603. $2=_st($1)._onClick_((function(){
  4604. return smalltalk.withContext(function($ctx2) {
  4605. return self._clear();
  4606. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4607. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.IDETranscript)})},
  4608. args: ["html"],
  4609. source: "renderButtonsOn: html\x0a\x09html button\x0a\x09with: 'Clear transcript';\x0a\x09onClick: [ self clear ]",
  4610. messageSends: ["with:", "button", "onClick:", "clear"],
  4611. referencedClasses: []
  4612. }),
  4613. smalltalk.IDETranscript);
  4614. smalltalk.addMethod(
  4615. smalltalk.method({
  4616. selector: "show:",
  4617. protocol: 'actions',
  4618. fn: function (anObject){
  4619. var self=this;
  4620. return smalltalk.withContext(function($ctx1) {
  4621. var $1,$2;
  4622. $1=self["@textarea"];
  4623. if(($receiver = $1) == nil || $receiver == null){
  4624. self._open();
  4625. } else {
  4626. $1;
  4627. };
  4628. $2=_st(self["@textarea"])._asJQuery();
  4629. $ctx1.sendIdx["asJQuery"]=1;
  4630. _st($2)._val_(_st(_st(_st(self["@textarea"])._asJQuery())._val()).__comma(_st(anObject)._asString()));
  4631. return self}, function($ctx1) {$ctx1.fill(self,"show:",{anObject:anObject},smalltalk.IDETranscript)})},
  4632. args: ["anObject"],
  4633. source: "show: anObject\x0a\x09textarea ifNil: [ self open ].\x0a\x09textarea asJQuery val: textarea asJQuery val, anObject asString.",
  4634. messageSends: ["ifNil:", "open", "val:", "asJQuery", ",", "val", "asString"],
  4635. referencedClasses: []
  4636. }),
  4637. smalltalk.IDETranscript);
  4638. smalltalk.IDETranscript.klass.iVarNames = ['current'];
  4639. smalltalk.addMethod(
  4640. smalltalk.method({
  4641. selector: "current",
  4642. protocol: 'instance creation',
  4643. fn: function (){
  4644. var self=this;
  4645. return smalltalk.withContext(function($ctx1) {
  4646. var $2,$1;
  4647. $2=self["@current"];
  4648. if(($receiver = $2) == nil || $receiver == null){
  4649. self["@current"]=smalltalk.IDETranscript.klass.superclass.fn.prototype._new.apply(_st(self), []);
  4650. $1=self["@current"];
  4651. } else {
  4652. $1=$2;
  4653. };
  4654. return $1;
  4655. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.IDETranscript.klass)})},
  4656. args: [],
  4657. source: "current\x0a\x09^ current ifNil: [ current := super new ]",
  4658. messageSends: ["ifNil:", "new"],
  4659. referencedClasses: []
  4660. }),
  4661. smalltalk.IDETranscript.klass);
  4662. smalltalk.addMethod(
  4663. smalltalk.method({
  4664. selector: "initialize",
  4665. protocol: 'initialization',
  4666. fn: function (){
  4667. var self=this;
  4668. function $Transcript(){return smalltalk.Transcript||(typeof Transcript=="undefined"?nil:Transcript)}
  4669. return smalltalk.withContext(function($ctx1) {
  4670. _st($Transcript())._register_(self._current());
  4671. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.IDETranscript.klass)})},
  4672. args: [],
  4673. source: "initialize\x0a\x09Transcript register: self current",
  4674. messageSends: ["register:", "current"],
  4675. referencedClasses: ["Transcript"]
  4676. }),
  4677. smalltalk.IDETranscript.klass);
  4678. smalltalk.addMethod(
  4679. smalltalk.method({
  4680. selector: "new",
  4681. protocol: 'instance creation',
  4682. fn: function (){
  4683. var self=this;
  4684. return smalltalk.withContext(function($ctx1) {
  4685. self._shouldNotImplement();
  4686. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.IDETranscript.klass)})},
  4687. args: [],
  4688. source: "new\x0a\x09self shouldNotImplement",
  4689. messageSends: ["shouldNotImplement"],
  4690. referencedClasses: []
  4691. }),
  4692. smalltalk.IDETranscript.klass);
  4693. smalltalk.addMethod(
  4694. smalltalk.method({
  4695. selector: "open",
  4696. protocol: 'instance creation',
  4697. fn: function (){
  4698. var self=this;
  4699. function $TabManager(){return smalltalk.TabManager||(typeof TabManager=="undefined"?nil:TabManager)}
  4700. return smalltalk.withContext(function($ctx1) {
  4701. var $1,$2;
  4702. $1=_st($TabManager())._current();
  4703. $ctx1.sendIdx["current"]=1;
  4704. _st($1)._open();
  4705. $2=_st($1)._selectTab_(self._current());
  4706. return self}, function($ctx1) {$ctx1.fill(self,"open",{},smalltalk.IDETranscript.klass)})},
  4707. args: [],
  4708. source: "open\x0a\x09TabManager current\x0a\x09open;\x0a\x09selectTab: self current",
  4709. messageSends: ["open", "current", "selectTab:"],
  4710. referencedClasses: ["TabManager"]
  4711. }),
  4712. smalltalk.IDETranscript.klass);
  4713. smalltalk.addClass('Inspector', smalltalk.TabWidget, ['label', 'variables', 'object', 'selectedVariable', 'variablesList', 'valueTextarea', 'diveButton', 'sourceArea'], 'IDE');
  4714. smalltalk.addMethod(
  4715. smalltalk.method({
  4716. selector: "canBeClosed",
  4717. protocol: 'testing',
  4718. fn: function (){
  4719. var self=this;
  4720. return smalltalk.withContext(function($ctx1) {
  4721. return true;
  4722. }, function($ctx1) {$ctx1.fill(self,"canBeClosed",{},smalltalk.Inspector)})},
  4723. args: [],
  4724. source: "canBeClosed\x0a\x09^ true",
  4725. messageSends: [],
  4726. referencedClasses: []
  4727. }),
  4728. smalltalk.Inspector);
  4729. smalltalk.addMethod(
  4730. smalltalk.method({
  4731. selector: "dive",
  4732. protocol: 'actions',
  4733. fn: function (){
  4734. var self=this;
  4735. return smalltalk.withContext(function($ctx1) {
  4736. _st(_st(self._variables())._at_(self._selectedVariable()))._inspect();
  4737. return self}, function($ctx1) {$ctx1.fill(self,"dive",{},smalltalk.Inspector)})},
  4738. args: [],
  4739. source: "dive\x0a\x09(self variables at: self selectedVariable) inspect",
  4740. messageSends: ["inspect", "at:", "variables", "selectedVariable"],
  4741. referencedClasses: []
  4742. }),
  4743. smalltalk.Inspector);
  4744. smalltalk.addMethod(
  4745. smalltalk.method({
  4746. selector: "inspect:",
  4747. protocol: 'actions',
  4748. fn: function (anObject){
  4749. var self=this;
  4750. return smalltalk.withContext(function($ctx1) {
  4751. self["@object"]=anObject;
  4752. self["@variables"]=[];
  4753. _st(self["@object"])._inspectOn_(self);
  4754. return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.Inspector)})},
  4755. args: ["anObject"],
  4756. source: "inspect: anObject\x0a\x09object := anObject.\x0a\x09variables := #().\x0a\x09object inspectOn: self",
  4757. messageSends: ["inspectOn:"],
  4758. referencedClasses: []
  4759. }),
  4760. smalltalk.Inspector);
  4761. smalltalk.addMethod(
  4762. smalltalk.method({
  4763. selector: "label",
  4764. protocol: 'accessing',
  4765. fn: function (){
  4766. var self=this;
  4767. return smalltalk.withContext(function($ctx1) {
  4768. var $2,$1;
  4769. $2=self["@label"];
  4770. if(($receiver = $2) == nil || $receiver == null){
  4771. $1="Inspector (nil)";
  4772. } else {
  4773. $1=$2;
  4774. };
  4775. return $1;
  4776. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.Inspector)})},
  4777. args: [],
  4778. source: "label\x0a\x09^ label ifNil: [ 'Inspector (nil)' ]",
  4779. messageSends: ["ifNil:"],
  4780. referencedClasses: []
  4781. }),
  4782. smalltalk.Inspector);
  4783. smalltalk.addMethod(
  4784. smalltalk.method({
  4785. selector: "refresh",
  4786. protocol: 'actions',
  4787. fn: function (){
  4788. var self=this;
  4789. return smalltalk.withContext(function($ctx1) {
  4790. var $1;
  4791. self._inspect_(self["@object"]);
  4792. self._updateVariablesList();
  4793. $1=self._updateValueTextarea();
  4794. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.Inspector)})},
  4795. args: [],
  4796. source: "refresh\x0a\x09self\x0a\x09\x09inspect: object;\x0a\x09\x09updateVariablesList;\x0a\x09\x09updateValueTextarea",
  4797. messageSends: ["inspect:", "updateVariablesList", "updateValueTextarea"],
  4798. referencedClasses: []
  4799. }),
  4800. smalltalk.Inspector);
  4801. smalltalk.addMethod(
  4802. smalltalk.method({
  4803. selector: "renderBottomPanelOn:",
  4804. protocol: 'rendering',
  4805. fn: function (html){
  4806. var self=this;
  4807. function $SourceArea(){return smalltalk.SourceArea||(typeof SourceArea=="undefined"?nil:SourceArea)}
  4808. return smalltalk.withContext(function($ctx1) {
  4809. var $1,$3,$4,$2;
  4810. $1=_st(html)._div();
  4811. _st($1)._class_("amber_sourceCode");
  4812. $2=_st($1)._with_((function(){
  4813. return smalltalk.withContext(function($ctx2) {
  4814. $3=_st($SourceArea())._new();
  4815. _st($3)._receiver_(self["@object"]);
  4816. _st($3)._onDoIt_((function(){
  4817. return smalltalk.withContext(function($ctx3) {
  4818. return self._refresh();
  4819. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  4820. $4=_st($3)._yourself();
  4821. self["@sourceArea"]=$4;
  4822. self["@sourceArea"];
  4823. return _st(self["@sourceArea"])._renderOn_(html);
  4824. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4825. return self}, function($ctx1) {$ctx1.fill(self,"renderBottomPanelOn:",{html:html},smalltalk.Inspector)})},
  4826. args: ["html"],
  4827. source: "renderBottomPanelOn: html\x0a\x09html div\x0a\x09class: 'amber_sourceCode';\x0a\x09with: [\x0a\x09\x09sourceArea := SourceArea new\x0a\x09\x09receiver: object;\x0a\x09\x09onDoIt: [ self refresh ];\x0a\x09\x09yourself.\x0a\x09\x09\x09sourceArea renderOn: html ]",
  4828. messageSends: ["class:", "div", "with:", "receiver:", "new", "onDoIt:", "refresh", "yourself", "renderOn:"],
  4829. referencedClasses: ["SourceArea"]
  4830. }),
  4831. smalltalk.Inspector);
  4832. smalltalk.addMethod(
  4833. smalltalk.method({
  4834. selector: "renderBoxOn:",
  4835. protocol: 'rendering',
  4836. fn: function (html){
  4837. var self=this;
  4838. return smalltalk.withContext(function($ctx1) {
  4839. var $1;
  4840. self._renderTopPanelOn_(html);
  4841. $1=self._renderBottomPanelOn_(html);
  4842. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.Inspector)})},
  4843. args: ["html"],
  4844. source: "renderBoxOn: html\x0a\x09self\x0a\x09\x09renderTopPanelOn: html;\x0a\x09\x09renderBottomPanelOn: html",
  4845. messageSends: ["renderTopPanelOn:", "renderBottomPanelOn:"],
  4846. referencedClasses: []
  4847. }),
  4848. smalltalk.Inspector);
  4849. smalltalk.addMethod(
  4850. smalltalk.method({
  4851. selector: "renderButtonsOn:",
  4852. protocol: 'rendering',
  4853. fn: function (html){
  4854. var self=this;
  4855. return smalltalk.withContext(function($ctx1) {
  4856. var $1,$3,$2,$4,$6,$5,$7,$8;
  4857. $1=_st(html)._button();
  4858. $ctx1.sendIdx["button"]=1;
  4859. _st($1)._with_("DoIt");
  4860. $ctx1.sendIdx["with:"]=1;
  4861. $2=_st($1)._onClick_((function(){
  4862. return smalltalk.withContext(function($ctx2) {
  4863. $3=self._sourceArea();
  4864. $ctx2.sendIdx["sourceArea"]=1;
  4865. return _st($3)._doIt();
  4866. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4867. $ctx1.sendIdx["onClick:"]=1;
  4868. $4=_st(html)._button();
  4869. $ctx1.sendIdx["button"]=2;
  4870. _st($4)._with_("PrintIt");
  4871. $ctx1.sendIdx["with:"]=2;
  4872. $5=_st($4)._onClick_((function(){
  4873. return smalltalk.withContext(function($ctx2) {
  4874. $6=self._sourceArea();
  4875. $ctx2.sendIdx["sourceArea"]=2;
  4876. return _st($6)._printIt();
  4877. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  4878. $ctx1.sendIdx["onClick:"]=2;
  4879. $7=_st(html)._button();
  4880. _st($7)._with_("InspectIt");
  4881. $8=_st($7)._onClick_((function(){
  4882. return smalltalk.withContext(function($ctx2) {
  4883. return _st(self._sourceArea())._inspectIt();
  4884. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  4885. self._updateButtons();
  4886. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.Inspector)})},
  4887. args: ["html"],
  4888. 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",
  4889. messageSends: ["with:", "button", "onClick:", "doIt", "sourceArea", "printIt", "inspectIt", "updateButtons"],
  4890. referencedClasses: []
  4891. }),
  4892. smalltalk.Inspector);
  4893. smalltalk.addMethod(
  4894. smalltalk.method({
  4895. selector: "renderTopPanelOn:",
  4896. protocol: 'rendering',
  4897. fn: function (html){
  4898. var self=this;
  4899. return smalltalk.withContext(function($ctx1) {
  4900. var $1,$3,$4,$5,$7,$8,$9,$10,$6,$2,$11;
  4901. $1=_st(html)._div();
  4902. $ctx1.sendIdx["div"]=1;
  4903. _st($1)._class_("top");
  4904. $ctx1.sendIdx["class:"]=1;
  4905. $2=_st($1)._with_((function(){
  4906. return smalltalk.withContext(function($ctx2) {
  4907. self["@variablesList"]=_st(_st(html)._ul())._class_("amber_column variables");
  4908. $ctx2.sendIdx["class:"]=2;
  4909. self["@variablesList"];
  4910. $3=_st(html)._textarea();
  4911. _st($3)._class_("amber_column value");
  4912. $ctx2.sendIdx["class:"]=3;
  4913. $4=_st($3)._at_put_("readonly","readonly");
  4914. self["@valueTextarea"]=$4;
  4915. self["@valueTextarea"];
  4916. $5=_st(html)._div();
  4917. $ctx2.sendIdx["div"]=2;
  4918. _st($5)._class_("amber_tabs inspector");
  4919. $ctx2.sendIdx["class:"]=4;
  4920. $6=_st($5)._with_((function(){
  4921. return smalltalk.withContext(function($ctx3) {
  4922. $7=_st(html)._button();
  4923. $ctx3.sendIdx["button"]=1;
  4924. _st($7)._class_("amber_button inspector refresh");
  4925. $ctx3.sendIdx["class:"]=5;
  4926. _st($7)._with_("Refresh");
  4927. $ctx3.sendIdx["with:"]=3;
  4928. $8=_st($7)._onClick_((function(){
  4929. return smalltalk.withContext(function($ctx4) {
  4930. return self._refresh();
  4931. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
  4932. $ctx3.sendIdx["onClick:"]=1;
  4933. $8;
  4934. $9=_st(html)._button();
  4935. _st($9)._class_("amber_button inspector dive");
  4936. $ctx3.sendIdx["class:"]=6;
  4937. _st($9)._with_("Dive");
  4938. $10=_st($9)._onClick_((function(){
  4939. return smalltalk.withContext(function($ctx4) {
  4940. return self._dive();
  4941. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)})}));
  4942. self["@diveButton"]=$10;
  4943. return self["@diveButton"];
  4944. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  4945. $ctx2.sendIdx["with:"]=2;
  4946. $6;
  4947. return _st(_st(html)._div())._class_("amber_clear");
  4948. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4949. $ctx1.sendIdx["with:"]=1;
  4950. self._updateVariablesList();
  4951. $11=self._updateValueTextarea();
  4952. return self}, function($ctx1) {$ctx1.fill(self,"renderTopPanelOn:",{html:html},smalltalk.Inspector)})},
  4953. args: ["html"],
  4954. 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.",
  4955. messageSends: ["class:", "div", "with:", "ul", "textarea", "at:put:", "button", "onClick:", "refresh", "dive", "updateVariablesList", "updateValueTextarea"],
  4956. referencedClasses: []
  4957. }),
  4958. smalltalk.Inspector);
  4959. smalltalk.addMethod(
  4960. smalltalk.method({
  4961. selector: "selectVariable:",
  4962. protocol: 'updating',
  4963. fn: function (aString){
  4964. var self=this;
  4965. return smalltalk.withContext(function($ctx1) {
  4966. var $1;
  4967. self._selectedVariable_(aString);
  4968. self._updateVariablesList();
  4969. self._updateValueTextarea();
  4970. $1=self._updateButtons();
  4971. return self}, function($ctx1) {$ctx1.fill(self,"selectVariable:",{aString:aString},smalltalk.Inspector)})},
  4972. args: ["aString"],
  4973. source: "selectVariable: aString\x0a\x09self selectedVariable: aString.\x0a\x09self\x0a\x09\x09updateVariablesList;\x0a\x09\x09updateValueTextarea;\x0a\x09\x09updateButtons",
  4974. messageSends: ["selectedVariable:", "updateVariablesList", "updateValueTextarea", "updateButtons"],
  4975. referencedClasses: []
  4976. }),
  4977. smalltalk.Inspector);
  4978. smalltalk.addMethod(
  4979. smalltalk.method({
  4980. selector: "selectedVariable",
  4981. protocol: 'accessing',
  4982. fn: function (){
  4983. var self=this;
  4984. return smalltalk.withContext(function($ctx1) {
  4985. var $1;
  4986. $1=self["@selectedVariable"];
  4987. return $1;
  4988. }, function($ctx1) {$ctx1.fill(self,"selectedVariable",{},smalltalk.Inspector)})},
  4989. args: [],
  4990. source: "selectedVariable\x0a\x09^ selectedVariable",
  4991. messageSends: [],
  4992. referencedClasses: []
  4993. }),
  4994. smalltalk.Inspector);
  4995. smalltalk.addMethod(
  4996. smalltalk.method({
  4997. selector: "selectedVariable:",
  4998. protocol: 'accessing',
  4999. fn: function (aString){
  5000. var self=this;
  5001. return smalltalk.withContext(function($ctx1) {
  5002. self["@selectedVariable"]=aString;
  5003. return self}, function($ctx1) {$ctx1.fill(self,"selectedVariable:",{aString:aString},smalltalk.Inspector)})},
  5004. args: ["aString"],
  5005. source: "selectedVariable: aString\x0a\x09selectedVariable := aString",
  5006. messageSends: [],
  5007. referencedClasses: []
  5008. }),
  5009. smalltalk.Inspector);
  5010. smalltalk.addMethod(
  5011. smalltalk.method({
  5012. selector: "setLabel:",
  5013. protocol: 'accessing',
  5014. fn: function (aString){
  5015. var self=this;
  5016. return smalltalk.withContext(function($ctx1) {
  5017. self["@label"]=aString;
  5018. return self}, function($ctx1) {$ctx1.fill(self,"setLabel:",{aString:aString},smalltalk.Inspector)})},
  5019. args: ["aString"],
  5020. source: "setLabel: aString\x0a\x09label := aString",
  5021. messageSends: [],
  5022. referencedClasses: []
  5023. }),
  5024. smalltalk.Inspector);
  5025. smalltalk.addMethod(
  5026. smalltalk.method({
  5027. selector: "setVariables:",
  5028. protocol: 'accessing',
  5029. fn: function (aCollection){
  5030. var self=this;
  5031. return smalltalk.withContext(function($ctx1) {
  5032. self["@variables"]=aCollection;
  5033. return self}, function($ctx1) {$ctx1.fill(self,"setVariables:",{aCollection:aCollection},smalltalk.Inspector)})},
  5034. args: ["aCollection"],
  5035. source: "setVariables: aCollection\x0a\x09variables := aCollection",
  5036. messageSends: [],
  5037. referencedClasses: []
  5038. }),
  5039. smalltalk.Inspector);
  5040. smalltalk.addMethod(
  5041. smalltalk.method({
  5042. selector: "sourceArea",
  5043. protocol: 'accessing',
  5044. fn: function (){
  5045. var self=this;
  5046. return smalltalk.withContext(function($ctx1) {
  5047. var $1;
  5048. $1=self["@sourceArea"];
  5049. return $1;
  5050. }, function($ctx1) {$ctx1.fill(self,"sourceArea",{},smalltalk.Inspector)})},
  5051. args: [],
  5052. source: "sourceArea\x0a\x09^ sourceArea",
  5053. messageSends: [],
  5054. referencedClasses: []
  5055. }),
  5056. smalltalk.Inspector);
  5057. smalltalk.addMethod(
  5058. smalltalk.method({
  5059. selector: "updateButtons",
  5060. protocol: 'updating',
  5061. fn: function (){
  5062. var self=this;
  5063. return smalltalk.withContext(function($ctx1) {
  5064. var $3,$2,$1;
  5065. $3=self._selectedVariable();
  5066. $ctx1.sendIdx["selectedVariable"]=1;
  5067. $2=_st($3)._notNil();
  5068. $ctx1.sendIdx["notNil"]=1;
  5069. $1=_st($2)._and_((function(){
  5070. return smalltalk.withContext(function($ctx2) {
  5071. return _st(_st(self._variables())._at_(self._selectedVariable()))._notNil();
  5072. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  5073. if(smalltalk.assert($1)){
  5074. _st(self["@diveButton"])._removeAt_("disabled");
  5075. } else {
  5076. _st(self["@diveButton"])._at_put_("disabled",true);
  5077. };
  5078. return self}, function($ctx1) {$ctx1.fill(self,"updateButtons",{},smalltalk.Inspector)})},
  5079. args: [],
  5080. 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' ]",
  5081. messageSends: ["ifFalse:ifTrue:", "and:", "notNil", "selectedVariable", "at:", "variables", "at:put:", "removeAt:"],
  5082. referencedClasses: []
  5083. }),
  5084. smalltalk.Inspector);
  5085. smalltalk.addMethod(
  5086. smalltalk.method({
  5087. selector: "updateValueTextarea",
  5088. protocol: 'updating',
  5089. fn: function (){
  5090. var self=this;
  5091. return smalltalk.withContext(function($ctx1) {
  5092. var $1,$4,$3,$2;
  5093. $1=_st(self["@valueTextarea"])._asJQuery();
  5094. $4=self._selectedVariable();
  5095. $ctx1.sendIdx["selectedVariable"]=1;
  5096. $3=_st($4)._isNil();
  5097. if(smalltalk.assert($3)){
  5098. $2="";
  5099. } else {
  5100. $2=_st(_st(self._variables())._at_(self._selectedVariable()))._printString();
  5101. };
  5102. _st($1)._val_($2);
  5103. return self}, function($ctx1) {$ctx1.fill(self,"updateValueTextarea",{},smalltalk.Inspector)})},
  5104. args: [],
  5105. source: "updateValueTextarea\x0a\x09valueTextarea asJQuery val: (self selectedVariable isNil\x0a\x09\x09ifTrue: [ '' ]\x0a\x09\x09ifFalse: [ (self variables at: self selectedVariable) printString ])",
  5106. messageSends: ["val:", "asJQuery", "ifTrue:ifFalse:", "isNil", "selectedVariable", "printString", "at:", "variables"],
  5107. referencedClasses: []
  5108. }),
  5109. smalltalk.Inspector);
  5110. smalltalk.addMethod(
  5111. smalltalk.method({
  5112. selector: "updateVariablesList",
  5113. protocol: 'updating',
  5114. fn: function (){
  5115. var self=this;
  5116. return smalltalk.withContext(function($ctx1) {
  5117. var $1,$2,$3;
  5118. _st(self["@variablesList"])._contents_((function(html){
  5119. return smalltalk.withContext(function($ctx2) {
  5120. return _st(self._variables())._keysDo_((function(each){
  5121. var li;
  5122. return smalltalk.withContext(function($ctx3) {
  5123. li=_st(html)._li();
  5124. li;
  5125. $1=li;
  5126. _st($1)._with_(each);
  5127. $2=_st($1)._onClick_((function(){
  5128. return smalltalk.withContext(function($ctx4) {
  5129. return self._selectVariable_(each);
  5130. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
  5131. $2;
  5132. $3=_st(self._selectedVariable()).__eq(each);
  5133. if(smalltalk.assert($3)){
  5134. return _st(li)._class_("selected");
  5135. };
  5136. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2,2)})}));
  5137. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  5138. return self}, function($ctx1) {$ctx1.fill(self,"updateVariablesList",{},smalltalk.Inspector)})},
  5139. args: [],
  5140. source: "updateVariablesList\x0a\x09variablesList contents: [ :html |\x0a\x09\x09self variables keysDo: [ :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' ]] ]",
  5141. messageSends: ["contents:", "keysDo:", "variables", "li", "with:", "onClick:", "selectVariable:", "ifTrue:", "=", "selectedVariable", "class:"],
  5142. referencedClasses: []
  5143. }),
  5144. smalltalk.Inspector);
  5145. smalltalk.addMethod(
  5146. smalltalk.method({
  5147. selector: "variables",
  5148. protocol: 'accessing',
  5149. fn: function (){
  5150. var self=this;
  5151. return smalltalk.withContext(function($ctx1) {
  5152. var $1;
  5153. $1=self["@variables"];
  5154. return $1;
  5155. }, function($ctx1) {$ctx1.fill(self,"variables",{},smalltalk.Inspector)})},
  5156. args: [],
  5157. source: "variables\x0a\x09^ variables",
  5158. messageSends: [],
  5159. referencedClasses: []
  5160. }),
  5161. smalltalk.Inspector);
  5162. smalltalk.addMethod(
  5163. smalltalk.method({
  5164. selector: "inspect:",
  5165. protocol: 'instance creation',
  5166. fn: function (anObject){
  5167. var self=this;
  5168. return smalltalk.withContext(function($ctx1) {
  5169. var $2,$3,$1;
  5170. $2=self._new();
  5171. _st($2)._inspect_(anObject);
  5172. _st($2)._open();
  5173. $3=_st($2)._yourself();
  5174. $1=$3;
  5175. return $1;
  5176. }, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.Inspector.klass)})},
  5177. args: ["anObject"],
  5178. source: "inspect: anObject\x0a\x09^ self new\x0a\x09\x09inspect: anObject;\x0a\x09\x09open;\x0a\x09\x09yourself",
  5179. messageSends: ["inspect:", "new", "open", "yourself"],
  5180. referencedClasses: []
  5181. }),
  5182. smalltalk.Inspector.klass);
  5183. smalltalk.addMethod(
  5184. smalltalk.method({
  5185. selector: "on:",
  5186. protocol: 'instance creation',
  5187. fn: function (anObject){
  5188. var self=this;
  5189. return smalltalk.withContext(function($ctx1) {
  5190. var $2,$3,$1;
  5191. $2=self._new();
  5192. _st($2)._inspect_(anObject);
  5193. $3=_st($2)._yourself();
  5194. $1=$3;
  5195. return $1;
  5196. }, function($ctx1) {$ctx1.fill(self,"on:",{anObject:anObject},smalltalk.Inspector.klass)})},
  5197. args: ["anObject"],
  5198. source: "on: anObject\x0a\x09^ self new\x0a\x09\x09inspect: anObject;\x0a\x09\x09yourself",
  5199. messageSends: ["inspect:", "new", "yourself"],
  5200. referencedClasses: []
  5201. }),
  5202. smalltalk.Inspector.klass);
  5203. smalltalk.addClass('ProgressBar', smalltalk.TabWidget, ['percent', 'progressDiv', 'div'], 'IDE');
  5204. smalltalk.addMethod(
  5205. smalltalk.method({
  5206. selector: "percent",
  5207. protocol: 'accessing',
  5208. fn: function (){
  5209. var self=this;
  5210. return smalltalk.withContext(function($ctx1) {
  5211. var $2,$1;
  5212. $2=self["@percent"];
  5213. if(($receiver = $2) == nil || $receiver == null){
  5214. $1=(0);
  5215. } else {
  5216. $1=$2;
  5217. };
  5218. return $1;
  5219. }, function($ctx1) {$ctx1.fill(self,"percent",{},smalltalk.ProgressBar)})},
  5220. args: [],
  5221. source: "percent\x0a\x09^ percent ifNil: [ 0 ]",
  5222. messageSends: ["ifNil:"],
  5223. referencedClasses: []
  5224. }),
  5225. smalltalk.ProgressBar);
  5226. smalltalk.addMethod(
  5227. smalltalk.method({
  5228. selector: "percent:",
  5229. protocol: 'accessing',
  5230. fn: function (aNumber){
  5231. var self=this;
  5232. return smalltalk.withContext(function($ctx1) {
  5233. self["@percent"]=aNumber;
  5234. return self}, function($ctx1) {$ctx1.fill(self,"percent:",{aNumber:aNumber},smalltalk.ProgressBar)})},
  5235. args: ["aNumber"],
  5236. source: "percent: aNumber\x0a\x09percent := aNumber",
  5237. messageSends: [],
  5238. referencedClasses: []
  5239. }),
  5240. smalltalk.ProgressBar);
  5241. smalltalk.addMethod(
  5242. smalltalk.method({
  5243. selector: "renderOn:",
  5244. protocol: 'rendering',
  5245. fn: function (html){
  5246. var self=this;
  5247. return smalltalk.withContext(function($ctx1) {
  5248. var $1,$2;
  5249. $1=_st(html)._div();
  5250. _st($1)._class_("progress_bar");
  5251. $2=_st($1)._yourself();
  5252. self["@div"]=$2;
  5253. self._renderProgressBar();
  5254. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.ProgressBar)})},
  5255. args: ["html"],
  5256. source: "renderOn: html\x0a\x09div := html div\x0a\x09\x09class: 'progress_bar';\x0a\x09\x09yourself.\x0a\x09self renderProgressBar",
  5257. messageSends: ["class:", "div", "yourself", "renderProgressBar"],
  5258. referencedClasses: []
  5259. }),
  5260. smalltalk.ProgressBar);
  5261. smalltalk.addMethod(
  5262. smalltalk.method({
  5263. selector: "renderProgressBar",
  5264. protocol: 'rendering',
  5265. fn: function (){
  5266. var self=this;
  5267. return smalltalk.withContext(function($ctx1) {
  5268. var $1,$3,$4,$2;
  5269. _st(self["@div"])._contents_((function(html){
  5270. return smalltalk.withContext(function($ctx2) {
  5271. $1=_st(html)._div();
  5272. _st($1)._class_("progress");
  5273. $3=$1;
  5274. $4=_st("width:".__comma(_st(self._percent())._asString())).__comma("%");
  5275. $ctx2.sendIdx[","]=1;
  5276. $2=_st($3)._style_($4);
  5277. return $2;
  5278. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  5279. return self}, function($ctx1) {$ctx1.fill(self,"renderProgressBar",{},smalltalk.ProgressBar)})},
  5280. args: [],
  5281. source: "renderProgressBar\x0a\x09div contents: [ :html |\x0a\x09\x09html div\x0a\x09\x09\x09class: 'progress';\x0a\x09\x09\x09style: 'width:', self percent asString, '%' ]",
  5282. messageSends: ["contents:", "class:", "div", "style:", ",", "asString", "percent"],
  5283. referencedClasses: []
  5284. }),
  5285. smalltalk.ProgressBar);
  5286. smalltalk.addMethod(
  5287. smalltalk.method({
  5288. selector: "updatePercent:",
  5289. protocol: 'updating',
  5290. fn: function (aNumber){
  5291. var self=this;
  5292. return smalltalk.withContext(function($ctx1) {
  5293. self._percent_(aNumber);
  5294. self._renderProgressBar();
  5295. return self}, function($ctx1) {$ctx1.fill(self,"updatePercent:",{aNumber:aNumber},smalltalk.ProgressBar)})},
  5296. args: ["aNumber"],
  5297. source: "updatePercent: aNumber\x0a\x09self percent: aNumber.\x0a\x09self renderProgressBar",
  5298. messageSends: ["percent:", "renderProgressBar"],
  5299. referencedClasses: []
  5300. }),
  5301. smalltalk.ProgressBar);
  5302. smalltalk.addClass('ReferencesBrowser', smalltalk.TabWidget, ['implementors', 'senders', 'implementorsList', 'input', 'timer', 'selector', 'sendersList', 'referencedClasses', 'referencedClassesList', 'matches', 'matchesList'], 'IDE');
  5303. smalltalk.addMethod(
  5304. smalltalk.method({
  5305. selector: "canBeClosed",
  5306. protocol: 'testing',
  5307. fn: function (){
  5308. var self=this;
  5309. return smalltalk.withContext(function($ctx1) {
  5310. return true;
  5311. }, function($ctx1) {$ctx1.fill(self,"canBeClosed",{},smalltalk.ReferencesBrowser)})},
  5312. args: [],
  5313. source: "canBeClosed\x0a\x09^ true",
  5314. messageSends: [],
  5315. referencedClasses: []
  5316. }),
  5317. smalltalk.ReferencesBrowser);
  5318. smalltalk.addMethod(
  5319. smalltalk.method({
  5320. selector: "classesAndMetaclasses",
  5321. protocol: 'accessing',
  5322. fn: function (){
  5323. var self=this;
  5324. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  5325. return smalltalk.withContext(function($ctx1) {
  5326. var $3,$2,$1;
  5327. $3=_st($Smalltalk())._current();
  5328. $ctx1.sendIdx["current"]=1;
  5329. $2=_st($3)._classes();
  5330. $ctx1.sendIdx["classes"]=1;
  5331. $1=_st($2).__comma(_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  5332. return smalltalk.withContext(function($ctx2) {
  5333. return _st(each)._class();
  5334. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})));
  5335. return $1;
  5336. }, function($ctx1) {$ctx1.fill(self,"classesAndMetaclasses",{},smalltalk.ReferencesBrowser)})},
  5337. args: [],
  5338. source: "classesAndMetaclasses\x0a\x09^ Smalltalk current classes, (Smalltalk current classes collect: [ :each | each class ])",
  5339. messageSends: [",", "classes", "current", "collect:", "class"],
  5340. referencedClasses: ["Smalltalk"]
  5341. }),
  5342. smalltalk.ReferencesBrowser);
  5343. smalltalk.addMethod(
  5344. smalltalk.method({
  5345. selector: "implementors",
  5346. protocol: 'accessing',
  5347. fn: function (){
  5348. var self=this;
  5349. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  5350. return smalltalk.withContext(function($ctx1) {
  5351. var $2,$1;
  5352. $2=self["@implementors"];
  5353. if(($receiver = $2) == nil || $receiver == null){
  5354. self["@implementors"]=_st($Array())._new();
  5355. $1=self["@implementors"];
  5356. } else {
  5357. $1=$2;
  5358. };
  5359. return $1;
  5360. }, function($ctx1) {$ctx1.fill(self,"implementors",{},smalltalk.ReferencesBrowser)})},
  5361. args: [],
  5362. source: "implementors\x0a\x09^ implementors ifNil: [ implementors := Array new ]",
  5363. messageSends: ["ifNil:", "new"],
  5364. referencedClasses: ["Array"]
  5365. }),
  5366. smalltalk.ReferencesBrowser);
  5367. smalltalk.addMethod(
  5368. smalltalk.method({
  5369. selector: "initialize",
  5370. protocol: 'initialization',
  5371. fn: function (){
  5372. var self=this;
  5373. return smalltalk.withContext(function($ctx1) {
  5374. smalltalk.ReferencesBrowser.superclass.fn.prototype._initialize.apply(_st(self), []);
  5375. self["@selector"]="";
  5376. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.ReferencesBrowser)})},
  5377. args: [],
  5378. source: "initialize\x0a\x09super initialize.\x0a\x09selector := ''",
  5379. messageSends: ["initialize"],
  5380. referencedClasses: []
  5381. }),
  5382. smalltalk.ReferencesBrowser);
  5383. smalltalk.addMethod(
  5384. smalltalk.method({
  5385. selector: "label",
  5386. protocol: 'accessing',
  5387. fn: function (){
  5388. var self=this;
  5389. return smalltalk.withContext(function($ctx1) {
  5390. return "[ References ]";
  5391. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.ReferencesBrowser)})},
  5392. args: [],
  5393. source: "label\x0a\x09^ '[ References ]'",
  5394. messageSends: [],
  5395. referencedClasses: []
  5396. }),
  5397. smalltalk.ReferencesBrowser);
  5398. smalltalk.addMethod(
  5399. smalltalk.method({
  5400. selector: "matches",
  5401. protocol: 'accessing',
  5402. fn: function (){
  5403. var self=this;
  5404. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  5405. return smalltalk.withContext(function($ctx1) {
  5406. var $2,$1;
  5407. $2=self["@matches"];
  5408. if(($receiver = $2) == nil || $receiver == null){
  5409. self["@matches"]=_st($Array())._new();
  5410. $1=self["@matches"];
  5411. } else {
  5412. $1=$2;
  5413. };
  5414. return $1;
  5415. }, function($ctx1) {$ctx1.fill(self,"matches",{},smalltalk.ReferencesBrowser)})},
  5416. args: [],
  5417. source: "matches\x0a\x09^ matches ifNil: [ matches := Array new ]",
  5418. messageSends: ["ifNil:", "new"],
  5419. referencedClasses: ["Array"]
  5420. }),
  5421. smalltalk.ReferencesBrowser);
  5422. smalltalk.addMethod(
  5423. smalltalk.method({
  5424. selector: "openBrowserOn:",
  5425. protocol: 'actions',
  5426. fn: function (aMethod){
  5427. var self=this;
  5428. var browser;
  5429. function $Browser(){return smalltalk.Browser||(typeof Browser=="undefined"?nil:Browser)}
  5430. return smalltalk.withContext(function($ctx1) {
  5431. var $3,$2,$4,$1,$5,$6,$7;
  5432. $3=_st(aMethod)._methodClass();
  5433. $ctx1.sendIdx["methodClass"]=1;
  5434. $2=_st($3)._isMetaclass();
  5435. $ctx1.sendIdx["isMetaclass"]=1;
  5436. if(smalltalk.assert($2)){
  5437. $4=_st(aMethod)._methodClass();
  5438. $ctx1.sendIdx["methodClass"]=2;
  5439. $1=_st($4)._instanceClass();
  5440. } else {
  5441. $1=_st(aMethod)._methodClass();
  5442. $ctx1.sendIdx["methodClass"]=3;
  5443. };
  5444. browser=_st($Browser())._openOn_($1);
  5445. $5=_st(_st(aMethod)._methodClass())._isMetaclass();
  5446. if(smalltalk.assert($5)){
  5447. _st(browser)._selectTab_("class");
  5448. };
  5449. $6=browser;
  5450. _st($6)._selectProtocol_(_st(aMethod)._category());
  5451. $7=_st($6)._selectMethod_(aMethod);
  5452. return self}, function($ctx1) {$ctx1.fill(self,"openBrowserOn:",{aMethod:aMethod,browser:browser},smalltalk.ReferencesBrowser)})},
  5453. args: ["aMethod"],
  5454. source: "openBrowserOn: aMethod\x0a\x09| browser |\x0a\x09browser := Browser openOn: (aMethod methodClass isMetaclass\x0a\x09\x09ifTrue: [ aMethod methodClass instanceClass ] ifFalse: [ aMethod methodClass ]).\x0a\x09aMethod methodClass isMetaclass ifTrue: [ browser selectTab: #class ].\x0a\x09browser\x0a\x09\x09selectProtocol: aMethod category;\x0a\x09\x09selectMethod: aMethod",
  5455. messageSends: ["openOn:", "ifTrue:ifFalse:", "isMetaclass", "methodClass", "instanceClass", "ifTrue:", "selectTab:", "selectProtocol:", "category", "selectMethod:"],
  5456. referencedClasses: ["Browser"]
  5457. }),
  5458. smalltalk.ReferencesBrowser);
  5459. smalltalk.addMethod(
  5460. smalltalk.method({
  5461. selector: "referencedClasses",
  5462. protocol: 'accessing',
  5463. fn: function (){
  5464. var self=this;
  5465. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  5466. return smalltalk.withContext(function($ctx1) {
  5467. var $2,$1;
  5468. $2=self["@referencedClasses"];
  5469. if(($receiver = $2) == nil || $receiver == null){
  5470. self["@referencedClasses"]=_st($Array())._new();
  5471. $1=self["@referencedClasses"];
  5472. } else {
  5473. $1=$2;
  5474. };
  5475. return $1;
  5476. }, function($ctx1) {$ctx1.fill(self,"referencedClasses",{},smalltalk.ReferencesBrowser)})},
  5477. args: [],
  5478. source: "referencedClasses\x0a\x09^ referencedClasses ifNil: [ referencedClasses := Array new ]",
  5479. messageSends: ["ifNil:", "new"],
  5480. referencedClasses: ["Array"]
  5481. }),
  5482. smalltalk.ReferencesBrowser);
  5483. smalltalk.addMethod(
  5484. smalltalk.method({
  5485. selector: "renderBoxOn:",
  5486. protocol: 'rendering',
  5487. fn: function (html){
  5488. var self=this;
  5489. return smalltalk.withContext(function($ctx1) {
  5490. var $1;
  5491. self._renderInputOn_(html);
  5492. self._renderImplementorsOn_(html);
  5493. self._renderSendersOn_(html);
  5494. self._renderReferencedClassesOn_(html);
  5495. $1=self._renderMatchesOn_(html);
  5496. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.ReferencesBrowser)})},
  5497. args: ["html"],
  5498. 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",
  5499. messageSends: ["renderInputOn:", "renderImplementorsOn:", "renderSendersOn:", "renderReferencedClassesOn:", "renderMatchesOn:"],
  5500. referencedClasses: []
  5501. }),
  5502. smalltalk.ReferencesBrowser);
  5503. smalltalk.addMethod(
  5504. smalltalk.method({
  5505. selector: "renderImplementorsOn:",
  5506. protocol: 'rendering',
  5507. fn: function (html){
  5508. var self=this;
  5509. return smalltalk.withContext(function($ctx1) {
  5510. self["@implementorsList"]=_st(_st(html)._ul())._class_("amber_column implementors");
  5511. self._updateImplementorsList();
  5512. return self}, function($ctx1) {$ctx1.fill(self,"renderImplementorsOn:",{html:html},smalltalk.ReferencesBrowser)})},
  5513. args: ["html"],
  5514. source: "renderImplementorsOn: html\x0a\x09implementorsList := html ul class: 'amber_column implementors'.\x0a\x09self updateImplementorsList",
  5515. messageSends: ["class:", "ul", "updateImplementorsList"],
  5516. referencedClasses: []
  5517. }),
  5518. smalltalk.ReferencesBrowser);
  5519. smalltalk.addMethod(
  5520. smalltalk.method({
  5521. selector: "renderInputOn:",
  5522. protocol: 'rendering',
  5523. fn: function (html){
  5524. var self=this;
  5525. return smalltalk.withContext(function($ctx1) {
  5526. var $1,$2;
  5527. $1=_st(html)._input();
  5528. _st($1)._class_("implementors");
  5529. $2=_st($1)._yourself();
  5530. self["@input"]=$2;
  5531. _st(_st(self["@input"])._asJQuery())._val_(self["@selector"]);
  5532. self._setInputEvents();
  5533. return self}, function($ctx1) {$ctx1.fill(self,"renderInputOn:",{html:html},smalltalk.ReferencesBrowser)})},
  5534. args: ["html"],
  5535. source: "renderInputOn: html\x0a\x09input := html input\x0a\x09\x09class: 'implementors';\x0a\x09\x09yourself.\x0a\x09input asJQuery val: selector.\x0a\x09self setInputEvents",
  5536. messageSends: ["class:", "input", "yourself", "val:", "asJQuery", "setInputEvents"],
  5537. referencedClasses: []
  5538. }),
  5539. smalltalk.ReferencesBrowser);
  5540. smalltalk.addMethod(
  5541. smalltalk.method({
  5542. selector: "renderMatchesOn:",
  5543. protocol: 'rendering',
  5544. fn: function (html){
  5545. var self=this;
  5546. return smalltalk.withContext(function($ctx1) {
  5547. self["@matchesList"]=_st(_st(html)._ul())._class_("amber_column matches");
  5548. self._updateMatchesList();
  5549. return self}, function($ctx1) {$ctx1.fill(self,"renderMatchesOn:",{html:html},smalltalk.ReferencesBrowser)})},
  5550. args: ["html"],
  5551. source: "renderMatchesOn: html\x0a\x09matchesList := html ul class: 'amber_column matches'.\x0a\x09self updateMatchesList",
  5552. messageSends: ["class:", "ul", "updateMatchesList"],
  5553. referencedClasses: []
  5554. }),
  5555. smalltalk.ReferencesBrowser);
  5556. smalltalk.addMethod(
  5557. smalltalk.method({
  5558. selector: "renderReferencedClassesOn:",
  5559. protocol: 'rendering',
  5560. fn: function (html){
  5561. var self=this;
  5562. return smalltalk.withContext(function($ctx1) {
  5563. self["@referencedClassesList"]=_st(_st(html)._ul())._class_("amber_column referenced_classes");
  5564. self._updateReferencedClassesList();
  5565. return self}, function($ctx1) {$ctx1.fill(self,"renderReferencedClassesOn:",{html:html},smalltalk.ReferencesBrowser)})},
  5566. args: ["html"],
  5567. source: "renderReferencedClassesOn: html\x0a\x09referencedClassesList := html ul class: 'amber_column referenced_classes'.\x0a\x09self updateReferencedClassesList",
  5568. messageSends: ["class:", "ul", "updateReferencedClassesList"],
  5569. referencedClasses: []
  5570. }),
  5571. smalltalk.ReferencesBrowser);
  5572. smalltalk.addMethod(
  5573. smalltalk.method({
  5574. selector: "renderSendersOn:",
  5575. protocol: 'rendering',
  5576. fn: function (html){
  5577. var self=this;
  5578. return smalltalk.withContext(function($ctx1) {
  5579. self["@sendersList"]=_st(_st(html)._ul())._class_("amber_column senders");
  5580. self._updateSendersList();
  5581. return self}, function($ctx1) {$ctx1.fill(self,"renderSendersOn:",{html:html},smalltalk.ReferencesBrowser)})},
  5582. args: ["html"],
  5583. source: "renderSendersOn: html\x0a\x09sendersList := html ul class: 'amber_column senders'.\x0a\x09self updateSendersList",
  5584. messageSends: ["class:", "ul", "updateSendersList"],
  5585. referencedClasses: []
  5586. }),
  5587. smalltalk.ReferencesBrowser);
  5588. smalltalk.addMethod(
  5589. smalltalk.method({
  5590. selector: "search:",
  5591. protocol: 'actions',
  5592. fn: function (aString){
  5593. var self=this;
  5594. return smalltalk.withContext(function($ctx1) {
  5595. var $1;
  5596. self._searchReferencesFor_(aString);
  5597. self._updateImplementorsList();
  5598. self._updateSendersList();
  5599. self._updateReferencedClassesList();
  5600. $1=self._updateMatchesList();
  5601. return self}, function($ctx1) {$ctx1.fill(self,"search:",{aString:aString},smalltalk.ReferencesBrowser)})},
  5602. args: ["aString"],
  5603. source: "search: aString\x0a\x09self\x0a\x09\x09searchReferencesFor: aString;\x0a\x09\x09updateImplementorsList;\x0a\x09\x09updateSendersList;\x0a\x09\x09updateReferencedClassesList;\x0a\x09\x09updateMatchesList",
  5604. messageSends: ["searchReferencesFor:", "updateImplementorsList", "updateSendersList", "updateReferencedClassesList", "updateMatchesList"],
  5605. referencedClasses: []
  5606. }),
  5607. smalltalk.ReferencesBrowser);
  5608. smalltalk.addMethod(
  5609. smalltalk.method({
  5610. selector: "searchMethodSource",
  5611. protocol: 'actions',
  5612. fn: function (){
  5613. var self=this;
  5614. var regex;
  5615. return smalltalk.withContext(function($ctx1) {
  5616. var $1;
  5617. regex=_st(self["@selector"])._allButFirst();
  5618. _st(self._classesAndMetaclasses())._do_((function(each){
  5619. return smalltalk.withContext(function($ctx2) {
  5620. return _st(_st(each)._methodDictionary())._valuesDo_((function(value){
  5621. return smalltalk.withContext(function($ctx3) {
  5622. $1=_st(_st(value)._source())._match_(regex);
  5623. if(smalltalk.assert($1)){
  5624. return _st(self._matches())._add_(value);
  5625. };
  5626. }, function($ctx3) {$ctx3.fillBlock({value:value},$ctx2,2)})}));
  5627. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  5628. return self}, function($ctx1) {$ctx1.fill(self,"searchMethodSource",{regex:regex},smalltalk.ReferencesBrowser)})},
  5629. args: [],
  5630. source: "searchMethodSource\x0a\x09| regex |\x0a\x09regex := selector allButFirst.\x0a\x09self classesAndMetaclasses do: [ :each |\x0a\x09\x09each methodDictionary valuesDo: [ :value |\x0a\x09\x09\x09(value source match: regex) ifTrue: [\x0a\x09\x09\x09\x09self matches add: value ]] ]",
  5631. messageSends: ["allButFirst", "do:", "classesAndMetaclasses", "valuesDo:", "methodDictionary", "ifTrue:", "match:", "source", "add:", "matches"],
  5632. referencedClasses: []
  5633. }),
  5634. smalltalk.ReferencesBrowser);
  5635. smalltalk.addMethod(
  5636. smalltalk.method({
  5637. selector: "searchReferencedClasses",
  5638. protocol: 'actions',
  5639. fn: function (){
  5640. var self=this;
  5641. return smalltalk.withContext(function($ctx1) {
  5642. var $2,$1;
  5643. _st(self._classesAndMetaclasses())._do_((function(each){
  5644. return smalltalk.withContext(function($ctx2) {
  5645. return _st(_st(each)._methodDictionary())._valuesDo_((function(value){
  5646. return smalltalk.withContext(function($ctx3) {
  5647. $2=_st(value)._referencedClasses();
  5648. $ctx3.sendIdx["referencedClasses"]=1;
  5649. $1=_st($2)._includes_(self["@selector"]);
  5650. if(smalltalk.assert($1)){
  5651. return _st(self._referencedClasses())._add_(value);
  5652. };
  5653. }, function($ctx3) {$ctx3.fillBlock({value:value},$ctx2,2)})}));
  5654. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  5655. return self}, function($ctx1) {$ctx1.fill(self,"searchReferencedClasses",{},smalltalk.ReferencesBrowser)})},
  5656. args: [],
  5657. source: "searchReferencedClasses\x0a\x09self classesAndMetaclasses do: [ :each |\x0a\x09\x09each methodDictionary valuesDo: [ :value |\x0a\x09\x09\x09(value referencedClasses includes: selector) ifTrue: [\x0a\x09\x09\x09\x09self referencedClasses add: value ]] ]",
  5658. messageSends: ["do:", "classesAndMetaclasses", "valuesDo:", "methodDictionary", "ifTrue:", "includes:", "referencedClasses", "add:"],
  5659. referencedClasses: []
  5660. }),
  5661. smalltalk.ReferencesBrowser);
  5662. smalltalk.addMethod(
  5663. smalltalk.method({
  5664. selector: "searchReferencesFor:",
  5665. protocol: 'actions',
  5666. fn: function (aString){
  5667. var self=this;
  5668. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  5669. return smalltalk.withContext(function($ctx1) {
  5670. var $1;
  5671. self["@selector"]=aString;
  5672. self["@implementors"]=_st($Array())._new();
  5673. $ctx1.sendIdx["new"]=1;
  5674. self["@senders"]=_st($Array())._new();
  5675. $ctx1.sendIdx["new"]=2;
  5676. self["@referencedClasses"]=_st($Array())._new();
  5677. $ctx1.sendIdx["new"]=3;
  5678. self["@matches"]=_st($Array())._new();
  5679. self._searchMethodSource();
  5680. $1=_st(self["@selector"])._match_("^[A-Z]");
  5681. if(smalltalk.assert($1)){
  5682. self._searchReferencedClasses();
  5683. } else {
  5684. self._searchSelectorReferences();
  5685. };
  5686. return self}, function($ctx1) {$ctx1.fill(self,"searchReferencesFor:",{aString:aString},smalltalk.ReferencesBrowser)})},
  5687. args: ["aString"],
  5688. 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 ]",
  5689. messageSends: ["new", "searchMethodSource", "ifFalse:ifTrue:", "match:", "searchSelectorReferences", "searchReferencedClasses"],
  5690. referencedClasses: ["Array"]
  5691. }),
  5692. smalltalk.ReferencesBrowser);
  5693. smalltalk.addMethod(
  5694. smalltalk.method({
  5695. selector: "searchSelectorReferences",
  5696. protocol: 'actions',
  5697. fn: function (){
  5698. var self=this;
  5699. return smalltalk.withContext(function($ctx1) {
  5700. var $1,$2;
  5701. _st(self._classesAndMetaclasses())._do_((function(each){
  5702. return smalltalk.withContext(function($ctx2) {
  5703. return _st(_st(each)._methodDictionary())._keysAndValuesDo_((function(key,value){
  5704. return smalltalk.withContext(function($ctx3) {
  5705. $1=_st(key).__eq(self["@selector"]);
  5706. if(smalltalk.assert($1)){
  5707. _st(self._implementors())._add_(value);
  5708. $ctx3.sendIdx["add:"]=1;
  5709. };
  5710. $2=_st(_st(value)._messageSends())._includes_(self["@selector"]);
  5711. if(smalltalk.assert($2)){
  5712. return _st(self._senders())._add_(value);
  5713. };
  5714. }, function($ctx3) {$ctx3.fillBlock({key:key,value:value},$ctx2,2)})}));
  5715. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  5716. return self}, function($ctx1) {$ctx1.fill(self,"searchSelectorReferences",{},smalltalk.ReferencesBrowser)})},
  5717. args: [],
  5718. 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 ]] ]",
  5719. messageSends: ["do:", "classesAndMetaclasses", "keysAndValuesDo:", "methodDictionary", "ifTrue:", "=", "add:", "implementors", "includes:", "messageSends", "senders"],
  5720. referencedClasses: []
  5721. }),
  5722. smalltalk.ReferencesBrowser);
  5723. smalltalk.addMethod(
  5724. smalltalk.method({
  5725. selector: "selector",
  5726. protocol: 'accessing',
  5727. fn: function (){
  5728. var self=this;
  5729. return smalltalk.withContext(function($ctx1) {
  5730. var $1;
  5731. $1=self["@selector"];
  5732. return $1;
  5733. }, function($ctx1) {$ctx1.fill(self,"selector",{},smalltalk.ReferencesBrowser)})},
  5734. args: [],
  5735. source: "selector\x0a\x09^ selector",
  5736. messageSends: [],
  5737. referencedClasses: []
  5738. }),
  5739. smalltalk.ReferencesBrowser);
  5740. smalltalk.addMethod(
  5741. smalltalk.method({
  5742. selector: "senders",
  5743. protocol: 'accessing',
  5744. fn: function (){
  5745. var self=this;
  5746. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  5747. return smalltalk.withContext(function($ctx1) {
  5748. var $2,$1;
  5749. $2=self["@senders"];
  5750. if(($receiver = $2) == nil || $receiver == null){
  5751. self["@senders"]=_st($Array())._new();
  5752. $1=self["@senders"];
  5753. } else {
  5754. $1=$2;
  5755. };
  5756. return $1;
  5757. }, function($ctx1) {$ctx1.fill(self,"senders",{},smalltalk.ReferencesBrowser)})},
  5758. args: [],
  5759. source: "senders\x0a\x09^ senders ifNil: [ senders := Array new ]",
  5760. messageSends: ["ifNil:", "new"],
  5761. referencedClasses: ["Array"]
  5762. }),
  5763. smalltalk.ReferencesBrowser);
  5764. smalltalk.addMethod(
  5765. smalltalk.method({
  5766. selector: "setInputEvents",
  5767. protocol: 'private',
  5768. fn: function (){
  5769. var self=this;
  5770. return smalltalk.withContext(function($ctx1) {
  5771. var $1,$3,$2;
  5772. $1=self["@input"];
  5773. _st($1)._onKeyUp_((function(){
  5774. return smalltalk.withContext(function($ctx2) {
  5775. self["@timer"]=_st((function(){
  5776. return smalltalk.withContext(function($ctx3) {
  5777. return self._search_(_st(_st(self["@input"])._asJQuery())._val());
  5778. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}))._valueWithTimeout_((100));
  5779. return self["@timer"];
  5780. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  5781. $2=_st($1)._onKeyDown_((function(){
  5782. return smalltalk.withContext(function($ctx2) {
  5783. $3=self["@timer"];
  5784. if(($receiver = $3) == nil || $receiver == null){
  5785. return $3;
  5786. } else {
  5787. return _st(self["@timer"])._clearTimeout();
  5788. };
  5789. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  5790. return self}, function($ctx1) {$ctx1.fill(self,"setInputEvents",{},smalltalk.ReferencesBrowser)})},
  5791. args: [],
  5792. source: "setInputEvents\x0a\x09input\x0a\x09\x09onKeyUp: [ timer := [ self search: input asJQuery val ] valueWithTimeout: 100 ];\x0a\x09\x09onKeyDown: [ timer ifNotNil: [ timer clearTimeout ]]",
  5793. messageSends: ["onKeyUp:", "valueWithTimeout:", "search:", "val", "asJQuery", "onKeyDown:", "ifNotNil:", "clearTimeout"],
  5794. referencedClasses: []
  5795. }),
  5796. smalltalk.ReferencesBrowser);
  5797. smalltalk.addMethod(
  5798. smalltalk.method({
  5799. selector: "updateImplementorsList",
  5800. protocol: 'updating',
  5801. fn: function (){
  5802. var self=this;
  5803. return smalltalk.withContext(function($ctx1) {
  5804. var $1,$2,$7,$6,$5,$4,$3,$8,$9,$10,$11,$12;
  5805. _st(self["@implementorsList"])._contents_((function(html){
  5806. return smalltalk.withContext(function($ctx2) {
  5807. $1=_st(html)._li();
  5808. $ctx2.sendIdx["li"]=1;
  5809. _st($1)._class_("column_label");
  5810. $2=$1;
  5811. $7=self._implementors();
  5812. $ctx2.sendIdx["implementors"]=1;
  5813. $6=_st($7)._size();
  5814. $5=_st($6)._asString();
  5815. $ctx2.sendIdx["asString"]=1;
  5816. $4="Implementors (".__comma($5);
  5817. $ctx2.sendIdx[","]=2;
  5818. $3=_st($4).__comma(")");
  5819. $ctx2.sendIdx[","]=1;
  5820. _st($2)._with_($3);
  5821. $ctx2.sendIdx["with:"]=1;
  5822. $8=_st($1)._style_("font-weight: bold");
  5823. $8;
  5824. return _st(self._implementors())._do_((function(each){
  5825. var li;
  5826. return smalltalk.withContext(function($ctx3) {
  5827. li=_st(html)._li();
  5828. li;
  5829. $9=li;
  5830. $10=$9;
  5831. $11=_st(_st(_st(_st(each)._methodClass())._asString()).__comma(" >> ")).__comma(self._selector());
  5832. $ctx3.sendIdx[","]=3;
  5833. _st($10)._with_($11);
  5834. $12=_st($9)._onClick_((function(){
  5835. return smalltalk.withContext(function($ctx4) {
  5836. return self._openBrowserOn_(each);
  5837. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
  5838. return $12;
  5839. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2,2)})}));
  5840. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  5841. return self}, function($ctx1) {$ctx1.fill(self,"updateImplementorsList",{},smalltalk.ReferencesBrowser)})},
  5842. args: [],
  5843. source: "updateImplementorsList\x0a\x09implementorsList contents: [ :html |\x0a\x09html li\x0a\x09\x09class: 'column_label';\x0a\x09\x09with: 'Implementors (', self implementors size asString, ')';\x0a\x09\x09style: 'font-weight: bold'.\x0a\x09self implementors do: [ :each || li |\x0a\x09\x09li := html li.\x0a\x09\x09li\x0a\x09\x09with: (each methodClass asString, ' >> ', self selector);\x0a\x09\x09onClick: [ self openBrowserOn: each ]] ]",
  5844. messageSends: ["contents:", "class:", "li", "with:", ",", "asString", "size", "implementors", "style:", "do:", "methodClass", "selector", "onClick:", "openBrowserOn:"],
  5845. referencedClasses: []
  5846. }),
  5847. smalltalk.ReferencesBrowser);
  5848. smalltalk.addMethod(
  5849. smalltalk.method({
  5850. selector: "updateMatchesList",
  5851. protocol: 'updating',
  5852. fn: function (){
  5853. var self=this;
  5854. return smalltalk.withContext(function($ctx1) {
  5855. var $1,$2,$7,$6,$5,$4,$3,$8,$9,$10,$11,$12;
  5856. _st(self["@matchesList"])._contents_((function(html){
  5857. return smalltalk.withContext(function($ctx2) {
  5858. $1=_st(html)._li();
  5859. $ctx2.sendIdx["li"]=1;
  5860. _st($1)._class_("column_label");
  5861. $2=$1;
  5862. $7=self._matches();
  5863. $ctx2.sendIdx["matches"]=1;
  5864. $6=_st($7)._size();
  5865. $5=_st($6)._asString();
  5866. $ctx2.sendIdx["asString"]=1;
  5867. $4="Regex matches (".__comma($5);
  5868. $ctx2.sendIdx[","]=2;
  5869. $3=_st($4).__comma(")");
  5870. $ctx2.sendIdx[","]=1;
  5871. _st($2)._with_($3);
  5872. $ctx2.sendIdx["with:"]=1;
  5873. $8=_st($1)._style_("font-weight: bold");
  5874. $8;
  5875. return _st(self._matches())._do_((function(each){
  5876. var li;
  5877. return smalltalk.withContext(function($ctx3) {
  5878. li=_st(html)._li();
  5879. li;
  5880. $9=li;
  5881. $10=$9;
  5882. $11=_st(_st(_st(_st(each)._methodClass())._asString()).__comma(" >> ")).__comma(_st(each)._selector());
  5883. $ctx3.sendIdx[","]=3;
  5884. _st($10)._with_($11);
  5885. $12=_st($9)._onClick_((function(){
  5886. return smalltalk.withContext(function($ctx4) {
  5887. return self._openBrowserOn_(each);
  5888. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
  5889. return $12;
  5890. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2,2)})}));
  5891. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  5892. return self}, function($ctx1) {$ctx1.fill(self,"updateMatchesList",{},smalltalk.ReferencesBrowser)})},
  5893. args: [],
  5894. source: "updateMatchesList\x0a\x09matchesList contents: [ :html |\x0a\x09html li\x0a\x09\x09class: 'column_label';\x0a\x09\x09with: 'Regex matches (', self matches size asString, ')';\x0a\x09\x09style: 'font-weight: bold'.\x0a\x09self matches do: [ :each || li |\x0a\x09\x09li := html li.\x0a\x09\x09li\x0a\x09\x09with: (each methodClass asString, ' >> ', each selector);\x0a\x09\x09onClick: [ self openBrowserOn: each ]] ]",
  5895. messageSends: ["contents:", "class:", "li", "with:", ",", "asString", "size", "matches", "style:", "do:", "methodClass", "selector", "onClick:", "openBrowserOn:"],
  5896. referencedClasses: []
  5897. }),
  5898. smalltalk.ReferencesBrowser);
  5899. smalltalk.addMethod(
  5900. smalltalk.method({
  5901. selector: "updateReferencedClassesList",
  5902. protocol: 'updating',
  5903. fn: function (){
  5904. var self=this;
  5905. return smalltalk.withContext(function($ctx1) {
  5906. var $1,$2,$7,$6,$5,$4,$3,$8,$9,$10,$11,$12;
  5907. _st(self["@referencedClassesList"])._contents_((function(html){
  5908. return smalltalk.withContext(function($ctx2) {
  5909. $1=_st(html)._li();
  5910. $ctx2.sendIdx["li"]=1;
  5911. _st($1)._class_("column_label");
  5912. $2=$1;
  5913. $7=self._referencedClasses();
  5914. $ctx2.sendIdx["referencedClasses"]=1;
  5915. $6=_st($7)._size();
  5916. $5=_st($6)._asString();
  5917. $ctx2.sendIdx["asString"]=1;
  5918. $4="Class references (".__comma($5);
  5919. $ctx2.sendIdx[","]=2;
  5920. $3=_st($4).__comma(")");
  5921. $ctx2.sendIdx[","]=1;
  5922. _st($2)._with_($3);
  5923. $ctx2.sendIdx["with:"]=1;
  5924. $8=_st($1)._style_("font-weight: bold");
  5925. $8;
  5926. return _st(self._referencedClasses())._do_((function(each){
  5927. return smalltalk.withContext(function($ctx3) {
  5928. $9=_st(html)._li();
  5929. $10=$9;
  5930. $11=_st(_st(_st(_st(each)._methodClass())._asString()).__comma(" >> ")).__comma(_st(each)._selector());
  5931. $ctx3.sendIdx[","]=3;
  5932. _st($10)._with_($11);
  5933. $12=_st($9)._onClick_((function(){
  5934. return smalltalk.withContext(function($ctx4) {
  5935. return self._openBrowserOn_(each);
  5936. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
  5937. return $12;
  5938. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  5939. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  5940. return self}, function($ctx1) {$ctx1.fill(self,"updateReferencedClassesList",{},smalltalk.ReferencesBrowser)})},
  5941. args: [],
  5942. 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 ]] ]",
  5943. messageSends: ["contents:", "class:", "li", "with:", ",", "asString", "size", "referencedClasses", "style:", "do:", "methodClass", "selector", "onClick:", "openBrowserOn:"],
  5944. referencedClasses: []
  5945. }),
  5946. smalltalk.ReferencesBrowser);
  5947. smalltalk.addMethod(
  5948. smalltalk.method({
  5949. selector: "updateSendersList",
  5950. protocol: 'updating',
  5951. fn: function (){
  5952. var self=this;
  5953. return smalltalk.withContext(function($ctx1) {
  5954. var $1,$2,$7,$6,$5,$4,$3,$8,$9,$10,$11,$12;
  5955. _st(self["@sendersList"])._contents_((function(html){
  5956. return smalltalk.withContext(function($ctx2) {
  5957. $1=_st(html)._li();
  5958. $ctx2.sendIdx["li"]=1;
  5959. _st($1)._class_("column_label");
  5960. $2=$1;
  5961. $7=self._senders();
  5962. $ctx2.sendIdx["senders"]=1;
  5963. $6=_st($7)._size();
  5964. $5=_st($6)._asString();
  5965. $ctx2.sendIdx["asString"]=1;
  5966. $4="Senders (".__comma($5);
  5967. $ctx2.sendIdx[","]=2;
  5968. $3=_st($4).__comma(")");
  5969. $ctx2.sendIdx[","]=1;
  5970. _st($2)._with_($3);
  5971. $ctx2.sendIdx["with:"]=1;
  5972. $8=_st($1)._style_("font-weight: bold");
  5973. $8;
  5974. return _st(self._senders())._do_((function(each){
  5975. return smalltalk.withContext(function($ctx3) {
  5976. $9=_st(html)._li();
  5977. $10=$9;
  5978. $11=_st(_st(_st(_st(each)._methodClass())._asString()).__comma(" >> ")).__comma(_st(each)._selector());
  5979. $ctx3.sendIdx[","]=3;
  5980. _st($10)._with_($11);
  5981. $12=_st($9)._onClick_((function(){
  5982. return smalltalk.withContext(function($ctx4) {
  5983. return self._openBrowserOn_(each);
  5984. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
  5985. return $12;
  5986. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  5987. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  5988. return self}, function($ctx1) {$ctx1.fill(self,"updateSendersList",{},smalltalk.ReferencesBrowser)})},
  5989. args: [],
  5990. 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 ]] ]",
  5991. messageSends: ["contents:", "class:", "li", "with:", ",", "asString", "size", "senders", "style:", "do:", "methodClass", "selector", "onClick:", "openBrowserOn:"],
  5992. referencedClasses: []
  5993. }),
  5994. smalltalk.ReferencesBrowser);
  5995. smalltalk.addMethod(
  5996. smalltalk.method({
  5997. selector: "search:",
  5998. protocol: 'instance creation',
  5999. fn: function (aString){
  6000. var self=this;
  6001. return smalltalk.withContext(function($ctx1) {
  6002. var $2,$3,$1;
  6003. $2=self._new();
  6004. _st($2)._searchReferencesFor_(aString);
  6005. $3=_st($2)._open();
  6006. $1=$3;
  6007. return $1;
  6008. }, function($ctx1) {$ctx1.fill(self,"search:",{aString:aString},smalltalk.ReferencesBrowser.klass)})},
  6009. args: ["aString"],
  6010. source: "search: aString\x0a\x09^ self new\x0a\x09\x09searchReferencesFor: aString;\x0a\x09\x09open",
  6011. messageSends: ["searchReferencesFor:", "new", "open"],
  6012. referencedClasses: []
  6013. }),
  6014. smalltalk.ReferencesBrowser.klass);
  6015. smalltalk.addClass('TestRunner', smalltalk.TabWidget, ['selectedCategories', 'packagesList', 'selectedClasses', 'classesList', 'selectedMethods', 'progressBar', 'methodsList', 'result', 'statusDiv'], 'IDE');
  6016. smalltalk.addMethod(
  6017. smalltalk.method({
  6018. selector: "allClasses",
  6019. protocol: 'accessing',
  6020. fn: function (){
  6021. var self=this;
  6022. function $TestCase(){return smalltalk.TestCase||(typeof TestCase=="undefined"?nil:TestCase)}
  6023. return smalltalk.withContext(function($ctx1) {
  6024. var $1;
  6025. $1=_st(_st($TestCase())._allSubclasses())._select_((function(each){
  6026. return smalltalk.withContext(function($ctx2) {
  6027. return _st(_st(each)._isAbstract())._not();
  6028. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  6029. return $1;
  6030. }, function($ctx1) {$ctx1.fill(self,"allClasses",{},smalltalk.TestRunner)})},
  6031. args: [],
  6032. source: "allClasses\x0a\x09^ TestCase allSubclasses select: [ :each | each isAbstract not ]",
  6033. messageSends: ["select:", "allSubclasses", "not", "isAbstract"],
  6034. referencedClasses: ["TestCase"]
  6035. }),
  6036. smalltalk.TestRunner);
  6037. smalltalk.addMethod(
  6038. smalltalk.method({
  6039. selector: "classes",
  6040. protocol: 'accessing',
  6041. fn: function (){
  6042. var self=this;
  6043. return smalltalk.withContext(function($ctx1) {
  6044. var $2,$1;
  6045. $1=_st(_st(self._allClasses())._select_((function(each){
  6046. return smalltalk.withContext(function($ctx2) {
  6047. return _st(self._selectedCategories())._includes_(_st(each)._category());
  6048. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._sort_((function(a,b){
  6049. return smalltalk.withContext(function($ctx2) {
  6050. $2=_st(a)._name();
  6051. $ctx2.sendIdx["name"]=1;
  6052. return _st($2).__gt(_st(b)._name());
  6053. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,2)})}));
  6054. return $1;
  6055. }, function($ctx1) {$ctx1.fill(self,"classes",{},smalltalk.TestRunner)})},
  6056. args: [],
  6057. source: "classes\x0a\x09^ (self allClasses\x0a\x09select: [ :each | self selectedCategories includes: each category ])\x0a\x09sort: [ :a :b | a name > b name ]",
  6058. messageSends: ["sort:", "select:", "allClasses", "includes:", "selectedCategories", "category", ">", "name"],
  6059. referencedClasses: []
  6060. }),
  6061. smalltalk.TestRunner);
  6062. smalltalk.addMethod(
  6063. smalltalk.method({
  6064. selector: "initialize",
  6065. protocol: 'initialization',
  6066. fn: function (){
  6067. var self=this;
  6068. function $TestResult(){return smalltalk.TestResult||(typeof TestResult=="undefined"?nil:TestResult)}
  6069. return smalltalk.withContext(function($ctx1) {
  6070. smalltalk.TestRunner.superclass.fn.prototype._initialize.apply(_st(self), []);
  6071. self["@result"]=_st($TestResult())._new();
  6072. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.TestRunner)})},
  6073. args: [],
  6074. source: "initialize\x0a\x09super initialize.\x0a\x09result := TestResult new",
  6075. messageSends: ["initialize", "new"],
  6076. referencedClasses: ["TestResult"]
  6077. }),
  6078. smalltalk.TestRunner);
  6079. smalltalk.addMethod(
  6080. smalltalk.method({
  6081. selector: "isSelectedCategory:",
  6082. protocol: 'testing',
  6083. fn: function (aCategory){
  6084. var self=this;
  6085. return smalltalk.withContext(function($ctx1) {
  6086. var $1;
  6087. $1=_st(self._selectedCategories())._includes_(aCategory);
  6088. return $1;
  6089. }, function($ctx1) {$ctx1.fill(self,"isSelectedCategory:",{aCategory:aCategory},smalltalk.TestRunner)})},
  6090. args: ["aCategory"],
  6091. source: "isSelectedCategory: aCategory\x0a\x09^ (self selectedCategories includes: aCategory)",
  6092. messageSends: ["includes:", "selectedCategories"],
  6093. referencedClasses: []
  6094. }),
  6095. smalltalk.TestRunner);
  6096. smalltalk.addMethod(
  6097. smalltalk.method({
  6098. selector: "isSelectedClass:",
  6099. protocol: 'testing',
  6100. fn: function (aClass){
  6101. var self=this;
  6102. return smalltalk.withContext(function($ctx1) {
  6103. var $1;
  6104. $1=_st(self._selectedClasses())._includes_(aClass);
  6105. return $1;
  6106. }, function($ctx1) {$ctx1.fill(self,"isSelectedClass:",{aClass:aClass},smalltalk.TestRunner)})},
  6107. args: ["aClass"],
  6108. source: "isSelectedClass: aClass\x0a\x09^ (self selectedClasses includes: aClass)",
  6109. messageSends: ["includes:", "selectedClasses"],
  6110. referencedClasses: []
  6111. }),
  6112. smalltalk.TestRunner);
  6113. smalltalk.addMethod(
  6114. smalltalk.method({
  6115. selector: "label",
  6116. protocol: 'accessing',
  6117. fn: function (){
  6118. var self=this;
  6119. return smalltalk.withContext(function($ctx1) {
  6120. return "SUnit";
  6121. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.TestRunner)})},
  6122. args: [],
  6123. source: "label\x0a\x09^ 'SUnit'",
  6124. messageSends: [],
  6125. referencedClasses: []
  6126. }),
  6127. smalltalk.TestRunner);
  6128. smalltalk.addMethod(
  6129. smalltalk.method({
  6130. selector: "packages",
  6131. protocol: 'accessing',
  6132. fn: function (){
  6133. var self=this;
  6134. var packages;
  6135. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  6136. return smalltalk.withContext(function($ctx1) {
  6137. var $2,$3,$1,$4;
  6138. packages=_st($Array())._new();
  6139. _st(self._allClasses())._do_((function(each){
  6140. return smalltalk.withContext(function($ctx2) {
  6141. $2=packages;
  6142. $3=_st(each)._category();
  6143. $ctx2.sendIdx["category"]=1;
  6144. $1=_st($2)._includes_($3);
  6145. if(! smalltalk.assert($1)){
  6146. return _st(packages)._add_(_st(each)._category());
  6147. };
  6148. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  6149. $4=_st(packages)._sort();
  6150. return $4;
  6151. }, function($ctx1) {$ctx1.fill(self,"packages",{packages:packages},smalltalk.TestRunner)})},
  6152. args: [],
  6153. source: "packages\x0a\x09| packages |\x0a\x09packages := Array new.\x0a\x09self allClasses do: [ :each |\x0a\x09(packages includes: each category) ifFalse: [\x0a\x09\x09packages add: each category ]].\x0a\x09^ packages sort",
  6154. messageSends: ["new", "do:", "allClasses", "ifFalse:", "includes:", "category", "add:", "sort"],
  6155. referencedClasses: ["Array"]
  6156. }),
  6157. smalltalk.TestRunner);
  6158. smalltalk.addMethod(
  6159. smalltalk.method({
  6160. selector: "performFailure:",
  6161. protocol: 'actions',
  6162. fn: function (aTestCase){
  6163. var self=this;
  6164. return smalltalk.withContext(function($ctx1) {
  6165. _st(aTestCase)._runCase();
  6166. return self}, function($ctx1) {$ctx1.fill(self,"performFailure:",{aTestCase:aTestCase},smalltalk.TestRunner)})},
  6167. args: ["aTestCase"],
  6168. source: "performFailure: aTestCase\x0a\x09aTestCase runCase",
  6169. messageSends: ["runCase"],
  6170. referencedClasses: []
  6171. }),
  6172. smalltalk.TestRunner);
  6173. smalltalk.addMethod(
  6174. smalltalk.method({
  6175. selector: "printErrors",
  6176. protocol: 'printing',
  6177. fn: function (){
  6178. var self=this;
  6179. return smalltalk.withContext(function($ctx1) {
  6180. var $1;
  6181. $1=_st(_st(_st(_st(self._result())._errors())._size())._asString()).__comma(" errors, ");
  6182. return $1;
  6183. }, function($ctx1) {$ctx1.fill(self,"printErrors",{},smalltalk.TestRunner)})},
  6184. args: [],
  6185. source: "printErrors\x0a\x09^ self result errors size asString , ' errors, '",
  6186. messageSends: [",", "asString", "size", "errors", "result"],
  6187. referencedClasses: []
  6188. }),
  6189. smalltalk.TestRunner);
  6190. smalltalk.addMethod(
  6191. smalltalk.method({
  6192. selector: "printFailures",
  6193. protocol: 'printing',
  6194. fn: function (){
  6195. var self=this;
  6196. return smalltalk.withContext(function($ctx1) {
  6197. var $1;
  6198. $1=_st(_st(_st(_st(self._result())._failures())._size())._asString()).__comma(" failures");
  6199. return $1;
  6200. }, function($ctx1) {$ctx1.fill(self,"printFailures",{},smalltalk.TestRunner)})},
  6201. args: [],
  6202. source: "printFailures\x0a\x09^ self result failures size asString, ' failures'",
  6203. messageSends: [",", "asString", "size", "failures", "result"],
  6204. referencedClasses: []
  6205. }),
  6206. smalltalk.TestRunner);
  6207. smalltalk.addMethod(
  6208. smalltalk.method({
  6209. selector: "printPasses",
  6210. protocol: 'printing',
  6211. fn: function (){
  6212. var self=this;
  6213. return smalltalk.withContext(function($ctx1) {
  6214. var $6,$5,$9,$8,$7,$4,$3,$2,$1;
  6215. $6=self._result();
  6216. $ctx1.sendIdx["result"]=1;
  6217. $5=_st($6)._runs();
  6218. $9=self._result();
  6219. $ctx1.sendIdx["result"]=2;
  6220. $8=_st($9)._errors();
  6221. $7=_st($8)._size();
  6222. $ctx1.sendIdx["size"]=1;
  6223. $4=_st($5).__minus($7);
  6224. $3=_st($4).__minus(_st(_st(self._result())._failures())._size());
  6225. $ctx1.sendIdx["-"]=1;
  6226. $2=_st($3)._asString();
  6227. $1=_st($2).__comma(" passes, ");
  6228. return $1;
  6229. }, function($ctx1) {$ctx1.fill(self,"printPasses",{},smalltalk.TestRunner)})},
  6230. args: [],
  6231. source: "printPasses\x0a\x09^ (self result runs - self result errors size - self result failures size) asString , ' passes, '",
  6232. messageSends: [",", "asString", "-", "runs", "result", "size", "errors", "failures"],
  6233. referencedClasses: []
  6234. }),
  6235. smalltalk.TestRunner);
  6236. smalltalk.addMethod(
  6237. smalltalk.method({
  6238. selector: "printTotal",
  6239. protocol: 'printing',
  6240. fn: function (){
  6241. var self=this;
  6242. return smalltalk.withContext(function($ctx1) {
  6243. var $1;
  6244. $1=_st(_st(_st(self._result())._total())._asString()).__comma(" runs, ");
  6245. return $1;
  6246. }, function($ctx1) {$ctx1.fill(self,"printTotal",{},smalltalk.TestRunner)})},
  6247. args: [],
  6248. source: "printTotal\x0a\x09^ self result total asString, ' runs, '",
  6249. messageSends: [",", "asString", "total", "result"],
  6250. referencedClasses: []
  6251. }),
  6252. smalltalk.TestRunner);
  6253. smalltalk.addMethod(
  6254. smalltalk.method({
  6255. selector: "progressBar",
  6256. protocol: 'accessing',
  6257. fn: function (){
  6258. var self=this;
  6259. function $ProgressBar(){return smalltalk.ProgressBar||(typeof ProgressBar=="undefined"?nil:ProgressBar)}
  6260. return smalltalk.withContext(function($ctx1) {
  6261. var $2,$1;
  6262. $2=self["@progressBar"];
  6263. if(($receiver = $2) == nil || $receiver == null){
  6264. self["@progressBar"]=_st($ProgressBar())._new();
  6265. $1=self["@progressBar"];
  6266. } else {
  6267. $1=$2;
  6268. };
  6269. return $1;
  6270. }, function($ctx1) {$ctx1.fill(self,"progressBar",{},smalltalk.TestRunner)})},
  6271. args: [],
  6272. source: "progressBar\x0a\x09^ progressBar ifNil: [ progressBar := ProgressBar new ]",
  6273. messageSends: ["ifNil:", "new"],
  6274. referencedClasses: ["ProgressBar"]
  6275. }),
  6276. smalltalk.TestRunner);
  6277. smalltalk.addMethod(
  6278. smalltalk.method({
  6279. selector: "renderBoxOn:",
  6280. protocol: 'rendering',
  6281. fn: function (html){
  6282. var self=this;
  6283. return smalltalk.withContext(function($ctx1) {
  6284. var $1;
  6285. self._renderCategoriesOn_(html);
  6286. self._renderClassesOn_(html);
  6287. $1=self._renderResultsOn_(html);
  6288. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.TestRunner)})},
  6289. args: ["html"],
  6290. source: "renderBoxOn: html\x0a\x09self\x0a\x09renderCategoriesOn: html;\x0a\x09renderClassesOn: html;\x0a\x09renderResultsOn: html",
  6291. messageSends: ["renderCategoriesOn:", "renderClassesOn:", "renderResultsOn:"],
  6292. referencedClasses: []
  6293. }),
  6294. smalltalk.TestRunner);
  6295. smalltalk.addMethod(
  6296. smalltalk.method({
  6297. selector: "renderButtonsOn:",
  6298. protocol: 'rendering',
  6299. fn: function (html){
  6300. var self=this;
  6301. return smalltalk.withContext(function($ctx1) {
  6302. var $1,$2;
  6303. $1=_st(html)._button();
  6304. _st($1)._with_("Run selected");
  6305. $2=_st($1)._onClick_((function(){
  6306. return smalltalk.withContext(function($ctx2) {
  6307. return self._run_(self._testCases());
  6308. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  6309. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.TestRunner)})},
  6310. args: ["html"],
  6311. source: "renderButtonsOn: html\x0a\x09html button\x0a\x09with: 'Run selected';\x0a\x09onClick: [ self run: self testCases ]",
  6312. messageSends: ["with:", "button", "onClick:", "run:", "testCases"],
  6313. referencedClasses: []
  6314. }),
  6315. smalltalk.TestRunner);
  6316. smalltalk.addMethod(
  6317. smalltalk.method({
  6318. selector: "renderCategoriesOn:",
  6319. protocol: 'rendering',
  6320. fn: function (html){
  6321. var self=this;
  6322. return smalltalk.withContext(function($ctx1) {
  6323. self["@packagesList"]=_st(_st(html)._ul())._class_("amber_column sunit packages");
  6324. self._updateCategoriesList();
  6325. return self}, function($ctx1) {$ctx1.fill(self,"renderCategoriesOn:",{html:html},smalltalk.TestRunner)})},
  6326. args: ["html"],
  6327. source: "renderCategoriesOn: html\x0a\x09packagesList := html ul class: 'amber_column sunit packages'.\x0a\x09self updateCategoriesList",
  6328. messageSends: ["class:", "ul", "updateCategoriesList"],
  6329. referencedClasses: []
  6330. }),
  6331. smalltalk.TestRunner);
  6332. smalltalk.addMethod(
  6333. smalltalk.method({
  6334. selector: "renderClassesOn:",
  6335. protocol: 'rendering',
  6336. fn: function (html){
  6337. var self=this;
  6338. return smalltalk.withContext(function($ctx1) {
  6339. self["@classesList"]=_st(_st(html)._ul())._class_("amber_column sunit classes");
  6340. self._updateClassesList();
  6341. return self}, function($ctx1) {$ctx1.fill(self,"renderClassesOn:",{html:html},smalltalk.TestRunner)})},
  6342. args: ["html"],
  6343. source: "renderClassesOn: html\x0a\x09classesList := html ul class: 'amber_column sunit classes'.\x0a\x09self updateClassesList",
  6344. messageSends: ["class:", "ul", "updateClassesList"],
  6345. referencedClasses: []
  6346. }),
  6347. smalltalk.TestRunner);
  6348. smalltalk.addMethod(
  6349. smalltalk.method({
  6350. selector: "renderErrorsOn:",
  6351. protocol: 'rendering',
  6352. fn: function (html){
  6353. var self=this;
  6354. return smalltalk.withContext(function($ctx1) {
  6355. var $1,$2,$3,$4;
  6356. _st(_st(self._result())._errors())._do_((function(each){
  6357. return smalltalk.withContext(function($ctx2) {
  6358. $1=_st(html)._li();
  6359. _st($1)._class_("errors");
  6360. $2=$1;
  6361. $3=_st(_st(_st(_st(each)._class())._name()).__comma(" >> ")).__comma(_st(each)._selector());
  6362. $ctx2.sendIdx[","]=1;
  6363. _st($2)._with_($3);
  6364. $4=_st($1)._onClick_((function(){
  6365. return smalltalk.withContext(function($ctx3) {
  6366. return self._performFailure_(each);
  6367. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  6368. return $4;
  6369. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  6370. return self}, function($ctx1) {$ctx1.fill(self,"renderErrorsOn:",{html:html},smalltalk.TestRunner)})},
  6371. args: ["html"],
  6372. source: "renderErrorsOn: html\x0a\x09self result errors do: [ :each |\x0a\x09\x09html li\x0a\x09\x09\x09class: 'errors';\x0a\x09\x09\x09with: each class name, ' >> ', each selector;\x0a\x09\x09\x09\x09\x09\x09onClick: [ self performFailure: each ]]",
  6373. messageSends: ["do:", "errors", "result", "class:", "li", "with:", ",", "name", "class", "selector", "onClick:", "performFailure:"],
  6374. referencedClasses: []
  6375. }),
  6376. smalltalk.TestRunner);
  6377. smalltalk.addMethod(
  6378. smalltalk.method({
  6379. selector: "renderFailuresOn:",
  6380. protocol: 'rendering',
  6381. fn: function (html){
  6382. var self=this;
  6383. return smalltalk.withContext(function($ctx1) {
  6384. var $1,$2,$3,$4;
  6385. _st(_st(self._result())._failures())._do_((function(each){
  6386. return smalltalk.withContext(function($ctx2) {
  6387. $1=_st(html)._li();
  6388. _st($1)._class_("failures");
  6389. $2=$1;
  6390. $3=_st(_st(_st(_st(each)._class())._name()).__comma(" >> ")).__comma(_st(each)._selector());
  6391. $ctx2.sendIdx[","]=1;
  6392. _st($2)._with_($3);
  6393. $4=_st($1)._onClick_((function(){
  6394. return smalltalk.withContext(function($ctx3) {
  6395. return self._performFailure_(each);
  6396. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  6397. return $4;
  6398. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  6399. return self}, function($ctx1) {$ctx1.fill(self,"renderFailuresOn:",{html:html},smalltalk.TestRunner)})},
  6400. args: ["html"],
  6401. source: "renderFailuresOn: html\x0a\x09self result failures do: [ :each |\x0a\x09\x09html li\x0a\x09\x09\x09class: 'failures';\x0a\x09\x09\x09with: each class name, ' >> ', each selector;\x0a\x09\x09\x09\x09\x09\x09onClick: [ self performFailure: each ]]",
  6402. messageSends: ["do:", "failures", "result", "class:", "li", "with:", ",", "name", "class", "selector", "onClick:", "performFailure:"],
  6403. referencedClasses: []
  6404. }),
  6405. smalltalk.TestRunner);
  6406. smalltalk.addMethod(
  6407. smalltalk.method({
  6408. selector: "renderResultsOn:",
  6409. protocol: 'rendering',
  6410. fn: function (html){
  6411. var self=this;
  6412. return smalltalk.withContext(function($ctx1) {
  6413. self["@statusDiv"]=_st(html)._div();
  6414. _st(html)._with_(self._progressBar());
  6415. self["@methodsList"]=_st(_st(html)._ul())._class_("amber_column sunit results");
  6416. self._updateMethodsList();
  6417. self._updateStatusDiv();
  6418. return self}, function($ctx1) {$ctx1.fill(self,"renderResultsOn:",{html:html},smalltalk.TestRunner)})},
  6419. args: ["html"],
  6420. 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",
  6421. messageSends: ["div", "with:", "progressBar", "class:", "ul", "updateMethodsList", "updateStatusDiv"],
  6422. referencedClasses: []
  6423. }),
  6424. smalltalk.TestRunner);
  6425. smalltalk.addMethod(
  6426. smalltalk.method({
  6427. selector: "result",
  6428. protocol: 'accessing',
  6429. fn: function (){
  6430. var self=this;
  6431. return smalltalk.withContext(function($ctx1) {
  6432. var $1;
  6433. $1=self["@result"];
  6434. return $1;
  6435. }, function($ctx1) {$ctx1.fill(self,"result",{},smalltalk.TestRunner)})},
  6436. args: [],
  6437. source: "result\x0a\x09^ result",
  6438. messageSends: [],
  6439. referencedClasses: []
  6440. }),
  6441. smalltalk.TestRunner);
  6442. smalltalk.addMethod(
  6443. smalltalk.method({
  6444. selector: "run:",
  6445. protocol: 'actions',
  6446. fn: function (aCollection){
  6447. var self=this;
  6448. var worker;
  6449. function $TestSuiteRunner(){return smalltalk.TestSuiteRunner||(typeof TestSuiteRunner=="undefined"?nil:TestSuiteRunner)}
  6450. function $ResultAnnouncement(){return smalltalk.ResultAnnouncement||(typeof ResultAnnouncement=="undefined"?nil:ResultAnnouncement)}
  6451. return smalltalk.withContext(function($ctx1) {
  6452. var $1;
  6453. worker=_st($TestSuiteRunner())._on_(aCollection);
  6454. self["@result"]=_st(worker)._result();
  6455. $ctx1.sendIdx["result"]=1;
  6456. _st(_st(worker)._announcer())._on_do_($ResultAnnouncement(),(function(ann){
  6457. return smalltalk.withContext(function($ctx2) {
  6458. $1=_st(_st(ann)._result()).__eq_eq(self["@result"]);
  6459. if(smalltalk.assert($1)){
  6460. _st(self._progressBar())._updatePercent_(_st(_st(_st(self["@result"])._runs()).__slash(_st(self["@result"])._total())).__star((100)));
  6461. self._updateStatusDiv();
  6462. return self._updateMethodsList();
  6463. };
  6464. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1,1)})}));
  6465. _st(worker)._run();
  6466. return self}, function($ctx1) {$ctx1.fill(self,"run:",{aCollection:aCollection,worker:worker},smalltalk.TestRunner)})},
  6467. args: ["aCollection"],
  6468. source: "run: aCollection\x0a| worker |\x0a\x09worker := TestSuiteRunner on: aCollection.\x0a\x09result := worker result.\x0a\x09worker announcer on: ResultAnnouncement do: [ :ann |\x0a\x09\x09ann result == result ifTrue: [\x0a\x09\x09\x09self progressBar updatePercent: result runs / result total * 100.\x0a\x09\x09\x09self updateStatusDiv.\x0a\x09\x09\x09self updateMethodsList\x0a\x09\x09]\x0a\x09].\x0a\x09worker run",
  6469. messageSends: ["on:", "result", "on:do:", "announcer", "ifTrue:", "==", "updatePercent:", "progressBar", "*", "/", "runs", "total", "updateStatusDiv", "updateMethodsList", "run"],
  6470. referencedClasses: ["TestSuiteRunner", "ResultAnnouncement"]
  6471. }),
  6472. smalltalk.TestRunner);
  6473. smalltalk.addMethod(
  6474. smalltalk.method({
  6475. selector: "selectAllCategories",
  6476. protocol: 'actions',
  6477. fn: function (){
  6478. var self=this;
  6479. return smalltalk.withContext(function($ctx1) {
  6480. var $1,$2;
  6481. _st(self._packages())._do_((function(each){
  6482. return smalltalk.withContext(function($ctx2) {
  6483. $1=_st(self["@selectedCategories"])._includes_(each);
  6484. if(! smalltalk.assert($1)){
  6485. return _st(self._selectedCategories())._add_(each);
  6486. };
  6487. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  6488. self._updateCategoriesList();
  6489. $2=self._updateClassesList();
  6490. return self}, function($ctx1) {$ctx1.fill(self,"selectAllCategories",{},smalltalk.TestRunner)})},
  6491. args: [],
  6492. source: "selectAllCategories\x0a\x09self packages do: [ :each |\x0a\x09\x09(selectedCategories includes: each) ifFalse: [\x0a\x09\x09\x09self selectedCategories add: each ]].\x0a\x09self\x0a\x09\x09updateCategoriesList;\x0a\x09\x09updateClassesList",
  6493. messageSends: ["do:", "packages", "ifFalse:", "includes:", "add:", "selectedCategories", "updateCategoriesList", "updateClassesList"],
  6494. referencedClasses: []
  6495. }),
  6496. smalltalk.TestRunner);
  6497. smalltalk.addMethod(
  6498. smalltalk.method({
  6499. selector: "selectAllClasses",
  6500. protocol: 'actions',
  6501. fn: function (){
  6502. var self=this;
  6503. return smalltalk.withContext(function($ctx1) {
  6504. var $1,$2;
  6505. _st(self._classes())._do_((function(each){
  6506. return smalltalk.withContext(function($ctx2) {
  6507. $1=_st(self["@selectedClasses"])._includes_(each);
  6508. if(! smalltalk.assert($1)){
  6509. return _st(self._selectedClasses())._add_(each);
  6510. };
  6511. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  6512. self._updateCategoriesList();
  6513. $2=self._updateClassesList();
  6514. return self}, function($ctx1) {$ctx1.fill(self,"selectAllClasses",{},smalltalk.TestRunner)})},
  6515. args: [],
  6516. source: "selectAllClasses\x0a\x09self classes do: [ :each |\x0a\x09\x09(selectedClasses includes: each) ifFalse: [\x0a\x09\x09\x09self selectedClasses add: each ]].\x0a\x09self\x0a\x09\x09updateCategoriesList;\x0a\x09\x09updateClassesList",
  6517. messageSends: ["do:", "classes", "ifFalse:", "includes:", "add:", "selectedClasses", "updateCategoriesList", "updateClassesList"],
  6518. referencedClasses: []
  6519. }),
  6520. smalltalk.TestRunner);
  6521. smalltalk.addMethod(
  6522. smalltalk.method({
  6523. selector: "selectedCategories",
  6524. protocol: 'accessing',
  6525. fn: function (){
  6526. var self=this;
  6527. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  6528. return smalltalk.withContext(function($ctx1) {
  6529. var $2,$1;
  6530. $2=self["@selectedCategories"];
  6531. if(($receiver = $2) == nil || $receiver == null){
  6532. self["@selectedCategories"]=_st($Array())._new();
  6533. $1=self["@selectedCategories"];
  6534. } else {
  6535. $1=$2;
  6536. };
  6537. return $1;
  6538. }, function($ctx1) {$ctx1.fill(self,"selectedCategories",{},smalltalk.TestRunner)})},
  6539. args: [],
  6540. source: "selectedCategories\x0a\x09^ selectedCategories ifNil: [ selectedCategories := Array new ]",
  6541. messageSends: ["ifNil:", "new"],
  6542. referencedClasses: ["Array"]
  6543. }),
  6544. smalltalk.TestRunner);
  6545. smalltalk.addMethod(
  6546. smalltalk.method({
  6547. selector: "selectedClasses",
  6548. protocol: 'accessing',
  6549. fn: function (){
  6550. var self=this;
  6551. function $Array(){return smalltalk.Array||(typeof Array=="undefined"?nil:Array)}
  6552. return smalltalk.withContext(function($ctx1) {
  6553. var $2,$1;
  6554. $2=self["@selectedClasses"];
  6555. if(($receiver = $2) == nil || $receiver == null){
  6556. self["@selectedClasses"]=_st($Array())._new();
  6557. $1=self["@selectedClasses"];
  6558. } else {
  6559. $1=$2;
  6560. };
  6561. return $1;
  6562. }, function($ctx1) {$ctx1.fill(self,"selectedClasses",{},smalltalk.TestRunner)})},
  6563. args: [],
  6564. source: "selectedClasses\x0a\x09^ selectedClasses ifNil: [ selectedClasses := Array new ]",
  6565. messageSends: ["ifNil:", "new"],
  6566. referencedClasses: ["Array"]
  6567. }),
  6568. smalltalk.TestRunner);
  6569. smalltalk.addMethod(
  6570. smalltalk.method({
  6571. selector: "statusInfo",
  6572. protocol: 'accessing',
  6573. fn: function (){
  6574. var self=this;
  6575. return smalltalk.withContext(function($ctx1) {
  6576. var $2,$1;
  6577. $2=_st(_st(self._printTotal()).__comma(self._printPasses())).__comma(self._printErrors());
  6578. $ctx1.sendIdx[","]=2;
  6579. $1=_st($2).__comma(self._printFailures());
  6580. $ctx1.sendIdx[","]=1;
  6581. return $1;
  6582. }, function($ctx1) {$ctx1.fill(self,"statusInfo",{},smalltalk.TestRunner)})},
  6583. args: [],
  6584. source: "statusInfo\x0a\x09^ self printTotal, self printPasses, self printErrors, self printFailures",
  6585. messageSends: [",", "printTotal", "printPasses", "printErrors", "printFailures"],
  6586. referencedClasses: []
  6587. }),
  6588. smalltalk.TestRunner);
  6589. smalltalk.addMethod(
  6590. smalltalk.method({
  6591. selector: "testCases",
  6592. protocol: 'accessing',
  6593. fn: function (){
  6594. var self=this;
  6595. var testCases;
  6596. return smalltalk.withContext(function($ctx1) {
  6597. var $1;
  6598. testCases=[];
  6599. _st(_st(self._selectedClasses())._select_((function(each){
  6600. return smalltalk.withContext(function($ctx2) {
  6601. return _st(self._selectedCategories())._includes_(_st(each)._category());
  6602. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._do_((function(each){
  6603. return smalltalk.withContext(function($ctx2) {
  6604. return _st(testCases)._addAll_(_st(each)._buildSuite());
  6605. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  6606. $1=testCases;
  6607. return $1;
  6608. }, function($ctx1) {$ctx1.fill(self,"testCases",{testCases:testCases},smalltalk.TestRunner)})},
  6609. args: [],
  6610. 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",
  6611. messageSends: ["do:", "select:", "selectedClasses", "includes:", "selectedCategories", "category", "addAll:", "buildSuite"],
  6612. referencedClasses: []
  6613. }),
  6614. smalltalk.TestRunner);
  6615. smalltalk.addMethod(
  6616. smalltalk.method({
  6617. selector: "toggleCategory:",
  6618. protocol: 'actions',
  6619. fn: function (aCategory){
  6620. var self=this;
  6621. return smalltalk.withContext(function($ctx1) {
  6622. var $1,$2;
  6623. $1=self._isSelectedCategory_(aCategory);
  6624. if(smalltalk.assert($1)){
  6625. _st(self["@selectedCategories"])._remove_(aCategory);
  6626. } else {
  6627. _st(self["@selectedCategories"])._add_(aCategory);
  6628. };
  6629. self._updateCategoriesList();
  6630. $2=self._updateClassesList();
  6631. return self}, function($ctx1) {$ctx1.fill(self,"toggleCategory:",{aCategory:aCategory},smalltalk.TestRunner)})},
  6632. args: ["aCategory"],
  6633. source: "toggleCategory: aCategory\x0a\x09(self isSelectedCategory: aCategory)\x0a\x09\x09ifFalse: [ selectedCategories add: aCategory ]\x0a\x09\x09ifTrue: [ selectedCategories remove: aCategory ].\x0a\x09self\x0a\x09\x09updateCategoriesList;\x0a\x09\x09updateClassesList",
  6634. messageSends: ["ifFalse:ifTrue:", "isSelectedCategory:", "add:", "remove:", "updateCategoriesList", "updateClassesList"],
  6635. referencedClasses: []
  6636. }),
  6637. smalltalk.TestRunner);
  6638. smalltalk.addMethod(
  6639. smalltalk.method({
  6640. selector: "toggleClass:",
  6641. protocol: 'actions',
  6642. fn: function (aClass){
  6643. var self=this;
  6644. return smalltalk.withContext(function($ctx1) {
  6645. var $1;
  6646. $1=self._isSelectedClass_(aClass);
  6647. if(smalltalk.assert($1)){
  6648. _st(self["@selectedClasses"])._remove_(aClass);
  6649. } else {
  6650. _st(self["@selectedClasses"])._add_(aClass);
  6651. };
  6652. self._updateClassesList();
  6653. return self}, function($ctx1) {$ctx1.fill(self,"toggleClass:",{aClass:aClass},smalltalk.TestRunner)})},
  6654. args: ["aClass"],
  6655. source: "toggleClass: aClass\x0a\x09(self isSelectedClass: aClass)\x0a\x09\x09ifFalse: [ selectedClasses add: aClass ]\x0a\x09\x09ifTrue: [ selectedClasses remove: aClass ].\x0a\x09self\x0a\x09\x09updateClassesList",
  6656. messageSends: ["ifFalse:ifTrue:", "isSelectedClass:", "add:", "remove:", "updateClassesList"],
  6657. referencedClasses: []
  6658. }),
  6659. smalltalk.TestRunner);
  6660. smalltalk.addMethod(
  6661. smalltalk.method({
  6662. selector: "updateCategoriesList",
  6663. protocol: 'updating',
  6664. fn: function (){
  6665. var self=this;
  6666. return smalltalk.withContext(function($ctx1) {
  6667. var $1,$2,$3,$4,$5;
  6668. _st(self["@packagesList"])._contents_((function(html){
  6669. return smalltalk.withContext(function($ctx2) {
  6670. $1=_st(html)._li();
  6671. $ctx2.sendIdx["li"]=1;
  6672. _st($1)._class_("all");
  6673. $ctx2.sendIdx["class:"]=1;
  6674. _st($1)._with_("All");
  6675. $ctx2.sendIdx["with:"]=1;
  6676. $2=_st($1)._onClick_((function(){
  6677. return smalltalk.withContext(function($ctx3) {
  6678. return self._selectAllCategories();
  6679. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  6680. $ctx2.sendIdx["onClick:"]=1;
  6681. $2;
  6682. return _st(self._packages())._do_((function(each){
  6683. var li;
  6684. return smalltalk.withContext(function($ctx3) {
  6685. li=_st(html)._li();
  6686. li;
  6687. $3=_st(self._selectedCategories())._includes_(each);
  6688. if(smalltalk.assert($3)){
  6689. _st(li)._class_("selected");
  6690. };
  6691. $4=li;
  6692. _st($4)._with_(each);
  6693. $5=_st($4)._onClick_((function(){
  6694. return smalltalk.withContext(function($ctx4) {
  6695. return self._toggleCategory_(each);
  6696. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)})}));
  6697. return $5;
  6698. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2,3)})}));
  6699. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  6700. return self}, function($ctx1) {$ctx1.fill(self,"updateCategoriesList",{},smalltalk.TestRunner)})},
  6701. args: [],
  6702. source: "updateCategoriesList\x0a\x09packagesList contents: [ :html |\x0a\x09\x09html li\x0a\x09\x09class: 'all';\x0a\x09\x09with: 'All';\x0a\x09\x09onClick: [ self selectAllCategories ].\x0a\x09self packages do: [ :each || li |\x0a\x09\x09li := html li.\x0a\x09\x09(self selectedCategories includes: each) ifTrue: [\x0a\x09\x09li class: 'selected' ].\x0a\x09\x09li\x0a\x09\x09with: each;\x0a\x09\x09onClick: [ self toggleCategory: each ]] ]",
  6703. messageSends: ["contents:", "class:", "li", "with:", "onClick:", "selectAllCategories", "do:", "packages", "ifTrue:", "includes:", "selectedCategories", "toggleCategory:"],
  6704. referencedClasses: []
  6705. }),
  6706. smalltalk.TestRunner);
  6707. smalltalk.addMethod(
  6708. smalltalk.method({
  6709. selector: "updateClassesList",
  6710. protocol: 'updating',
  6711. fn: function (){
  6712. var self=this;
  6713. return smalltalk.withContext(function($ctx1) {
  6714. var $1,$2,$3,$4,$5,$6;
  6715. _st(self["@classesList"])._contents_((function(html){
  6716. return smalltalk.withContext(function($ctx2) {
  6717. $1=_st(self._selectedCategories())._isEmpty();
  6718. if(! smalltalk.assert($1)){
  6719. $2=_st(html)._li();
  6720. $ctx2.sendIdx["li"]=1;
  6721. _st($2)._class_("all");
  6722. $ctx2.sendIdx["class:"]=1;
  6723. _st($2)._with_("All");
  6724. $ctx2.sendIdx["with:"]=1;
  6725. $3=_st($2)._onClick_((function(){
  6726. return smalltalk.withContext(function($ctx3) {
  6727. return self._selectAllClasses();
  6728. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  6729. $ctx2.sendIdx["onClick:"]=1;
  6730. $3;
  6731. };
  6732. return _st(self._classes())._do_((function(each){
  6733. var li;
  6734. return smalltalk.withContext(function($ctx3) {
  6735. li=_st(html)._li();
  6736. li;
  6737. $4=_st(self._selectedClasses())._includes_(each);
  6738. if(smalltalk.assert($4)){
  6739. _st(li)._class_("selected");
  6740. };
  6741. $5=li;
  6742. _st($5)._with_(_st(each)._name());
  6743. $6=_st($5)._onClick_((function(){
  6744. return smalltalk.withContext(function($ctx4) {
  6745. return self._toggleClass_(each);
  6746. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,6)})}));
  6747. return $6;
  6748. }, function($ctx3) {$ctx3.fillBlock({each:each,li:li},$ctx2,4)})}));
  6749. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  6750. return self}, function($ctx1) {$ctx1.fill(self,"updateClassesList",{},smalltalk.TestRunner)})},
  6751. args: [],
  6752. source: "updateClassesList\x0a\x09classesList contents: [ :html |\x0a\x09(self selectedCategories isEmpty) ifFalse: [\x0a\x09\x09html li\x0a\x09\x09\x09class: 'all';\x0a\x09\x09\x09with: 'All';\x0a\x09\x09\x09onClick: [ self selectAllClasses ]].\x0a\x09self classes do: [ :each || li |\x0a\x09\x09li := html li.\x0a\x09\x09(self selectedClasses includes: each) ifTrue: [\x0a\x09\x09\x09li class: 'selected' ].\x0a\x09\x09li\x0a\x09\x09\x09with: each name;\x0a\x09\x09\x09onClick: [ self toggleClass: each ]] ]",
  6753. messageSends: ["contents:", "ifFalse:", "isEmpty", "selectedCategories", "class:", "li", "with:", "onClick:", "selectAllClasses", "do:", "classes", "ifTrue:", "includes:", "selectedClasses", "name", "toggleClass:"],
  6754. referencedClasses: []
  6755. }),
  6756. smalltalk.TestRunner);
  6757. smalltalk.addMethod(
  6758. smalltalk.method({
  6759. selector: "updateMethodsList",
  6760. protocol: 'updating',
  6761. fn: function (){
  6762. var self=this;
  6763. return smalltalk.withContext(function($ctx1) {
  6764. _st(self["@methodsList"])._contents_((function(html){
  6765. return smalltalk.withContext(function($ctx2) {
  6766. self._renderErrorsOn_(html);
  6767. return self._renderFailuresOn_(html);
  6768. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  6769. return self}, function($ctx1) {$ctx1.fill(self,"updateMethodsList",{},smalltalk.TestRunner)})},
  6770. args: [],
  6771. source: "updateMethodsList\x0a\x09methodsList contents: [ :html |\x0a\x09\x09self renderErrorsOn: html.\x0a\x09\x09\x09\x09self renderFailuresOn: html ]",
  6772. messageSends: ["contents:", "renderErrorsOn:", "renderFailuresOn:"],
  6773. referencedClasses: []
  6774. }),
  6775. smalltalk.TestRunner);
  6776. smalltalk.addMethod(
  6777. smalltalk.method({
  6778. selector: "updateStatusDiv",
  6779. protocol: 'updating',
  6780. fn: function (){
  6781. var self=this;
  6782. return smalltalk.withContext(function($ctx1) {
  6783. _st(self["@statusDiv"])._class_("sunit status ".__comma(_st(self["@result"])._status()));
  6784. _st(self["@statusDiv"])._contents_((function(html){
  6785. return smalltalk.withContext(function($ctx2) {
  6786. return _st(_st(html)._span())._with_(self._statusInfo());
  6787. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  6788. return self}, function($ctx1) {$ctx1.fill(self,"updateStatusDiv",{},smalltalk.TestRunner)})},
  6789. args: [],
  6790. source: "updateStatusDiv\x0a\x09statusDiv class: 'sunit status ', result status.\x0a\x09statusDiv contents: [ :html |\x0a\x09\x09html span with: self statusInfo ]",
  6791. messageSends: ["class:", ",", "status", "contents:", "with:", "span", "statusInfo"],
  6792. referencedClasses: []
  6793. }),
  6794. smalltalk.TestRunner);
  6795. smalltalk.addClass('Workspace', smalltalk.TabWidget, ['sourceArea'], 'IDE');
  6796. smalltalk.addMethod(
  6797. smalltalk.method({
  6798. selector: "clearWorkspace",
  6799. protocol: 'actions',
  6800. fn: function (){
  6801. var self=this;
  6802. return smalltalk.withContext(function($ctx1) {
  6803. _st(self["@sourceArea"])._clear();
  6804. return self}, function($ctx1) {$ctx1.fill(self,"clearWorkspace",{},smalltalk.Workspace)})},
  6805. args: [],
  6806. source: "clearWorkspace\x0a\x09sourceArea clear",
  6807. messageSends: ["clear"],
  6808. referencedClasses: []
  6809. }),
  6810. smalltalk.Workspace);
  6811. smalltalk.addMethod(
  6812. smalltalk.method({
  6813. selector: "doIt",
  6814. protocol: 'actions',
  6815. fn: function (){
  6816. var self=this;
  6817. return smalltalk.withContext(function($ctx1) {
  6818. _st(self["@sourceArea"])._doIt();
  6819. return self}, function($ctx1) {$ctx1.fill(self,"doIt",{},smalltalk.Workspace)})},
  6820. args: [],
  6821. source: "doIt\x0a\x09sourceArea doIt",
  6822. messageSends: ["doIt"],
  6823. referencedClasses: []
  6824. }),
  6825. smalltalk.Workspace);
  6826. smalltalk.addMethod(
  6827. smalltalk.method({
  6828. selector: "fileIn",
  6829. protocol: 'actions',
  6830. fn: function (){
  6831. var self=this;
  6832. return smalltalk.withContext(function($ctx1) {
  6833. _st(self["@sourceArea"])._fileIn();
  6834. return self}, function($ctx1) {$ctx1.fill(self,"fileIn",{},smalltalk.Workspace)})},
  6835. args: [],
  6836. source: "fileIn\x0a\x09sourceArea fileIn",
  6837. messageSends: ["fileIn"],
  6838. referencedClasses: []
  6839. }),
  6840. smalltalk.Workspace);
  6841. smalltalk.addMethod(
  6842. smalltalk.method({
  6843. selector: "inspectIt",
  6844. protocol: 'actions',
  6845. fn: function (){
  6846. var self=this;
  6847. return smalltalk.withContext(function($ctx1) {
  6848. _st(self["@sourceArea"])._inspectIt();
  6849. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{},smalltalk.Workspace)})},
  6850. args: [],
  6851. source: "inspectIt\x0a\x09sourceArea inspectIt",
  6852. messageSends: ["inspectIt"],
  6853. referencedClasses: []
  6854. }),
  6855. smalltalk.Workspace);
  6856. smalltalk.addMethod(
  6857. smalltalk.method({
  6858. selector: "label",
  6859. protocol: 'accessing',
  6860. fn: function (){
  6861. var self=this;
  6862. return smalltalk.withContext(function($ctx1) {
  6863. return "Workspace";
  6864. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.Workspace)})},
  6865. args: [],
  6866. source: "label\x0a\x09^ 'Workspace'",
  6867. messageSends: [],
  6868. referencedClasses: []
  6869. }),
  6870. smalltalk.Workspace);
  6871. smalltalk.addMethod(
  6872. smalltalk.method({
  6873. selector: "printIt",
  6874. protocol: 'actions',
  6875. fn: function (){
  6876. var self=this;
  6877. return smalltalk.withContext(function($ctx1) {
  6878. _st(self["@sourceArea"])._printIt();
  6879. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{},smalltalk.Workspace)})},
  6880. args: [],
  6881. source: "printIt\x0a\x09sourceArea printIt",
  6882. messageSends: ["printIt"],
  6883. referencedClasses: []
  6884. }),
  6885. smalltalk.Workspace);
  6886. smalltalk.addMethod(
  6887. smalltalk.method({
  6888. selector: "renderBoxOn:",
  6889. protocol: 'rendering',
  6890. fn: function (html){
  6891. var self=this;
  6892. function $SourceArea(){return smalltalk.SourceArea||(typeof SourceArea=="undefined"?nil:SourceArea)}
  6893. return smalltalk.withContext(function($ctx1) {
  6894. self["@sourceArea"]=_st($SourceArea())._new();
  6895. _st(self["@sourceArea"])._renderOn_(html);
  6896. return self}, function($ctx1) {$ctx1.fill(self,"renderBoxOn:",{html:html},smalltalk.Workspace)})},
  6897. args: ["html"],
  6898. source: "renderBoxOn: html\x0a\x09sourceArea := SourceArea new.\x0a\x09sourceArea renderOn: html",
  6899. messageSends: ["new", "renderOn:"],
  6900. referencedClasses: ["SourceArea"]
  6901. }),
  6902. smalltalk.Workspace);
  6903. smalltalk.addMethod(
  6904. smalltalk.method({
  6905. selector: "renderButtonsOn:",
  6906. protocol: 'rendering',
  6907. fn: function (html){
  6908. var self=this;
  6909. return smalltalk.withContext(function($ctx1) {
  6910. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10;
  6911. $1=_st(html)._button();
  6912. $ctx1.sendIdx["button"]=1;
  6913. _st($1)._with_("DoIt");
  6914. $ctx1.sendIdx["with:"]=1;
  6915. _st($1)._title_("ctrl+d");
  6916. $ctx1.sendIdx["title:"]=1;
  6917. $2=_st($1)._onClick_((function(){
  6918. return smalltalk.withContext(function($ctx2) {
  6919. return self._doIt();
  6920. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  6921. $ctx1.sendIdx["onClick:"]=1;
  6922. $3=_st(html)._button();
  6923. $ctx1.sendIdx["button"]=2;
  6924. _st($3)._with_("PrintIt");
  6925. $ctx1.sendIdx["with:"]=2;
  6926. _st($3)._title_("ctrl+p");
  6927. $ctx1.sendIdx["title:"]=2;
  6928. $4=_st($3)._onClick_((function(){
  6929. return smalltalk.withContext(function($ctx2) {
  6930. return self._printIt();
  6931. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  6932. $ctx1.sendIdx["onClick:"]=2;
  6933. $5=_st(html)._button();
  6934. $ctx1.sendIdx["button"]=3;
  6935. _st($5)._with_("InspectIt");
  6936. $ctx1.sendIdx["with:"]=3;
  6937. _st($5)._title_("ctrl+i");
  6938. $ctx1.sendIdx["title:"]=3;
  6939. $6=_st($5)._onClick_((function(){
  6940. return smalltalk.withContext(function($ctx2) {
  6941. return self._inspectIt();
  6942. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  6943. $ctx1.sendIdx["onClick:"]=3;
  6944. $7=_st(html)._button();
  6945. $ctx1.sendIdx["button"]=4;
  6946. _st($7)._with_("FileIn");
  6947. $ctx1.sendIdx["with:"]=4;
  6948. _st($7)._title_("ctrl+f");
  6949. $8=_st($7)._onClick_((function(){
  6950. return smalltalk.withContext(function($ctx2) {
  6951. return self._fileIn();
  6952. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
  6953. $ctx1.sendIdx["onClick:"]=4;
  6954. $9=_st(html)._button();
  6955. _st($9)._with_("Clear workspace");
  6956. $10=_st($9)._onClick_((function(){
  6957. return smalltalk.withContext(function($ctx2) {
  6958. return self._clearWorkspace();
  6959. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}));
  6960. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.Workspace)})},
  6961. args: ["html"],
  6962. source: "renderButtonsOn: html\x0a\x09html button\x0a\x09with: 'DoIt';\x0a\x09title: 'ctrl+d';\x0a\x09onClick: [ self doIt ].\x0a\x09html button\x0a\x09with: 'PrintIt';\x0a\x09title: 'ctrl+p';\x0a\x09onClick: [ self printIt ].\x0a\x09html button\x0a\x09with: 'InspectIt';\x0a\x09title: 'ctrl+i';\x0a\x09onClick: [ self inspectIt ].\x0a\x09html button\x0a\x09with: 'FileIn';\x0a\x09title: 'ctrl+f';\x0a\x09onClick: [ self fileIn ].\x0a\x09html button\x0a\x09with: 'Clear workspace';\x0a\x09onClick: [ self clearWorkspace ]",
  6963. messageSends: ["with:", "button", "title:", "onClick:", "doIt", "printIt", "inspectIt", "fileIn", "clearWorkspace"],
  6964. referencedClasses: []
  6965. }),
  6966. smalltalk.Workspace);
  6967. smalltalk.addMethod(
  6968. smalltalk.method({
  6969. selector: "show",
  6970. protocol: 'actions',
  6971. fn: function (){
  6972. var self=this;
  6973. return smalltalk.withContext(function($ctx1) {
  6974. smalltalk.Workspace.superclass.fn.prototype._show.apply(_st(self), []);
  6975. _st(self["@sourceArea"])._focus();
  6976. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.Workspace)})},
  6977. args: [],
  6978. source: "show\x0a\x09super show.\x0a\x09sourceArea focus.",
  6979. messageSends: ["show", "focus"],
  6980. referencedClasses: []
  6981. }),
  6982. smalltalk.Workspace);
  6983. smalltalk.addMethod(
  6984. smalltalk.method({
  6985. selector: "inspectOn:",
  6986. protocol: '*IDE',
  6987. fn: function (anInspector){
  6988. var self=this;
  6989. var variables;
  6990. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  6991. return smalltalk.withContext(function($ctx1) {
  6992. var $1;
  6993. variables=_st($Dictionary())._new();
  6994. _st(variables)._at_put_("#self",self);
  6995. $ctx1.sendIdx["at:put:"]=1;
  6996. _st(variables)._at_put_("#year",self._year());
  6997. $ctx1.sendIdx["at:put:"]=2;
  6998. _st(variables)._at_put_("#month",self._month());
  6999. $ctx1.sendIdx["at:put:"]=3;
  7000. _st(variables)._at_put_("#day",self._day());
  7001. $ctx1.sendIdx["at:put:"]=4;
  7002. _st(variables)._at_put_("#hours",self._hours());
  7003. $ctx1.sendIdx["at:put:"]=5;
  7004. _st(variables)._at_put_("#minutes",self._minutes());
  7005. $ctx1.sendIdx["at:put:"]=6;
  7006. _st(variables)._at_put_("#seconds",self._seconds());
  7007. $ctx1.sendIdx["at:put:"]=7;
  7008. _st(variables)._at_put_("#milliseconds",self._milliseconds());
  7009. _st(anInspector)._setLabel_(self._printString());
  7010. $1=_st(anInspector)._setVariables_(variables);
  7011. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.Date)})},
  7012. args: ["anInspector"],
  7013. 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",
  7014. messageSends: ["new", "at:put:", "year", "month", "day", "hours", "minutes", "seconds", "milliseconds", "setLabel:", "printString", "setVariables:"],
  7015. referencedClasses: ["Dictionary"]
  7016. }),
  7017. smalltalk.Date);
  7018. smalltalk.addMethod(
  7019. smalltalk.method({
  7020. selector: "inspectOn:",
  7021. protocol: '*IDE',
  7022. fn: function (anInspector){
  7023. var self=this;
  7024. var variables;
  7025. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  7026. return smalltalk.withContext(function($ctx1) {
  7027. var $1;
  7028. variables=_st($Dictionary())._new();
  7029. _st(variables)._at_put_("#self",self);
  7030. $ctx1.sendIdx["at:put:"]=1;
  7031. self._withIndexDo_((function(each,i){
  7032. return smalltalk.withContext(function($ctx2) {
  7033. return _st(variables)._at_put_(i,each);
  7034. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1,1)})}));
  7035. _st(anInspector)._setLabel_(self._printString());
  7036. $1=_st(anInspector)._setVariables_(variables);
  7037. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.Collection)})},
  7038. args: ["anInspector"],
  7039. 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",
  7040. messageSends: ["new", "at:put:", "withIndexDo:", "setLabel:", "printString", "setVariables:"],
  7041. referencedClasses: ["Dictionary"]
  7042. }),
  7043. smalltalk.Collection);
  7044. smalltalk.addMethod(
  7045. smalltalk.method({
  7046. selector: "inspectOn:",
  7047. protocol: '*IDE',
  7048. fn: function (anInspector){
  7049. var self=this;
  7050. var label;
  7051. return smalltalk.withContext(function($ctx1) {
  7052. var $3,$2,$1,$5,$4;
  7053. smalltalk.String.superclass.fn.prototype._inspectOn_.apply(_st(self), [anInspector]);
  7054. $3=self._printString();
  7055. $ctx1.sendIdx["printString"]=1;
  7056. $2=_st($3)._size();
  7057. $1=_st($2).__gt((30));
  7058. if(smalltalk.assert($1)){
  7059. $5=self._printString();
  7060. $ctx1.sendIdx["printString"]=2;
  7061. $4=_st($5)._copyFrom_to_((1),(30));
  7062. label=_st($4).__comma("...'");
  7063. label;
  7064. } else {
  7065. label=self._printString();
  7066. label;
  7067. };
  7068. _st(anInspector)._setLabel_(label);
  7069. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,label:label},smalltalk.String)})},
  7070. args: ["anInspector"],
  7071. 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",
  7072. messageSends: ["inspectOn:", "ifTrue:ifFalse:", ">", "size", "printString", ",", "copyFrom:to:", "setLabel:"],
  7073. referencedClasses: []
  7074. }),
  7075. smalltalk.String);
  7076. smalltalk.addMethod(
  7077. smalltalk.method({
  7078. selector: "inspectOn:",
  7079. protocol: '*IDE',
  7080. fn: function (anInspector){
  7081. var self=this;
  7082. var variables;
  7083. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  7084. return smalltalk.withContext(function($ctx1) {
  7085. var $1;
  7086. variables=_st($Dictionary())._new();
  7087. _st(variables)._at_put_("#self",self);
  7088. $ctx1.sendIdx["at:put:"]=1;
  7089. _st(variables)._at_put_("#home",self._home());
  7090. $ctx1.sendIdx["at:put:"]=2;
  7091. _st(variables)._at_put_("#receiver",self._receiver());
  7092. $ctx1.sendIdx["at:put:"]=3;
  7093. _st(variables)._at_put_("#selector",self._selector());
  7094. $ctx1.sendIdx["at:put:"]=4;
  7095. _st(variables)._at_put_("#temps",self._temps());
  7096. $ctx1.sendIdx["at:put:"]=5;
  7097. _st(_st(self._class())._instanceVariableNames())._do_((function(each){
  7098. return smalltalk.withContext(function($ctx2) {
  7099. return _st(variables)._at_put_(each,self._instVarAt_(each));
  7100. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  7101. _st(anInspector)._setLabel_(self._printString());
  7102. $1=_st(anInspector)._setVariables_(variables);
  7103. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.MethodContext)})},
  7104. args: ["anInspector"],
  7105. 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",
  7106. messageSends: ["new", "at:put:", "home", "receiver", "selector", "temps", "do:", "instanceVariableNames", "class", "instVarAt:", "setLabel:", "printString", "setVariables:"],
  7107. referencedClasses: ["Dictionary"]
  7108. }),
  7109. smalltalk.MethodContext);
  7110. smalltalk.addMethod(
  7111. smalltalk.method({
  7112. selector: "inspectOn:",
  7113. protocol: '*IDE',
  7114. fn: function (anInspector){
  7115. var self=this;
  7116. var variables;
  7117. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  7118. return smalltalk.withContext(function($ctx1) {
  7119. var $1;
  7120. variables=_st($Dictionary())._new();
  7121. _st(variables)._at_put_("#self",self);
  7122. $ctx1.sendIdx["at:put:"]=1;
  7123. _st(variables)._at_put_("#keys",self._keys());
  7124. $ctx1.sendIdx["at:put:"]=2;
  7125. self._keysAndValuesDo_((function(key,value){
  7126. return smalltalk.withContext(function($ctx2) {
  7127. return _st(variables)._at_put_(key,value);
  7128. }, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1,1)})}));
  7129. _st(anInspector)._setLabel_(self._printString());
  7130. $1=_st(anInspector)._setVariables_(variables);
  7131. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.AssociativeCollection)})},
  7132. args: ["anInspector"],
  7133. 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",
  7134. messageSends: ["new", "at:put:", "keys", "keysAndValuesDo:", "setLabel:", "printString", "setVariables:"],
  7135. referencedClasses: ["Dictionary"]
  7136. }),
  7137. smalltalk.AssociativeCollection);
  7138. smalltalk.addMethod(
  7139. smalltalk.method({
  7140. selector: "inspectOn:",
  7141. protocol: '*IDE',
  7142. fn: function (anInspector){
  7143. var self=this;
  7144. var variables;
  7145. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  7146. return smalltalk.withContext(function($ctx1) {
  7147. var $1;
  7148. variables=_st($Dictionary())._new();
  7149. _st(variables)._at_put_("#self",self);
  7150. $ctx1.sendIdx["at:put:"]=1;
  7151. _st(self["@elements"])._withIndexDo_((function(each,i){
  7152. return smalltalk.withContext(function($ctx2) {
  7153. return _st(variables)._at_put_(i,each);
  7154. }, function($ctx2) {$ctx2.fillBlock({each:each,i:i},$ctx1,1)})}));
  7155. _st(anInspector)._setLabel_(self._printString());
  7156. $1=_st(anInspector)._setVariables_(variables);
  7157. return self}, function($ctx1) {$ctx1.fill(self,"inspectOn:",{anInspector:anInspector,variables:variables},smalltalk.Set)})},
  7158. args: ["anInspector"],
  7159. 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",
  7160. messageSends: ["new", "at:put:", "withIndexDo:", "setLabel:", "printString", "setVariables:"],
  7161. referencedClasses: ["Dictionary"]
  7162. }),
  7163. smalltalk.Set);
  7164. });