IDE.js 263 KB

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