2
0

IDE.js 249 KB

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