IDE.js 268 KB

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