IDE.js 249 KB

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