IDE.js 249 KB

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