IDE.js 253 KB

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