1
0

IDE.js 272 KB

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