2
0

IDE.js 261 KB

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