1
0

IDE.js 250 KB

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