Helios-Core.js 196 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625
  1. define("amber_core/Helios-Core", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Infrastructure", "amber_core/Canvas"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Helios-Core');
  3. smalltalk.packages["Helios-Core"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('HLModel', smalltalk.InterfacingObject, ['announcer', 'environment'], 'Helios-Core');
  5. smalltalk.HLModel.comment="I am the abstract superclass of all models of Helios.\x0aI am the \x22Model\x22 part of the MVC pattern implementation in Helios.\x0a\x0aI provide access to an `Environment` object and both a local (model-specific) and global (system-specific) announcer.\x0a\x0aThe `#withChangesDo:` method is handy for performing model changes ensuring that all widgets are aware of the change and can prevent it from happening.\x0a\x0aModifications of the system should be done via commands (see `HLCommand` and subclasses).";
  6. smalltalk.addMethod(
  7. smalltalk.method({
  8. selector: "announcer",
  9. category: 'accessing',
  10. fn: function (){
  11. var self=this;
  12. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  13. return smalltalk.withContext(function($ctx1) {
  14. var $2,$1;
  15. $2=self["@announcer"];
  16. if(($receiver = $2) == nil || $receiver == null){
  17. self["@announcer"]=_st($Announcer())._new();
  18. $1=self["@announcer"];
  19. } else {
  20. $1=$2;
  21. };
  22. return $1;
  23. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLModel)})},
  24. args: [],
  25. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  26. messageSends: ["ifNil:", "new"],
  27. referencedClasses: ["Announcer"]
  28. }),
  29. smalltalk.HLModel);
  30. smalltalk.addMethod(
  31. smalltalk.method({
  32. selector: "environment",
  33. category: 'accessing',
  34. fn: function (){
  35. var self=this;
  36. return smalltalk.withContext(function($ctx1) {
  37. var $2,$1;
  38. $2=self["@environment"];
  39. if(($receiver = $2) == nil || $receiver == null){
  40. $1=_st(self._manager())._environment();
  41. } else {
  42. $1=$2;
  43. };
  44. return $1;
  45. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLModel)})},
  46. args: [],
  47. source: "environment\x0a\x09^ environment ifNil: [ self manager environment ]",
  48. messageSends: ["ifNil:", "environment", "manager"],
  49. referencedClasses: []
  50. }),
  51. smalltalk.HLModel);
  52. smalltalk.addMethod(
  53. smalltalk.method({
  54. selector: "environment:",
  55. category: 'accessing',
  56. fn: function (anEnvironment){
  57. var self=this;
  58. return smalltalk.withContext(function($ctx1) {
  59. self["@environment"]=anEnvironment;
  60. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLModel)})},
  61. args: ["anEnvironment"],
  62. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  63. messageSends: [],
  64. referencedClasses: []
  65. }),
  66. smalltalk.HLModel);
  67. smalltalk.addMethod(
  68. smalltalk.method({
  69. selector: "isBrowserModel",
  70. category: 'testing',
  71. fn: function (){
  72. var self=this;
  73. return smalltalk.withContext(function($ctx1) {
  74. return false;
  75. }, function($ctx1) {$ctx1.fill(self,"isBrowserModel",{},smalltalk.HLModel)})},
  76. args: [],
  77. source: "isBrowserModel\x0a\x09^ false",
  78. messageSends: [],
  79. referencedClasses: []
  80. }),
  81. smalltalk.HLModel);
  82. smalltalk.addMethod(
  83. smalltalk.method({
  84. selector: "isReferencesModel",
  85. category: 'testing',
  86. fn: function (){
  87. var self=this;
  88. return smalltalk.withContext(function($ctx1) {
  89. return false;
  90. }, function($ctx1) {$ctx1.fill(self,"isReferencesModel",{},smalltalk.HLModel)})},
  91. args: [],
  92. source: "isReferencesModel\x0a\x09^ false",
  93. messageSends: [],
  94. referencedClasses: []
  95. }),
  96. smalltalk.HLModel);
  97. smalltalk.addMethod(
  98. smalltalk.method({
  99. selector: "isToolModel",
  100. category: 'testing',
  101. fn: function (){
  102. var self=this;
  103. return smalltalk.withContext(function($ctx1) {
  104. return false;
  105. }, function($ctx1) {$ctx1.fill(self,"isToolModel",{},smalltalk.HLModel)})},
  106. args: [],
  107. source: "isToolModel\x0a\x09^ false",
  108. messageSends: [],
  109. referencedClasses: []
  110. }),
  111. smalltalk.HLModel);
  112. smalltalk.addMethod(
  113. smalltalk.method({
  114. selector: "manager",
  115. category: 'accessing',
  116. fn: function (){
  117. var self=this;
  118. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  119. return smalltalk.withContext(function($ctx1) {
  120. var $1;
  121. $1=_st($HLManager())._current();
  122. return $1;
  123. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLModel)})},
  124. args: [],
  125. source: "manager\x0a\x09^ HLManager current",
  126. messageSends: ["current"],
  127. referencedClasses: ["HLManager"]
  128. }),
  129. smalltalk.HLModel);
  130. smalltalk.addMethod(
  131. smalltalk.method({
  132. selector: "systemAnnouncer",
  133. category: 'accessing',
  134. fn: function (){
  135. var self=this;
  136. return smalltalk.withContext(function($ctx1) {
  137. var $1;
  138. $1=_st(self._environment())._systemAnnouncer();
  139. return $1;
  140. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLModel)})},
  141. args: [],
  142. source: "systemAnnouncer\x0a\x09^ self environment systemAnnouncer",
  143. messageSends: ["systemAnnouncer", "environment"],
  144. referencedClasses: []
  145. }),
  146. smalltalk.HLModel);
  147. smalltalk.addMethod(
  148. smalltalk.method({
  149. selector: "withChangesDo:",
  150. category: 'error handling',
  151. fn: function (aBlock){
  152. var self=this;
  153. function $HLAboutToChange(){return smalltalk.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  154. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  155. return smalltalk.withContext(function($ctx1) {
  156. _st((function(){
  157. return smalltalk.withContext(function($ctx2) {
  158. _st(self._announcer())._announce_(_st(_st($HLAboutToChange())._new())._actionBlock_(aBlock));
  159. return _st(aBlock)._value();
  160. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($HLChangeForbidden(),(function(ex){
  161. return smalltalk.withContext(function($ctx2) {
  162. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})}));
  163. return self}, function($ctx1) {$ctx1.fill(self,"withChangesDo:",{aBlock:aBlock},smalltalk.HLModel)})},
  164. args: ["aBlock"],
  165. source: "withChangesDo: aBlock\x0a\x09[ \x0a\x09\x09self announcer announce: (HLAboutToChange new\x0a\x09\x09\x09actionBlock: aBlock).\x0a\x09\x09aBlock value.\x0a\x09]\x0a\x09\x09on: HLChangeForbidden \x0a\x09\x09do: [ :ex | ]",
  166. messageSends: ["on:do:", "announce:", "announcer", "actionBlock:", "new", "value"],
  167. referencedClasses: ["HLAboutToChange", "HLChangeForbidden"]
  168. }),
  169. smalltalk.HLModel);
  170. smalltalk.addClass('HLToolModel', smalltalk.HLModel, ['selectedClass', 'selectedPackage', 'selectedProtocol', 'selectedSelector'], 'Helios-Core');
  171. smalltalk.HLToolModel.comment="I am a model specific to package and class manipulation. All browsers should either use me or a subclass as their model.\x0a\x0aI provide methods for package, class, protocol and method manipulation and access, forwarding to my environment.\x0a\x0aI also handle compilation of classes and methods as well as compilation and parsing errors.";
  172. smalltalk.addMethod(
  173. smalltalk.method({
  174. selector: "addInstVarNamed:",
  175. category: 'actions',
  176. fn: function (aString){
  177. var self=this;
  178. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  179. return smalltalk.withContext(function($ctx1) {
  180. var $1,$2,$3,$4,$6,$7,$8,$9,$5;
  181. $1=self._environment();
  182. $2=aString;
  183. $3=self._selectedClass();
  184. $ctx1.sendIdx["selectedClass"]=1;
  185. _st($1)._addInstVarNamed_to_($2,$3);
  186. $4=self._announcer();
  187. $6=_st($HLInstVarAdded())._new();
  188. $7=$6;
  189. $8=self._selectedClass();
  190. _st($7)._theClass_($8);
  191. _st($6)._variableName_(aString);
  192. $9=_st($6)._yourself();
  193. $5=$9;
  194. _st($4)._announce_($5);
  195. return self}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:",{aString:aString},smalltalk.HLToolModel)})},
  196. args: ["aString"],
  197. source: "addInstVarNamed: aString\x0a\x09self environment addInstVarNamed: aString to: self selectedClass.\x0a\x09self announcer announce: (HLInstVarAdded new\x0a\x09\x09theClass: self selectedClass;\x0a\x09\x09variableName: aString;\x0a\x09\x09yourself)",
  198. messageSends: ["addInstVarNamed:to:", "environment", "selectedClass", "announce:", "announcer", "theClass:", "new", "variableName:", "yourself"],
  199. referencedClasses: ["HLInstVarAdded"]
  200. }),
  201. smalltalk.HLToolModel);
  202. smalltalk.addMethod(
  203. smalltalk.method({
  204. selector: "allProtocol",
  205. category: 'defaults',
  206. fn: function (){
  207. var self=this;
  208. return smalltalk.withContext(function($ctx1) {
  209. return "-- all --";
  210. }, function($ctx1) {$ctx1.fill(self,"allProtocol",{},smalltalk.HLToolModel)})},
  211. args: [],
  212. source: "allProtocol\x0a\x09^ '-- all --'",
  213. messageSends: [],
  214. referencedClasses: []
  215. }),
  216. smalltalk.HLToolModel);
  217. smalltalk.addMethod(
  218. smalltalk.method({
  219. selector: "allSelectors",
  220. category: 'accessing',
  221. fn: function (){
  222. var self=this;
  223. return smalltalk.withContext(function($ctx1) {
  224. var $1;
  225. $1=_st(self._environment())._allSelectors();
  226. return $1;
  227. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},smalltalk.HLToolModel)})},
  228. args: [],
  229. source: "allSelectors\x0a\x09^ self environment allSelectors",
  230. messageSends: ["allSelectors", "environment"],
  231. referencedClasses: []
  232. }),
  233. smalltalk.HLToolModel);
  234. smalltalk.addMethod(
  235. smalltalk.method({
  236. selector: "availableClassNames",
  237. category: 'accessing',
  238. fn: function (){
  239. var self=this;
  240. return smalltalk.withContext(function($ctx1) {
  241. var $1;
  242. $1=_st(self._environment())._availableClassNames();
  243. return $1;
  244. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLToolModel)})},
  245. args: [],
  246. source: "availableClassNames\x0a\x09^ self environment availableClassNames",
  247. messageSends: ["availableClassNames", "environment"],
  248. referencedClasses: []
  249. }),
  250. smalltalk.HLToolModel);
  251. smalltalk.addMethod(
  252. smalltalk.method({
  253. selector: "availablePackageNames",
  254. category: 'accessing',
  255. fn: function (){
  256. var self=this;
  257. return smalltalk.withContext(function($ctx1) {
  258. var $1;
  259. $1=_st(self._environment())._availablePackageNames();
  260. return $1;
  261. }, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},smalltalk.HLToolModel)})},
  262. args: [],
  263. source: "availablePackageNames\x0a\x09^ self environment availablePackageNames",
  264. messageSends: ["availablePackageNames", "environment"],
  265. referencedClasses: []
  266. }),
  267. smalltalk.HLToolModel);
  268. smalltalk.addMethod(
  269. smalltalk.method({
  270. selector: "availablePackages",
  271. category: 'accessing',
  272. fn: function (){
  273. var self=this;
  274. return smalltalk.withContext(function($ctx1) {
  275. var $1;
  276. $1=_st(self._environment())._availablePackageNames();
  277. return $1;
  278. }, function($ctx1) {$ctx1.fill(self,"availablePackages",{},smalltalk.HLToolModel)})},
  279. args: [],
  280. source: "availablePackages\x0a\x09^ self environment availablePackageNames",
  281. messageSends: ["availablePackageNames", "environment"],
  282. referencedClasses: []
  283. }),
  284. smalltalk.HLToolModel);
  285. smalltalk.addMethod(
  286. smalltalk.method({
  287. selector: "availableProtocols",
  288. category: 'accessing',
  289. fn: function (){
  290. var self=this;
  291. return smalltalk.withContext(function($ctx1) {
  292. var $1;
  293. $1=_st(self._environment())._availableProtocolsFor_(self._selectedClass());
  294. return $1;
  295. }, function($ctx1) {$ctx1.fill(self,"availableProtocols",{},smalltalk.HLToolModel)})},
  296. args: [],
  297. source: "availableProtocols\x0a\x09^ self environment availableProtocolsFor: self selectedClass",
  298. messageSends: ["availableProtocolsFor:", "environment", "selectedClass"],
  299. referencedClasses: []
  300. }),
  301. smalltalk.HLToolModel);
  302. smalltalk.addMethod(
  303. smalltalk.method({
  304. selector: "commitPackage",
  305. category: 'commands actions',
  306. fn: function (){
  307. var self=this;
  308. return smalltalk.withContext(function($ctx1) {
  309. _st(self._environment())._commitPackage_(self._selectedPackage());
  310. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage",{},smalltalk.HLToolModel)})},
  311. args: [],
  312. source: "commitPackage\x0a\x09self environment commitPackage: self selectedPackage",
  313. messageSends: ["commitPackage:", "environment", "selectedPackage"],
  314. referencedClasses: []
  315. }),
  316. smalltalk.HLToolModel);
  317. smalltalk.addMethod(
  318. smalltalk.method({
  319. selector: "compilationProtocol",
  320. category: 'private',
  321. fn: function (){
  322. var self=this;
  323. var currentProtocol;
  324. return smalltalk.withContext(function($ctx1) {
  325. var $1,$2,$3,$5,$4;
  326. currentProtocol=self._selectedProtocol();
  327. $1=currentProtocol;
  328. if(($receiver = $1) == nil || $receiver == null){
  329. currentProtocol=self._unclassifiedProtocol();
  330. $ctx1.sendIdx["unclassifiedProtocol"]=1;
  331. currentProtocol;
  332. } else {
  333. $1;
  334. };
  335. $2=self._selectedMethod();
  336. $ctx1.sendIdx["selectedMethod"]=1;
  337. if(($receiver = $2) == nil || $receiver == null){
  338. $2;
  339. } else {
  340. $3=self._selectedMethod();
  341. currentProtocol=_st($3)._protocol();
  342. currentProtocol;
  343. };
  344. $5=_st(currentProtocol).__eq(self._allProtocol());
  345. if(smalltalk.assert($5)){
  346. $4=self._unclassifiedProtocol();
  347. } else {
  348. $4=currentProtocol;
  349. };
  350. return $4;
  351. }, function($ctx1) {$ctx1.fill(self,"compilationProtocol",{currentProtocol:currentProtocol},smalltalk.HLToolModel)})},
  352. args: [],
  353. source: "compilationProtocol\x0a\x09| currentProtocol |\x0a\x09\x0a\x09currentProtocol := self selectedProtocol.\x0a\x09currentProtocol ifNil: [ currentProtocol := self unclassifiedProtocol ].\x0a\x09self selectedMethod ifNotNil: [ currentProtocol := self selectedMethod protocol ].\x0a\x0a\x09^ currentProtocol = self allProtocol\x0a\x09\x09ifTrue: [ self unclassifiedProtocol ]\x0a\x09\x09ifFalse: [ currentProtocol ]",
  354. messageSends: ["selectedProtocol", "ifNil:", "unclassifiedProtocol", "ifNotNil:", "selectedMethod", "protocol", "ifTrue:ifFalse:", "=", "allProtocol"],
  355. referencedClasses: []
  356. }),
  357. smalltalk.HLToolModel);
  358. smalltalk.addMethod(
  359. smalltalk.method({
  360. selector: "compileClassComment:",
  361. category: 'compiling',
  362. fn: function (aString){
  363. var self=this;
  364. return smalltalk.withContext(function($ctx1) {
  365. _st(self._environment())._compileClassComment_for_(aString,self._selectedClass());
  366. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:",{aString:aString},smalltalk.HLToolModel)})},
  367. args: ["aString"],
  368. source: "compileClassComment: aString\x0a\x09self environment \x0a\x09\x09compileClassComment: aString \x0a\x09\x09for: self selectedClass",
  369. messageSends: ["compileClassComment:for:", "environment", "selectedClass"],
  370. referencedClasses: []
  371. }),
  372. smalltalk.HLToolModel);
  373. smalltalk.addMethod(
  374. smalltalk.method({
  375. selector: "compileClassDefinition:",
  376. category: 'compiling',
  377. fn: function (aString){
  378. var self=this;
  379. return smalltalk.withContext(function($ctx1) {
  380. _st(self._environment())._compileClassDefinition_(aString);
  381. return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},smalltalk.HLToolModel)})},
  382. args: ["aString"],
  383. source: "compileClassDefinition: aString\x0a\x09self environment compileClassDefinition: aString",
  384. messageSends: ["compileClassDefinition:", "environment"],
  385. referencedClasses: []
  386. }),
  387. smalltalk.HLToolModel);
  388. smalltalk.addMethod(
  389. smalltalk.method({
  390. selector: "compileMethod:",
  391. category: 'compiling',
  392. fn: function (aString){
  393. var self=this;
  394. var method;
  395. return smalltalk.withContext(function($ctx1) {
  396. self._withCompileErrorHandling_((function(){
  397. return smalltalk.withContext(function($ctx2) {
  398. method=_st(self._environment())._compileMethod_for_protocol_(aString,self._selectedClass(),self._compilationProtocol());
  399. method;
  400. return self._selectedMethod_(method);
  401. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  402. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString,method:method},smalltalk.HLToolModel)})},
  403. args: ["aString"],
  404. source: "compileMethod: aString\x0a\x09| method |\x0a\x09\x0a\x09self withCompileErrorHandling: [ \x0a\x09\x09method := self environment \x0a\x09\x09\x09compileMethod: aString \x0a\x09\x09\x09for: self selectedClass\x0a\x09\x09\x09protocol: self compilationProtocol.\x0a\x0a\x09\x09self selectedMethod: method ]",
  405. messageSends: ["withCompileErrorHandling:", "compileMethod:for:protocol:", "environment", "selectedClass", "compilationProtocol", "selectedMethod:"],
  406. referencedClasses: []
  407. }),
  408. smalltalk.HLToolModel);
  409. smalltalk.addMethod(
  410. smalltalk.method({
  411. selector: "copyClassTo:",
  412. category: 'commands actions',
  413. fn: function (aClassName){
  414. var self=this;
  415. return smalltalk.withContext(function($ctx1) {
  416. self._withChangesDo_((function(){
  417. return smalltalk.withContext(function($ctx2) {
  418. return _st(self._environment())._copyClass_to_(_st(self._selectedClass())._theNonMetaClass(),aClassName);
  419. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  420. return self}, function($ctx1) {$ctx1.fill(self,"copyClassTo:",{aClassName:aClassName},smalltalk.HLToolModel)})},
  421. args: ["aClassName"],
  422. source: "copyClassTo: aClassName\x0a\x09self withChangesDo: [ \x0a\x09\x09self environment \x0a\x09\x09\x09copyClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09to: aClassName ]",
  423. messageSends: ["withChangesDo:", "copyClass:to:", "environment", "theNonMetaClass", "selectedClass"],
  424. referencedClasses: []
  425. }),
  426. smalltalk.HLToolModel);
  427. smalltalk.addMethod(
  428. smalltalk.method({
  429. selector: "handleCompileError:",
  430. category: 'error handling',
  431. fn: function (anError){
  432. var self=this;
  433. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  434. return smalltalk.withContext(function($ctx1) {
  435. var $1,$2;
  436. $1=_st($HLCompileErrorRaised())._new();
  437. _st($1)._error_(anError);
  438. $2=_st($1)._yourself();
  439. _st(self._announcer())._announce_($2);
  440. return self}, function($ctx1) {$ctx1.fill(self,"handleCompileError:",{anError:anError},smalltalk.HLToolModel)})},
  441. args: ["anError"],
  442. source: "handleCompileError: anError\x0a\x09self announcer announce: (HLCompileErrorRaised new\x0a\x09\x09error: anError;\x0a\x09\x09yourself)",
  443. messageSends: ["announce:", "announcer", "error:", "new", "yourself"],
  444. referencedClasses: ["HLCompileErrorRaised"]
  445. }),
  446. smalltalk.HLToolModel);
  447. smalltalk.addMethod(
  448. smalltalk.method({
  449. selector: "handleParseError:",
  450. category: 'error handling',
  451. fn: function (anError){
  452. var self=this;
  453. var split,line,column,messageToInsert;
  454. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  455. return smalltalk.withContext(function($ctx1) {
  456. var $1,$3,$2,$4,$6,$7,$8,$9,$10,$11,$5;
  457. split=_st(_st(anError)._messageText())._tokenize_(" : ");
  458. $ctx1.sendIdx["tokenize:"]=1;
  459. messageToInsert=_st(split)._second();
  460. $ctx1.sendIdx["second"]=1;
  461. $1=_st(split)._first();
  462. $ctx1.sendIdx["first"]=1;
  463. $3=_st(split)._first();
  464. $ctx1.sendIdx["first"]=2;
  465. $2=_st($3)._size();
  466. split=_st($1)._copyFrom_to_((21),$2);
  467. split=_st(split)._tokenize_(" column ");
  468. line=_st(split)._first();
  469. column=_st(split)._second();
  470. $4=self._announcer();
  471. $6=_st($HLParseErrorRaised())._new();
  472. $7=$6;
  473. $8=_st(line)._asNumber();
  474. $ctx1.sendIdx["asNumber"]=1;
  475. _st($7)._line_($8);
  476. $9=$6;
  477. $10=_st(column)._asNumber();
  478. _st($9)._column_($10);
  479. _st($6)._message_(messageToInsert);
  480. _st($6)._error_(anError);
  481. $11=_st($6)._yourself();
  482. $5=$11;
  483. _st($4)._announce_($5);
  484. return self}, function($ctx1) {$ctx1.fill(self,"handleParseError:",{anError:anError,split:split,line:line,column:column,messageToInsert:messageToInsert},smalltalk.HLToolModel)})},
  485. args: ["anError"],
  486. source: "handleParseError: anError\x0a\x09| split line column messageToInsert |\x0a\x09\x0a\x09split := anError messageText tokenize: ' : '.\x0a\x09messageToInsert := split second.\x0a\x0a\x09\x2221 = 'Parse error on line ' size + 1\x22\x0a\x09split := split first copyFrom: 21 to: split first size.\x0a\x09\x0a\x09split := split tokenize: ' column '.\x0a\x09line := split first.\x0a\x09column := split second.\x0a\x09\x0a\x09self announcer announce: (HLParseErrorRaised new\x0a\x09\x09line: line asNumber;\x0a\x09\x09column: column asNumber;\x0a\x09\x09message: messageToInsert;\x0a\x09\x09error: anError;\x0a\x09\x09yourself)",
  487. messageSends: ["tokenize:", "messageText", "second", "copyFrom:to:", "first", "size", "announce:", "announcer", "line:", "new", "asNumber", "column:", "message:", "error:", "yourself"],
  488. referencedClasses: ["HLParseErrorRaised"]
  489. }),
  490. smalltalk.HLToolModel);
  491. smalltalk.addMethod(
  492. smalltalk.method({
  493. selector: "handleUnkownVariableError:",
  494. category: 'error handling',
  495. fn: function (anError){
  496. var self=this;
  497. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  498. return smalltalk.withContext(function($ctx1) {
  499. var $1,$2;
  500. $1=_st($HLUnknownVariableErrorRaised())._new();
  501. _st($1)._error_(anError);
  502. $2=_st($1)._yourself();
  503. _st(self._announcer())._announce_($2);
  504. return self}, function($ctx1) {$ctx1.fill(self,"handleUnkownVariableError:",{anError:anError},smalltalk.HLToolModel)})},
  505. args: ["anError"],
  506. source: "handleUnkownVariableError: anError\x0a\x09self announcer announce: (HLUnknownVariableErrorRaised new\x0a\x09\x09error: anError;\x0a\x09\x09yourself)",
  507. messageSends: ["announce:", "announcer", "error:", "new", "yourself"],
  508. referencedClasses: ["HLUnknownVariableErrorRaised"]
  509. }),
  510. smalltalk.HLToolModel);
  511. smalltalk.addMethod(
  512. smalltalk.method({
  513. selector: "isToolModel",
  514. category: 'testing',
  515. fn: function (){
  516. var self=this;
  517. return smalltalk.withContext(function($ctx1) {
  518. return true;
  519. }, function($ctx1) {$ctx1.fill(self,"isToolModel",{},smalltalk.HLToolModel)})},
  520. args: [],
  521. source: "isToolModel\x0a\x09^ true",
  522. messageSends: [],
  523. referencedClasses: []
  524. }),
  525. smalltalk.HLToolModel);
  526. smalltalk.addMethod(
  527. smalltalk.method({
  528. selector: "moveClassToPackage:",
  529. category: 'commands actions',
  530. fn: function (aPackageName){
  531. var self=this;
  532. return smalltalk.withContext(function($ctx1) {
  533. self._withChangesDo_((function(){
  534. return smalltalk.withContext(function($ctx2) {
  535. return _st(self._environment())._moveClass_toPackage_(_st(self._selectedClass())._theNonMetaClass(),aPackageName);
  536. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  537. return self}, function($ctx1) {$ctx1.fill(self,"moveClassToPackage:",{aPackageName:aPackageName},smalltalk.HLToolModel)})},
  538. args: ["aPackageName"],
  539. source: "moveClassToPackage: aPackageName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09toPackage: aPackageName ]",
  540. messageSends: ["withChangesDo:", "moveClass:toPackage:", "environment", "theNonMetaClass", "selectedClass"],
  541. referencedClasses: []
  542. }),
  543. smalltalk.HLToolModel);
  544. smalltalk.addMethod(
  545. smalltalk.method({
  546. selector: "moveMethodToClass:",
  547. category: 'commands actions',
  548. fn: function (aClassName){
  549. var self=this;
  550. return smalltalk.withContext(function($ctx1) {
  551. self._withChangesDo_((function(){
  552. return smalltalk.withContext(function($ctx2) {
  553. return _st(self._environment())._moveMethod_toClass_(self._selectedMethod(),aClassName);
  554. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  555. return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToClass:",{aClassName:aClassName},smalltalk.HLToolModel)})},
  556. args: ["aClassName"],
  557. source: "moveMethodToClass: aClassName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveMethod: self selectedMethod \x0a\x09\x09\x09toClass: aClassName ]",
  558. messageSends: ["withChangesDo:", "moveMethod:toClass:", "environment", "selectedMethod"],
  559. referencedClasses: []
  560. }),
  561. smalltalk.HLToolModel);
  562. smalltalk.addMethod(
  563. smalltalk.method({
  564. selector: "moveMethodToProtocol:",
  565. category: 'commands actions',
  566. fn: function (aProtocol){
  567. var self=this;
  568. return smalltalk.withContext(function($ctx1) {
  569. self._withChangesDo_((function(){
  570. return smalltalk.withContext(function($ctx2) {
  571. return _st(self._environment())._moveMethod_toProtocol_(self._selectedMethod(),aProtocol);
  572. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  573. return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToProtocol:",{aProtocol:aProtocol},smalltalk.HLToolModel)})},
  574. args: ["aProtocol"],
  575. source: "moveMethodToProtocol: aProtocol\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveMethod: self selectedMethod \x0a\x09\x09\x09toProtocol: aProtocol ]",
  576. messageSends: ["withChangesDo:", "moveMethod:toProtocol:", "environment", "selectedMethod"],
  577. referencedClasses: []
  578. }),
  579. smalltalk.HLToolModel);
  580. smalltalk.addMethod(
  581. smalltalk.method({
  582. selector: "openClassNamed:",
  583. category: 'commands actions',
  584. fn: function (aString){
  585. var self=this;
  586. var class_;
  587. return smalltalk.withContext(function($ctx1) {
  588. self._withChangesDo_((function(){
  589. return smalltalk.withContext(function($ctx2) {
  590. class_=_st(self._environment())._classNamed_(aString);
  591. class_;
  592. self._selectedPackage_(_st(class_)._package());
  593. return self._selectedClass_(class_);
  594. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  595. return self}, function($ctx1) {$ctx1.fill(self,"openClassNamed:",{aString:aString,class_:class_},smalltalk.HLToolModel)})},
  596. args: ["aString"],
  597. source: "openClassNamed: aString\x0a\x09| class |\x0a\x09\x0a\x09self withChangesDo: [\x0a\x09\x09class := self environment classNamed: aString.\x0a\x09\x09self selectedPackage: class package.\x0a\x09\x09self selectedClass: class ]",
  598. messageSends: ["withChangesDo:", "classNamed:", "environment", "selectedPackage:", "package", "selectedClass:"],
  599. referencedClasses: []
  600. }),
  601. smalltalk.HLToolModel);
  602. smalltalk.addMethod(
  603. smalltalk.method({
  604. selector: "packages",
  605. category: 'accessing',
  606. fn: function (){
  607. var self=this;
  608. return smalltalk.withContext(function($ctx1) {
  609. var $1;
  610. $1=_st(self._environment())._packages();
  611. return $1;
  612. }, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLToolModel)})},
  613. args: [],
  614. source: "packages\x0a\x09^ self environment packages",
  615. messageSends: ["packages", "environment"],
  616. referencedClasses: []
  617. }),
  618. smalltalk.HLToolModel);
  619. smalltalk.addMethod(
  620. smalltalk.method({
  621. selector: "removeClass",
  622. category: 'commands actions',
  623. fn: function (){
  624. var self=this;
  625. return smalltalk.withContext(function($ctx1) {
  626. var $1,$4,$3,$2,$5,$6;
  627. self._withChangesDo_((function(){
  628. return smalltalk.withContext(function($ctx2) {
  629. $1=self._manager();
  630. $4=self._selectedClass();
  631. $ctx2.sendIdx["selectedClass"]=1;
  632. $3=_st($4)._name();
  633. $2="Do you REALLY want to remove class ".__comma($3);
  634. return _st($1)._confirm_ifTrue_($2,(function(){
  635. return smalltalk.withContext(function($ctx3) {
  636. $5=self._environment();
  637. $6=self._selectedClass();
  638. return _st($5)._removeClass_($6);
  639. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  640. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  641. return self}, function($ctx1) {$ctx1.fill(self,"removeClass",{},smalltalk.HLToolModel)})},
  642. args: [],
  643. source: "removeClass\x0a\x09self withChangesDo: [\x0a\x09\x09self manager \x0a\x09\x09\x09confirm: 'Do you REALLY want to remove class ', self selectedClass name\x0a\x09\x09\x09ifTrue: [ self environment removeClass: self selectedClass ] ]",
  644. messageSends: ["withChangesDo:", "confirm:ifTrue:", "manager", ",", "name", "selectedClass", "removeClass:", "environment"],
  645. referencedClasses: []
  646. }),
  647. smalltalk.HLToolModel);
  648. smalltalk.addMethod(
  649. smalltalk.method({
  650. selector: "removeMethod",
  651. category: 'commands actions',
  652. fn: function (){
  653. var self=this;
  654. return smalltalk.withContext(function($ctx1) {
  655. var $1,$7,$6,$5,$4,$3,$9,$8,$2,$10,$11;
  656. self._withChangesDo_((function(){
  657. return smalltalk.withContext(function($ctx2) {
  658. $1=self._manager();
  659. $7=self._selectedMethod();
  660. $ctx2.sendIdx["selectedMethod"]=1;
  661. $6=_st($7)._methodClass();
  662. $5=_st($6)._name();
  663. $4="Do you REALLY want to remove method ".__comma($5);
  664. $3=_st($4).__comma(" >> #");
  665. $ctx2.sendIdx[","]=2;
  666. $9=self._selectedMethod();
  667. $ctx2.sendIdx["selectedMethod"]=2;
  668. $8=_st($9)._selector();
  669. $2=_st($3).__comma($8);
  670. $ctx2.sendIdx[","]=1;
  671. return _st($1)._confirm_ifTrue_($2,(function(){
  672. return smalltalk.withContext(function($ctx3) {
  673. $10=self._environment();
  674. $11=self._selectedMethod();
  675. return _st($10)._removeMethod_($11);
  676. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  677. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  678. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod",{},smalltalk.HLToolModel)})},
  679. args: [],
  680. source: "removeMethod\x0a\x09self withChangesDo: [\x0a\x09\x09self manager \x0a\x09\x09\x09confirm: 'Do you REALLY want to remove method ', self selectedMethod methodClass name,' >> #', self selectedMethod selector\x0a\x09\x09\x09ifTrue: [ self environment removeMethod: self selectedMethod ] ]",
  681. messageSends: ["withChangesDo:", "confirm:ifTrue:", "manager", ",", "name", "methodClass", "selectedMethod", "selector", "removeMethod:", "environment"],
  682. referencedClasses: []
  683. }),
  684. smalltalk.HLToolModel);
  685. smalltalk.addMethod(
  686. smalltalk.method({
  687. selector: "removeProtocol",
  688. category: 'commands actions',
  689. fn: function (){
  690. var self=this;
  691. return smalltalk.withContext(function($ctx1) {
  692. var $1,$3,$2,$4,$5;
  693. self._withChangesDo_((function(){
  694. return smalltalk.withContext(function($ctx2) {
  695. $1=self._manager();
  696. $3=self._selectedProtocol();
  697. $ctx2.sendIdx["selectedProtocol"]=1;
  698. $2="Do you REALLY want to remove protocol ".__comma($3);
  699. return _st($1)._confirm_ifTrue_($2,(function(){
  700. return smalltalk.withContext(function($ctx3) {
  701. $4=self._environment();
  702. $5=self._selectedProtocol();
  703. return _st($4)._removeProtocol_from_($5,self._selectedClass());
  704. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  705. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  706. return self}, function($ctx1) {$ctx1.fill(self,"removeProtocol",{},smalltalk.HLToolModel)})},
  707. args: [],
  708. source: "removeProtocol\x0a\x09self withChangesDo: [\x0a\x09\x09self manager \x0a\x09\x09\x09confirm: 'Do you REALLY want to remove protocol ', self selectedProtocol\x0a\x09\x09\x09ifTrue: [ self environment \x0a\x09\x09\x09\x09removeProtocol: self selectedProtocol \x0a\x09\x09\x09\x09from: self selectedClass ] ]",
  709. messageSends: ["withChangesDo:", "confirm:ifTrue:", "manager", ",", "selectedProtocol", "removeProtocol:from:", "environment", "selectedClass"],
  710. referencedClasses: []
  711. }),
  712. smalltalk.HLToolModel);
  713. smalltalk.addMethod(
  714. smalltalk.method({
  715. selector: "renameClassTo:",
  716. category: 'commands actions',
  717. fn: function (aClassName){
  718. var self=this;
  719. return smalltalk.withContext(function($ctx1) {
  720. self._withChangesDo_((function(){
  721. return smalltalk.withContext(function($ctx2) {
  722. return _st(self._environment())._renameClass_to_(_st(self._selectedClass())._theNonMetaClass(),aClassName);
  723. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  724. return self}, function($ctx1) {$ctx1.fill(self,"renameClassTo:",{aClassName:aClassName},smalltalk.HLToolModel)})},
  725. args: ["aClassName"],
  726. source: "renameClassTo: aClassName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09renameClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09to: aClassName ]",
  727. messageSends: ["withChangesDo:", "renameClass:to:", "environment", "theNonMetaClass", "selectedClass"],
  728. referencedClasses: []
  729. }),
  730. smalltalk.HLToolModel);
  731. smalltalk.addMethod(
  732. smalltalk.method({
  733. selector: "renameProtocolTo:",
  734. category: 'commands actions',
  735. fn: function (aString){
  736. var self=this;
  737. return smalltalk.withContext(function($ctx1) {
  738. self._withChangesDo_((function(){
  739. return smalltalk.withContext(function($ctx2) {
  740. return _st(self._environment())._renameProtocol_to_in_(self._selectedProtocol(),aString,self._selectedClass());
  741. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  742. return self}, function($ctx1) {$ctx1.fill(self,"renameProtocolTo:",{aString:aString},smalltalk.HLToolModel)})},
  743. args: ["aString"],
  744. source: "renameProtocolTo: aString\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09renameProtocol: self selectedProtocol\x0a\x09\x09\x09to: aString\x0a\x09\x09\x09in: self selectedClass ]",
  745. messageSends: ["withChangesDo:", "renameProtocol:to:in:", "environment", "selectedProtocol", "selectedClass"],
  746. referencedClasses: []
  747. }),
  748. smalltalk.HLToolModel);
  749. smalltalk.addMethod(
  750. smalltalk.method({
  751. selector: "save:",
  752. category: 'actions',
  753. fn: function (aString){
  754. var self=this;
  755. function $HLSourceCodeSaved(){return smalltalk.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  756. return smalltalk.withContext(function($ctx1) {
  757. var $1;
  758. _st(self._announcer())._announce_(_st($HLSourceCodeSaved())._new());
  759. $1=self._shouldCompileClassDefinition_(aString);
  760. if(smalltalk.assert($1)){
  761. self._compileClassDefinition_(aString);
  762. } else {
  763. self._compileMethod_(aString);
  764. };
  765. return self}, function($ctx1) {$ctx1.fill(self,"save:",{aString:aString},smalltalk.HLToolModel)})},
  766. args: ["aString"],
  767. source: "save: aString\x0a\x09self announcer announce: HLSourceCodeSaved new.\x0a\x09\x0a\x09(self shouldCompileClassDefinition: aString)\x0a\x09\x09ifTrue: [ self compileClassDefinition: aString ]\x0a\x09\x09ifFalse: [ self compileMethod: aString ]",
  768. messageSends: ["announce:", "announcer", "new", "ifTrue:ifFalse:", "shouldCompileClassDefinition:", "compileClassDefinition:", "compileMethod:"],
  769. referencedClasses: ["HLSourceCodeSaved"]
  770. }),
  771. smalltalk.HLToolModel);
  772. smalltalk.addMethod(
  773. smalltalk.method({
  774. selector: "saveSourceCode",
  775. category: 'actions',
  776. fn: function (){
  777. var self=this;
  778. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  779. return smalltalk.withContext(function($ctx1) {
  780. _st(self._announcer())._announce_(_st($HLSaveSourceCode())._new());
  781. return self}, function($ctx1) {$ctx1.fill(self,"saveSourceCode",{},smalltalk.HLToolModel)})},
  782. args: [],
  783. source: "saveSourceCode\x0a\x09self announcer announce: HLSaveSourceCode new",
  784. messageSends: ["announce:", "announcer", "new"],
  785. referencedClasses: ["HLSaveSourceCode"]
  786. }),
  787. smalltalk.HLToolModel);
  788. smalltalk.addMethod(
  789. smalltalk.method({
  790. selector: "selectedClass",
  791. category: 'accessing',
  792. fn: function (){
  793. var self=this;
  794. return smalltalk.withContext(function($ctx1) {
  795. var $1;
  796. $1=self["@selectedClass"];
  797. return $1;
  798. }, function($ctx1) {$ctx1.fill(self,"selectedClass",{},smalltalk.HLToolModel)})},
  799. args: [],
  800. source: "selectedClass\x0a\x09^ selectedClass",
  801. messageSends: [],
  802. referencedClasses: []
  803. }),
  804. smalltalk.HLToolModel);
  805. smalltalk.addMethod(
  806. smalltalk.method({
  807. selector: "selectedClass:",
  808. category: 'accessing',
  809. fn: function (aClass){
  810. var self=this;
  811. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  812. return smalltalk.withContext(function($ctx1) {
  813. var $4,$3,$2,$1,$5,$6,$8,$7,$9,$10,$12,$13,$11;
  814. $4=self._selectedClass();
  815. $ctx1.sendIdx["selectedClass"]=1;
  816. $3=_st($4).__eq(aClass);
  817. $ctx1.sendIdx["="]=1;
  818. $2=_st($3)._and_((function(){
  819. return smalltalk.withContext(function($ctx2) {
  820. return _st(aClass)._isNil();
  821. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  822. if(smalltalk.assert($2)){
  823. return self;
  824. };
  825. self._withChangesDo_((function(){
  826. return smalltalk.withContext(function($ctx2) {
  827. $5=_st(self["@selectedClass"]).__eq(aClass);
  828. if(smalltalk.assert($5)){
  829. self._selectedProtocol_(nil);
  830. $ctx2.sendIdx["selectedProtocol:"]=1;
  831. };
  832. $6=aClass;
  833. if(($receiver = $6) == nil || $receiver == null){
  834. self["@selectedClass"]=nil;
  835. self["@selectedClass"];
  836. } else {
  837. $8=_st(aClass)._theNonMetaClass();
  838. $ctx2.sendIdx["theNonMetaClass"]=1;
  839. $7=_st($8)._package();
  840. self._selectedPackage_($7);
  841. $9=self._showInstance();
  842. if(smalltalk.assert($9)){
  843. self["@selectedClass"]=_st(aClass)._theNonMetaClass();
  844. self["@selectedClass"];
  845. } else {
  846. self["@selectedClass"]=_st(aClass)._theMetaClass();
  847. self["@selectedClass"];
  848. };
  849. };
  850. self._selectedProtocol_(nil);
  851. $10=self._announcer();
  852. $12=$HLClassSelected();
  853. $13=self._selectedClass();
  854. $11=_st($12)._on_($13);
  855. return _st($10)._announce_($11);
  856. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  857. return self}, function($ctx1) {$ctx1.fill(self,"selectedClass:",{aClass:aClass},smalltalk.HLToolModel)})},
  858. args: ["aClass"],
  859. source: "selectedClass: aClass\x0a\x09(self selectedClass = aClass and: [ aClass isNil ]) \x0a\x09\x09ifTrue: [ ^ self ].\x0a\x09\x0a\x09self withChangesDo: [\x0a\x09\x09selectedClass = aClass ifTrue: [ \x0a\x09\x09\x09self selectedProtocol: nil ].\x0a \x0a\x09\x09aClass \x0a \x09\x09\x09ifNil: [ selectedClass := nil ]\x0a \x09\x09ifNotNil: [\x0a\x09\x09\x09\x09self selectedPackage: aClass theNonMetaClass package.\x0a\x09\x09\x09\x09self showInstance \x0a \x09\x09\x09\x09\x09ifTrue: [ selectedClass := aClass theNonMetaClass ]\x0a \x09\x09\x09\x09ifFalse: [ selectedClass := aClass theMetaClass ] ].\x0a\x09\x09self selectedProtocol: nil.\x0a\x09\x09self announcer announce: (HLClassSelected on: self selectedClass) ]",
  860. messageSends: ["ifTrue:", "and:", "=", "selectedClass", "isNil", "withChangesDo:", "selectedProtocol:", "ifNil:ifNotNil:", "selectedPackage:", "package", "theNonMetaClass", "ifTrue:ifFalse:", "showInstance", "theMetaClass", "announce:", "announcer", "on:"],
  861. referencedClasses: ["HLClassSelected"]
  862. }),
  863. smalltalk.HLToolModel);
  864. smalltalk.addMethod(
  865. smalltalk.method({
  866. selector: "selectedMethod",
  867. category: 'accessing',
  868. fn: function (){
  869. var self=this;
  870. return smalltalk.withContext(function($ctx1) {
  871. var $2,$4,$3,$1;
  872. $2=self._selectedClass();
  873. $ctx1.sendIdx["selectedClass"]=1;
  874. if(($receiver = $2) == nil || $receiver == null){
  875. $1=$2;
  876. } else {
  877. $4=self._selectedClass();
  878. $3=_st($4)._methodDictionary();
  879. $1=_st($3)._at_ifAbsent_(self["@selectedSelector"],(function(){
  880. return smalltalk.withContext(function($ctx2) {
  881. return nil;
  882. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  883. };
  884. return $1;
  885. }, function($ctx1) {$ctx1.fill(self,"selectedMethod",{},smalltalk.HLToolModel)})},
  886. args: [],
  887. source: "selectedMethod\x0a\x09^ self selectedClass ifNotNil: [ \x0a\x09\x09self selectedClass methodDictionary \x0a\x09\x09\x09at: selectedSelector \x0a\x09\x09\x09ifAbsent: [ nil ] ]",
  888. messageSends: ["ifNotNil:", "selectedClass", "at:ifAbsent:", "methodDictionary"],
  889. referencedClasses: []
  890. }),
  891. smalltalk.HLToolModel);
  892. smalltalk.addMethod(
  893. smalltalk.method({
  894. selector: "selectedMethod:",
  895. category: 'accessing',
  896. fn: function (aCompiledMethod){
  897. var self=this;
  898. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  899. return smalltalk.withContext(function($ctx1) {
  900. var $1,$2;
  901. $1=_st(self["@selectedSelector"]).__eq(aCompiledMethod);
  902. if(smalltalk.assert($1)){
  903. return self;
  904. };
  905. self._withChangesDo_((function(){
  906. return smalltalk.withContext(function($ctx2) {
  907. $2=aCompiledMethod;
  908. if(($receiver = $2) == nil || $receiver == null){
  909. self["@selectedSelector"]=nil;
  910. self["@selectedSelector"];
  911. } else {
  912. self["@selectedClass"]=_st(aCompiledMethod)._methodClass();
  913. self["@selectedClass"];
  914. self["@selectedPackage"]=_st(_st(self["@selectedClass"])._theNonMetaClass())._package();
  915. self["@selectedPackage"];
  916. self["@selectedSelector"]=_st(aCompiledMethod)._selector();
  917. self["@selectedSelector"];
  918. };
  919. return _st(self._announcer())._announce_(_st($HLMethodSelected())._on_(aCompiledMethod));
  920. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  921. return self}, function($ctx1) {$ctx1.fill(self,"selectedMethod:",{aCompiledMethod:aCompiledMethod},smalltalk.HLToolModel)})},
  922. args: ["aCompiledMethod"],
  923. source: "selectedMethod: aCompiledMethod\x0a\x09selectedSelector = aCompiledMethod ifTrue: [ ^ self ].\x0a \x0a self withChangesDo: [\x0a\x09\x09aCompiledMethod\x0a \x09\x09ifNil: [ selectedSelector := nil ]\x0a \x09\x09ifNotNil: [\x0a\x09\x09\x09\x09selectedClass := aCompiledMethod methodClass.\x0a\x09\x09\x09\x09selectedPackage := selectedClass theNonMetaClass package.\x0a\x09\x09\x09\x09selectedSelector := aCompiledMethod selector ].\x0a\x0a\x09\x09self announcer announce: (HLMethodSelected on: aCompiledMethod) ]",
  924. messageSends: ["ifTrue:", "=", "withChangesDo:", "ifNil:ifNotNil:", "methodClass", "package", "theNonMetaClass", "selector", "announce:", "announcer", "on:"],
  925. referencedClasses: ["HLMethodSelected"]
  926. }),
  927. smalltalk.HLToolModel);
  928. smalltalk.addMethod(
  929. smalltalk.method({
  930. selector: "selectedPackage",
  931. category: 'accessing',
  932. fn: function (){
  933. var self=this;
  934. return smalltalk.withContext(function($ctx1) {
  935. var $1;
  936. $1=self["@selectedPackage"];
  937. return $1;
  938. }, function($ctx1) {$ctx1.fill(self,"selectedPackage",{},smalltalk.HLToolModel)})},
  939. args: [],
  940. source: "selectedPackage\x0a\x09^ selectedPackage",
  941. messageSends: [],
  942. referencedClasses: []
  943. }),
  944. smalltalk.HLToolModel);
  945. smalltalk.addMethod(
  946. smalltalk.method({
  947. selector: "selectedPackage:",
  948. category: 'accessing',
  949. fn: function (aPackage){
  950. var self=this;
  951. function $HLPackageSelected(){return smalltalk.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  952. return smalltalk.withContext(function($ctx1) {
  953. var $1;
  954. $1=_st(self["@selectedPackage"]).__eq(aPackage);
  955. if(smalltalk.assert($1)){
  956. return self;
  957. };
  958. self._withChangesDo_((function(){
  959. return smalltalk.withContext(function($ctx2) {
  960. self["@selectedPackage"]=aPackage;
  961. self["@selectedPackage"];
  962. self._selectedClass_(nil);
  963. return _st(self._announcer())._announce_(_st($HLPackageSelected())._on_(aPackage));
  964. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  965. return self}, function($ctx1) {$ctx1.fill(self,"selectedPackage:",{aPackage:aPackage},smalltalk.HLToolModel)})},
  966. args: ["aPackage"],
  967. source: "selectedPackage: aPackage\x0a\x09selectedPackage = aPackage ifTrue: [ ^ self ].\x0a \x0a\x09self withChangesDo: [\x0a\x09\x09selectedPackage := aPackage.\x0a\x09\x09self selectedClass: nil.\x0a\x09\x09self announcer announce: (HLPackageSelected on: aPackage) ]",
  968. messageSends: ["ifTrue:", "=", "withChangesDo:", "selectedClass:", "announce:", "announcer", "on:"],
  969. referencedClasses: ["HLPackageSelected"]
  970. }),
  971. smalltalk.HLToolModel);
  972. smalltalk.addMethod(
  973. smalltalk.method({
  974. selector: "selectedProtocol",
  975. category: 'accessing',
  976. fn: function (){
  977. var self=this;
  978. return smalltalk.withContext(function($ctx1) {
  979. var $1;
  980. $1=self["@selectedProtocol"];
  981. return $1;
  982. }, function($ctx1) {$ctx1.fill(self,"selectedProtocol",{},smalltalk.HLToolModel)})},
  983. args: [],
  984. source: "selectedProtocol\x0a\x09^ selectedProtocol",
  985. messageSends: [],
  986. referencedClasses: []
  987. }),
  988. smalltalk.HLToolModel);
  989. smalltalk.addMethod(
  990. smalltalk.method({
  991. selector: "selectedProtocol:",
  992. category: 'accessing',
  993. fn: function (aString){
  994. var self=this;
  995. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  996. return smalltalk.withContext(function($ctx1) {
  997. var $1;
  998. $1=_st(self["@selectedProtocol"]).__eq(aString);
  999. if(smalltalk.assert($1)){
  1000. return self;
  1001. };
  1002. self._withChangesDo_((function(){
  1003. return smalltalk.withContext(function($ctx2) {
  1004. self["@selectedProtocol"]=aString;
  1005. self["@selectedProtocol"];
  1006. self._selectedMethod_(nil);
  1007. return _st(self._announcer())._announce_(_st($HLProtocolSelected())._on_(aString));
  1008. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1009. return self}, function($ctx1) {$ctx1.fill(self,"selectedProtocol:",{aString:aString},smalltalk.HLToolModel)})},
  1010. args: ["aString"],
  1011. source: "selectedProtocol: aString\x0a\x09selectedProtocol = aString ifTrue: [ ^ self ].\x0a\x0a\x09self withChangesDo: [\x0a\x09\x09selectedProtocol := aString.\x0a\x09\x09self selectedMethod: nil.\x0a\x09\x09self announcer announce: (HLProtocolSelected on: aString) ]",
  1012. messageSends: ["ifTrue:", "=", "withChangesDo:", "selectedMethod:", "announce:", "announcer", "on:"],
  1013. referencedClasses: ["HLProtocolSelected"]
  1014. }),
  1015. smalltalk.HLToolModel);
  1016. smalltalk.addMethod(
  1017. smalltalk.method({
  1018. selector: "shouldCompileClassDefinition:",
  1019. category: 'testing',
  1020. fn: function (aString){
  1021. var self=this;
  1022. return smalltalk.withContext(function($ctx1) {
  1023. var $1;
  1024. $1=_st(_st(self._selectedClass())._isNil())._or_((function(){
  1025. return smalltalk.withContext(function($ctx2) {
  1026. return _st(aString)._match_("^[A-Z]");
  1027. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1028. return $1;
  1029. }, function($ctx1) {$ctx1.fill(self,"shouldCompileClassDefinition:",{aString:aString},smalltalk.HLToolModel)})},
  1030. args: ["aString"],
  1031. source: "shouldCompileClassDefinition: aString\x0a\x09^ self selectedClass isNil or: [\x0a\x09\x09aString match: '^[A-Z]' ]",
  1032. messageSends: ["or:", "isNil", "selectedClass", "match:"],
  1033. referencedClasses: []
  1034. }),
  1035. smalltalk.HLToolModel);
  1036. smalltalk.addMethod(
  1037. smalltalk.method({
  1038. selector: "unclassifiedProtocol",
  1039. category: 'defaults',
  1040. fn: function (){
  1041. var self=this;
  1042. return smalltalk.withContext(function($ctx1) {
  1043. return "as yet unclassified";
  1044. }, function($ctx1) {$ctx1.fill(self,"unclassifiedProtocol",{},smalltalk.HLToolModel)})},
  1045. args: [],
  1046. source: "unclassifiedProtocol\x0a\x09^ 'as yet unclassified'",
  1047. messageSends: [],
  1048. referencedClasses: []
  1049. }),
  1050. smalltalk.HLToolModel);
  1051. smalltalk.addMethod(
  1052. smalltalk.method({
  1053. selector: "withCompileErrorHandling:",
  1054. category: 'error handling',
  1055. fn: function (aBlock){
  1056. var self=this;
  1057. function $ParseError(){return smalltalk.ParseError||(typeof ParseError=="undefined"?nil:ParseError)}
  1058. function $UnknownVariableError(){return smalltalk.UnknownVariableError||(typeof UnknownVariableError=="undefined"?nil:UnknownVariableError)}
  1059. function $CompilerError(){return smalltalk.CompilerError||(typeof CompilerError=="undefined"?nil:CompilerError)}
  1060. return smalltalk.withContext(function($ctx1) {
  1061. var $2,$3,$4,$1;
  1062. $2=self._environment();
  1063. $ctx1.sendIdx["environment"]=1;
  1064. $1=_st($2)._evaluate_on_do_((function(){
  1065. return smalltalk.withContext(function($ctx2) {
  1066. $3=self._environment();
  1067. $ctx2.sendIdx["environment"]=2;
  1068. return _st($3)._evaluate_on_do_((function(){
  1069. return smalltalk.withContext(function($ctx3) {
  1070. $4=self._environment();
  1071. return _st($4)._evaluate_on_do_(aBlock,$ParseError(),(function(ex){
  1072. return smalltalk.withContext(function($ctx4) {
  1073. return self._handleParseError_(ex);
  1074. }, function($ctx4) {$ctx4.fillBlock({ex:ex},$ctx3,3)})}));
  1075. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}),$UnknownVariableError(),(function(ex){
  1076. return smalltalk.withContext(function($ctx3) {
  1077. return self._handleUnkownVariableError_(ex);
  1078. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,4)})}));
  1079. $ctx2.sendIdx["evaluate:on:do:"]=2;
  1080. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$CompilerError(),(function(ex){
  1081. return smalltalk.withContext(function($ctx2) {
  1082. return self._handleCompileError_(ex);
  1083. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,5)})}));
  1084. $ctx1.sendIdx["evaluate:on:do:"]=1;
  1085. return self}, function($ctx1) {$ctx1.fill(self,"withCompileErrorHandling:",{aBlock:aBlock},smalltalk.HLToolModel)})},
  1086. args: ["aBlock"],
  1087. source: "withCompileErrorHandling: aBlock\x0a\x09self environment\x0a\x09\x09evaluate: [\x0a\x09\x09\x09self environment \x0a\x09\x09\x09evaluate: [\x0a\x09\x09\x09\x09self environment \x0a\x09\x09\x09\x09\x09evaluate: aBlock\x0a\x09\x09\x09\x09\x09on: ParseError\x0a\x09\x09\x09\x09\x09do: [:ex | self handleParseError: ex ] ]\x0a\x09\x09\x09on: UnknownVariableError\x0a\x09\x09\x09do: [ :ex | self handleUnkownVariableError: ex ] ]\x0a\x09\x09on: CompilerError\x0a\x09\x09do: [ :ex | self handleCompileError: ex ]",
  1088. messageSends: ["evaluate:on:do:", "environment", "handleParseError:", "handleUnkownVariableError:", "handleCompileError:"],
  1089. referencedClasses: ["ParseError", "UnknownVariableError", "CompilerError"]
  1090. }),
  1091. smalltalk.HLToolModel);
  1092. smalltalk.addMethod(
  1093. smalltalk.method({
  1094. selector: "withHelperLabelled:do:",
  1095. category: 'private',
  1096. fn: function (aString,aBlock){
  1097. var self=this;
  1098. return smalltalk.withContext(function($ctx1) {
  1099. var $2,$1,$4,$5,$3,$6,$7;
  1100. $2="#helper"._asJQuery();
  1101. $ctx1.sendIdx["asJQuery"]=1;
  1102. $1=_st($2)._remove();
  1103. $ctx1.sendIdx["remove"]=1;
  1104. $3=(function(html){
  1105. return smalltalk.withContext(function($ctx2) {
  1106. $4=_st(html)._div();
  1107. _st($4)._id_("helper");
  1108. $5=_st($4)._with_(aString);
  1109. return $5;
  1110. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})});
  1111. $6="body"._asJQuery();
  1112. $ctx1.sendIdx["asJQuery"]=2;
  1113. _st($3)._appendToJQuery_($6);
  1114. _st((function(){
  1115. return smalltalk.withContext(function($ctx2) {
  1116. _st(aBlock)._value();
  1117. $7="#helper"._asJQuery();
  1118. return _st($7)._remove();
  1119. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}))._valueWithTimeout_((10));
  1120. return self}, function($ctx1) {$ctx1.fill(self,"withHelperLabelled:do:",{aString:aString,aBlock:aBlock},smalltalk.HLToolModel)})},
  1121. args: ["aString", "aBlock"],
  1122. source: "withHelperLabelled: aString do: aBlock\x0a\x09\x22TODO: doesn't belong here\x22\x0a\x0a\x09'#helper' asJQuery remove.\x0a\x0a\x09[ :html |\x0a\x09\x09html div \x0a\x09\x09\x09id: 'helper';\x0a\x09\x09\x09with: aString ] appendToJQuery: 'body' asJQuery.\x0a\x09\x0a\x09[\x0a\x09\x09aBlock value.\x0a\x09\x09'#helper' asJQuery remove\x0a\x09] \x0a\x09\x09valueWithTimeout: 10",
  1123. messageSends: ["remove", "asJQuery", "appendToJQuery:", "id:", "div", "with:", "valueWithTimeout:", "value"],
  1124. referencedClasses: []
  1125. }),
  1126. smalltalk.HLToolModel);
  1127. smalltalk.addMethod(
  1128. smalltalk.method({
  1129. selector: "on:",
  1130. category: 'actions',
  1131. fn: function (anEnvironment){
  1132. var self=this;
  1133. return smalltalk.withContext(function($ctx1) {
  1134. var $2,$3,$1;
  1135. $2=self._new();
  1136. _st($2)._environment_(anEnvironment);
  1137. $3=_st($2)._yourself();
  1138. $1=$3;
  1139. return $1;
  1140. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLToolModel.klass)})},
  1141. args: ["anEnvironment"],
  1142. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  1143. messageSends: ["environment:", "new", "yourself"],
  1144. referencedClasses: []
  1145. }),
  1146. smalltalk.HLToolModel.klass);
  1147. smalltalk.addClass('HLProgressHandler', smalltalk.ProgressHandler, [], 'Helios-Core');
  1148. smalltalk.HLProgressHandler.comment="I am a specific progress handler for Helios, displaying progresses in a modal window.";
  1149. smalltalk.addMethod(
  1150. smalltalk.method({
  1151. selector: "do:on:displaying:",
  1152. category: 'progress handling',
  1153. fn: function (aBlock,aCollection,aString){
  1154. var self=this;
  1155. function $HLProgressWidget(){return smalltalk.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  1156. return smalltalk.withContext(function($ctx1) {
  1157. _st(_st($HLProgressWidget())._default())._do_on_displaying_(aBlock,aCollection,aString);
  1158. return self}, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},smalltalk.HLProgressHandler)})},
  1159. args: ["aBlock", "aCollection", "aString"],
  1160. source: "do: aBlock on: aCollection displaying: aString\x0a\x09HLProgressWidget default\x0a\x09\x09do: aBlock \x0a\x09\x09on: aCollection \x0a\x09\x09displaying: aString",
  1161. messageSends: ["do:on:displaying:", "default"],
  1162. referencedClasses: ["HLProgressWidget"]
  1163. }),
  1164. smalltalk.HLProgressHandler);
  1165. smalltalk.addClass('HLTabWidget', smalltalk.Widget, ['widget', 'label', 'root'], 'Helios-Core');
  1166. smalltalk.HLTabWidget.comment="I am a widget specialized into building another widget as an Helios tab.\x0a\x0aI should not be used directly, `HLWidget class >> #openAsTab` should be used instead.\x0a\x0a## Example\x0a\x0a HLWorkspace openAsTab";
  1167. smalltalk.addMethod(
  1168. smalltalk.method({
  1169. selector: "activate",
  1170. category: 'accessing',
  1171. fn: function (){
  1172. var self=this;
  1173. return smalltalk.withContext(function($ctx1) {
  1174. _st(self._manager())._activate_(self);
  1175. return self}, function($ctx1) {$ctx1.fill(self,"activate",{},smalltalk.HLTabWidget)})},
  1176. args: [],
  1177. source: "activate\x0a\x09self manager activate: self",
  1178. messageSends: ["activate:", "manager"],
  1179. referencedClasses: []
  1180. }),
  1181. smalltalk.HLTabWidget);
  1182. smalltalk.addMethod(
  1183. smalltalk.method({
  1184. selector: "add",
  1185. category: 'accessing',
  1186. fn: function (){
  1187. var self=this;
  1188. return smalltalk.withContext(function($ctx1) {
  1189. _st(self._manager())._addTab_(self);
  1190. return self}, function($ctx1) {$ctx1.fill(self,"add",{},smalltalk.HLTabWidget)})},
  1191. args: [],
  1192. source: "add\x0a\x09self manager addTab: self",
  1193. messageSends: ["addTab:", "manager"],
  1194. referencedClasses: []
  1195. }),
  1196. smalltalk.HLTabWidget);
  1197. smalltalk.addMethod(
  1198. smalltalk.method({
  1199. selector: "cssClass",
  1200. category: 'accessing',
  1201. fn: function (){
  1202. var self=this;
  1203. return smalltalk.withContext(function($ctx1) {
  1204. var $1;
  1205. $1=_st(self._widget())._tabClass();
  1206. return $1;
  1207. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLTabWidget)})},
  1208. args: [],
  1209. source: "cssClass\x0a\x09^ self widget tabClass",
  1210. messageSends: ["tabClass", "widget"],
  1211. referencedClasses: []
  1212. }),
  1213. smalltalk.HLTabWidget);
  1214. smalltalk.addMethod(
  1215. smalltalk.method({
  1216. selector: "displayLabel",
  1217. category: 'accessing',
  1218. fn: function (){
  1219. var self=this;
  1220. return smalltalk.withContext(function($ctx1) {
  1221. var $4,$3,$2,$6,$5,$1;
  1222. $4=self._label();
  1223. $ctx1.sendIdx["label"]=1;
  1224. $3=_st($4)._size();
  1225. $2=_st($3).__gt((20));
  1226. if(smalltalk.assert($2)){
  1227. $6=self._label();
  1228. $ctx1.sendIdx["label"]=2;
  1229. $5=_st($6)._first_((20));
  1230. $1=_st($5).__comma("...");
  1231. } else {
  1232. $1=self._label();
  1233. };
  1234. return $1;
  1235. }, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLTabWidget)})},
  1236. args: [],
  1237. source: "displayLabel\x0a\x09^ self label size > 20 \x0a\x09\x09ifTrue: [ (self label first: 20), '...' ]\x0a\x09\x09ifFalse: [ self label ]",
  1238. messageSends: ["ifTrue:ifFalse:", ">", "size", "label", ",", "first:"],
  1239. referencedClasses: []
  1240. }),
  1241. smalltalk.HLTabWidget);
  1242. smalltalk.addMethod(
  1243. smalltalk.method({
  1244. selector: "focus",
  1245. category: 'accessing',
  1246. fn: function (){
  1247. var self=this;
  1248. return smalltalk.withContext(function($ctx1) {
  1249. var $2,$1,$3;
  1250. $2=self._widget();
  1251. $ctx1.sendIdx["widget"]=1;
  1252. $1=_st($2)._canHaveFocus();
  1253. if(smalltalk.assert($1)){
  1254. $3=self._widget();
  1255. _st($3)._focus();
  1256. };
  1257. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLTabWidget)})},
  1258. args: [],
  1259. source: "focus\x0a\x09self widget canHaveFocus ifTrue: [\x0a\x09\x09self widget focus ]",
  1260. messageSends: ["ifTrue:", "canHaveFocus", "widget", "focus"],
  1261. referencedClasses: []
  1262. }),
  1263. smalltalk.HLTabWidget);
  1264. smalltalk.addMethod(
  1265. smalltalk.method({
  1266. selector: "hide",
  1267. category: 'actions',
  1268. fn: function (){
  1269. var self=this;
  1270. return smalltalk.withContext(function($ctx1) {
  1271. var $1;
  1272. $1=self["@root"];
  1273. if(($receiver = $1) == nil || $receiver == null){
  1274. $1;
  1275. } else {
  1276. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","hidden");
  1277. };
  1278. return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.HLTabWidget)})},
  1279. args: [],
  1280. source: "hide\x0a\x09root ifNotNil: [ root asJQuery css: 'visibility' put: 'hidden' ]",
  1281. messageSends: ["ifNotNil:", "css:put:", "asJQuery"],
  1282. referencedClasses: []
  1283. }),
  1284. smalltalk.HLTabWidget);
  1285. smalltalk.addMethod(
  1286. smalltalk.method({
  1287. selector: "isActive",
  1288. category: 'testing',
  1289. fn: function (){
  1290. var self=this;
  1291. return smalltalk.withContext(function($ctx1) {
  1292. var $1;
  1293. $1=_st(_st(self._manager())._activeTab()).__eq(self);
  1294. return $1;
  1295. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLTabWidget)})},
  1296. args: [],
  1297. source: "isActive\x0a\x09^ self manager activeTab = self",
  1298. messageSends: ["=", "activeTab", "manager"],
  1299. referencedClasses: []
  1300. }),
  1301. smalltalk.HLTabWidget);
  1302. smalltalk.addMethod(
  1303. smalltalk.method({
  1304. selector: "label",
  1305. category: 'accessing',
  1306. fn: function (){
  1307. var self=this;
  1308. return smalltalk.withContext(function($ctx1) {
  1309. var $2,$1;
  1310. $2=self["@label"];
  1311. if(($receiver = $2) == nil || $receiver == null){
  1312. $1="";
  1313. } else {
  1314. $1=$2;
  1315. };
  1316. return $1;
  1317. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLTabWidget)})},
  1318. args: [],
  1319. source: "label\x0a\x09^ label ifNil: [ '' ]",
  1320. messageSends: ["ifNil:"],
  1321. referencedClasses: []
  1322. }),
  1323. smalltalk.HLTabWidget);
  1324. smalltalk.addMethod(
  1325. smalltalk.method({
  1326. selector: "label:",
  1327. category: 'accessing',
  1328. fn: function (aString){
  1329. var self=this;
  1330. return smalltalk.withContext(function($ctx1) {
  1331. self["@label"]=aString;
  1332. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.HLTabWidget)})},
  1333. args: ["aString"],
  1334. source: "label: aString\x0a\x09label := aString",
  1335. messageSends: [],
  1336. referencedClasses: []
  1337. }),
  1338. smalltalk.HLTabWidget);
  1339. smalltalk.addMethod(
  1340. smalltalk.method({
  1341. selector: "manager",
  1342. category: 'accessing',
  1343. fn: function (){
  1344. var self=this;
  1345. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1346. return smalltalk.withContext(function($ctx1) {
  1347. var $1;
  1348. $1=_st($HLManager())._current();
  1349. return $1;
  1350. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLTabWidget)})},
  1351. args: [],
  1352. source: "manager\x0a\x09^ HLManager current",
  1353. messageSends: ["current"],
  1354. referencedClasses: ["HLManager"]
  1355. }),
  1356. smalltalk.HLTabWidget);
  1357. smalltalk.addMethod(
  1358. smalltalk.method({
  1359. selector: "registerBindings",
  1360. category: 'actions',
  1361. fn: function (){
  1362. var self=this;
  1363. return smalltalk.withContext(function($ctx1) {
  1364. _st(self._widget())._registerBindings();
  1365. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLTabWidget)})},
  1366. args: [],
  1367. source: "registerBindings\x0a\x09self widget registerBindings",
  1368. messageSends: ["registerBindings", "widget"],
  1369. referencedClasses: []
  1370. }),
  1371. smalltalk.HLTabWidget);
  1372. smalltalk.addMethod(
  1373. smalltalk.method({
  1374. selector: "remove",
  1375. category: 'actions',
  1376. fn: function (){
  1377. var self=this;
  1378. return smalltalk.withContext(function($ctx1) {
  1379. var $1;
  1380. _st(self._widget())._unregister();
  1381. $1=self["@root"];
  1382. if(($receiver = $1) == nil || $receiver == null){
  1383. $1;
  1384. } else {
  1385. _st(_st(self["@root"])._asJQuery())._remove();
  1386. };
  1387. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLTabWidget)})},
  1388. args: [],
  1389. source: "remove\x0a\x09self widget unregister.\x0a\x09root ifNotNil: [ root asJQuery remove ]",
  1390. messageSends: ["unregister", "widget", "ifNotNil:", "remove", "asJQuery"],
  1391. referencedClasses: []
  1392. }),
  1393. smalltalk.HLTabWidget);
  1394. smalltalk.addMethod(
  1395. smalltalk.method({
  1396. selector: "renderOn:",
  1397. category: 'rendering',
  1398. fn: function (html){
  1399. var self=this;
  1400. return smalltalk.withContext(function($ctx1) {
  1401. var $1,$2;
  1402. $1=_st(html)._div();
  1403. _st($1)._class_("tab");
  1404. $2=_st($1)._yourself();
  1405. self["@root"]=$2;
  1406. self._renderTab();
  1407. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLTabWidget)})},
  1408. args: ["html"],
  1409. source: "renderOn: html\x0a\x09root := html div\x0a\x09\x09class: 'tab';\x0a\x09\x09yourself.\x0a\x09self renderTab",
  1410. messageSends: ["class:", "div", "yourself", "renderTab"],
  1411. referencedClasses: []
  1412. }),
  1413. smalltalk.HLTabWidget);
  1414. smalltalk.addMethod(
  1415. smalltalk.method({
  1416. selector: "renderTab",
  1417. category: 'rendering',
  1418. fn: function (){
  1419. var self=this;
  1420. return smalltalk.withContext(function($ctx1) {
  1421. var $1,$2;
  1422. _st(self["@root"])._contents_((function(html){
  1423. return smalltalk.withContext(function($ctx2) {
  1424. $1=_st(html)._div();
  1425. _st($1)._class_("amber_box");
  1426. $2=_st($1)._with_((function(){
  1427. return smalltalk.withContext(function($ctx3) {
  1428. return _st(self._widget())._renderOn_(html);
  1429. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  1430. return $2;
  1431. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  1432. return self}, function($ctx1) {$ctx1.fill(self,"renderTab",{},smalltalk.HLTabWidget)})},
  1433. args: [],
  1434. source: "renderTab\x0a\x09root contents: [ :html |\x0a\x09\x09html div\x0a\x09\x09\x09class: 'amber_box';\x0a\x09\x09\x09with: [ self widget renderOn: html ] ]",
  1435. messageSends: ["contents:", "class:", "div", "with:", "renderOn:", "widget"],
  1436. referencedClasses: []
  1437. }),
  1438. smalltalk.HLTabWidget);
  1439. smalltalk.addMethod(
  1440. smalltalk.method({
  1441. selector: "show",
  1442. category: 'actions',
  1443. fn: function (){
  1444. var self=this;
  1445. return smalltalk.withContext(function($ctx1) {
  1446. var $1,$2,$3;
  1447. $1=self["@root"];
  1448. if(($receiver = $1) == nil || $receiver == null){
  1449. $2="body"._asJQuery();
  1450. $ctx1.sendIdx["asJQuery"]=1;
  1451. self._appendToJQuery_($2);
  1452. } else {
  1453. $3=_st(self["@root"])._asJQuery();
  1454. _st($3)._css_put_("visibility","visible");
  1455. };
  1456. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLTabWidget)})},
  1457. args: [],
  1458. source: "show\x0a\x09root\x0a\x09\x09ifNil: [ self appendToJQuery: 'body' asJQuery ]\x0a\x09\x09ifNotNil: [ root asJQuery css: 'visibility' put: 'visible' ]",
  1459. messageSends: ["ifNil:ifNotNil:", "appendToJQuery:", "asJQuery", "css:put:"],
  1460. referencedClasses: []
  1461. }),
  1462. smalltalk.HLTabWidget);
  1463. smalltalk.addMethod(
  1464. smalltalk.method({
  1465. selector: "widget",
  1466. category: 'accessing',
  1467. fn: function (){
  1468. var self=this;
  1469. return smalltalk.withContext(function($ctx1) {
  1470. var $1;
  1471. $1=self["@widget"];
  1472. return $1;
  1473. }, function($ctx1) {$ctx1.fill(self,"widget",{},smalltalk.HLTabWidget)})},
  1474. args: [],
  1475. source: "widget\x0a\x09^ widget",
  1476. messageSends: [],
  1477. referencedClasses: []
  1478. }),
  1479. smalltalk.HLTabWidget);
  1480. smalltalk.addMethod(
  1481. smalltalk.method({
  1482. selector: "widget:",
  1483. category: 'accessing',
  1484. fn: function (aWidget){
  1485. var self=this;
  1486. return smalltalk.withContext(function($ctx1) {
  1487. self["@widget"]=aWidget;
  1488. return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget},smalltalk.HLTabWidget)})},
  1489. args: ["aWidget"],
  1490. source: "widget: aWidget\x0a\x09widget := aWidget",
  1491. messageSends: [],
  1492. referencedClasses: []
  1493. }),
  1494. smalltalk.HLTabWidget);
  1495. smalltalk.addMethod(
  1496. smalltalk.method({
  1497. selector: "on:labelled:",
  1498. category: 'instance creation',
  1499. fn: function (aWidget,aString){
  1500. var self=this;
  1501. return smalltalk.withContext(function($ctx1) {
  1502. var $2,$3,$1;
  1503. $2=self._new();
  1504. _st($2)._widget_(aWidget);
  1505. _st($2)._label_(aString);
  1506. $3=_st($2)._yourself();
  1507. $1=$3;
  1508. return $1;
  1509. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString},smalltalk.HLTabWidget.klass)})},
  1510. args: ["aWidget", "aString"],
  1511. source: "on: aWidget labelled: aString\x0a\x09^ self new\x0a\x09\x09widget: aWidget;\x0a\x09\x09label: aString;\x0a\x09\x09yourself",
  1512. messageSends: ["widget:", "new", "label:", "yourself"],
  1513. referencedClasses: []
  1514. }),
  1515. smalltalk.HLTabWidget.klass);
  1516. smalltalk.addClass('HLWidget', smalltalk.Widget, ['wrapper'], 'Helios-Core');
  1517. smalltalk.HLWidget.comment="I am the abstract superclass of all Helios widgets.\x0a\x0aI provide common methods, additional behavior to widgets useful for Helios, like dialog creation, command execution and tab creation.\x0a\x0a## API\x0a\x0a1. Rendering\x0a\x0a Instead of overriding `#renderOn:` as with other Widget subclasses, my subclasses should override `#renderContentOn:`.\x0a\x0a2. Refreshing\x0a\x0a To re-render a widget, use `#refresh`.\x0a\x0a3. Key bindings registration and tabs\x0a\x0a When displayed as a tab, the widget has a chance to register keybindings with the `#registerBindingsOn:` hook method.\x0a \x0a4. Unregistration\x0a\x0a When a widget has subscribed to announcements or other actions that need to be cleared when closing the tab, the hook method `#unregister` will be called by helios.\x0a\x0a5. Tabs\x0a\x0a To enable a widget class to be open as a tab, override the class-side `#canBeOpenAsTab` method to answer `true`. `#tabClass` and `#tabPriority` can be overridden too to respectively change the css class of the tab and the order of tabs in the main menu.\x0a\x0a6. Command execution\x0a\x0a An helios command (instance of `HLCommand` or one of its subclass) can be executed with `#execute:`.";
  1518. smalltalk.addMethod(
  1519. smalltalk.method({
  1520. selector: "bindKeyDown:keyUp:",
  1521. category: 'keybindings',
  1522. fn: function (keyDownBlock,keyUpBlock){
  1523. var self=this;
  1524. return smalltalk.withContext(function($ctx1) {
  1525. var $1,$2;
  1526. $1=_st(self._wrapper())._asJQuery();
  1527. _st($1)._keydown_(keyDownBlock);
  1528. $2=_st($1)._keyup_(keyUpBlock);
  1529. return self}, function($ctx1) {$ctx1.fill(self,"bindKeyDown:keyUp:",{keyDownBlock:keyDownBlock,keyUpBlock:keyUpBlock},smalltalk.HLWidget)})},
  1530. args: ["keyDownBlock", "keyUpBlock"],
  1531. source: "bindKeyDown: keyDownBlock keyUp: keyUpBlock\x0a\x09self wrapper asJQuery\x0a\x09\x09keydown: keyDownBlock;\x0a\x09\x09keyup: keyUpBlock",
  1532. messageSends: ["keydown:", "asJQuery", "wrapper", "keyup:"],
  1533. referencedClasses: []
  1534. }),
  1535. smalltalk.HLWidget);
  1536. smalltalk.addMethod(
  1537. smalltalk.method({
  1538. selector: "canHaveFocus",
  1539. category: 'testing',
  1540. fn: function (){
  1541. var self=this;
  1542. return smalltalk.withContext(function($ctx1) {
  1543. return false;
  1544. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWidget)})},
  1545. args: [],
  1546. source: "canHaveFocus\x0a\x09^ false",
  1547. messageSends: [],
  1548. referencedClasses: []
  1549. }),
  1550. smalltalk.HLWidget);
  1551. smalltalk.addMethod(
  1552. smalltalk.method({
  1553. selector: "confirm:ifTrue:",
  1554. category: 'actions',
  1555. fn: function (aString,aBlock){
  1556. var self=this;
  1557. return smalltalk.withContext(function($ctx1) {
  1558. _st(self._manager())._confirm_ifTrue_(aString,aBlock);
  1559. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLWidget)})},
  1560. args: ["aString", "aBlock"],
  1561. source: "confirm: aString ifTrue: aBlock\x0a\x09self manager confirm: aString ifTrue: aBlock",
  1562. messageSends: ["confirm:ifTrue:", "manager"],
  1563. referencedClasses: []
  1564. }),
  1565. smalltalk.HLWidget);
  1566. smalltalk.addMethod(
  1567. smalltalk.method({
  1568. selector: "execute:",
  1569. category: 'actions',
  1570. fn: function (aCommand){
  1571. var self=this;
  1572. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1573. return smalltalk.withContext(function($ctx1) {
  1574. var $1,$2;
  1575. $1=_st(_st($HLManager())._current())._keyBinder();
  1576. _st($1)._activate();
  1577. $2=_st($1)._applyBinding_(_st(aCommand)._asBinding());
  1578. return self}, function($ctx1) {$ctx1.fill(self,"execute:",{aCommand:aCommand},smalltalk.HLWidget)})},
  1579. args: ["aCommand"],
  1580. source: "execute: aCommand\x0a\x09HLManager current keyBinder\x0a\x09\x09activate;\x0a\x09\x09applyBinding: aCommand asBinding",
  1581. messageSends: ["activate", "keyBinder", "current", "applyBinding:", "asBinding"],
  1582. referencedClasses: ["HLManager"]
  1583. }),
  1584. smalltalk.HLWidget);
  1585. smalltalk.addMethod(
  1586. smalltalk.method({
  1587. selector: "manager",
  1588. category: 'accessing',
  1589. fn: function (){
  1590. var self=this;
  1591. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1592. return smalltalk.withContext(function($ctx1) {
  1593. var $1;
  1594. $1=_st($HLManager())._current();
  1595. return $1;
  1596. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLWidget)})},
  1597. args: [],
  1598. source: "manager\x0a\x09^ HLManager current",
  1599. messageSends: ["current"],
  1600. referencedClasses: ["HLManager"]
  1601. }),
  1602. smalltalk.HLWidget);
  1603. smalltalk.addMethod(
  1604. smalltalk.method({
  1605. selector: "openAsTab",
  1606. category: 'actions',
  1607. fn: function (){
  1608. var self=this;
  1609. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1610. function $HLTabWidget(){return smalltalk.HLTabWidget||(typeof HLTabWidget=="undefined"?nil:HLTabWidget)}
  1611. return smalltalk.withContext(function($ctx1) {
  1612. _st(_st($HLManager())._current())._addTab_(_st($HLTabWidget())._on_labelled_(self,_st(self._class())._tabLabel()));
  1613. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{},smalltalk.HLWidget)})},
  1614. args: [],
  1615. source: "openAsTab\x0a\x09HLManager current addTab: (HLTabWidget on: self labelled: self class tabLabel)",
  1616. messageSends: ["addTab:", "current", "on:labelled:", "tabLabel", "class"],
  1617. referencedClasses: ["HLManager", "HLTabWidget"]
  1618. }),
  1619. smalltalk.HLWidget);
  1620. smalltalk.addMethod(
  1621. smalltalk.method({
  1622. selector: "refresh",
  1623. category: 'updating',
  1624. fn: function (){
  1625. var self=this;
  1626. return smalltalk.withContext(function($ctx1) {
  1627. var $1,$3,$2,$4,$6,$5;
  1628. $1=self._wrapper();
  1629. $ctx1.sendIdx["wrapper"]=1;
  1630. if(($receiver = $1) == nil || $receiver == null){
  1631. return self;
  1632. } else {
  1633. $1;
  1634. };
  1635. $3=self._wrapper();
  1636. $ctx1.sendIdx["wrapper"]=2;
  1637. $2=_st($3)._asJQuery();
  1638. $ctx1.sendIdx["asJQuery"]=1;
  1639. _st($2)._empty();
  1640. $4=(function(html){
  1641. return smalltalk.withContext(function($ctx2) {
  1642. return self._renderContentOn_(html);
  1643. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,2)})});
  1644. $6=self._wrapper();
  1645. $5=_st($6)._asJQuery();
  1646. _st($4)._appendToJQuery_($5);
  1647. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLWidget)})},
  1648. args: [],
  1649. source: "refresh\x0a\x09self wrapper ifNil: [ ^ self ].\x0a \x0a\x09self wrapper asJQuery empty.\x0a [ :html | self renderContentOn: html ] appendToJQuery: self wrapper asJQuery",
  1650. messageSends: ["ifNil:", "wrapper", "empty", "asJQuery", "appendToJQuery:", "renderContentOn:"],
  1651. referencedClasses: []
  1652. }),
  1653. smalltalk.HLWidget);
  1654. smalltalk.addMethod(
  1655. smalltalk.method({
  1656. selector: "registerBindings",
  1657. category: 'keybindings',
  1658. fn: function (){
  1659. var self=this;
  1660. return smalltalk.withContext(function($ctx1) {
  1661. self._registerBindingsOn_(_st(_st(self._manager())._keyBinder())._bindings());
  1662. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLWidget)})},
  1663. args: [],
  1664. source: "registerBindings\x0a\x09self registerBindingsOn: self manager keyBinder bindings",
  1665. messageSends: ["registerBindingsOn:", "bindings", "keyBinder", "manager"],
  1666. referencedClasses: []
  1667. }),
  1668. smalltalk.HLWidget);
  1669. smalltalk.addMethod(
  1670. smalltalk.method({
  1671. selector: "registerBindingsOn:",
  1672. category: 'keybindings',
  1673. fn: function (aBindingGroup){
  1674. var self=this;
  1675. return smalltalk.withContext(function($ctx1) {
  1676. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLWidget)})},
  1677. args: ["aBindingGroup"],
  1678. source: "registerBindingsOn: aBindingGroup",
  1679. messageSends: [],
  1680. referencedClasses: []
  1681. }),
  1682. smalltalk.HLWidget);
  1683. smalltalk.addMethod(
  1684. smalltalk.method({
  1685. selector: "renderContentOn:",
  1686. category: 'rendering',
  1687. fn: function (html){
  1688. var self=this;
  1689. return smalltalk.withContext(function($ctx1) {
  1690. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWidget)})},
  1691. args: ["html"],
  1692. source: "renderContentOn: html",
  1693. messageSends: [],
  1694. referencedClasses: []
  1695. }),
  1696. smalltalk.HLWidget);
  1697. smalltalk.addMethod(
  1698. smalltalk.method({
  1699. selector: "renderOn:",
  1700. category: 'rendering',
  1701. fn: function (html){
  1702. var self=this;
  1703. return smalltalk.withContext(function($ctx1) {
  1704. self["@wrapper"]=_st(html)._div();
  1705. _st((function(renderer){
  1706. return smalltalk.withContext(function($ctx2) {
  1707. return self._renderContentOn_(renderer);
  1708. }, function($ctx2) {$ctx2.fillBlock({renderer:renderer},$ctx1,1)})}))._appendToJQuery_(_st(self["@wrapper"])._asJQuery());
  1709. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLWidget)})},
  1710. args: ["html"],
  1711. source: "renderOn: html\x0a\x09wrapper := html div.\x0a [ :renderer | self renderContentOn: renderer ] appendToJQuery: wrapper asJQuery",
  1712. messageSends: ["div", "appendToJQuery:", "renderContentOn:", "asJQuery"],
  1713. referencedClasses: []
  1714. }),
  1715. smalltalk.HLWidget);
  1716. smalltalk.addMethod(
  1717. smalltalk.method({
  1718. selector: "request:do:",
  1719. category: 'actions',
  1720. fn: function (aString,aBlock){
  1721. var self=this;
  1722. return smalltalk.withContext(function($ctx1) {
  1723. _st(self._manager())._request_do_(aString,aBlock);
  1724. return self}, function($ctx1) {$ctx1.fill(self,"request:do:",{aString:aString,aBlock:aBlock},smalltalk.HLWidget)})},
  1725. args: ["aString", "aBlock"],
  1726. source: "request: aString do: aBlock\x0a\x09self manager request: aString do: aBlock",
  1727. messageSends: ["request:do:", "manager"],
  1728. referencedClasses: []
  1729. }),
  1730. smalltalk.HLWidget);
  1731. smalltalk.addMethod(
  1732. smalltalk.method({
  1733. selector: "request:value:do:",
  1734. category: 'actions',
  1735. fn: function (aString,valueString,aBlock){
  1736. var self=this;
  1737. return smalltalk.withContext(function($ctx1) {
  1738. _st(self._manager())._request_value_do_(aString,valueString,aBlock);
  1739. return self}, function($ctx1) {$ctx1.fill(self,"request:value:do:",{aString:aString,valueString:valueString,aBlock:aBlock},smalltalk.HLWidget)})},
  1740. args: ["aString", "valueString", "aBlock"],
  1741. source: "request: aString value: valueString do: aBlock\x0a\x09self manager \x0a\x09\x09request: aString \x0a\x09\x09value: valueString\x0a\x09\x09do: aBlock",
  1742. messageSends: ["request:value:do:", "manager"],
  1743. referencedClasses: []
  1744. }),
  1745. smalltalk.HLWidget);
  1746. smalltalk.addMethod(
  1747. smalltalk.method({
  1748. selector: "tabClass",
  1749. category: 'accessing',
  1750. fn: function (){
  1751. var self=this;
  1752. return smalltalk.withContext(function($ctx1) {
  1753. var $1;
  1754. $1=_st(self._class())._tabClass();
  1755. return $1;
  1756. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLWidget)})},
  1757. args: [],
  1758. source: "tabClass\x0a\x09^ self class tabClass",
  1759. messageSends: ["tabClass", "class"],
  1760. referencedClasses: []
  1761. }),
  1762. smalltalk.HLWidget);
  1763. smalltalk.addMethod(
  1764. smalltalk.method({
  1765. selector: "unbindKeyDownKeyUp",
  1766. category: 'keybindings',
  1767. fn: function (){
  1768. var self=this;
  1769. return smalltalk.withContext(function($ctx1) {
  1770. var $1,$2;
  1771. $1=_st(self._wrapper())._asJQuery();
  1772. _st($1)._unbind_("keydown");
  1773. $ctx1.sendIdx["unbind:"]=1;
  1774. $2=_st($1)._unbind_("keyup");
  1775. return self}, function($ctx1) {$ctx1.fill(self,"unbindKeyDownKeyUp",{},smalltalk.HLWidget)})},
  1776. args: [],
  1777. source: "unbindKeyDownKeyUp\x0a\x09self wrapper asJQuery\x0a\x09\x09unbind: 'keydown';\x0a\x09\x09unbind: 'keyup'",
  1778. messageSends: ["unbind:", "asJQuery", "wrapper"],
  1779. referencedClasses: []
  1780. }),
  1781. smalltalk.HLWidget);
  1782. smalltalk.addMethod(
  1783. smalltalk.method({
  1784. selector: "unregister",
  1785. category: 'actions',
  1786. fn: function (){
  1787. var self=this;
  1788. return smalltalk.withContext(function($ctx1) {
  1789. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLWidget)})},
  1790. args: [],
  1791. source: "unregister\x0a\x09\x22This method is called whenever the receiver is closed (as a tab).\x0a\x09Widgets subscribing to announcements should unregister there\x22",
  1792. messageSends: [],
  1793. referencedClasses: []
  1794. }),
  1795. smalltalk.HLWidget);
  1796. smalltalk.addMethod(
  1797. smalltalk.method({
  1798. selector: "wrapper",
  1799. category: 'accessing',
  1800. fn: function (){
  1801. var self=this;
  1802. return smalltalk.withContext(function($ctx1) {
  1803. var $1;
  1804. $1=self["@wrapper"];
  1805. return $1;
  1806. }, function($ctx1) {$ctx1.fill(self,"wrapper",{},smalltalk.HLWidget)})},
  1807. args: [],
  1808. source: "wrapper\x0a\x09^ wrapper",
  1809. messageSends: [],
  1810. referencedClasses: []
  1811. }),
  1812. smalltalk.HLWidget);
  1813. smalltalk.addMethod(
  1814. smalltalk.method({
  1815. selector: "canBeOpenAsTab",
  1816. category: 'testing',
  1817. fn: function (){
  1818. var self=this;
  1819. return smalltalk.withContext(function($ctx1) {
  1820. return false;
  1821. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWidget.klass)})},
  1822. args: [],
  1823. source: "canBeOpenAsTab\x0a\x09^ false",
  1824. messageSends: [],
  1825. referencedClasses: []
  1826. }),
  1827. smalltalk.HLWidget.klass);
  1828. smalltalk.addMethod(
  1829. smalltalk.method({
  1830. selector: "openAsTab",
  1831. category: 'accessing',
  1832. fn: function (){
  1833. var self=this;
  1834. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1835. function $HLTabWidget(){return smalltalk.HLTabWidget||(typeof HLTabWidget=="undefined"?nil:HLTabWidget)}
  1836. return smalltalk.withContext(function($ctx1) {
  1837. _st(_st($HLManager())._current())._addTab_(_st($HLTabWidget())._on_labelled_(self._new(),self._tabLabel()));
  1838. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{},smalltalk.HLWidget.klass)})},
  1839. args: [],
  1840. source: "openAsTab\x0a\x09HLManager current addTab: (HLTabWidget on: self new labelled: self tabLabel)",
  1841. messageSends: ["addTab:", "current", "on:labelled:", "new", "tabLabel"],
  1842. referencedClasses: ["HLManager", "HLTabWidget"]
  1843. }),
  1844. smalltalk.HLWidget.klass);
  1845. smalltalk.addMethod(
  1846. smalltalk.method({
  1847. selector: "tabClass",
  1848. category: 'accessing',
  1849. fn: function (){
  1850. var self=this;
  1851. return smalltalk.withContext(function($ctx1) {
  1852. return "";
  1853. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLWidget.klass)})},
  1854. args: [],
  1855. source: "tabClass\x0a\x09^ ''",
  1856. messageSends: [],
  1857. referencedClasses: []
  1858. }),
  1859. smalltalk.HLWidget.klass);
  1860. smalltalk.addMethod(
  1861. smalltalk.method({
  1862. selector: "tabLabel",
  1863. category: 'accessing',
  1864. fn: function (){
  1865. var self=this;
  1866. return smalltalk.withContext(function($ctx1) {
  1867. return "Tab";
  1868. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWidget.klass)})},
  1869. args: [],
  1870. source: "tabLabel\x0a\x09^ 'Tab'",
  1871. messageSends: [],
  1872. referencedClasses: []
  1873. }),
  1874. smalltalk.HLWidget.klass);
  1875. smalltalk.addMethod(
  1876. smalltalk.method({
  1877. selector: "tabPriority",
  1878. category: 'accessing',
  1879. fn: function (){
  1880. var self=this;
  1881. return smalltalk.withContext(function($ctx1) {
  1882. return (500);
  1883. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWidget.klass)})},
  1884. args: [],
  1885. source: "tabPriority\x0a\x09^ 500",
  1886. messageSends: [],
  1887. referencedClasses: []
  1888. }),
  1889. smalltalk.HLWidget.klass);
  1890. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, [], 'Helios-Core');
  1891. smalltalk.HLFocusableWidget.comment="I am a widget that can be focused.\x0a\x0a## API \x0a\x0aInstead of overriding `#renderOn:` as with other `Widget` subclasses, my subclasses should override `#renderContentOn:`.\x0a\x0aTo bring the focus to the widget, use the `#focus` method.";
  1892. smalltalk.addMethod(
  1893. smalltalk.method({
  1894. selector: "blur",
  1895. category: 'events',
  1896. fn: function (){
  1897. var self=this;
  1898. return smalltalk.withContext(function($ctx1) {
  1899. _st(_st(self._wrapper())._asJQuery())._blur();
  1900. return self}, function($ctx1) {$ctx1.fill(self,"blur",{},smalltalk.HLFocusableWidget)})},
  1901. args: [],
  1902. source: "blur\x0a\x09self wrapper asJQuery blur",
  1903. messageSends: ["blur", "asJQuery", "wrapper"],
  1904. referencedClasses: []
  1905. }),
  1906. smalltalk.HLFocusableWidget);
  1907. smalltalk.addMethod(
  1908. smalltalk.method({
  1909. selector: "canHaveFocus",
  1910. category: 'testing',
  1911. fn: function (){
  1912. var self=this;
  1913. return smalltalk.withContext(function($ctx1) {
  1914. return true;
  1915. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLFocusableWidget)})},
  1916. args: [],
  1917. source: "canHaveFocus\x0a\x09^ true",
  1918. messageSends: [],
  1919. referencedClasses: []
  1920. }),
  1921. smalltalk.HLFocusableWidget);
  1922. smalltalk.addMethod(
  1923. smalltalk.method({
  1924. selector: "focus",
  1925. category: 'events',
  1926. fn: function (){
  1927. var self=this;
  1928. return smalltalk.withContext(function($ctx1) {
  1929. _st(_st(self._wrapper())._asJQuery())._focus();
  1930. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLFocusableWidget)})},
  1931. args: [],
  1932. source: "focus\x0a\x09self wrapper asJQuery focus",
  1933. messageSends: ["focus", "asJQuery", "wrapper"],
  1934. referencedClasses: []
  1935. }),
  1936. smalltalk.HLFocusableWidget);
  1937. smalltalk.addMethod(
  1938. smalltalk.method({
  1939. selector: "focusClass",
  1940. category: 'accessing',
  1941. fn: function (){
  1942. var self=this;
  1943. return smalltalk.withContext(function($ctx1) {
  1944. return "focused";
  1945. }, function($ctx1) {$ctx1.fill(self,"focusClass",{},smalltalk.HLFocusableWidget)})},
  1946. args: [],
  1947. source: "focusClass\x0a\x09^ 'focused'",
  1948. messageSends: [],
  1949. referencedClasses: []
  1950. }),
  1951. smalltalk.HLFocusableWidget);
  1952. smalltalk.addMethod(
  1953. smalltalk.method({
  1954. selector: "hasFocus",
  1955. category: 'testing',
  1956. fn: function (){
  1957. var self=this;
  1958. return smalltalk.withContext(function($ctx1) {
  1959. var $3,$2,$5,$4,$1;
  1960. $3=self._wrapper();
  1961. $ctx1.sendIdx["wrapper"]=1;
  1962. $2=_st($3)._notNil();
  1963. $1=_st($2)._and_((function(){
  1964. return smalltalk.withContext(function($ctx2) {
  1965. $5=self._wrapper();
  1966. $4=_st($5)._asJQuery();
  1967. return _st($4)._hasClass_(self._focusClass());
  1968. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1969. return $1;
  1970. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLFocusableWidget)})},
  1971. args: [],
  1972. source: "hasFocus\x0a\x09^ self wrapper notNil and: [ self wrapper asJQuery hasClass: self focusClass ]",
  1973. messageSends: ["and:", "notNil", "wrapper", "hasClass:", "asJQuery", "focusClass"],
  1974. referencedClasses: []
  1975. }),
  1976. smalltalk.HLFocusableWidget);
  1977. smalltalk.addMethod(
  1978. smalltalk.method({
  1979. selector: "renderContentOn:",
  1980. category: 'rendering',
  1981. fn: function (html){
  1982. var self=this;
  1983. return smalltalk.withContext(function($ctx1) {
  1984. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLFocusableWidget)})},
  1985. args: ["html"],
  1986. source: "renderContentOn: html",
  1987. messageSends: [],
  1988. referencedClasses: []
  1989. }),
  1990. smalltalk.HLFocusableWidget);
  1991. smalltalk.addMethod(
  1992. smalltalk.method({
  1993. selector: "renderOn:",
  1994. category: 'rendering',
  1995. fn: function (html){
  1996. var self=this;
  1997. return smalltalk.withContext(function($ctx1) {
  1998. var $1,$2,$3,$5,$4,$6,$9,$8,$10,$7;
  1999. $1=_st(html)._div();
  2000. _st($1)._class_("hl_widget");
  2001. $2=_st($1)._yourself();
  2002. self["@wrapper"]=$2;
  2003. _st(self["@wrapper"])._with_((function(){
  2004. return smalltalk.withContext(function($ctx2) {
  2005. return self._renderContentOn_(html);
  2006. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2007. $3=self["@wrapper"];
  2008. _st($3)._at_put_("tabindex","0");
  2009. _st($3)._onBlur_((function(){
  2010. return smalltalk.withContext(function($ctx2) {
  2011. $5=self._wrapper();
  2012. $ctx2.sendIdx["wrapper"]=1;
  2013. $4=_st($5)._asJQuery();
  2014. $ctx2.sendIdx["asJQuery"]=1;
  2015. $6=self._focusClass();
  2016. $ctx2.sendIdx["focusClass"]=1;
  2017. return _st($4)._removeClass_($6);
  2018. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  2019. $7=_st($3)._onFocus_((function(){
  2020. return smalltalk.withContext(function($ctx2) {
  2021. $9=self._wrapper();
  2022. $8=_st($9)._asJQuery();
  2023. $10=self._focusClass();
  2024. return _st($8)._addClass_($10);
  2025. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  2026. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLFocusableWidget)})},
  2027. args: ["html"],
  2028. source: "renderOn: html\x0a wrapper := html div \x0a \x09class: 'hl_widget';\x0a\x09\x09yourself.\x0a\x09\x09\x0a wrapper with: [ self renderContentOn: html ].\x0a\x09\x0a\x09wrapper\x0a\x09\x09at: 'tabindex' put: '0';\x0a\x09\x09onBlur: [ self wrapper asJQuery removeClass: self focusClass ];\x0a onFocus: [ self wrapper asJQuery addClass: self focusClass ]",
  2029. messageSends: ["class:", "div", "yourself", "with:", "renderContentOn:", "at:put:", "onBlur:", "removeClass:", "asJQuery", "wrapper", "focusClass", "onFocus:", "addClass:"],
  2030. referencedClasses: []
  2031. }),
  2032. smalltalk.HLFocusableWidget);
  2033. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem', 'mapping'], 'Helios-Core');
  2034. smalltalk.addMethod(
  2035. smalltalk.method({
  2036. selector: "activateFirstListItem",
  2037. category: 'actions',
  2038. fn: function (){
  2039. var self=this;
  2040. return smalltalk.withContext(function($ctx1) {
  2041. self._activateListItem_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li.inactive"))._eq_((0)));
  2042. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{},smalltalk.HLListWidget)})},
  2043. args: [],
  2044. source: "activateFirstListItem\x0a\x09self activateListItem: ((wrapper asJQuery find: 'li.inactive') eq: 0)",
  2045. messageSends: ["activateListItem:", "eq:", "find:", "asJQuery"],
  2046. referencedClasses: []
  2047. }),
  2048. smalltalk.HLListWidget);
  2049. smalltalk.addMethod(
  2050. smalltalk.method({
  2051. selector: "activateItem:",
  2052. category: 'actions',
  2053. fn: function (anObject){
  2054. var self=this;
  2055. return smalltalk.withContext(function($ctx1) {
  2056. var $early={};
  2057. try {
  2058. self._activateListItem_(_st(_st(self["@mapping"])._at_ifAbsent_(anObject,(function(){
  2059. return smalltalk.withContext(function($ctx2) {
  2060. throw $early=[self];
  2061. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})))._asJQuery());
  2062. return self}
  2063. catch(e) {if(e===$early)return e[0]; throw e}
  2064. }, function($ctx1) {$ctx1.fill(self,"activateItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2065. args: ["anObject"],
  2066. source: "activateItem: anObject\x0a\x09self activateListItem: (mapping \x0a\x09\x09at: anObject\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  2067. messageSends: ["activateListItem:", "asJQuery", "at:ifAbsent:"],
  2068. referencedClasses: []
  2069. }),
  2070. smalltalk.HLListWidget);
  2071. smalltalk.addMethod(
  2072. smalltalk.method({
  2073. selector: "activateListItem:",
  2074. category: 'actions',
  2075. fn: function (aListItem){
  2076. var self=this;
  2077. var item;
  2078. return smalltalk.withContext(function($ctx1) {
  2079. var $1,$2;
  2080. $1=_st(aListItem)._get_((0));
  2081. if(($receiver = $1) == nil || $receiver == null){
  2082. return self;
  2083. } else {
  2084. $1;
  2085. };
  2086. _st(_st(_st(aListItem)._parent())._children())._removeClass_("active");
  2087. _st(aListItem)._addClass_("active");
  2088. self._ensureVisible_(aListItem);
  2089. item=_st(self._items())._at_(_st(_st(aListItem)._attr_("list-data"))._asNumber());
  2090. $2=_st(self._selectedItem()).__eq_eq(item);
  2091. if(! smalltalk.assert($2)){
  2092. self._selectItem_(item);
  2093. };
  2094. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,item:item},smalltalk.HLListWidget)})},
  2095. args: ["aListItem"],
  2096. source: "activateListItem: aListItem\x0a\x09| item |\x0a\x09\x0a\x09(aListItem get: 0) ifNil: [ ^self ].\x0a\x09aListItem parent children removeClass: 'active'.\x0a\x09aListItem addClass: 'active'.\x0a \x0a\x09self ensureVisible: aListItem.\x0a \x0a \x22Activate the corresponding item\x22\x0a item := (self items at: (aListItem attr: 'list-data') asNumber).\x0a self selectedItem == item ifFalse: [\x0a\x09 self selectItem: item ]",
  2097. messageSends: ["ifNil:", "get:", "removeClass:", "children", "parent", "addClass:", "ensureVisible:", "at:", "items", "asNumber", "attr:", "ifFalse:", "==", "selectedItem", "selectItem:"],
  2098. referencedClasses: []
  2099. }),
  2100. smalltalk.HLListWidget);
  2101. smalltalk.addMethod(
  2102. smalltalk.method({
  2103. selector: "activateNextListItem",
  2104. category: 'actions',
  2105. fn: function (){
  2106. var self=this;
  2107. return smalltalk.withContext(function($ctx1) {
  2108. var $4,$3,$2,$1,$8,$7,$6,$5;
  2109. $4=self._wrapper();
  2110. $ctx1.sendIdx["wrapper"]=1;
  2111. $3=_st($4)._asJQuery();
  2112. $ctx1.sendIdx["asJQuery"]=1;
  2113. $2=_st($3)._find_("li.active");
  2114. $ctx1.sendIdx["find:"]=1;
  2115. $1=_st($2)._next();
  2116. self._activateListItem_($1);
  2117. $8=self._wrapper();
  2118. $7=_st($8)._asJQuery();
  2119. $6=_st($7)._find_(" .active");
  2120. $5=_st($6)._get();
  2121. _st($5)._ifEmpty_((function(){
  2122. return smalltalk.withContext(function($ctx2) {
  2123. return self._activateFirstListItem();
  2124. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2125. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLListWidget)})},
  2126. args: [],
  2127. source: "activateNextListItem\x0a\x09self activateListItem: (self wrapper asJQuery find: 'li.active') next.\x0a\x09\x0a\x09\x22select the first item if none is selected\x22\x0a\x09(self wrapper asJQuery find: ' .active') get ifEmpty: [\x0a\x09\x09self activateFirstListItem ]",
  2128. messageSends: ["activateListItem:", "next", "find:", "asJQuery", "wrapper", "ifEmpty:", "get", "activateFirstListItem"],
  2129. referencedClasses: []
  2130. }),
  2131. smalltalk.HLListWidget);
  2132. smalltalk.addMethod(
  2133. smalltalk.method({
  2134. selector: "activatePreviousListItem",
  2135. category: 'actions',
  2136. fn: function (){
  2137. var self=this;
  2138. return smalltalk.withContext(function($ctx1) {
  2139. self._activateListItem_(_st(_st(_st(self._wrapper())._asJQuery())._find_("li.active"))._prev());
  2140. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLListWidget)})},
  2141. args: [],
  2142. source: "activatePreviousListItem\x0a\x09self activateListItem: (self wrapper asJQuery find: 'li.active') prev",
  2143. messageSends: ["activateListItem:", "prev", "find:", "asJQuery", "wrapper"],
  2144. referencedClasses: []
  2145. }),
  2146. smalltalk.HLListWidget);
  2147. smalltalk.addMethod(
  2148. smalltalk.method({
  2149. selector: "cssClassForItem:",
  2150. category: 'accessing',
  2151. fn: function (anObject){
  2152. var self=this;
  2153. return smalltalk.withContext(function($ctx1) {
  2154. return "";
  2155. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2156. args: ["anObject"],
  2157. source: "cssClassForItem: anObject\x0a\x09^ ''",
  2158. messageSends: [],
  2159. referencedClasses: []
  2160. }),
  2161. smalltalk.HLListWidget);
  2162. smalltalk.addMethod(
  2163. smalltalk.method({
  2164. selector: "defaultItems",
  2165. category: 'defaults',
  2166. fn: function (){
  2167. var self=this;
  2168. return smalltalk.withContext(function($ctx1) {
  2169. var $1;
  2170. $1=[];
  2171. return $1;
  2172. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{},smalltalk.HLListWidget)})},
  2173. args: [],
  2174. source: "defaultItems\x0a\x09^ #()",
  2175. messageSends: [],
  2176. referencedClasses: []
  2177. }),
  2178. smalltalk.HLListWidget);
  2179. smalltalk.addMethod(
  2180. smalltalk.method({
  2181. selector: "ensureVisible:",
  2182. category: 'actions',
  2183. fn: function (aListItem){
  2184. var self=this;
  2185. var parent,position;
  2186. return smalltalk.withContext(function($ctx1) {
  2187. var $4,$3,$2,$5,$9,$8,$11,$10,$7,$6,$1,$16,$15,$17,$14,$18,$13,$19,$24,$23,$25,$22,$27,$29,$28,$26,$21,$20,$12;
  2188. position=self._positionOf_(aListItem);
  2189. parent=_st(aListItem)._parent();
  2190. $4=_st(aListItem)._position();
  2191. $ctx1.sendIdx["position"]=1;
  2192. $3=_st($4)._top();
  2193. $ctx1.sendIdx["top"]=1;
  2194. $2=_st($3).__lt((0));
  2195. if(smalltalk.assert($2)){
  2196. $5=_st(parent)._get_((0));
  2197. $ctx1.sendIdx["get:"]=1;
  2198. $9=_st(parent)._get_((0));
  2199. $ctx1.sendIdx["get:"]=2;
  2200. $8=_st($9)._scrollTop();
  2201. $ctx1.sendIdx["scrollTop"]=1;
  2202. $11=_st(aListItem)._position();
  2203. $ctx1.sendIdx["position"]=2;
  2204. $10=_st($11)._top();
  2205. $ctx1.sendIdx["top"]=2;
  2206. $7=_st($8).__plus($10);
  2207. $ctx1.sendIdx["+"]=1;
  2208. $6=_st($7).__minus((10));
  2209. $ctx1.sendIdx["-"]=1;
  2210. $1=_st($5)._scrollTop_($6);
  2211. $ctx1.sendIdx["scrollTop:"]=1;
  2212. };
  2213. $16=_st(aListItem)._position();
  2214. $ctx1.sendIdx["position"]=3;
  2215. $15=_st($16)._top();
  2216. $ctx1.sendIdx["top"]=3;
  2217. $17=_st(aListItem)._height();
  2218. $ctx1.sendIdx["height"]=1;
  2219. $14=_st($15).__plus($17);
  2220. $ctx1.sendIdx["+"]=2;
  2221. $18=_st(parent)._height();
  2222. $ctx1.sendIdx["height"]=2;
  2223. $13=_st($14).__gt($18);
  2224. if(smalltalk.assert($13)){
  2225. $19=_st(parent)._get_((0));
  2226. $ctx1.sendIdx["get:"]=3;
  2227. $24=_st(parent)._get_((0));
  2228. $23=_st($24)._scrollTop();
  2229. $25=_st(aListItem)._height();
  2230. $ctx1.sendIdx["height"]=3;
  2231. $22=_st($23).__plus($25);
  2232. $27=_st(parent)._height();
  2233. $29=_st(aListItem)._position();
  2234. $28=_st($29)._top();
  2235. $26=_st($27).__minus($28);
  2236. $21=_st($22).__minus($26);
  2237. $ctx1.sendIdx["-"]=2;
  2238. $20=_st($21).__plus((10));
  2239. $ctx1.sendIdx["+"]=3;
  2240. $12=_st($19)._scrollTop_($20);
  2241. };
  2242. return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,parent:parent,position:position},smalltalk.HLListWidget)})},
  2243. args: ["aListItem"],
  2244. source: "ensureVisible: aListItem\x09\x0a\x09\x22Move the scrollbar to show the active element\x22\x0a\x09\x0a\x09| parent position |\x0a\x09\x0a\x09position := self positionOf: aListItem.\x0a\x09parent := aListItem parent.\x0a\x09\x0a aListItem position top < 0 ifTrue: [\x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem position top - 10) ].\x0a aListItem position top + aListItem height > parent height ifTrue: [ \x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem height - (parent height - aListItem position top)) +10 ]",
  2245. messageSends: ["positionOf:", "parent", "ifTrue:", "<", "top", "position", "scrollTop:", "get:", "-", "+", "scrollTop", ">", "height"],
  2246. referencedClasses: []
  2247. }),
  2248. smalltalk.HLListWidget);
  2249. smalltalk.addMethod(
  2250. smalltalk.method({
  2251. selector: "focus",
  2252. category: 'actions',
  2253. fn: function (){
  2254. var self=this;
  2255. return smalltalk.withContext(function($ctx1) {
  2256. var $1,$2;
  2257. smalltalk.HLListWidget.superclass.fn.prototype._focus.apply(_st(self), []);
  2258. $1=_st(self._items())._isEmpty();
  2259. if(! smalltalk.assert($1)){
  2260. $2=self._selectedItem();
  2261. if(($receiver = $2) == nil || $receiver == null){
  2262. self._activateFirstListItem();
  2263. } else {
  2264. $2;
  2265. };
  2266. };
  2267. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLListWidget)})},
  2268. args: [],
  2269. source: "focus\x0a\x09super focus.\x0a self items isEmpty ifFalse: [ \x0a\x09\x09self selectedItem ifNil: [ self activateFirstListItem ] ]",
  2270. messageSends: ["focus", "ifFalse:", "isEmpty", "items", "ifNil:", "selectedItem", "activateFirstListItem"],
  2271. referencedClasses: []
  2272. }),
  2273. smalltalk.HLListWidget);
  2274. smalltalk.addMethod(
  2275. smalltalk.method({
  2276. selector: "initialize",
  2277. category: 'initialization',
  2278. fn: function (){
  2279. var self=this;
  2280. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  2281. return smalltalk.withContext(function($ctx1) {
  2282. smalltalk.HLListWidget.superclass.fn.prototype._initialize.apply(_st(self), []);
  2283. self["@mapping"]=_st($Dictionary())._new();
  2284. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLListWidget)})},
  2285. args: [],
  2286. source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09mapping := Dictionary new.",
  2287. messageSends: ["initialize", "new"],
  2288. referencedClasses: ["Dictionary"]
  2289. }),
  2290. smalltalk.HLListWidget);
  2291. smalltalk.addMethod(
  2292. smalltalk.method({
  2293. selector: "items",
  2294. category: 'accessing',
  2295. fn: function (){
  2296. var self=this;
  2297. return smalltalk.withContext(function($ctx1) {
  2298. var $2,$1;
  2299. $2=self["@items"];
  2300. if(($receiver = $2) == nil || $receiver == null){
  2301. self["@items"]=self._defaultItems();
  2302. $1=self["@items"];
  2303. } else {
  2304. $1=$2;
  2305. };
  2306. return $1;
  2307. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLListWidget)})},
  2308. args: [],
  2309. source: "items\x0a\x09^ items ifNil: [ items := self defaultItems ]",
  2310. messageSends: ["ifNil:", "defaultItems"],
  2311. referencedClasses: []
  2312. }),
  2313. smalltalk.HLListWidget);
  2314. smalltalk.addMethod(
  2315. smalltalk.method({
  2316. selector: "items:",
  2317. category: 'accessing',
  2318. fn: function (aCollection){
  2319. var self=this;
  2320. return smalltalk.withContext(function($ctx1) {
  2321. self["@items"]=aCollection;
  2322. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection},smalltalk.HLListWidget)})},
  2323. args: ["aCollection"],
  2324. source: "items: aCollection\x0a\x09items := aCollection",
  2325. messageSends: [],
  2326. referencedClasses: []
  2327. }),
  2328. smalltalk.HLListWidget);
  2329. smalltalk.addMethod(
  2330. smalltalk.method({
  2331. selector: "listCssClassForItem:",
  2332. category: 'accessing',
  2333. fn: function (anObject){
  2334. var self=this;
  2335. return smalltalk.withContext(function($ctx1) {
  2336. var $2,$1;
  2337. $2=_st(self._selectedItem()).__eq(anObject);
  2338. if(smalltalk.assert($2)){
  2339. $1="active";
  2340. } else {
  2341. $1="inactive";
  2342. };
  2343. return $1;
  2344. }, function($ctx1) {$ctx1.fill(self,"listCssClassForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2345. args: ["anObject"],
  2346. source: "listCssClassForItem: anObject\x0a\x09^ self selectedItem = anObject\x0a\x09\x09ifTrue: [ 'active' ]\x0a\x09\x09ifFalse: [ 'inactive' ]",
  2347. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"],
  2348. referencedClasses: []
  2349. }),
  2350. smalltalk.HLListWidget);
  2351. smalltalk.addMethod(
  2352. smalltalk.method({
  2353. selector: "positionOf:",
  2354. category: 'accessing',
  2355. fn: function (aListItem){
  2356. var self=this;
  2357. return smalltalk.withContext(function($ctx1) {
  2358. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  2359. ;
  2360. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem},smalltalk.HLListWidget)})},
  2361. args: ["aListItem"],
  2362. source: "positionOf: aListItem\x0a\x09<\x0a \x09return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1\x0a\x09>",
  2363. messageSends: [],
  2364. referencedClasses: []
  2365. }),
  2366. smalltalk.HLListWidget);
  2367. smalltalk.addMethod(
  2368. smalltalk.method({
  2369. selector: "refresh",
  2370. category: 'actions',
  2371. fn: function (){
  2372. var self=this;
  2373. return smalltalk.withContext(function($ctx1) {
  2374. var $early={};
  2375. try {
  2376. smalltalk.HLListWidget.superclass.fn.prototype._refresh.apply(_st(self), []);
  2377. self._ensureVisible_(_st(_st(self["@mapping"])._at_ifAbsent_(self._selectedItem(),(function(){
  2378. return smalltalk.withContext(function($ctx2) {
  2379. throw $early=[self];
  2380. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})})))._asJQuery());
  2381. return self}
  2382. catch(e) {if(e===$early)return e[0]; throw e}
  2383. }, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLListWidget)})},
  2384. args: [],
  2385. source: "refresh\x0a\x09super refresh.\x0a\x09\x0a\x09self ensureVisible: (mapping \x0a\x09\x09at: self selectedItem\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  2386. messageSends: ["refresh", "ensureVisible:", "asJQuery", "at:ifAbsent:", "selectedItem"],
  2387. referencedClasses: []
  2388. }),
  2389. smalltalk.HLListWidget);
  2390. smalltalk.addMethod(
  2391. smalltalk.method({
  2392. selector: "registerMappingFrom:to:",
  2393. category: 'private',
  2394. fn: function (anObject,aTag){
  2395. var self=this;
  2396. return smalltalk.withContext(function($ctx1) {
  2397. _st(self["@mapping"])._at_put_(anObject,aTag);
  2398. return self}, function($ctx1) {$ctx1.fill(self,"registerMappingFrom:to:",{anObject:anObject,aTag:aTag},smalltalk.HLListWidget)})},
  2399. args: ["anObject", "aTag"],
  2400. source: "registerMappingFrom: anObject to: aTag\x0a\x09mapping at: anObject put: aTag",
  2401. messageSends: ["at:put:"],
  2402. referencedClasses: []
  2403. }),
  2404. smalltalk.HLListWidget);
  2405. smalltalk.addMethod(
  2406. smalltalk.method({
  2407. selector: "renderButtonsOn:",
  2408. category: 'rendering',
  2409. fn: function (html){
  2410. var self=this;
  2411. return smalltalk.withContext(function($ctx1) {
  2412. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLListWidget)})},
  2413. args: ["html"],
  2414. source: "renderButtonsOn: html",
  2415. messageSends: [],
  2416. referencedClasses: []
  2417. }),
  2418. smalltalk.HLListWidget);
  2419. smalltalk.addMethod(
  2420. smalltalk.method({
  2421. selector: "renderContentOn:",
  2422. category: 'rendering',
  2423. fn: function (html){
  2424. var self=this;
  2425. return smalltalk.withContext(function($ctx1) {
  2426. var $1,$2,$3,$4;
  2427. $1=_st(html)._ul();
  2428. _st($1)._class_("nav nav-pills nav-stacked");
  2429. $ctx1.sendIdx["class:"]=1;
  2430. $2=_st($1)._with_((function(){
  2431. return smalltalk.withContext(function($ctx2) {
  2432. return self._renderListOn_(html);
  2433. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2434. $ctx1.sendIdx["with:"]=1;
  2435. $3=_st(html)._div();
  2436. _st($3)._class_("pane_actions form-actions");
  2437. $4=_st($3)._with_((function(){
  2438. return smalltalk.withContext(function($ctx2) {
  2439. return self._renderButtonsOn_(html);
  2440. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  2441. self._setupKeyBindings();
  2442. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLListWidget)})},
  2443. args: ["html"],
  2444. source: "renderContentOn: html\x0a\x09html ul \x0a \x09class: 'nav nav-pills nav-stacked';\x0a with: [ self renderListOn: html ].\x0a html div class: 'pane_actions form-actions'; with: [\x0a \x09self renderButtonsOn: html ].\x0a \x0a self setupKeyBindings",
  2445. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"],
  2446. referencedClasses: []
  2447. }),
  2448. smalltalk.HLListWidget);
  2449. smalltalk.addMethod(
  2450. smalltalk.method({
  2451. selector: "renderItem:on:",
  2452. category: 'rendering',
  2453. fn: function (anObject,html){
  2454. var self=this;
  2455. var li;
  2456. return smalltalk.withContext(function($ctx1) {
  2457. var $1,$3,$4,$2;
  2458. li=_st(html)._li();
  2459. self._registerMappingFrom_to_(anObject,li);
  2460. $1=li;
  2461. _st($1)._at_put_("list-data",_st(_st(self._items())._indexOf_(anObject))._asString());
  2462. _st($1)._class_(self._listCssClassForItem_(anObject));
  2463. $ctx1.sendIdx["class:"]=1;
  2464. $2=_st($1)._with_((function(){
  2465. return smalltalk.withContext(function($ctx2) {
  2466. $3=_st(html)._a();
  2467. _st($3)._with_((function(){
  2468. return smalltalk.withContext(function($ctx3) {
  2469. _st(_st(html)._tag_("i"))._class_(self._cssClassForItem_(anObject));
  2470. return self._renderItemLabel_on_(anObject,html);
  2471. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  2472. $4=_st($3)._onClick_((function(){
  2473. return smalltalk.withContext(function($ctx3) {
  2474. return self._activateListItem_(_st(li)._asJQuery());
  2475. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  2476. return $4;
  2477. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2478. $ctx1.sendIdx["with:"]=1;
  2479. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},smalltalk.HLListWidget)})},
  2480. args: ["anObject", "html"],
  2481. source: "renderItem: anObject on: html\x0a\x09| li |\x0a \x0a\x09li := html li.\x0a\x09self registerMappingFrom: anObject to: li.\x0a\x09\x0a li\x0a at: 'list-data' put: (self items indexOf: anObject) asString;\x0a\x09\x09class: (self listCssClassForItem: anObject);\x0a with: [ \x0a \x09html a\x0a \x09with: [ \x0a \x09\x09(html tag: 'i') class: (self cssClassForItem: anObject).\x0a \x09\x09\x09\x09\x09self renderItemLabel: anObject on: html ];\x0a\x09\x09\x09\x09onClick: [\x0a \x09self activateListItem: li asJQuery ] ]",
  2482. messageSends: ["li", "registerMappingFrom:to:", "at:put:", "asString", "indexOf:", "items", "class:", "listCssClassForItem:", "with:", "a", "tag:", "cssClassForItem:", "renderItemLabel:on:", "onClick:", "activateListItem:", "asJQuery"],
  2483. referencedClasses: []
  2484. }),
  2485. smalltalk.HLListWidget);
  2486. smalltalk.addMethod(
  2487. smalltalk.method({
  2488. selector: "renderItemLabel:on:",
  2489. category: 'rendering',
  2490. fn: function (anObject,html){
  2491. var self=this;
  2492. return smalltalk.withContext(function($ctx1) {
  2493. _st(html)._with_(_st(anObject)._asString());
  2494. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html},smalltalk.HLListWidget)})},
  2495. args: ["anObject", "html"],
  2496. source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject asString",
  2497. messageSends: ["with:", "asString"],
  2498. referencedClasses: []
  2499. }),
  2500. smalltalk.HLListWidget);
  2501. smalltalk.addMethod(
  2502. smalltalk.method({
  2503. selector: "renderListOn:",
  2504. category: 'rendering',
  2505. fn: function (html){
  2506. var self=this;
  2507. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  2508. return smalltalk.withContext(function($ctx1) {
  2509. self["@mapping"]=_st($Dictionary())._new();
  2510. _st(self._items())._do_((function(each){
  2511. return smalltalk.withContext(function($ctx2) {
  2512. return self._renderItem_on_(each,html);
  2513. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  2514. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html},smalltalk.HLListWidget)})},
  2515. args: ["html"],
  2516. source: "renderListOn: html\x0a\x09mapping := Dictionary new.\x0a\x09\x0a\x09self items do: [ :each | \x0a \x09self renderItem: each on: html ]",
  2517. messageSends: ["new", "do:", "items", "renderItem:on:"],
  2518. referencedClasses: ["Dictionary"]
  2519. }),
  2520. smalltalk.HLListWidget);
  2521. smalltalk.addMethod(
  2522. smalltalk.method({
  2523. selector: "selectItem:",
  2524. category: 'actions',
  2525. fn: function (anObject){
  2526. var self=this;
  2527. return smalltalk.withContext(function($ctx1) {
  2528. self._selectedItem_(anObject);
  2529. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2530. args: ["anObject"],
  2531. source: "selectItem: anObject\x0a\x09self selectedItem: anObject",
  2532. messageSends: ["selectedItem:"],
  2533. referencedClasses: []
  2534. }),
  2535. smalltalk.HLListWidget);
  2536. smalltalk.addMethod(
  2537. smalltalk.method({
  2538. selector: "selectedItem",
  2539. category: 'accessing',
  2540. fn: function (){
  2541. var self=this;
  2542. return smalltalk.withContext(function($ctx1) {
  2543. var $1;
  2544. $1=self["@selectedItem"];
  2545. return $1;
  2546. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.HLListWidget)})},
  2547. args: [],
  2548. source: "selectedItem\x0a\x09^ selectedItem",
  2549. messageSends: [],
  2550. referencedClasses: []
  2551. }),
  2552. smalltalk.HLListWidget);
  2553. smalltalk.addMethod(
  2554. smalltalk.method({
  2555. selector: "selectedItem:",
  2556. category: 'accessing',
  2557. fn: function (anObject){
  2558. var self=this;
  2559. return smalltalk.withContext(function($ctx1) {
  2560. self["@selectedItem"]=anObject;
  2561. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2562. args: ["anObject"],
  2563. source: "selectedItem: anObject\x0a\x09selectedItem := anObject",
  2564. messageSends: [],
  2565. referencedClasses: []
  2566. }),
  2567. smalltalk.HLListWidget);
  2568. smalltalk.addMethod(
  2569. smalltalk.method({
  2570. selector: "setupKeyBindings",
  2571. category: 'events',
  2572. fn: function (){
  2573. var self=this;
  2574. function $HLRepeatedKeyDownHandler(){return smalltalk.HLRepeatedKeyDownHandler||(typeof HLRepeatedKeyDownHandler=="undefined"?nil:HLRepeatedKeyDownHandler)}
  2575. return smalltalk.withContext(function($ctx1) {
  2576. var $1,$2;
  2577. $1=_st($HLRepeatedKeyDownHandler())._on_(self);
  2578. _st($1)._whileKeyDown_do_((38),(function(){
  2579. return smalltalk.withContext(function($ctx2) {
  2580. return self._activatePreviousListItem();
  2581. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2582. $ctx1.sendIdx["whileKeyDown:do:"]=1;
  2583. _st($1)._whileKeyDown_do_((40),(function(){
  2584. return smalltalk.withContext(function($ctx2) {
  2585. return self._activateNextListItem();
  2586. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  2587. $2=_st($1)._rebindKeys();
  2588. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLListWidget)})},
  2589. args: [],
  2590. source: "setupKeyBindings \x0a\x09(HLRepeatedKeyDownHandler on: self)\x0a\x09\x09whileKeyDown: 38 do: [ self activatePreviousListItem ];\x0a\x09\x09whileKeyDown: 40 do: [ self activateNextListItem ];\x0a\x09\x09rebindKeys",
  2591. messageSends: ["whileKeyDown:do:", "on:", "activatePreviousListItem", "activateNextListItem", "rebindKeys"],
  2592. referencedClasses: ["HLRepeatedKeyDownHandler"]
  2593. }),
  2594. smalltalk.HLListWidget);
  2595. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  2596. smalltalk.addMethod(
  2597. smalltalk.method({
  2598. selector: "next",
  2599. category: 'accessing',
  2600. fn: function (){
  2601. var self=this;
  2602. return smalltalk.withContext(function($ctx1) {
  2603. var $1;
  2604. $1=self["@next"];
  2605. return $1;
  2606. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.HLNavigationListWidget)})},
  2607. args: [],
  2608. source: "next\x0a\x09^ next",
  2609. messageSends: [],
  2610. referencedClasses: []
  2611. }),
  2612. smalltalk.HLNavigationListWidget);
  2613. smalltalk.addMethod(
  2614. smalltalk.method({
  2615. selector: "next:",
  2616. category: 'accessing',
  2617. fn: function (aWidget){
  2618. var self=this;
  2619. return smalltalk.withContext(function($ctx1) {
  2620. var $1;
  2621. self["@next"]=aWidget;
  2622. $1=_st(_st(aWidget)._previous()).__eq(self);
  2623. if(! smalltalk.assert($1)){
  2624. _st(aWidget)._previous_(self);
  2625. };
  2626. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  2627. args: ["aWidget"],
  2628. source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
  2629. messageSends: ["ifFalse:", "=", "previous", "previous:"],
  2630. referencedClasses: []
  2631. }),
  2632. smalltalk.HLNavigationListWidget);
  2633. smalltalk.addMethod(
  2634. smalltalk.method({
  2635. selector: "nextFocus",
  2636. category: 'actions',
  2637. fn: function (){
  2638. var self=this;
  2639. return smalltalk.withContext(function($ctx1) {
  2640. var $1,$2;
  2641. $1=self._next();
  2642. $ctx1.sendIdx["next"]=1;
  2643. if(($receiver = $1) == nil || $receiver == null){
  2644. $1;
  2645. } else {
  2646. $2=self._next();
  2647. _st($2)._focus();
  2648. };
  2649. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{},smalltalk.HLNavigationListWidget)})},
  2650. args: [],
  2651. source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
  2652. messageSends: ["ifNotNil:", "next", "focus"],
  2653. referencedClasses: []
  2654. }),
  2655. smalltalk.HLNavigationListWidget);
  2656. smalltalk.addMethod(
  2657. smalltalk.method({
  2658. selector: "previous",
  2659. category: 'accessing',
  2660. fn: function (){
  2661. var self=this;
  2662. return smalltalk.withContext(function($ctx1) {
  2663. var $1;
  2664. $1=self["@previous"];
  2665. return $1;
  2666. }, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationListWidget)})},
  2667. args: [],
  2668. source: "previous\x0a\x09^ previous",
  2669. messageSends: [],
  2670. referencedClasses: []
  2671. }),
  2672. smalltalk.HLNavigationListWidget);
  2673. smalltalk.addMethod(
  2674. smalltalk.method({
  2675. selector: "previous:",
  2676. category: 'accessing',
  2677. fn: function (aWidget){
  2678. var self=this;
  2679. return smalltalk.withContext(function($ctx1) {
  2680. var $1;
  2681. self["@previous"]=aWidget;
  2682. $1=_st(_st(aWidget)._next()).__eq(self);
  2683. if(! smalltalk.assert($1)){
  2684. _st(aWidget)._next_(self);
  2685. };
  2686. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  2687. args: ["aWidget"],
  2688. source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
  2689. messageSends: ["ifFalse:", "=", "next", "next:"],
  2690. referencedClasses: []
  2691. }),
  2692. smalltalk.HLNavigationListWidget);
  2693. smalltalk.addMethod(
  2694. smalltalk.method({
  2695. selector: "previousFocus",
  2696. category: 'actions',
  2697. fn: function (){
  2698. var self=this;
  2699. return smalltalk.withContext(function($ctx1) {
  2700. var $1,$2;
  2701. $1=self._previous();
  2702. $ctx1.sendIdx["previous"]=1;
  2703. if(($receiver = $1) == nil || $receiver == null){
  2704. $1;
  2705. } else {
  2706. $2=self._previous();
  2707. _st($2)._focus();
  2708. };
  2709. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{},smalltalk.HLNavigationListWidget)})},
  2710. args: [],
  2711. source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
  2712. messageSends: ["ifNotNil:", "previous", "focus"],
  2713. referencedClasses: []
  2714. }),
  2715. smalltalk.HLNavigationListWidget);
  2716. smalltalk.addMethod(
  2717. smalltalk.method({
  2718. selector: "setupKeyBindings",
  2719. category: 'events',
  2720. fn: function (){
  2721. var self=this;
  2722. return smalltalk.withContext(function($ctx1) {
  2723. var $2,$1,$4,$3;
  2724. smalltalk.HLNavigationListWidget.superclass.fn.prototype._setupKeyBindings.apply(_st(self), []);
  2725. _st(_st(self._wrapper())._asJQuery())._keydown_((function(e){
  2726. return smalltalk.withContext(function($ctx2) {
  2727. $2=_st(e)._which();
  2728. $ctx2.sendIdx["which"]=1;
  2729. $1=_st($2).__eq((39));
  2730. $ctx2.sendIdx["="]=1;
  2731. if(smalltalk.assert($1)){
  2732. self._nextFocus();
  2733. };
  2734. $4=_st(e)._which();
  2735. $3=_st($4).__eq((37));
  2736. if(smalltalk.assert($3)){
  2737. return self._previousFocus();
  2738. };
  2739. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,1)})}));
  2740. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLNavigationListWidget)})},
  2741. args: [],
  2742. source: "setupKeyBindings\x0a\x09super setupKeyBindings.\x0a\x0a\x09self wrapper asJQuery keydown: [ :e |\x0a e which = 39 ifTrue: [ \x0a \x09self nextFocus ].\x0a\x09\x09e which = 37 ifTrue: [ \x0a \x09self previousFocus ] ]",
  2743. messageSends: ["setupKeyBindings", "keydown:", "asJQuery", "wrapper", "ifTrue:", "=", "which", "nextFocus", "previousFocus"],
  2744. referencedClasses: []
  2745. }),
  2746. smalltalk.HLNavigationListWidget);
  2747. smalltalk.addClass('HLToolListWidget', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Core');
  2748. smalltalk.addMethod(
  2749. smalltalk.method({
  2750. selector: "activateListItem:",
  2751. category: 'actions',
  2752. fn: function (anItem){
  2753. var self=this;
  2754. return smalltalk.withContext(function($ctx1) {
  2755. _st(self._model())._withChangesDo_((function(){
  2756. return smalltalk.withContext(function($ctx2) {
  2757. return smalltalk.HLToolListWidget.superclass.fn.prototype._activateListItem_.apply(_st(self), [anItem]);
  2758. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2759. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{anItem:anItem},smalltalk.HLToolListWidget)})},
  2760. args: ["anItem"],
  2761. source: "activateListItem: anItem\x0a\x09self model withChangesDo: [ super activateListItem: anItem ]",
  2762. messageSends: ["withChangesDo:", "model", "activateListItem:"],
  2763. referencedClasses: []
  2764. }),
  2765. smalltalk.HLToolListWidget);
  2766. smalltalk.addMethod(
  2767. smalltalk.method({
  2768. selector: "activateNextListItem",
  2769. category: 'actions',
  2770. fn: function (){
  2771. var self=this;
  2772. return smalltalk.withContext(function($ctx1) {
  2773. _st(self._model())._withChangesDo_((function(){
  2774. return smalltalk.withContext(function($ctx2) {
  2775. return smalltalk.HLToolListWidget.superclass.fn.prototype._activateNextListItem.apply(_st(self), []);
  2776. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2777. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLToolListWidget)})},
  2778. args: [],
  2779. source: "activateNextListItem\x0a\x09self model withChangesDo: [ super activateNextListItem ]",
  2780. messageSends: ["withChangesDo:", "model", "activateNextListItem"],
  2781. referencedClasses: []
  2782. }),
  2783. smalltalk.HLToolListWidget);
  2784. smalltalk.addMethod(
  2785. smalltalk.method({
  2786. selector: "activatePreviousListItem",
  2787. category: 'actions',
  2788. fn: function (){
  2789. var self=this;
  2790. return smalltalk.withContext(function($ctx1) {
  2791. _st(self._model())._withChangesDo_((function(){
  2792. return smalltalk.withContext(function($ctx2) {
  2793. return smalltalk.HLToolListWidget.superclass.fn.prototype._activatePreviousListItem.apply(_st(self), []);
  2794. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2795. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLToolListWidget)})},
  2796. args: [],
  2797. source: "activatePreviousListItem\x0a\x09self model withChangesDo: [ super activatePreviousListItem ]",
  2798. messageSends: ["withChangesDo:", "model", "activatePreviousListItem"],
  2799. referencedClasses: []
  2800. }),
  2801. smalltalk.HLToolListWidget);
  2802. smalltalk.addMethod(
  2803. smalltalk.method({
  2804. selector: "commandCategory",
  2805. category: 'accessing',
  2806. fn: function (){
  2807. var self=this;
  2808. return smalltalk.withContext(function($ctx1) {
  2809. var $1;
  2810. $1=self._label();
  2811. return $1;
  2812. }, function($ctx1) {$ctx1.fill(self,"commandCategory",{},smalltalk.HLToolListWidget)})},
  2813. args: [],
  2814. source: "commandCategory\x0a\x09^ self label",
  2815. messageSends: ["label"],
  2816. referencedClasses: []
  2817. }),
  2818. smalltalk.HLToolListWidget);
  2819. smalltalk.addMethod(
  2820. smalltalk.method({
  2821. selector: "label",
  2822. category: 'accessing',
  2823. fn: function (){
  2824. var self=this;
  2825. return smalltalk.withContext(function($ctx1) {
  2826. return "List";
  2827. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToolListWidget)})},
  2828. args: [],
  2829. source: "label\x0a\x09^ 'List'",
  2830. messageSends: [],
  2831. referencedClasses: []
  2832. }),
  2833. smalltalk.HLToolListWidget);
  2834. smalltalk.addMethod(
  2835. smalltalk.method({
  2836. selector: "menuCommands",
  2837. category: 'accessing',
  2838. fn: function (){
  2839. var self=this;
  2840. function $HLToolCommand(){return smalltalk.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  2841. return smalltalk.withContext(function($ctx1) {
  2842. var $4,$5,$3,$6,$7,$2,$1;
  2843. $3=_st(_st($HLToolCommand())._concreteClasses())._select_((function(each){
  2844. return smalltalk.withContext(function($ctx2) {
  2845. $4=each;
  2846. $5=self._model();
  2847. $ctx2.sendIdx["model"]=1;
  2848. return _st($4)._isValidFor_($5);
  2849. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  2850. $2=_st($3)._collect_((function(each){
  2851. return smalltalk.withContext(function($ctx2) {
  2852. $6=each;
  2853. $7=self._model();
  2854. return _st($6)._for_($7);
  2855. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  2856. $1=_st($2)._select_((function(each){
  2857. return smalltalk.withContext(function($ctx2) {
  2858. return _st(_st(_st(each)._category()).__eq(self._commandCategory()))._and_((function(){
  2859. return smalltalk.withContext(function($ctx3) {
  2860. return _st(_st(each)._isAction())._and_((function(){
  2861. return smalltalk.withContext(function($ctx4) {
  2862. return _st(each)._isActive();
  2863. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)})}));
  2864. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  2865. $ctx2.sendIdx["and:"]=1;
  2866. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})}));
  2867. $ctx1.sendIdx["select:"]=1;
  2868. return $1;
  2869. }, function($ctx1) {$ctx1.fill(self,"menuCommands",{},smalltalk.HLToolListWidget)})},
  2870. args: [],
  2871. source: "menuCommands\x0a\x09\x22Answer a collection of commands to be put in the cog menu\x22\x0a\x09\x0a\x09^ ((HLToolCommand concreteClasses\x0a\x09\x09select: [ :each | each isValidFor: self model ])\x0a\x09\x09\x09collect: [ :each | each for: self model ])\x0a\x09\x09\x09select: [ :each | \x0a\x09\x09\x09\x09each category = self commandCategory and: [ \x0a\x09\x09\x09\x09\x09each isAction and: [ each isActive ] ] ]",
  2872. messageSends: ["select:", "collect:", "concreteClasses", "isValidFor:", "model", "for:", "and:", "=", "category", "commandCategory", "isAction", "isActive"],
  2873. referencedClasses: ["HLToolCommand"]
  2874. }),
  2875. smalltalk.HLToolListWidget);
  2876. smalltalk.addMethod(
  2877. smalltalk.method({
  2878. selector: "model",
  2879. category: 'accessing',
  2880. fn: function (){
  2881. var self=this;
  2882. return smalltalk.withContext(function($ctx1) {
  2883. var $1;
  2884. $1=self["@model"];
  2885. return $1;
  2886. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLToolListWidget)})},
  2887. args: [],
  2888. source: "model\x0a\x09^ model",
  2889. messageSends: [],
  2890. referencedClasses: []
  2891. }),
  2892. smalltalk.HLToolListWidget);
  2893. smalltalk.addMethod(
  2894. smalltalk.method({
  2895. selector: "model:",
  2896. category: 'accessing',
  2897. fn: function (aBrowserModel){
  2898. var self=this;
  2899. return smalltalk.withContext(function($ctx1) {
  2900. var $1;
  2901. self["@model"]=aBrowserModel;
  2902. self._observeSystem();
  2903. $1=self._observeModel();
  2904. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aBrowserModel:aBrowserModel},smalltalk.HLToolListWidget)})},
  2905. args: ["aBrowserModel"],
  2906. source: "model: aBrowserModel\x0a\x09model := aBrowserModel.\x0a \x0a self \x0a\x09\x09observeSystem;\x0a\x09\x09observeModel",
  2907. messageSends: ["observeSystem", "observeModel"],
  2908. referencedClasses: []
  2909. }),
  2910. smalltalk.HLToolListWidget);
  2911. smalltalk.addMethod(
  2912. smalltalk.method({
  2913. selector: "observeModel",
  2914. category: 'actions',
  2915. fn: function (){
  2916. var self=this;
  2917. return smalltalk.withContext(function($ctx1) {
  2918. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLToolListWidget)})},
  2919. args: [],
  2920. source: "observeModel",
  2921. messageSends: [],
  2922. referencedClasses: []
  2923. }),
  2924. smalltalk.HLToolListWidget);
  2925. smalltalk.addMethod(
  2926. smalltalk.method({
  2927. selector: "observeSystem",
  2928. category: 'actions',
  2929. fn: function (){
  2930. var self=this;
  2931. return smalltalk.withContext(function($ctx1) {
  2932. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLToolListWidget)})},
  2933. args: [],
  2934. source: "observeSystem",
  2935. messageSends: [],
  2936. referencedClasses: []
  2937. }),
  2938. smalltalk.HLToolListWidget);
  2939. smalltalk.addMethod(
  2940. smalltalk.method({
  2941. selector: "renderContentOn:",
  2942. category: 'rendering',
  2943. fn: function (html){
  2944. var self=this;
  2945. return smalltalk.withContext(function($ctx1) {
  2946. self._renderHeadOn_(html);
  2947. smalltalk.HLToolListWidget.superclass.fn.prototype._renderContentOn_.apply(_st(self), [html]);
  2948. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLToolListWidget)})},
  2949. args: ["html"],
  2950. source: "renderContentOn: html\x0a\x09self renderHeadOn: html.\x09\x0a\x09super renderContentOn: html",
  2951. messageSends: ["renderHeadOn:", "renderContentOn:"],
  2952. referencedClasses: []
  2953. }),
  2954. smalltalk.HLToolListWidget);
  2955. smalltalk.addMethod(
  2956. smalltalk.method({
  2957. selector: "renderHeadOn:",
  2958. category: 'rendering',
  2959. fn: function (html){
  2960. var self=this;
  2961. return smalltalk.withContext(function($ctx1) {
  2962. var $1,$2;
  2963. $1=_st(html)._div();
  2964. _st($1)._class_("list-label");
  2965. $2=_st($1)._with_((function(){
  2966. return smalltalk.withContext(function($ctx2) {
  2967. _st(html)._with_(self._label());
  2968. return self._renderMenuOn_(html);
  2969. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2970. $ctx1.sendIdx["with:"]=1;
  2971. return self}, function($ctx1) {$ctx1.fill(self,"renderHeadOn:",{html:html},smalltalk.HLToolListWidget)})},
  2972. args: ["html"],
  2973. source: "renderHeadOn: html\x0a\x09html div \x0a\x09\x09class: 'list-label';\x0a\x09\x09with: [\x0a\x09\x09\x09html with: self label.\x0a\x09\x09\x09self renderMenuOn: html ]",
  2974. messageSends: ["class:", "div", "with:", "label", "renderMenuOn:"],
  2975. referencedClasses: []
  2976. }),
  2977. smalltalk.HLToolListWidget);
  2978. smalltalk.addMethod(
  2979. smalltalk.method({
  2980. selector: "renderMenuOn:",
  2981. category: 'rendering',
  2982. fn: function (html){
  2983. var self=this;
  2984. var commands;
  2985. return smalltalk.withContext(function($ctx1) {
  2986. var $1,$2,$4,$5,$6,$8,$9,$10,$7,$3;
  2987. commands=self._menuCommands();
  2988. $ctx1.sendIdx["menuCommands"]=1;
  2989. $1=_st(commands)._isEmpty();
  2990. if(smalltalk.assert($1)){
  2991. return self;
  2992. };
  2993. $2=_st(html)._div();
  2994. _st($2)._class_("btn-group cog");
  2995. $ctx1.sendIdx["class:"]=1;
  2996. $3=_st($2)._with_((function(){
  2997. return smalltalk.withContext(function($ctx2) {
  2998. $4=_st(html)._a();
  2999. $ctx2.sendIdx["a"]=1;
  3000. _st($4)._class_("btn dropdown-toggle");
  3001. $ctx2.sendIdx["class:"]=2;
  3002. _st($4)._at_put_("data-toggle","dropdown");
  3003. $5=_st($4)._with_((function(){
  3004. return smalltalk.withContext(function($ctx3) {
  3005. return _st(_st(html)._tag_("i"))._class_("icon-cog");
  3006. $ctx3.sendIdx["class:"]=3;
  3007. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  3008. $ctx2.sendIdx["with:"]=2;
  3009. $5;
  3010. $6=_st(html)._ul();
  3011. _st($6)._class_("dropdown-menu pull-right");
  3012. $7=_st($6)._with_((function(){
  3013. return smalltalk.withContext(function($ctx3) {
  3014. $8=self._menuCommands();
  3015. return _st($8)._do_((function(each){
  3016. return smalltalk.withContext(function($ctx4) {
  3017. return _st(_st(html)._li())._with_((function(){
  3018. return smalltalk.withContext(function($ctx5) {
  3019. $9=_st(html)._a();
  3020. _st($9)._with_(_st(each)._menuLabel());
  3021. $10=_st($9)._onClick_((function(){
  3022. return smalltalk.withContext(function($ctx6) {
  3023. return self._execute_(each);
  3024. }, function($ctx6) {$ctx6.fillBlock({},$ctx5,7)})}));
  3025. return $10;
  3026. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,6)})}));
  3027. $ctx4.sendIdx["with:"]=4;
  3028. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,5)})}));
  3029. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  3030. $ctx2.sendIdx["with:"]=3;
  3031. return $7;
  3032. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  3033. $ctx1.sendIdx["with:"]=1;
  3034. return self}, function($ctx1) {$ctx1.fill(self,"renderMenuOn:",{html:html,commands:commands},smalltalk.HLToolListWidget)})},
  3035. args: ["html"],
  3036. source: "renderMenuOn: html\x0a\x09| commands |\x0a\x09\x0a\x09commands := self menuCommands.\x0a\x09commands isEmpty ifTrue: [ ^ self ].\x0a\x09\x0a\x09html div \x0a\x09\x09class: 'btn-group cog';\x0a\x09\x09with: [\x0a\x09\x09\x09html a\x0a\x09\x09\x09\x09class: 'btn dropdown-toggle';\x0a\x09\x09\x09\x09at: 'data-toggle' put: 'dropdown';\x0a\x09\x09\x09\x09with: [ (html tag: 'i') class: 'icon-cog' ].\x0a\x09\x09html ul \x0a\x09\x09\x09class: 'dropdown-menu pull-right';\x0a\x09\x09\x09with: [ \x0a\x09\x09\x09\x09self menuCommands do: [ :each | \x0a\x09\x09\x09\x09\x09html li with: [ html a \x0a\x09\x09\x09\x09\x09\x09with: each menuLabel;\x0a\x09\x09\x09\x09\x09\x09onClick: [ self execute: each ] ] ] ] ]",
  3037. messageSends: ["menuCommands", "ifTrue:", "isEmpty", "class:", "div", "with:", "a", "at:put:", "tag:", "ul", "do:", "li", "menuLabel", "onClick:", "execute:"],
  3038. referencedClasses: []
  3039. }),
  3040. smalltalk.HLToolListWidget);
  3041. smalltalk.addMethod(
  3042. smalltalk.method({
  3043. selector: "selectedItem:",
  3044. category: 'accessing',
  3045. fn: function (anItem){
  3046. var self=this;
  3047. return smalltalk.withContext(function($ctx1) {
  3048. smalltalk.HLToolListWidget.superclass.fn.prototype._selectedItem_.apply(_st(self), [anItem]);
  3049. self._updateMenu();
  3050. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anItem:anItem},smalltalk.HLToolListWidget)})},
  3051. args: ["anItem"],
  3052. source: "selectedItem: anItem\x0a\x09\x22Selection changed, update the cog menu\x22\x0a\x09\x0a\x09super selectedItem: anItem.\x0a\x09self updateMenu",
  3053. messageSends: ["selectedItem:", "updateMenu"],
  3054. referencedClasses: []
  3055. }),
  3056. smalltalk.HLToolListWidget);
  3057. smalltalk.addMethod(
  3058. smalltalk.method({
  3059. selector: "unregister",
  3060. category: 'actions',
  3061. fn: function (){
  3062. var self=this;
  3063. return smalltalk.withContext(function($ctx1) {
  3064. var $3,$2,$1,$6,$5,$4;
  3065. smalltalk.HLToolListWidget.superclass.fn.prototype._unregister.apply(_st(self), []);
  3066. $3=self._model();
  3067. $ctx1.sendIdx["model"]=1;
  3068. $2=_st($3)._announcer();
  3069. $1=_st($2)._unsubscribe_(self);
  3070. $ctx1.sendIdx["unsubscribe:"]=1;
  3071. $6=self._model();
  3072. $5=_st($6)._systemAnnouncer();
  3073. $4=_st($5)._unsubscribe_(self);
  3074. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLToolListWidget)})},
  3075. args: [],
  3076. source: "unregister\x0a\x09super unregister.\x0a\x09\x0a\x09self model announcer unsubscribe: self.\x0a\x09self model systemAnnouncer unsubscribe: self",
  3077. messageSends: ["unregister", "unsubscribe:", "announcer", "model", "systemAnnouncer"],
  3078. referencedClasses: []
  3079. }),
  3080. smalltalk.HLToolListWidget);
  3081. smalltalk.addMethod(
  3082. smalltalk.method({
  3083. selector: "updateMenu",
  3084. category: 'updating',
  3085. fn: function (){
  3086. var self=this;
  3087. return smalltalk.withContext(function($ctx1) {
  3088. var $3,$2,$1,$4,$7,$6,$5;
  3089. $3=self._wrapper();
  3090. $ctx1.sendIdx["wrapper"]=1;
  3091. $2=_st($3)._asJQuery();
  3092. $ctx1.sendIdx["asJQuery"]=1;
  3093. $1=_st($2)._find_(".cog");
  3094. $ctx1.sendIdx["find:"]=1;
  3095. _st($1)._remove();
  3096. $4=(function(html){
  3097. return smalltalk.withContext(function($ctx2) {
  3098. return self._renderMenuOn_(html);
  3099. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})});
  3100. $7=self._wrapper();
  3101. $6=_st($7)._asJQuery();
  3102. $5=_st($6)._find_(".list-label");
  3103. _st($4)._appendToJQuery_($5);
  3104. return self}, function($ctx1) {$ctx1.fill(self,"updateMenu",{},smalltalk.HLToolListWidget)})},
  3105. args: [],
  3106. source: "updateMenu\x0a\x09(self wrapper asJQuery find: '.cog') remove.\x0a\x09\x0a\x09[ :html | self renderMenuOn: html ] \x0a\x09\x09appendToJQuery: (self wrapper asJQuery find: '.list-label')",
  3107. messageSends: ["remove", "find:", "asJQuery", "wrapper", "appendToJQuery:", "renderMenuOn:"],
  3108. referencedClasses: []
  3109. }),
  3110. smalltalk.HLToolListWidget);
  3111. smalltalk.addMethod(
  3112. smalltalk.method({
  3113. selector: "on:",
  3114. category: 'instance creation',
  3115. fn: function (aModel){
  3116. var self=this;
  3117. return smalltalk.withContext(function($ctx1) {
  3118. var $2,$3,$1;
  3119. $2=self._new();
  3120. _st($2)._model_(aModel);
  3121. $3=_st($2)._yourself();
  3122. $1=$3;
  3123. return $1;
  3124. }, function($ctx1) {$ctx1.fill(self,"on:",{aModel:aModel},smalltalk.HLToolListWidget.klass)})},
  3125. args: ["aModel"],
  3126. source: "on: aModel\x0a\x09^ self new \x0a \x09model: aModel;\x0a yourself",
  3127. messageSends: ["model:", "new", "yourself"],
  3128. referencedClasses: []
  3129. }),
  3130. smalltalk.HLToolListWidget.klass);
  3131. smalltalk.addClass('HLTabListWidget', smalltalk.HLListWidget, ['callback'], 'Helios-Core');
  3132. smalltalk.HLTabListWidget.comment="I am a widget used to display a list of helios tabs.\x0a\x0aWhen a tab is selected, `callback` is evaluated with the selected tab as argument.";
  3133. smalltalk.addMethod(
  3134. smalltalk.method({
  3135. selector: "callback",
  3136. category: 'accessing',
  3137. fn: function (){
  3138. var self=this;
  3139. return smalltalk.withContext(function($ctx1) {
  3140. var $2,$1;
  3141. $2=self["@callback"];
  3142. if(($receiver = $2) == nil || $receiver == null){
  3143. $1=(function(){
  3144. return smalltalk.withContext(function($ctx2) {
  3145. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
  3146. } else {
  3147. $1=$2;
  3148. };
  3149. return $1;
  3150. }, function($ctx1) {$ctx1.fill(self,"callback",{},smalltalk.HLTabListWidget)})},
  3151. args: [],
  3152. source: "callback\x0a\x09^ callback ifNil: [ [] ]",
  3153. messageSends: ["ifNil:"],
  3154. referencedClasses: []
  3155. }),
  3156. smalltalk.HLTabListWidget);
  3157. smalltalk.addMethod(
  3158. smalltalk.method({
  3159. selector: "callback:",
  3160. category: 'accessing',
  3161. fn: function (aBlock){
  3162. var self=this;
  3163. return smalltalk.withContext(function($ctx1) {
  3164. self["@callback"]=aBlock;
  3165. return self}, function($ctx1) {$ctx1.fill(self,"callback:",{aBlock:aBlock},smalltalk.HLTabListWidget)})},
  3166. args: ["aBlock"],
  3167. source: "callback: aBlock\x0a\x09callback := aBlock",
  3168. messageSends: [],
  3169. referencedClasses: []
  3170. }),
  3171. smalltalk.HLTabListWidget);
  3172. smalltalk.addMethod(
  3173. smalltalk.method({
  3174. selector: "renderItemLabel:on:",
  3175. category: 'rendering',
  3176. fn: function (aTab,html){
  3177. var self=this;
  3178. return smalltalk.withContext(function($ctx1) {
  3179. var $1,$2;
  3180. $1=_st(html)._span();
  3181. _st($1)._class_(_st(aTab)._cssClass());
  3182. $2=_st($1)._with_(_st(aTab)._label());
  3183. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{aTab:aTab,html:html},smalltalk.HLTabListWidget)})},
  3184. args: ["aTab", "html"],
  3185. source: "renderItemLabel: aTab on: html\x0a\x09html span\x0a\x09\x09class: aTab cssClass;\x0a\x09\x09with: aTab label",
  3186. messageSends: ["class:", "span", "cssClass", "with:", "label"],
  3187. referencedClasses: []
  3188. }),
  3189. smalltalk.HLTabListWidget);
  3190. smalltalk.addMethod(
  3191. smalltalk.method({
  3192. selector: "selectItem:",
  3193. category: 'actions',
  3194. fn: function (aTab){
  3195. var self=this;
  3196. return smalltalk.withContext(function($ctx1) {
  3197. smalltalk.HLTabListWidget.superclass.fn.prototype._selectItem_.apply(_st(self), [aTab]);
  3198. _st(self._callback())._value_(aTab);
  3199. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aTab:aTab},smalltalk.HLTabListWidget)})},
  3200. args: ["aTab"],
  3201. source: "selectItem: aTab\x0a\x09super selectItem: aTab.\x0a\x09self callback value: aTab",
  3202. messageSends: ["selectItem:", "value:", "callback"],
  3203. referencedClasses: []
  3204. }),
  3205. smalltalk.HLTabListWidget);
  3206. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'environment', 'history'], 'Helios-Core');
  3207. smalltalk.addMethod(
  3208. smalltalk.method({
  3209. selector: "activate:",
  3210. category: 'actions',
  3211. fn: function (aTab){
  3212. var self=this;
  3213. return smalltalk.withContext(function($ctx1) {
  3214. var $1;
  3215. _st(self._keyBinder())._flushBindings();
  3216. _st(aTab)._registerBindings();
  3217. self["@activeTab"]=aTab;
  3218. self._refresh();
  3219. self._addToHistory_(aTab);
  3220. $1=self._show_(aTab);
  3221. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},smalltalk.HLManager)})},
  3222. args: ["aTab"],
  3223. source: "activate: aTab\x0a\x09self keyBinder flushBindings.\x0a\x09aTab registerBindings.\x0a\x09activeTab := aTab.\x0a\x09\x0a\x09self \x0a\x09\x09refresh;\x0a\x09\x09addToHistory: aTab;\x0a\x09\x09show: aTab",
  3224. messageSends: ["flushBindings", "keyBinder", "registerBindings", "refresh", "addToHistory:", "show:"],
  3225. referencedClasses: []
  3226. }),
  3227. smalltalk.HLManager);
  3228. smalltalk.addMethod(
  3229. smalltalk.method({
  3230. selector: "activeTab",
  3231. category: 'accessing',
  3232. fn: function (){
  3233. var self=this;
  3234. return smalltalk.withContext(function($ctx1) {
  3235. var $1;
  3236. $1=self["@activeTab"];
  3237. return $1;
  3238. }, function($ctx1) {$ctx1.fill(self,"activeTab",{},smalltalk.HLManager)})},
  3239. args: [],
  3240. source: "activeTab\x0a\x09^ activeTab",
  3241. messageSends: [],
  3242. referencedClasses: []
  3243. }),
  3244. smalltalk.HLManager);
  3245. smalltalk.addMethod(
  3246. smalltalk.method({
  3247. selector: "addTab:",
  3248. category: 'actions',
  3249. fn: function (aTab){
  3250. var self=this;
  3251. return smalltalk.withContext(function($ctx1) {
  3252. _st(self._tabs())._add_(aTab);
  3253. self._activate_(aTab);
  3254. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab},smalltalk.HLManager)})},
  3255. args: ["aTab"],
  3256. source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
  3257. messageSends: ["add:", "tabs", "activate:"],
  3258. referencedClasses: []
  3259. }),
  3260. smalltalk.HLManager);
  3261. smalltalk.addMethod(
  3262. smalltalk.method({
  3263. selector: "addToHistory:",
  3264. category: 'actions',
  3265. fn: function (aTab){
  3266. var self=this;
  3267. return smalltalk.withContext(function($ctx1) {
  3268. self._removeFromHistory_(aTab);
  3269. _st(self._history())._add_(aTab);
  3270. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab},smalltalk.HLManager)})},
  3271. args: ["aTab"],
  3272. source: "addToHistory: aTab\x0a\x09self removeFromHistory: aTab.\x0a\x09self history add: aTab",
  3273. messageSends: ["removeFromHistory:", "add:", "history"],
  3274. referencedClasses: []
  3275. }),
  3276. smalltalk.HLManager);
  3277. smalltalk.addMethod(
  3278. smalltalk.method({
  3279. selector: "confirm:ifFalse:",
  3280. category: 'actions',
  3281. fn: function (aString,aBlock){
  3282. var self=this;
  3283. function $HLConfirmationWidget(){return smalltalk.HLConfirmationWidget||(typeof HLConfirmationWidget=="undefined"?nil:HLConfirmationWidget)}
  3284. return smalltalk.withContext(function($ctx1) {
  3285. var $1,$2;
  3286. $1=_st($HLConfirmationWidget())._new();
  3287. _st($1)._confirmationString_(aString);
  3288. _st($1)._cancelBlock_(aBlock);
  3289. $2=_st($1)._show();
  3290. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifFalse:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  3291. args: ["aString", "aBlock"],
  3292. source: "confirm: aString ifFalse: aBlock\x0a\x09HLConfirmationWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09cancelBlock: aBlock;\x0a\x09\x09show",
  3293. messageSends: ["confirmationString:", "new", "cancelBlock:", "show"],
  3294. referencedClasses: ["HLConfirmationWidget"]
  3295. }),
  3296. smalltalk.HLManager);
  3297. smalltalk.addMethod(
  3298. smalltalk.method({
  3299. selector: "confirm:ifTrue:",
  3300. category: 'actions',
  3301. fn: function (aString,aBlock){
  3302. var self=this;
  3303. function $HLConfirmationWidget(){return smalltalk.HLConfirmationWidget||(typeof HLConfirmationWidget=="undefined"?nil:HLConfirmationWidget)}
  3304. return smalltalk.withContext(function($ctx1) {
  3305. var $1,$2;
  3306. $1=_st($HLConfirmationWidget())._new();
  3307. _st($1)._confirmationString_(aString);
  3308. _st($1)._actionBlock_(aBlock);
  3309. $2=_st($1)._show();
  3310. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  3311. args: ["aString", "aBlock"],
  3312. source: "confirm: aString ifTrue: aBlock\x0a\x09HLConfirmationWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09show",
  3313. messageSends: ["confirmationString:", "new", "actionBlock:", "show"],
  3314. referencedClasses: ["HLConfirmationWidget"]
  3315. }),
  3316. smalltalk.HLManager);
  3317. smalltalk.addMethod(
  3318. smalltalk.method({
  3319. selector: "defaultEnvironment",
  3320. category: 'defaults',
  3321. fn: function (){
  3322. var self=this;
  3323. var parent,parentSmalltalk;
  3324. function $Environment(){return smalltalk.Environment||(typeof Environment=="undefined"?nil:Environment)}
  3325. return smalltalk.withContext(function($ctx1) {
  3326. var $1,$3,$4,$2,$5,$7,$8,$6,$10,$9;
  3327. $1=_st(window)._opener();
  3328. if(($receiver = $1) == nil || $receiver == null){
  3329. parent=_st(window)._parent();
  3330. } else {
  3331. parent=$1;
  3332. };
  3333. $3=parent;
  3334. if(($receiver = $3) == nil || $receiver == null){
  3335. $4=_st($Environment())._new();
  3336. $ctx1.sendIdx["new"]=1;
  3337. return $4;
  3338. } else {
  3339. $2=$3;
  3340. };
  3341. $5=_st(parent)._at_("requirejs");
  3342. $ctx1.sendIdx["at:"]=1;
  3343. parentSmalltalk=_st($5)._value_("amber_vm/smalltalk");
  3344. $7=parentSmalltalk;
  3345. if(($receiver = $7) == nil || $receiver == null){
  3346. $8=_st($Environment())._new();
  3347. $ctx1.sendIdx["new"]=2;
  3348. return $8;
  3349. } else {
  3350. $6=$7;
  3351. };
  3352. $10=_st(parentSmalltalk)._at_("Environment");
  3353. $9=_st($10)._new();
  3354. return $9;
  3355. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{parent:parent,parentSmalltalk:parentSmalltalk},smalltalk.HLManager)})},
  3356. args: [],
  3357. source: "defaultEnvironment\x0a\x09\x22If helios is loaded from within a frame, answer the parent window environment\x22\x0a\x09\x0a\x09| parent parentSmalltalk |\x0a\x09\x0a\x09parent := window opener ifNil: [ window parent ].\x0a\x09parent ifNil: [ ^ Environment new ].\x0a\x09\x0a\x09parentSmalltalk := (parent at: 'requirejs') value: 'amber_vm/smalltalk'.\x0a\x09parentSmalltalk ifNil: [ ^ Environment new ].\x0a\x09\x0a\x09^ (parentSmalltalk at: 'Environment') new",
  3358. messageSends: ["ifNil:", "opener", "parent", "new", "value:", "at:"],
  3359. referencedClasses: ["Environment"]
  3360. }),
  3361. smalltalk.HLManager);
  3362. smalltalk.addMethod(
  3363. smalltalk.method({
  3364. selector: "environment",
  3365. category: 'accessing',
  3366. fn: function (){
  3367. var self=this;
  3368. return smalltalk.withContext(function($ctx1) {
  3369. var $2,$1;
  3370. $2=self["@environment"];
  3371. if(($receiver = $2) == nil || $receiver == null){
  3372. self["@environment"]=self._defaultEnvironment();
  3373. $1=self["@environment"];
  3374. } else {
  3375. $1=$2;
  3376. };
  3377. return $1;
  3378. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLManager)})},
  3379. args: [],
  3380. source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
  3381. messageSends: ["ifNil:", "defaultEnvironment"],
  3382. referencedClasses: []
  3383. }),
  3384. smalltalk.HLManager);
  3385. smalltalk.addMethod(
  3386. smalltalk.method({
  3387. selector: "environment:",
  3388. category: 'accessing',
  3389. fn: function (anEnvironment){
  3390. var self=this;
  3391. return smalltalk.withContext(function($ctx1) {
  3392. self["@environment"]=anEnvironment;
  3393. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLManager)})},
  3394. args: ["anEnvironment"],
  3395. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  3396. messageSends: [],
  3397. referencedClasses: []
  3398. }),
  3399. smalltalk.HLManager);
  3400. smalltalk.addMethod(
  3401. smalltalk.method({
  3402. selector: "history",
  3403. category: 'accessing',
  3404. fn: function (){
  3405. var self=this;
  3406. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3407. return smalltalk.withContext(function($ctx1) {
  3408. var $2,$1;
  3409. $2=self["@history"];
  3410. if(($receiver = $2) == nil || $receiver == null){
  3411. self["@history"]=_st($OrderedCollection())._new();
  3412. $1=self["@history"];
  3413. } else {
  3414. $1=$2;
  3415. };
  3416. return $1;
  3417. }, function($ctx1) {$ctx1.fill(self,"history",{},smalltalk.HLManager)})},
  3418. args: [],
  3419. source: "history\x0a\x09^ history ifNil: [ history := OrderedCollection new ]",
  3420. messageSends: ["ifNil:", "new"],
  3421. referencedClasses: ["OrderedCollection"]
  3422. }),
  3423. smalltalk.HLManager);
  3424. smalltalk.addMethod(
  3425. smalltalk.method({
  3426. selector: "history:",
  3427. category: 'accessing',
  3428. fn: function (aCollection){
  3429. var self=this;
  3430. return smalltalk.withContext(function($ctx1) {
  3431. self["@history"]=aCollection;
  3432. return self}, function($ctx1) {$ctx1.fill(self,"history:",{aCollection:aCollection},smalltalk.HLManager)})},
  3433. args: ["aCollection"],
  3434. source: "history: aCollection\x0a\x09history := aCollection",
  3435. messageSends: [],
  3436. referencedClasses: []
  3437. }),
  3438. smalltalk.HLManager);
  3439. smalltalk.addMethod(
  3440. smalltalk.method({
  3441. selector: "initialize",
  3442. category: 'initialization',
  3443. fn: function (){
  3444. var self=this;
  3445. function $HLErrorHandler(){return smalltalk.HLErrorHandler||(typeof HLErrorHandler=="undefined"?nil:HLErrorHandler)}
  3446. function $HLProgressHandler(){return smalltalk.HLProgressHandler||(typeof HLProgressHandler=="undefined"?nil:HLProgressHandler)}
  3447. function $HLInspector(){return smalltalk.HLInspector||(typeof HLInspector=="undefined"?nil:HLInspector)}
  3448. function $ErrorHandler(){return smalltalk.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  3449. function $ProgressHandler(){return smalltalk.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  3450. return smalltalk.withContext(function($ctx1) {
  3451. var $1,$2,$3,$4;
  3452. smalltalk.HLManager.superclass.fn.prototype._initialize.apply(_st(self), []);
  3453. $1=_st($HLErrorHandler())._register();
  3454. $ctx1.sendIdx["register"]=1;
  3455. $2=_st($HLProgressHandler())._register();
  3456. self._registerInspector_($HLInspector());
  3457. $3=_st($ErrorHandler())._current();
  3458. $ctx1.sendIdx["current"]=1;
  3459. self._registerErrorHandler_($3);
  3460. $4=_st($ProgressHandler())._current();
  3461. self._registerProgressHandler_($4);
  3462. _st(self._keyBinder())._setupEvents();
  3463. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager)})},
  3464. args: [],
  3465. source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09HLErrorHandler register.\x0a\x09HLProgressHandler register.\x0a\x09\x0a\x09self registerInspector: HLInspector.\x0a\x09self registerErrorHandler: ErrorHandler current.\x0a\x09self registerProgressHandler: ProgressHandler current.\x0a self keyBinder setupEvents",
  3466. messageSends: ["initialize", "register", "registerInspector:", "registerErrorHandler:", "current", "registerProgressHandler:", "setupEvents", "keyBinder"],
  3467. referencedClasses: ["HLErrorHandler", "HLProgressHandler", "HLInspector", "ErrorHandler", "ProgressHandler"]
  3468. }),
  3469. smalltalk.HLManager);
  3470. smalltalk.addMethod(
  3471. smalltalk.method({
  3472. selector: "keyBinder",
  3473. category: 'accessing',
  3474. fn: function (){
  3475. var self=this;
  3476. function $HLKeyBinder(){return smalltalk.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
  3477. return smalltalk.withContext(function($ctx1) {
  3478. var $1;
  3479. $1=_st($HLKeyBinder())._current();
  3480. return $1;
  3481. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{},smalltalk.HLManager)})},
  3482. args: [],
  3483. source: "keyBinder\x0a\x09^ HLKeyBinder current",
  3484. messageSends: ["current"],
  3485. referencedClasses: ["HLKeyBinder"]
  3486. }),
  3487. smalltalk.HLManager);
  3488. smalltalk.addMethod(
  3489. smalltalk.method({
  3490. selector: "refresh",
  3491. category: 'rendering',
  3492. fn: function (){
  3493. var self=this;
  3494. return smalltalk.withContext(function($ctx1) {
  3495. var $1,$2;
  3496. $1=".navbar"._asJQuery();
  3497. $ctx1.sendIdx["asJQuery"]=1;
  3498. _st($1)._remove();
  3499. $2="body"._asJQuery();
  3500. self._appendToJQuery_($2);
  3501. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLManager)})},
  3502. args: [],
  3503. source: "refresh\x0a\x09'.navbar' asJQuery remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
  3504. messageSends: ["remove", "asJQuery", "appendToJQuery:"],
  3505. referencedClasses: []
  3506. }),
  3507. smalltalk.HLManager);
  3508. smalltalk.addMethod(
  3509. smalltalk.method({
  3510. selector: "registerErrorHandler:",
  3511. category: 'actions',
  3512. fn: function (anErrorHandler){
  3513. var self=this;
  3514. return smalltalk.withContext(function($ctx1) {
  3515. _st(self._environment())._registerErrorHandler_(anErrorHandler);
  3516. return self}, function($ctx1) {$ctx1.fill(self,"registerErrorHandler:",{anErrorHandler:anErrorHandler},smalltalk.HLManager)})},
  3517. args: ["anErrorHandler"],
  3518. source: "registerErrorHandler: anErrorHandler\x0a\x09self environment registerErrorHandler: anErrorHandler",
  3519. messageSends: ["registerErrorHandler:", "environment"],
  3520. referencedClasses: []
  3521. }),
  3522. smalltalk.HLManager);
  3523. smalltalk.addMethod(
  3524. smalltalk.method({
  3525. selector: "registerInspector:",
  3526. category: 'actions',
  3527. fn: function (anInspector){
  3528. var self=this;
  3529. return smalltalk.withContext(function($ctx1) {
  3530. _st(self._environment())._registerInspector_(anInspector);
  3531. return self}, function($ctx1) {$ctx1.fill(self,"registerInspector:",{anInspector:anInspector},smalltalk.HLManager)})},
  3532. args: ["anInspector"],
  3533. source: "registerInspector: anInspector\x0a\x09self environment registerInspector: anInspector",
  3534. messageSends: ["registerInspector:", "environment"],
  3535. referencedClasses: []
  3536. }),
  3537. smalltalk.HLManager);
  3538. smalltalk.addMethod(
  3539. smalltalk.method({
  3540. selector: "registerProgressHandler:",
  3541. category: 'actions',
  3542. fn: function (aProgressHandler){
  3543. var self=this;
  3544. return smalltalk.withContext(function($ctx1) {
  3545. _st(self._environment())._registerProgressHandler_(aProgressHandler);
  3546. return self}, function($ctx1) {$ctx1.fill(self,"registerProgressHandler:",{aProgressHandler:aProgressHandler},smalltalk.HLManager)})},
  3547. args: ["aProgressHandler"],
  3548. source: "registerProgressHandler: aProgressHandler\x0a\x09self environment registerProgressHandler: aProgressHandler",
  3549. messageSends: ["registerProgressHandler:", "environment"],
  3550. referencedClasses: []
  3551. }),
  3552. smalltalk.HLManager);
  3553. smalltalk.addMethod(
  3554. smalltalk.method({
  3555. selector: "removeActiveTab",
  3556. category: 'actions',
  3557. fn: function (){
  3558. var self=this;
  3559. return smalltalk.withContext(function($ctx1) {
  3560. self._removeTab_(self._activeTab());
  3561. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{},smalltalk.HLManager)})},
  3562. args: [],
  3563. source: "removeActiveTab\x0a\x09self removeTab: self activeTab",
  3564. messageSends: ["removeTab:", "activeTab"],
  3565. referencedClasses: []
  3566. }),
  3567. smalltalk.HLManager);
  3568. smalltalk.addMethod(
  3569. smalltalk.method({
  3570. selector: "removeFromHistory:",
  3571. category: 'actions',
  3572. fn: function (aTab){
  3573. var self=this;
  3574. return smalltalk.withContext(function($ctx1) {
  3575. self._history_(_st(self._history())._reject_((function(each){
  3576. return smalltalk.withContext(function($ctx2) {
  3577. return _st(each).__eq_eq(aTab);
  3578. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})));
  3579. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab},smalltalk.HLManager)})},
  3580. args: ["aTab"],
  3581. source: "removeFromHistory: aTab\x0a\x09self history: (self history reject: [ :each | each == aTab ])",
  3582. messageSends: ["history:", "reject:", "history", "=="],
  3583. referencedClasses: []
  3584. }),
  3585. smalltalk.HLManager);
  3586. smalltalk.addMethod(
  3587. smalltalk.method({
  3588. selector: "removeTab:",
  3589. category: 'actions',
  3590. fn: function (aTab){
  3591. var self=this;
  3592. return smalltalk.withContext(function($ctx1) {
  3593. var $2,$1,$3,$4,$6,$5;
  3594. $2=self._tabs();
  3595. $ctx1.sendIdx["tabs"]=1;
  3596. $1=_st($2)._includes_(aTab);
  3597. if(! smalltalk.assert($1)){
  3598. return self;
  3599. };
  3600. self._removeFromHistory_(aTab);
  3601. $3=self._tabs();
  3602. _st($3)._remove_(aTab);
  3603. _st(self._keyBinder())._flushBindings();
  3604. _st(aTab)._remove();
  3605. self._refresh();
  3606. $4=self._history();
  3607. $ctx1.sendIdx["history"]=1;
  3608. _st($4)._ifNotEmpty_((function(){
  3609. return smalltalk.withContext(function($ctx2) {
  3610. $6=self._history();
  3611. $5=_st($6)._last();
  3612. return _st($5)._activate();
  3613. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  3614. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)})},
  3615. args: ["aTab"],
  3616. source: "removeTab: aTab\x0a\x09(self tabs includes: aTab) ifFalse: [ ^ self ].\x0a\x0a\x09self removeFromHistory: aTab.\x0a\x09self tabs remove: aTab.\x0a\x09self keyBinder flushBindings.\x0a\x09aTab remove.\x0a\x09self refresh.\x0a\x09self history ifNotEmpty: [\x0a\x09\x09self history last activate ]",
  3617. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "remove", "refresh", "ifNotEmpty:", "history", "activate", "last"],
  3618. referencedClasses: []
  3619. }),
  3620. smalltalk.HLManager);
  3621. smalltalk.addMethod(
  3622. smalltalk.method({
  3623. selector: "renderAddOn:",
  3624. category: 'rendering',
  3625. fn: function (html){
  3626. var self=this;
  3627. function $HLWidget(){return smalltalk.HLWidget||(typeof HLWidget=="undefined"?nil:HLWidget)}
  3628. return smalltalk.withContext(function($ctx1) {
  3629. var $1,$3,$4,$5,$7,$8,$9,$10,$11,$6,$2;
  3630. $1=_st(html)._li();
  3631. $ctx1.sendIdx["li"]=1;
  3632. _st($1)._class_("dropdown");
  3633. $ctx1.sendIdx["class:"]=1;
  3634. $2=_st($1)._with_((function(){
  3635. return smalltalk.withContext(function($ctx2) {
  3636. $3=_st(html)._a();
  3637. $ctx2.sendIdx["a"]=1;
  3638. _st($3)._class_("dropdown-toggle");
  3639. $ctx2.sendIdx["class:"]=2;
  3640. _st($3)._at_put_("data-toggle","dropdown");
  3641. $4=_st($3)._with_((function(){
  3642. return smalltalk.withContext(function($ctx3) {
  3643. _st(html)._with_("Open...");
  3644. $ctx3.sendIdx["with:"]=3;
  3645. return _st(_st(html)._tag_("b"))._class_("caret");
  3646. $ctx3.sendIdx["class:"]=3;
  3647. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  3648. $ctx2.sendIdx["with:"]=2;
  3649. $4;
  3650. $5=_st(html)._ul();
  3651. _st($5)._class_("dropdown-menu");
  3652. $6=_st($5)._with_((function(){
  3653. return smalltalk.withContext(function($ctx3) {
  3654. return _st(_st(_st(_st($HLWidget())._withAllSubclasses())._select_((function(each){
  3655. return smalltalk.withContext(function($ctx4) {
  3656. return _st(each)._canBeOpenAsTab();
  3657. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,4)})})))._sorted_((function(a,b){
  3658. return smalltalk.withContext(function($ctx4) {
  3659. $7=_st(a)._tabPriority();
  3660. $ctx4.sendIdx["tabPriority"]=1;
  3661. $8=_st(b)._tabPriority();
  3662. return _st($7).__lt($8);
  3663. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3,5)})})))._do_((function(each){
  3664. return smalltalk.withContext(function($ctx4) {
  3665. $9=_st(html)._li();
  3666. return _st($9)._with_((function(){
  3667. return smalltalk.withContext(function($ctx5) {
  3668. $10=_st(html)._a();
  3669. _st($10)._with_(_st(each)._tabLabel());
  3670. $11=_st($10)._onClick_((function(){
  3671. return smalltalk.withContext(function($ctx6) {
  3672. return _st(each)._openAsTab();
  3673. }, function($ctx6) {$ctx6.fillBlock({},$ctx5,8)})}));
  3674. return $11;
  3675. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,7)})}));
  3676. $ctx4.sendIdx["with:"]=5;
  3677. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,6)})}));
  3678. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  3679. $ctx2.sendIdx["with:"]=4;
  3680. return $6;
  3681. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  3682. $ctx1.sendIdx["with:"]=1;
  3683. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html},smalltalk.HLManager)})},
  3684. args: ["html"],
  3685. source: "renderAddOn: html\x0a html li \x0a \x09class: 'dropdown';\x0a with: [ \x0a\x09\x09\x09html a \x0a \x09\x09class: 'dropdown-toggle';\x0a \x09 \x09at: 'data-toggle' put: 'dropdown';\x0a \x09with: [ \x0a \x09\x09html with: 'Open...'.\x0a \x09\x09\x09\x09\x09(html tag: 'b') class: 'caret' ].\x0a html ul \x0a \x09\x09class: 'dropdown-menu';\x0a with: [\x0a \x09((HLWidget withAllSubclasses\x0a \x09select: [ :each | each canBeOpenAsTab ])\x0a sorted: [ :a :b | a tabPriority < b tabPriority ])\x0a do: [ :each |\x0a \x09\x09\x09\x09\x09\x09\x09html li with: [\x0a \x09\x09\x09html a \x0a \x09with: each tabLabel;\x0a \x09\x09\x09\x09\x09\x09\x09\x09onClick: [ each openAsTab ] ] ] ] ]",
  3686. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "sorted:", "select:", "withAllSubclasses", "canBeOpenAsTab", "<", "tabPriority", "tabLabel", "onClick:", "openAsTab"],
  3687. referencedClasses: ["HLWidget"]
  3688. }),
  3689. smalltalk.HLManager);
  3690. smalltalk.addMethod(
  3691. smalltalk.method({
  3692. selector: "renderContentOn:",
  3693. category: 'rendering',
  3694. fn: function (html){
  3695. var self=this;
  3696. return smalltalk.withContext(function($ctx1) {
  3697. var $1,$3,$4,$2;
  3698. $1=_st(html)._div();
  3699. $ctx1.sendIdx["div"]=1;
  3700. _st($1)._class_("navbar navbar-fixed-top");
  3701. $ctx1.sendIdx["class:"]=1;
  3702. $2=_st($1)._with_((function(){
  3703. return smalltalk.withContext(function($ctx2) {
  3704. $3=_st(html)._div();
  3705. _st($3)._class_("navbar-inner");
  3706. $4=_st($3)._with_((function(){
  3707. return smalltalk.withContext(function($ctx3) {
  3708. return self._renderTabsOn_(html);
  3709. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  3710. return $4;
  3711. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  3712. $ctx1.sendIdx["with:"]=1;
  3713. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLManager)})},
  3714. args: ["html"],
  3715. source: "renderContentOn: html\x0a\x09html div \x0a\x09\x09class: 'navbar navbar-fixed-top';\x0a\x09\x09with: [ html div \x0a\x09\x09\x09class: 'navbar-inner';\x0a\x09\x09\x09with: [ self renderTabsOn: html ] ]",
  3716. messageSends: ["class:", "div", "with:", "renderTabsOn:"],
  3717. referencedClasses: []
  3718. }),
  3719. smalltalk.HLManager);
  3720. smalltalk.addMethod(
  3721. smalltalk.method({
  3722. selector: "renderTabsOn:",
  3723. category: 'rendering',
  3724. fn: function (html){
  3725. var self=this;
  3726. return smalltalk.withContext(function($ctx1) {
  3727. var $1,$3,$4,$6,$5,$8,$9,$10,$11,$12,$7,$2;
  3728. $1=_st(html)._ul();
  3729. _st($1)._class_("nav");
  3730. $ctx1.sendIdx["class:"]=1;
  3731. $2=_st($1)._with_((function(){
  3732. return smalltalk.withContext(function($ctx2) {
  3733. _st(self._tabs())._do_((function(each){
  3734. return smalltalk.withContext(function($ctx3) {
  3735. $3=_st(html)._li();
  3736. $4=$3;
  3737. $6=_st(each)._isActive();
  3738. if(smalltalk.assert($6)){
  3739. $5="active";
  3740. } else {
  3741. $5="inactive";
  3742. };
  3743. _st($4)._class_($5);
  3744. $ctx3.sendIdx["class:"]=2;
  3745. $7=_st($3)._with_((function(){
  3746. return smalltalk.withContext(function($ctx4) {
  3747. $8=_st(html)._a();
  3748. _st($8)._with_((function(){
  3749. return smalltalk.withContext(function($ctx5) {
  3750. $9=_st(_st(html)._tag_("i"))._class_("close");
  3751. $ctx5.sendIdx["class:"]=3;
  3752. _st($9)._onClick_((function(){
  3753. return smalltalk.withContext(function($ctx6) {
  3754. return self._removeTab_(each);
  3755. }, function($ctx6) {$ctx6.fillBlock({},$ctx5,7)})}));
  3756. $ctx5.sendIdx["onClick:"]=1;
  3757. $10=_st(html)._span();
  3758. _st($10)._class_(_st(each)._cssClass());
  3759. $11=_st($10)._with_(_st(each)._displayLabel());
  3760. return $11;
  3761. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,6)})}));
  3762. $ctx4.sendIdx["with:"]=3;
  3763. $12=_st($8)._onClick_((function(){
  3764. return smalltalk.withContext(function($ctx5) {
  3765. return _st(each)._activate();
  3766. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,8)})}));
  3767. return $12;
  3768. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)})}));
  3769. $ctx3.sendIdx["with:"]=2;
  3770. return $7;
  3771. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  3772. return self._renderAddOn_(html);
  3773. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  3774. $ctx1.sendIdx["with:"]=1;
  3775. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.HLManager)})},
  3776. args: ["html"],
  3777. source: "renderTabsOn: html\x0a\x09html ul \x0a\x09\x09class: 'nav';\x0a\x09\x09with: [ \x0a \x09self tabs do: [ :each |\x0a\x09\x09\x09\x09html li \x0a\x09\x09\x09\x09\x09class: (each isActive ifTrue: [ 'active' ] ifFalse: [ 'inactive' ]);\x0a\x09\x09\x09\x09\x09with: [\x0a\x09\x09\x09\x09\x09\x09html a\x0a\x09\x09\x09\x09\x09\x09\x09with: [\x0a \x09\x09\x09\x09\x09\x09\x09((html tag: 'i') class: 'close')\x0a \x09\x09\x09\x09\x09\x09\x09\x09\x09onClick: [ self removeTab: each ].\x0a \x09html span \x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09class: each cssClass;\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09with: each displayLabel ];\x0a\x09\x09\x09\x09\x09\x09\x09onClick: [ each activate ] ] ].\x0a\x09\x09\x09self renderAddOn: html ]",
  3778. messageSends: ["class:", "ul", "with:", "do:", "tabs", "li", "ifTrue:ifFalse:", "isActive", "a", "onClick:", "tag:", "removeTab:", "span", "cssClass", "displayLabel", "activate", "renderAddOn:"],
  3779. referencedClasses: []
  3780. }),
  3781. smalltalk.HLManager);
  3782. smalltalk.addMethod(
  3783. smalltalk.method({
  3784. selector: "request:do:",
  3785. category: 'actions',
  3786. fn: function (aString,aBlock){
  3787. var self=this;
  3788. return smalltalk.withContext(function($ctx1) {
  3789. self._request_value_do_(aString,"",aBlock);
  3790. return self}, function($ctx1) {$ctx1.fill(self,"request:do:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  3791. args: ["aString", "aBlock"],
  3792. source: "request: aString do: aBlock\x0a\x09self \x0a\x09\x09request: aString\x0a\x09\x09value: ''\x0a\x09\x09do: aBlock",
  3793. messageSends: ["request:value:do:"],
  3794. referencedClasses: []
  3795. }),
  3796. smalltalk.HLManager);
  3797. smalltalk.addMethod(
  3798. smalltalk.method({
  3799. selector: "request:value:do:",
  3800. category: 'actions',
  3801. fn: function (aString,valueString,aBlock){
  3802. var self=this;
  3803. function $HLRequestWidget(){return smalltalk.HLRequestWidget||(typeof HLRequestWidget=="undefined"?nil:HLRequestWidget)}
  3804. return smalltalk.withContext(function($ctx1) {
  3805. var $1,$2;
  3806. $1=_st($HLRequestWidget())._new();
  3807. _st($1)._confirmationString_(aString);
  3808. _st($1)._actionBlock_(aBlock);
  3809. _st($1)._value_(valueString);
  3810. $2=_st($1)._show();
  3811. return self}, function($ctx1) {$ctx1.fill(self,"request:value:do:",{aString:aString,valueString:valueString,aBlock:aBlock},smalltalk.HLManager)})},
  3812. args: ["aString", "valueString", "aBlock"],
  3813. source: "request: aString value: valueString do: aBlock\x0a\x09HLRequestWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09value: valueString;\x0a\x09\x09show",
  3814. messageSends: ["confirmationString:", "new", "actionBlock:", "value:", "show"],
  3815. referencedClasses: ["HLRequestWidget"]
  3816. }),
  3817. smalltalk.HLManager);
  3818. smalltalk.addMethod(
  3819. smalltalk.method({
  3820. selector: "show:",
  3821. category: 'rendering',
  3822. fn: function (aTab){
  3823. var self=this;
  3824. return smalltalk.withContext(function($ctx1) {
  3825. var $1,$2;
  3826. _st(self._tabs())._do_((function(each){
  3827. return smalltalk.withContext(function($ctx2) {
  3828. return _st(each)._hide();
  3829. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  3830. $1=aTab;
  3831. _st($1)._show();
  3832. $2=_st($1)._focus();
  3833. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)})},
  3834. args: ["aTab"],
  3835. source: "show: aTab\x0a\x09self tabs do: [ :each | each hide ].\x0a\x09aTab show; focus",
  3836. messageSends: ["do:", "tabs", "hide", "show", "focus"],
  3837. referencedClasses: []
  3838. }),
  3839. smalltalk.HLManager);
  3840. smalltalk.addMethod(
  3841. smalltalk.method({
  3842. selector: "tabs",
  3843. category: 'accessing',
  3844. fn: function (){
  3845. var self=this;
  3846. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3847. return smalltalk.withContext(function($ctx1) {
  3848. var $2,$1;
  3849. $2=self["@tabs"];
  3850. if(($receiver = $2) == nil || $receiver == null){
  3851. self["@tabs"]=_st($OrderedCollection())._new();
  3852. $1=self["@tabs"];
  3853. } else {
  3854. $1=$2;
  3855. };
  3856. return $1;
  3857. }, function($ctx1) {$ctx1.fill(self,"tabs",{},smalltalk.HLManager)})},
  3858. args: [],
  3859. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
  3860. messageSends: ["ifNil:", "new"],
  3861. referencedClasses: ["OrderedCollection"]
  3862. }),
  3863. smalltalk.HLManager);
  3864. smalltalk.HLManager.klass.iVarNames = ['current'];
  3865. smalltalk.addMethod(
  3866. smalltalk.method({
  3867. selector: "current",
  3868. category: 'accessing',
  3869. fn: function (){
  3870. var self=this;
  3871. return smalltalk.withContext(function($ctx1) {
  3872. var $2,$1;
  3873. $2=self["@current"];
  3874. if(($receiver = $2) == nil || $receiver == null){
  3875. self["@current"]=_st(self._basicNew())._initialize();
  3876. $1=self["@current"];
  3877. } else {
  3878. $1=$2;
  3879. };
  3880. return $1;
  3881. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.HLManager.klass)})},
  3882. args: [],
  3883. source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
  3884. messageSends: ["ifNil:", "initialize", "basicNew"],
  3885. referencedClasses: []
  3886. }),
  3887. smalltalk.HLManager.klass);
  3888. smalltalk.addMethod(
  3889. smalltalk.method({
  3890. selector: "initialize",
  3891. category: 'initialization',
  3892. fn: function (){
  3893. var self=this;
  3894. return smalltalk.withContext(function($ctx1) {
  3895. _st(self._current())._appendToJQuery_("body"._asJQuery());
  3896. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager.klass)})},
  3897. args: [],
  3898. source: "initialize\x0a\x09self current appendToJQuery: 'body' asJQuery",
  3899. messageSends: ["appendToJQuery:", "current", "asJQuery"],
  3900. referencedClasses: []
  3901. }),
  3902. smalltalk.HLManager.klass);
  3903. smalltalk.addMethod(
  3904. smalltalk.method({
  3905. selector: "new",
  3906. category: 'instance creation',
  3907. fn: function (){
  3908. var self=this;
  3909. return smalltalk.withContext(function($ctx1) {
  3910. self._shouldNotImplement();
  3911. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.HLManager.klass)})},
  3912. args: [],
  3913. source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
  3914. messageSends: ["shouldNotImplement"],
  3915. referencedClasses: []
  3916. }),
  3917. smalltalk.HLManager.klass);
  3918. smalltalk.addClass('HLModalWidget', smalltalk.HLWidget, [], 'Helios-Core');
  3919. smalltalk.HLModalWidget.comment="I implement an abstract modal widget.";
  3920. smalltalk.addMethod(
  3921. smalltalk.method({
  3922. selector: "cancel",
  3923. category: 'actions',
  3924. fn: function (){
  3925. var self=this;
  3926. return smalltalk.withContext(function($ctx1) {
  3927. self._remove();
  3928. return self}, function($ctx1) {$ctx1.fill(self,"cancel",{},smalltalk.HLModalWidget)})},
  3929. args: [],
  3930. source: "cancel\x0a\x09self remove",
  3931. messageSends: ["remove"],
  3932. referencedClasses: []
  3933. }),
  3934. smalltalk.HLModalWidget);
  3935. smalltalk.addMethod(
  3936. smalltalk.method({
  3937. selector: "confirm",
  3938. category: 'actions',
  3939. fn: function (){
  3940. var self=this;
  3941. return smalltalk.withContext(function($ctx1) {
  3942. self._remove();
  3943. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},smalltalk.HLModalWidget)})},
  3944. args: [],
  3945. source: "confirm\x0a\x09\x22Override in subclasses\x22\x0a\x09self remove",
  3946. messageSends: ["remove"],
  3947. referencedClasses: []
  3948. }),
  3949. smalltalk.HLModalWidget);
  3950. smalltalk.addMethod(
  3951. smalltalk.method({
  3952. selector: "cssClass",
  3953. category: 'accessing',
  3954. fn: function (){
  3955. var self=this;
  3956. return smalltalk.withContext(function($ctx1) {
  3957. return "";
  3958. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLModalWidget)})},
  3959. args: [],
  3960. source: "cssClass\x0a\x09^ ''",
  3961. messageSends: [],
  3962. referencedClasses: []
  3963. }),
  3964. smalltalk.HLModalWidget);
  3965. smalltalk.addMethod(
  3966. smalltalk.method({
  3967. selector: "hasButtons",
  3968. category: 'rendering',
  3969. fn: function (){
  3970. var self=this;
  3971. return smalltalk.withContext(function($ctx1) {
  3972. return true;
  3973. }, function($ctx1) {$ctx1.fill(self,"hasButtons",{},smalltalk.HLModalWidget)})},
  3974. args: [],
  3975. source: "hasButtons\x0a\x09^ true",
  3976. messageSends: [],
  3977. referencedClasses: []
  3978. }),
  3979. smalltalk.HLModalWidget);
  3980. smalltalk.addMethod(
  3981. smalltalk.method({
  3982. selector: "remove",
  3983. category: 'actions',
  3984. fn: function (){
  3985. var self=this;
  3986. return smalltalk.withContext(function($ctx1) {
  3987. var $1,$2,$3;
  3988. $1=".dialog"._asJQuery();
  3989. $ctx1.sendIdx["asJQuery"]=1;
  3990. _st($1)._removeClass_("active");
  3991. _st((function(){
  3992. return smalltalk.withContext(function($ctx2) {
  3993. $2="#overlay"._asJQuery();
  3994. $ctx2.sendIdx["asJQuery"]=2;
  3995. _st($2)._remove();
  3996. $ctx2.sendIdx["remove"]=1;
  3997. $3=".dialog"._asJQuery();
  3998. return _st($3)._remove();
  3999. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._valueWithTimeout_((300));
  4000. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLModalWidget)})},
  4001. args: [],
  4002. source: "remove\x0a\x09'.dialog' asJQuery removeClass: 'active'.\x0a\x09[ \x0a\x09\x09'#overlay' asJQuery remove.\x0a\x09\x09'.dialog' asJQuery remove\x0a\x09] valueWithTimeout: 300",
  4003. messageSends: ["removeClass:", "asJQuery", "valueWithTimeout:", "remove"],
  4004. referencedClasses: []
  4005. }),
  4006. smalltalk.HLModalWidget);
  4007. smalltalk.addMethod(
  4008. smalltalk.method({
  4009. selector: "renderButtonsOn:",
  4010. category: 'rendering',
  4011. fn: function (html){
  4012. var self=this;
  4013. var confirmButton;
  4014. return smalltalk.withContext(function($ctx1) {
  4015. var $1,$3,$4,$5,$6,$2;
  4016. $1=_st(html)._div();
  4017. _st($1)._class_("buttons");
  4018. $ctx1.sendIdx["class:"]=1;
  4019. $2=_st($1)._with_((function(){
  4020. return smalltalk.withContext(function($ctx2) {
  4021. $3=_st(html)._button();
  4022. $ctx2.sendIdx["button"]=1;
  4023. _st($3)._class_("button");
  4024. $ctx2.sendIdx["class:"]=2;
  4025. _st($3)._with_("Cancel");
  4026. $ctx2.sendIdx["with:"]=2;
  4027. $4=_st($3)._onClick_((function(){
  4028. return smalltalk.withContext(function($ctx3) {
  4029. return self._cancel();
  4030. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  4031. $ctx2.sendIdx["onClick:"]=1;
  4032. $4;
  4033. $5=_st(html)._button();
  4034. _st($5)._class_("button default");
  4035. _st($5)._with_("Confirm");
  4036. $6=_st($5)._onClick_((function(){
  4037. return smalltalk.withContext(function($ctx3) {
  4038. return self._confirm();
  4039. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  4040. confirmButton=$6;
  4041. return confirmButton;
  4042. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4043. $ctx1.sendIdx["with:"]=1;
  4044. _st(_st(confirmButton)._asJQuery())._focus();
  4045. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html,confirmButton:confirmButton},smalltalk.HLModalWidget)})},
  4046. args: ["html"],
  4047. source: "renderButtonsOn: html\x0a\x09| confirmButton |\x0a\x09\x0a\x09html div \x0a\x09\x09class: 'buttons';\x0a\x09\x09with: [\x0a\x09\x09\x09html button\x0a\x09\x09\x09\x09class: 'button';\x0a\x09\x09\x09\x09with: 'Cancel';\x0a\x09\x09\x09\x09onClick: [ self cancel ].\x0a\x09\x09\x09confirmButton := html button\x0a\x09\x09\x09\x09class: 'button default';\x0a\x09\x09\x09\x09with: 'Confirm';\x0a\x09\x09\x09\x09onClick: [ self confirm ] ].\x0a\x0a\x09confirmButton asJQuery focus",
  4048. messageSends: ["class:", "div", "with:", "button", "onClick:", "cancel", "confirm", "focus", "asJQuery"],
  4049. referencedClasses: []
  4050. }),
  4051. smalltalk.HLModalWidget);
  4052. smalltalk.addMethod(
  4053. smalltalk.method({
  4054. selector: "renderContentOn:",
  4055. category: 'rendering',
  4056. fn: function (html){
  4057. var self=this;
  4058. var confirmButton;
  4059. return smalltalk.withContext(function($ctx1) {
  4060. var $1,$2,$4,$3;
  4061. $1=_st(html)._div();
  4062. $ctx1.sendIdx["div"]=1;
  4063. _st($1)._id_("overlay");
  4064. $2=_st(html)._div();
  4065. _st($2)._class_("dialog ".__comma(self._cssClass()));
  4066. $3=_st($2)._with_((function(){
  4067. return smalltalk.withContext(function($ctx2) {
  4068. self._renderMainOn_(html);
  4069. $4=self._hasButtons();
  4070. if(smalltalk.assert($4)){
  4071. return self._renderButtonsOn_(html);
  4072. };
  4073. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4074. _st(".dialog"._asJQuery())._addClass_("active");
  4075. self._setupKeyBindings();
  4076. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html,confirmButton:confirmButton},smalltalk.HLModalWidget)})},
  4077. args: ["html"],
  4078. source: "renderContentOn: html\x0a\x09| confirmButton |\x0a\x09\x0a\x09html div id: 'overlay'.\x0a\x09html div \x0a\x09\x09class: 'dialog ', self cssClass;\x0a\x09\x09with: [\x0a\x09\x09\x09self renderMainOn: html.\x0a\x09\x09\x09self hasButtons ifTrue: [ \x0a\x09\x09\x09\x09self renderButtonsOn: html ] ].\x0a\x0a\x09'.dialog' asJQuery addClass: 'active'.\x0a\x09self setupKeyBindings",
  4079. messageSends: ["id:", "div", "class:", ",", "cssClass", "with:", "renderMainOn:", "ifTrue:", "hasButtons", "renderButtonsOn:", "addClass:", "asJQuery", "setupKeyBindings"],
  4080. referencedClasses: []
  4081. }),
  4082. smalltalk.HLModalWidget);
  4083. smalltalk.addMethod(
  4084. smalltalk.method({
  4085. selector: "renderMainOn:",
  4086. category: 'rendering',
  4087. fn: function (html){
  4088. var self=this;
  4089. return smalltalk.withContext(function($ctx1) {
  4090. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLModalWidget)})},
  4091. args: ["html"],
  4092. source: "renderMainOn: html",
  4093. messageSends: [],
  4094. referencedClasses: []
  4095. }),
  4096. smalltalk.HLModalWidget);
  4097. smalltalk.addMethod(
  4098. smalltalk.method({
  4099. selector: "setupKeyBindings",
  4100. category: 'rendering',
  4101. fn: function (){
  4102. var self=this;
  4103. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  4104. return smalltalk.withContext(function($ctx1) {
  4105. var $1;
  4106. _st(".dialog"._asJQuery())._keyup_((function(e){
  4107. return smalltalk.withContext(function($ctx2) {
  4108. $1=_st(_st(e)._keyCode()).__eq(_st(_st($String())._esc())._asciiValue());
  4109. if(smalltalk.assert($1)){
  4110. return self._cancel();
  4111. };
  4112. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,1)})}));
  4113. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLModalWidget)})},
  4114. args: [],
  4115. source: "setupKeyBindings\x0a\x09'.dialog' asJQuery keyup: [ :e |\x0a\x09\x09e keyCode = String esc asciiValue ifTrue: [ self cancel ] ]",
  4116. messageSends: ["keyup:", "asJQuery", "ifTrue:", "=", "keyCode", "asciiValue", "esc", "cancel"],
  4117. referencedClasses: ["String"]
  4118. }),
  4119. smalltalk.HLModalWidget);
  4120. smalltalk.addMethod(
  4121. smalltalk.method({
  4122. selector: "show",
  4123. category: 'actions',
  4124. fn: function (){
  4125. var self=this;
  4126. return smalltalk.withContext(function($ctx1) {
  4127. self._appendToJQuery_("body"._asJQuery());
  4128. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLModalWidget)})},
  4129. args: [],
  4130. source: "show\x0a\x09self appendToJQuery: 'body' asJQuery",
  4131. messageSends: ["appendToJQuery:", "asJQuery"],
  4132. referencedClasses: []
  4133. }),
  4134. smalltalk.HLModalWidget);
  4135. smalltalk.addClass('HLConfirmationWidget', smalltalk.HLModalWidget, ['confirmationString', 'actionBlock', 'cancelBlock'], 'Helios-Core');
  4136. smalltalk.HLConfirmationWidget.comment="I display confirmation messages. \x0a\x0aInstead of creating an instance directly, use `HLWidget >> #confirm:ifTrue:`.";
  4137. smalltalk.addMethod(
  4138. smalltalk.method({
  4139. selector: "actionBlock",
  4140. category: 'accessing',
  4141. fn: function (){
  4142. var self=this;
  4143. return smalltalk.withContext(function($ctx1) {
  4144. var $2,$1;
  4145. $2=self["@actionBlock"];
  4146. if(($receiver = $2) == nil || $receiver == null){
  4147. $1=(function(){
  4148. return smalltalk.withContext(function($ctx2) {
  4149. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
  4150. } else {
  4151. $1=$2;
  4152. };
  4153. return $1;
  4154. }, function($ctx1) {$ctx1.fill(self,"actionBlock",{},smalltalk.HLConfirmationWidget)})},
  4155. args: [],
  4156. source: "actionBlock\x0a\x09^ actionBlock ifNil: [ [] ]",
  4157. messageSends: ["ifNil:"],
  4158. referencedClasses: []
  4159. }),
  4160. smalltalk.HLConfirmationWidget);
  4161. smalltalk.addMethod(
  4162. smalltalk.method({
  4163. selector: "actionBlock:",
  4164. category: 'accessing',
  4165. fn: function (aBlock){
  4166. var self=this;
  4167. return smalltalk.withContext(function($ctx1) {
  4168. self["@actionBlock"]=aBlock;
  4169. return self}, function($ctx1) {$ctx1.fill(self,"actionBlock:",{aBlock:aBlock},smalltalk.HLConfirmationWidget)})},
  4170. args: ["aBlock"],
  4171. source: "actionBlock: aBlock\x0a\x09actionBlock := aBlock",
  4172. messageSends: [],
  4173. referencedClasses: []
  4174. }),
  4175. smalltalk.HLConfirmationWidget);
  4176. smalltalk.addMethod(
  4177. smalltalk.method({
  4178. selector: "cancel",
  4179. category: 'actions',
  4180. fn: function (){
  4181. var self=this;
  4182. return smalltalk.withContext(function($ctx1) {
  4183. _st(self._cancelBlock())._value();
  4184. smalltalk.HLConfirmationWidget.superclass.fn.prototype._cancel.apply(_st(self), []);
  4185. return self}, function($ctx1) {$ctx1.fill(self,"cancel",{},smalltalk.HLConfirmationWidget)})},
  4186. args: [],
  4187. source: "cancel\x0a\x09self cancelBlock value.\x0a\x09super cancel",
  4188. messageSends: ["value", "cancelBlock", "cancel"],
  4189. referencedClasses: []
  4190. }),
  4191. smalltalk.HLConfirmationWidget);
  4192. smalltalk.addMethod(
  4193. smalltalk.method({
  4194. selector: "cancelBlock",
  4195. category: 'accessing',
  4196. fn: function (){
  4197. var self=this;
  4198. return smalltalk.withContext(function($ctx1) {
  4199. var $2,$1;
  4200. $2=self["@cancelBlock"];
  4201. if(($receiver = $2) == nil || $receiver == null){
  4202. $1=(function(){
  4203. return smalltalk.withContext(function($ctx2) {
  4204. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
  4205. } else {
  4206. $1=$2;
  4207. };
  4208. return $1;
  4209. }, function($ctx1) {$ctx1.fill(self,"cancelBlock",{},smalltalk.HLConfirmationWidget)})},
  4210. args: [],
  4211. source: "cancelBlock\x0a\x09^ cancelBlock ifNil: [ [] ]",
  4212. messageSends: ["ifNil:"],
  4213. referencedClasses: []
  4214. }),
  4215. smalltalk.HLConfirmationWidget);
  4216. smalltalk.addMethod(
  4217. smalltalk.method({
  4218. selector: "cancelBlock:",
  4219. category: 'accessing',
  4220. fn: function (aBlock){
  4221. var self=this;
  4222. return smalltalk.withContext(function($ctx1) {
  4223. self["@cancelBlock"]=aBlock;
  4224. return self}, function($ctx1) {$ctx1.fill(self,"cancelBlock:",{aBlock:aBlock},smalltalk.HLConfirmationWidget)})},
  4225. args: ["aBlock"],
  4226. source: "cancelBlock: aBlock\x0a\x09cancelBlock := aBlock",
  4227. messageSends: [],
  4228. referencedClasses: []
  4229. }),
  4230. smalltalk.HLConfirmationWidget);
  4231. smalltalk.addMethod(
  4232. smalltalk.method({
  4233. selector: "confirm",
  4234. category: 'actions',
  4235. fn: function (){
  4236. var self=this;
  4237. return smalltalk.withContext(function($ctx1) {
  4238. smalltalk.HLConfirmationWidget.superclass.fn.prototype._confirm.apply(_st(self), []);
  4239. _st(self._actionBlock())._value();
  4240. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},smalltalk.HLConfirmationWidget)})},
  4241. args: [],
  4242. source: "confirm\x0a\x09super confirm.\x0a\x09self actionBlock value",
  4243. messageSends: ["confirm", "value", "actionBlock"],
  4244. referencedClasses: []
  4245. }),
  4246. smalltalk.HLConfirmationWidget);
  4247. smalltalk.addMethod(
  4248. smalltalk.method({
  4249. selector: "confirmationString",
  4250. category: 'accessing',
  4251. fn: function (){
  4252. var self=this;
  4253. return smalltalk.withContext(function($ctx1) {
  4254. var $2,$1;
  4255. $2=self["@confirmationString"];
  4256. if(($receiver = $2) == nil || $receiver == null){
  4257. $1="Confirm";
  4258. } else {
  4259. $1=$2;
  4260. };
  4261. return $1;
  4262. }, function($ctx1) {$ctx1.fill(self,"confirmationString",{},smalltalk.HLConfirmationWidget)})},
  4263. args: [],
  4264. source: "confirmationString\x0a\x09^ confirmationString ifNil: [ 'Confirm' ]",
  4265. messageSends: ["ifNil:"],
  4266. referencedClasses: []
  4267. }),
  4268. smalltalk.HLConfirmationWidget);
  4269. smalltalk.addMethod(
  4270. smalltalk.method({
  4271. selector: "confirmationString:",
  4272. category: 'accessing',
  4273. fn: function (aString){
  4274. var self=this;
  4275. return smalltalk.withContext(function($ctx1) {
  4276. self["@confirmationString"]=aString;
  4277. return self}, function($ctx1) {$ctx1.fill(self,"confirmationString:",{aString:aString},smalltalk.HLConfirmationWidget)})},
  4278. args: ["aString"],
  4279. source: "confirmationString: aString\x0a\x09confirmationString := aString",
  4280. messageSends: [],
  4281. referencedClasses: []
  4282. }),
  4283. smalltalk.HLConfirmationWidget);
  4284. smalltalk.addMethod(
  4285. smalltalk.method({
  4286. selector: "renderMainOn:",
  4287. category: 'rendering',
  4288. fn: function (html){
  4289. var self=this;
  4290. return smalltalk.withContext(function($ctx1) {
  4291. _st(_st(html)._span())._with_(self._confirmationString());
  4292. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLConfirmationWidget)})},
  4293. args: ["html"],
  4294. source: "renderMainOn: html\x0a\x09html span with: self confirmationString",
  4295. messageSends: ["with:", "span", "confirmationString"],
  4296. referencedClasses: []
  4297. }),
  4298. smalltalk.HLConfirmationWidget);
  4299. smalltalk.addClass('HLRequestWidget', smalltalk.HLConfirmationWidget, ['input', 'value'], 'Helios-Core');
  4300. smalltalk.HLRequestWidget.comment="I display a modal window requesting user input.\x0a\x0aInstead of creating instances manually, use `HLWidget >> #request:do:` and `#request:value:do:`.";
  4301. smalltalk.addMethod(
  4302. smalltalk.method({
  4303. selector: "confirm",
  4304. category: 'actions',
  4305. fn: function (){
  4306. var self=this;
  4307. return smalltalk.withContext(function($ctx1) {
  4308. smalltalk.HLRequestWidget.superclass.fn.prototype._confirm.apply(_st(self), []);
  4309. _st(self._actionBlock())._value_(_st(_st(self["@input"])._asJQuery())._val());
  4310. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},smalltalk.HLRequestWidget)})},
  4311. args: [],
  4312. source: "confirm\x0a\x09super confirm.\x0a\x09self actionBlock value: input asJQuery val",
  4313. messageSends: ["confirm", "value:", "actionBlock", "val", "asJQuery"],
  4314. referencedClasses: []
  4315. }),
  4316. smalltalk.HLRequestWidget);
  4317. smalltalk.addMethod(
  4318. smalltalk.method({
  4319. selector: "cssClass",
  4320. category: 'accessing',
  4321. fn: function (){
  4322. var self=this;
  4323. return smalltalk.withContext(function($ctx1) {
  4324. return "large";
  4325. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLRequestWidget)})},
  4326. args: [],
  4327. source: "cssClass\x0a\x09^ 'large'",
  4328. messageSends: [],
  4329. referencedClasses: []
  4330. }),
  4331. smalltalk.HLRequestWidget);
  4332. smalltalk.addMethod(
  4333. smalltalk.method({
  4334. selector: "renderMainOn:",
  4335. category: 'rendering',
  4336. fn: function (html){
  4337. var self=this;
  4338. return smalltalk.withContext(function($ctx1) {
  4339. smalltalk.HLRequestWidget.superclass.fn.prototype._renderMainOn_.apply(_st(self), [html]);
  4340. self["@input"]=_st(html)._textarea();
  4341. _st(_st(self["@input"])._asJQuery())._val_(self._value());
  4342. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLRequestWidget)})},
  4343. args: ["html"],
  4344. source: "renderMainOn: html\x0a\x09super renderMainOn: html.\x0a\x09input := html textarea.\x0a\x09input asJQuery val: self value",
  4345. messageSends: ["renderMainOn:", "textarea", "val:", "asJQuery", "value"],
  4346. referencedClasses: []
  4347. }),
  4348. smalltalk.HLRequestWidget);
  4349. smalltalk.addMethod(
  4350. smalltalk.method({
  4351. selector: "value",
  4352. category: 'accessing',
  4353. fn: function (){
  4354. var self=this;
  4355. return smalltalk.withContext(function($ctx1) {
  4356. var $2,$1;
  4357. $2=self["@value"];
  4358. if(($receiver = $2) == nil || $receiver == null){
  4359. $1="";
  4360. } else {
  4361. $1=$2;
  4362. };
  4363. return $1;
  4364. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.HLRequestWidget)})},
  4365. args: [],
  4366. source: "value\x0a\x09^ value ifNil: [ '' ]",
  4367. messageSends: ["ifNil:"],
  4368. referencedClasses: []
  4369. }),
  4370. smalltalk.HLRequestWidget);
  4371. smalltalk.addMethod(
  4372. smalltalk.method({
  4373. selector: "value:",
  4374. category: 'accessing',
  4375. fn: function (aString){
  4376. var self=this;
  4377. return smalltalk.withContext(function($ctx1) {
  4378. self["@value"]=aString;
  4379. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aString:aString},smalltalk.HLRequestWidget)})},
  4380. args: ["aString"],
  4381. source: "value: aString\x0a\x09value := aString",
  4382. messageSends: [],
  4383. referencedClasses: []
  4384. }),
  4385. smalltalk.HLRequestWidget);
  4386. smalltalk.addClass('HLProgressWidget', smalltalk.HLModalWidget, ['progressBars', 'visible'], 'Helios-Core');
  4387. smalltalk.HLProgressWidget.comment="I am a widget used to display progress modal dialogs.\x0a\x0aMy default instance is accessed with `HLProgressWidget class >> #default`.\x0a\x0aSee `HLProgressHandler` for usage.";
  4388. smalltalk.addMethod(
  4389. smalltalk.method({
  4390. selector: "addProgressBar:",
  4391. category: 'actions',
  4392. fn: function (aProgressBar){
  4393. var self=this;
  4394. return smalltalk.withContext(function($ctx1) {
  4395. self._show();
  4396. _st(self._progressBars())._add_(aProgressBar);
  4397. _st(aProgressBar)._appendToJQuery_(_st(_st(self._wrapper())._asJQuery())._find_(".dialog"));
  4398. return self}, function($ctx1) {$ctx1.fill(self,"addProgressBar:",{aProgressBar:aProgressBar},smalltalk.HLProgressWidget)})},
  4399. args: ["aProgressBar"],
  4400. source: "addProgressBar: aProgressBar\x0a\x09self show.\x0a\x09self progressBars add: aProgressBar.\x0a\x09aProgressBar appendToJQuery: (self wrapper asJQuery find: '.dialog')",
  4401. messageSends: ["show", "add:", "progressBars", "appendToJQuery:", "find:", "asJQuery", "wrapper"],
  4402. referencedClasses: []
  4403. }),
  4404. smalltalk.HLProgressWidget);
  4405. smalltalk.addMethod(
  4406. smalltalk.method({
  4407. selector: "do:on:displaying:",
  4408. category: 'actions',
  4409. fn: function (aBlock,aCollection,aString){
  4410. var self=this;
  4411. var progressBar;
  4412. function $HLProgressBarWidget(){return smalltalk.HLProgressBarWidget||(typeof HLProgressBarWidget=="undefined"?nil:HLProgressBarWidget)}
  4413. return smalltalk.withContext(function($ctx1) {
  4414. var $1,$2;
  4415. $1=_st($HLProgressBarWidget())._new();
  4416. _st($1)._parent_(self);
  4417. _st($1)._label_(aString);
  4418. _st($1)._workBlock_(aBlock);
  4419. _st($1)._collection_(aCollection);
  4420. $2=_st($1)._yourself();
  4421. progressBar=$2;
  4422. self._addProgressBar_(progressBar);
  4423. _st(progressBar)._start();
  4424. return self}, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString,progressBar:progressBar},smalltalk.HLProgressWidget)})},
  4425. args: ["aBlock", "aCollection", "aString"],
  4426. source: "do: aBlock on: aCollection displaying: aString\x0a\x09| progressBar |\x0a\x09\x0a\x09progressBar := HLProgressBarWidget new\x0a\x09\x09parent: self;\x0a\x09\x09label: aString;\x0a\x09\x09workBlock: aBlock;\x0a\x09\x09collection: aCollection;\x0a\x09\x09yourself.\x0a\x09\x0a\x09self addProgressBar: progressBar.\x0a\x09progressBar start",
  4427. messageSends: ["parent:", "new", "label:", "workBlock:", "collection:", "yourself", "addProgressBar:", "start"],
  4428. referencedClasses: ["HLProgressBarWidget"]
  4429. }),
  4430. smalltalk.HLProgressWidget);
  4431. smalltalk.addMethod(
  4432. smalltalk.method({
  4433. selector: "flush",
  4434. category: 'actions',
  4435. fn: function (){
  4436. var self=this;
  4437. return smalltalk.withContext(function($ctx1) {
  4438. _st(self._progressBars())._do_((function(each){
  4439. return smalltalk.withContext(function($ctx2) {
  4440. return self._removeProgressBar_(each);
  4441. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  4442. return self}, function($ctx1) {$ctx1.fill(self,"flush",{},smalltalk.HLProgressWidget)})},
  4443. args: [],
  4444. source: "flush\x0a\x09self progressBars do: [ :each |\x0a\x09\x09self removeProgressBar: each ]",
  4445. messageSends: ["do:", "progressBars", "removeProgressBar:"],
  4446. referencedClasses: []
  4447. }),
  4448. smalltalk.HLProgressWidget);
  4449. smalltalk.addMethod(
  4450. smalltalk.method({
  4451. selector: "hasButtons",
  4452. category: 'testing',
  4453. fn: function (){
  4454. var self=this;
  4455. return smalltalk.withContext(function($ctx1) {
  4456. return false;
  4457. }, function($ctx1) {$ctx1.fill(self,"hasButtons",{},smalltalk.HLProgressWidget)})},
  4458. args: [],
  4459. source: "hasButtons\x0a\x09^ false",
  4460. messageSends: [],
  4461. referencedClasses: []
  4462. }),
  4463. smalltalk.HLProgressWidget);
  4464. smalltalk.addMethod(
  4465. smalltalk.method({
  4466. selector: "isVisible",
  4467. category: 'testing',
  4468. fn: function (){
  4469. var self=this;
  4470. return smalltalk.withContext(function($ctx1) {
  4471. var $2,$1;
  4472. $2=self["@visible"];
  4473. if(($receiver = $2) == nil || $receiver == null){
  4474. $1=false;
  4475. } else {
  4476. $1=$2;
  4477. };
  4478. return $1;
  4479. }, function($ctx1) {$ctx1.fill(self,"isVisible",{},smalltalk.HLProgressWidget)})},
  4480. args: [],
  4481. source: "isVisible\x0a\x09^ visible ifNil: [ false ]",
  4482. messageSends: ["ifNil:"],
  4483. referencedClasses: []
  4484. }),
  4485. smalltalk.HLProgressWidget);
  4486. smalltalk.addMethod(
  4487. smalltalk.method({
  4488. selector: "progressBars",
  4489. category: 'accessing',
  4490. fn: function (){
  4491. var self=this;
  4492. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  4493. return smalltalk.withContext(function($ctx1) {
  4494. var $2,$1;
  4495. $2=self["@progressBars"];
  4496. if(($receiver = $2) == nil || $receiver == null){
  4497. self["@progressBars"]=_st($OrderedCollection())._new();
  4498. $1=self["@progressBars"];
  4499. } else {
  4500. $1=$2;
  4501. };
  4502. return $1;
  4503. }, function($ctx1) {$ctx1.fill(self,"progressBars",{},smalltalk.HLProgressWidget)})},
  4504. args: [],
  4505. source: "progressBars\x0a\x09^ progressBars ifNil: [ progressBars := OrderedCollection new ]",
  4506. messageSends: ["ifNil:", "new"],
  4507. referencedClasses: ["OrderedCollection"]
  4508. }),
  4509. smalltalk.HLProgressWidget);
  4510. smalltalk.addMethod(
  4511. smalltalk.method({
  4512. selector: "remove",
  4513. category: 'actions',
  4514. fn: function (){
  4515. var self=this;
  4516. return smalltalk.withContext(function($ctx1) {
  4517. var $1;
  4518. $1=self._isVisible();
  4519. if(smalltalk.assert($1)){
  4520. self["@visible"]=false;
  4521. self["@visible"];
  4522. smalltalk.HLProgressWidget.superclass.fn.prototype._remove.apply(_st(self), []);
  4523. };
  4524. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLProgressWidget)})},
  4525. args: [],
  4526. source: "remove\x0a\x09self isVisible ifTrue: [\x0a\x09\x09visible := false.\x0a\x09\x09super remove ]",
  4527. messageSends: ["ifTrue:", "isVisible", "remove"],
  4528. referencedClasses: []
  4529. }),
  4530. smalltalk.HLProgressWidget);
  4531. smalltalk.addMethod(
  4532. smalltalk.method({
  4533. selector: "removeProgressBar:",
  4534. category: 'actions',
  4535. fn: function (aProgressBar){
  4536. var self=this;
  4537. return smalltalk.withContext(function($ctx1) {
  4538. var $1,$2,$3;
  4539. $1=self._progressBars();
  4540. $ctx1.sendIdx["progressBars"]=1;
  4541. _st($1)._remove_ifAbsent_(aProgressBar,(function(){
  4542. return smalltalk.withContext(function($ctx2) {
  4543. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4544. $2=_st(_st(_st(aProgressBar)._wrapper())._asJQuery())._remove();
  4545. $ctx1.sendIdx["remove"]=1;
  4546. $3=self._progressBars();
  4547. _st($3)._ifEmpty_((function(){
  4548. return smalltalk.withContext(function($ctx2) {
  4549. return self._remove();
  4550. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  4551. return self}, function($ctx1) {$ctx1.fill(self,"removeProgressBar:",{aProgressBar:aProgressBar},smalltalk.HLProgressWidget)})},
  4552. args: ["aProgressBar"],
  4553. source: "removeProgressBar: aProgressBar\x0a\x09self progressBars remove: aProgressBar ifAbsent: [].\x0a\x09aProgressBar wrapper asJQuery remove.\x0a\x09\x0a\x09self progressBars ifEmpty: [ self remove ]",
  4554. messageSends: ["remove:ifAbsent:", "progressBars", "remove", "asJQuery", "wrapper", "ifEmpty:"],
  4555. referencedClasses: []
  4556. }),
  4557. smalltalk.HLProgressWidget);
  4558. smalltalk.addMethod(
  4559. smalltalk.method({
  4560. selector: "renderMainOn:",
  4561. category: 'rendering',
  4562. fn: function (html){
  4563. var self=this;
  4564. return smalltalk.withContext(function($ctx1) {
  4565. _st(self._progressBars())._do_((function(each){
  4566. return smalltalk.withContext(function($ctx2) {
  4567. return _st(html)._with_(each);
  4568. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  4569. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLProgressWidget)})},
  4570. args: ["html"],
  4571. source: "renderMainOn: html\x0a\x09self progressBars do: [ :each |\x0a\x09\x09html with: each ]",
  4572. messageSends: ["do:", "progressBars", "with:"],
  4573. referencedClasses: []
  4574. }),
  4575. smalltalk.HLProgressWidget);
  4576. smalltalk.addMethod(
  4577. smalltalk.method({
  4578. selector: "show",
  4579. category: 'actions',
  4580. fn: function (){
  4581. var self=this;
  4582. return smalltalk.withContext(function($ctx1) {
  4583. var $1;
  4584. $1=self._isVisible();
  4585. if(! smalltalk.assert($1)){
  4586. self["@visible"]=true;
  4587. self["@visible"];
  4588. smalltalk.HLProgressWidget.superclass.fn.prototype._show.apply(_st(self), []);
  4589. };
  4590. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLProgressWidget)})},
  4591. args: [],
  4592. source: "show\x0a\x09self isVisible ifFalse: [\x0a\x09\x09visible := true.\x0a\x09\x09super show ]",
  4593. messageSends: ["ifFalse:", "isVisible", "show"],
  4594. referencedClasses: []
  4595. }),
  4596. smalltalk.HLProgressWidget);
  4597. smalltalk.HLProgressWidget.klass.iVarNames = ['default'];
  4598. smalltalk.addMethod(
  4599. smalltalk.method({
  4600. selector: "default",
  4601. category: 'accessing',
  4602. fn: function (){
  4603. var self=this;
  4604. return smalltalk.withContext(function($ctx1) {
  4605. var $2,$1;
  4606. $2=self["@default"];
  4607. if(($receiver = $2) == nil || $receiver == null){
  4608. self["@default"]=self._new();
  4609. $1=self["@default"];
  4610. } else {
  4611. $1=$2;
  4612. };
  4613. return $1;
  4614. }, function($ctx1) {$ctx1.fill(self,"default",{},smalltalk.HLProgressWidget.klass)})},
  4615. args: [],
  4616. source: "default\x0a\x09^ default ifNil: [ default := self new ]",
  4617. messageSends: ["ifNil:", "new"],
  4618. referencedClasses: []
  4619. }),
  4620. smalltalk.HLProgressWidget.klass);
  4621. smalltalk.addClass('HLTabSelectionWidget', smalltalk.HLModalWidget, ['tabs', 'tabList', 'selectedTab', 'selectCallback', 'cancelCallback', 'confirmCallback'], 'Helios-Core');
  4622. smalltalk.HLTabSelectionWidget.comment="I am a modal window used to select or create tabs.";
  4623. smalltalk.addMethod(
  4624. smalltalk.method({
  4625. selector: "cancel",
  4626. category: 'actions',
  4627. fn: function (){
  4628. var self=this;
  4629. return smalltalk.withContext(function($ctx1) {
  4630. smalltalk.HLTabSelectionWidget.superclass.fn.prototype._cancel.apply(_st(self), []);
  4631. _st(self._cancelCallback())._value();
  4632. return self}, function($ctx1) {$ctx1.fill(self,"cancel",{},smalltalk.HLTabSelectionWidget)})},
  4633. args: [],
  4634. source: "cancel\x0a\x09super cancel.\x0a\x09self cancelCallback value",
  4635. messageSends: ["cancel", "value", "cancelCallback"],
  4636. referencedClasses: []
  4637. }),
  4638. smalltalk.HLTabSelectionWidget);
  4639. smalltalk.addMethod(
  4640. smalltalk.method({
  4641. selector: "cancelCallback",
  4642. category: 'accessing',
  4643. fn: function (){
  4644. var self=this;
  4645. return smalltalk.withContext(function($ctx1) {
  4646. var $2,$1;
  4647. $2=self["@cancelCallback"];
  4648. if(($receiver = $2) == nil || $receiver == null){
  4649. $1=(function(){
  4650. return smalltalk.withContext(function($ctx2) {
  4651. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
  4652. } else {
  4653. $1=$2;
  4654. };
  4655. return $1;
  4656. }, function($ctx1) {$ctx1.fill(self,"cancelCallback",{},smalltalk.HLTabSelectionWidget)})},
  4657. args: [],
  4658. source: "cancelCallback\x0a\x09^ cancelCallback ifNil: [ [] ]",
  4659. messageSends: ["ifNil:"],
  4660. referencedClasses: []
  4661. }),
  4662. smalltalk.HLTabSelectionWidget);
  4663. smalltalk.addMethod(
  4664. smalltalk.method({
  4665. selector: "cancelCallback:",
  4666. category: 'accessing',
  4667. fn: function (aBlock){
  4668. var self=this;
  4669. return smalltalk.withContext(function($ctx1) {
  4670. self["@cancelCallback"]=aBlock;
  4671. return self}, function($ctx1) {$ctx1.fill(self,"cancelCallback:",{aBlock:aBlock},smalltalk.HLTabSelectionWidget)})},
  4672. args: ["aBlock"],
  4673. source: "cancelCallback: aBlock\x0a\x09cancelCallback := aBlock",
  4674. messageSends: [],
  4675. referencedClasses: []
  4676. }),
  4677. smalltalk.HLTabSelectionWidget);
  4678. smalltalk.addMethod(
  4679. smalltalk.method({
  4680. selector: "confirm",
  4681. category: 'actions',
  4682. fn: function (){
  4683. var self=this;
  4684. return smalltalk.withContext(function($ctx1) {
  4685. smalltalk.HLTabSelectionWidget.superclass.fn.prototype._confirm.apply(_st(self), []);
  4686. _st(self._confirmCallback())._value_(self._selectedTab());
  4687. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},smalltalk.HLTabSelectionWidget)})},
  4688. args: [],
  4689. source: "confirm\x0a\x09super confirm.\x0a\x09self confirmCallback value: self selectedTab",
  4690. messageSends: ["confirm", "value:", "confirmCallback", "selectedTab"],
  4691. referencedClasses: []
  4692. }),
  4693. smalltalk.HLTabSelectionWidget);
  4694. smalltalk.addMethod(
  4695. smalltalk.method({
  4696. selector: "confirmCallback",
  4697. category: 'accessing',
  4698. fn: function (){
  4699. var self=this;
  4700. return smalltalk.withContext(function($ctx1) {
  4701. var $2,$1;
  4702. $2=self["@confirmCallback"];
  4703. if(($receiver = $2) == nil || $receiver == null){
  4704. $1=(function(){
  4705. return smalltalk.withContext(function($ctx2) {
  4706. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
  4707. } else {
  4708. $1=$2;
  4709. };
  4710. return $1;
  4711. }, function($ctx1) {$ctx1.fill(self,"confirmCallback",{},smalltalk.HLTabSelectionWidget)})},
  4712. args: [],
  4713. source: "confirmCallback\x0a\x09^ confirmCallback ifNil: [ [] ]",
  4714. messageSends: ["ifNil:"],
  4715. referencedClasses: []
  4716. }),
  4717. smalltalk.HLTabSelectionWidget);
  4718. smalltalk.addMethod(
  4719. smalltalk.method({
  4720. selector: "confirmCallback:",
  4721. category: 'accessing',
  4722. fn: function (aBlock){
  4723. var self=this;
  4724. return smalltalk.withContext(function($ctx1) {
  4725. self["@confirmCallback"]=aBlock;
  4726. return self}, function($ctx1) {$ctx1.fill(self,"confirmCallback:",{aBlock:aBlock},smalltalk.HLTabSelectionWidget)})},
  4727. args: ["aBlock"],
  4728. source: "confirmCallback: aBlock\x0a\x09confirmCallback := aBlock",
  4729. messageSends: [],
  4730. referencedClasses: []
  4731. }),
  4732. smalltalk.HLTabSelectionWidget);
  4733. smalltalk.addMethod(
  4734. smalltalk.method({
  4735. selector: "renderContentOn:",
  4736. category: 'rendering',
  4737. fn: function (html){
  4738. var self=this;
  4739. return smalltalk.withContext(function($ctx1) {
  4740. smalltalk.HLTabSelectionWidget.superclass.fn.prototype._renderContentOn_.apply(_st(self), [html]);
  4741. _st(self._tabList())._focus();
  4742. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLTabSelectionWidget)})},
  4743. args: ["html"],
  4744. source: "renderContentOn: html\x0a\x09super renderContentOn: html.\x0a\x09self tabList focus",
  4745. messageSends: ["renderContentOn:", "focus", "tabList"],
  4746. referencedClasses: []
  4747. }),
  4748. smalltalk.HLTabSelectionWidget);
  4749. smalltalk.addMethod(
  4750. smalltalk.method({
  4751. selector: "renderMainOn:",
  4752. category: 'rendering',
  4753. fn: function (html){
  4754. var self=this;
  4755. return smalltalk.withContext(function($ctx1) {
  4756. var $1,$2,$3;
  4757. $1=_st(html)._div();
  4758. _st($1)._class_("title");
  4759. $2=_st($1)._with_("Tab selection");
  4760. $ctx1.sendIdx["with:"]=1;
  4761. $3=_st(html)._with_(self._tabList());
  4762. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLTabSelectionWidget)})},
  4763. args: ["html"],
  4764. source: "renderMainOn: html\x0a\x09html div \x0a\x09\x09class: 'title'; \x0a\x09\x09with: 'Tab selection'.\x0a\x09\x0a\x09html with: self tabList",
  4765. messageSends: ["class:", "div", "with:", "tabList"],
  4766. referencedClasses: []
  4767. }),
  4768. smalltalk.HLTabSelectionWidget);
  4769. smalltalk.addMethod(
  4770. smalltalk.method({
  4771. selector: "renderTab:on:",
  4772. category: 'rendering',
  4773. fn: function (aTab,html){
  4774. var self=this;
  4775. return smalltalk.withContext(function($ctx1) {
  4776. var $1,$2;
  4777. $1=_st(html)._span();
  4778. _st($1)._class_(_st(aTab)._cssClass());
  4779. $2=_st($1)._with_(_st(aTab)._label());
  4780. return self}, function($ctx1) {$ctx1.fill(self,"renderTab:on:",{aTab:aTab,html:html},smalltalk.HLTabSelectionWidget)})},
  4781. args: ["aTab", "html"],
  4782. source: "renderTab: aTab on: html\x0a\x09html \x0a\x09\x09span \x0a\x09\x09\x09class: aTab cssClass;\x0a\x09\x09\x09with: aTab label",
  4783. messageSends: ["class:", "span", "cssClass", "with:", "label"],
  4784. referencedClasses: []
  4785. }),
  4786. smalltalk.HLTabSelectionWidget);
  4787. smalltalk.addMethod(
  4788. smalltalk.method({
  4789. selector: "renderTabsOn:",
  4790. category: 'rendering',
  4791. fn: function (html){
  4792. var self=this;
  4793. return smalltalk.withContext(function($ctx1) {
  4794. var $1,$2;
  4795. _st(self._tabs())._do_((function(each){
  4796. return smalltalk.withContext(function($ctx2) {
  4797. return _st(_st(html)._li())._with_((function(){
  4798. return smalltalk.withContext(function($ctx3) {
  4799. $1=_st(html)._a();
  4800. _st($1)._with_((function(){
  4801. return smalltalk.withContext(function($ctx4) {
  4802. return self._renderTab_on_(each,html);
  4803. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
  4804. $2=_st($1)._onClick_((function(){
  4805. return smalltalk.withContext(function($ctx4) {
  4806. return self._selectTab_(each);
  4807. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)})}));
  4808. return $2;
  4809. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  4810. $ctx2.sendIdx["with:"]=1;
  4811. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  4812. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.HLTabSelectionWidget)})},
  4813. args: ["html"],
  4814. source: "renderTabsOn: html\x0a\x09self tabs do: [ :each |\x0a\x09\x09html li with: [ \x0a\x09\x09\x09html a \x0a\x09\x09\x09\x09with: [ \x0a\x09\x09\x09\x09\x09self renderTab: each on: html ];\x0a\x09\x09\x09\x09onClick: [ self selectTab: each ] ] ]",
  4815. messageSends: ["do:", "tabs", "with:", "li", "a", "renderTab:on:", "onClick:", "selectTab:"],
  4816. referencedClasses: []
  4817. }),
  4818. smalltalk.HLTabSelectionWidget);
  4819. smalltalk.addMethod(
  4820. smalltalk.method({
  4821. selector: "selectCallback",
  4822. category: 'accessing',
  4823. fn: function (){
  4824. var self=this;
  4825. return smalltalk.withContext(function($ctx1) {
  4826. var $2,$1;
  4827. $2=self["@selectCallback"];
  4828. if(($receiver = $2) == nil || $receiver == null){
  4829. $1=(function(){
  4830. return smalltalk.withContext(function($ctx2) {
  4831. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})});
  4832. } else {
  4833. $1=$2;
  4834. };
  4835. return $1;
  4836. }, function($ctx1) {$ctx1.fill(self,"selectCallback",{},smalltalk.HLTabSelectionWidget)})},
  4837. args: [],
  4838. source: "selectCallback\x0a\x09^ selectCallback ifNil: [ [] ]",
  4839. messageSends: ["ifNil:"],
  4840. referencedClasses: []
  4841. }),
  4842. smalltalk.HLTabSelectionWidget);
  4843. smalltalk.addMethod(
  4844. smalltalk.method({
  4845. selector: "selectCallback:",
  4846. category: 'accessing',
  4847. fn: function (aBlock){
  4848. var self=this;
  4849. return smalltalk.withContext(function($ctx1) {
  4850. self["@selectCallback"]=aBlock;
  4851. return self}, function($ctx1) {$ctx1.fill(self,"selectCallback:",{aBlock:aBlock},smalltalk.HLTabSelectionWidget)})},
  4852. args: ["aBlock"],
  4853. source: "selectCallback: aBlock\x0a\x09selectCallback := aBlock",
  4854. messageSends: [],
  4855. referencedClasses: []
  4856. }),
  4857. smalltalk.HLTabSelectionWidget);
  4858. smalltalk.addMethod(
  4859. smalltalk.method({
  4860. selector: "selectTab:",
  4861. category: 'actions',
  4862. fn: function (aTab){
  4863. var self=this;
  4864. return smalltalk.withContext(function($ctx1) {
  4865. self._selectedTab_(aTab);
  4866. _st(self._selectCallback())._value_(aTab);
  4867. return self}, function($ctx1) {$ctx1.fill(self,"selectTab:",{aTab:aTab},smalltalk.HLTabSelectionWidget)})},
  4868. args: ["aTab"],
  4869. source: "selectTab: aTab\x0a\x09self selectedTab: aTab.\x0a\x09self selectCallback value: aTab",
  4870. messageSends: ["selectedTab:", "value:", "selectCallback"],
  4871. referencedClasses: []
  4872. }),
  4873. smalltalk.HLTabSelectionWidget);
  4874. smalltalk.addMethod(
  4875. smalltalk.method({
  4876. selector: "selectedTab",
  4877. category: 'accessing',
  4878. fn: function (){
  4879. var self=this;
  4880. return smalltalk.withContext(function($ctx1) {
  4881. var $1;
  4882. $1=self["@selectedTab"];
  4883. return $1;
  4884. }, function($ctx1) {$ctx1.fill(self,"selectedTab",{},smalltalk.HLTabSelectionWidget)})},
  4885. args: [],
  4886. source: "selectedTab\x0a\x09^ selectedTab",
  4887. messageSends: [],
  4888. referencedClasses: []
  4889. }),
  4890. smalltalk.HLTabSelectionWidget);
  4891. smalltalk.addMethod(
  4892. smalltalk.method({
  4893. selector: "selectedTab:",
  4894. category: 'accessing',
  4895. fn: function (aTab){
  4896. var self=this;
  4897. return smalltalk.withContext(function($ctx1) {
  4898. self["@selectedTab"]=aTab;
  4899. return self}, function($ctx1) {$ctx1.fill(self,"selectedTab:",{aTab:aTab},smalltalk.HLTabSelectionWidget)})},
  4900. args: ["aTab"],
  4901. source: "selectedTab: aTab\x0a\x09selectedTab := aTab",
  4902. messageSends: [],
  4903. referencedClasses: []
  4904. }),
  4905. smalltalk.HLTabSelectionWidget);
  4906. smalltalk.addMethod(
  4907. smalltalk.method({
  4908. selector: "setupKeyBindings",
  4909. category: 'actions',
  4910. fn: function (){
  4911. var self=this;
  4912. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  4913. return smalltalk.withContext(function($ctx1) {
  4914. var $1;
  4915. smalltalk.HLTabSelectionWidget.superclass.fn.prototype._setupKeyBindings.apply(_st(self), []);
  4916. _st(".dialog"._asJQuery())._keyup_((function(e){
  4917. return smalltalk.withContext(function($ctx2) {
  4918. $1=_st(_st(e)._keyCode()).__eq(_st(_st($String())._cr())._asciiValue());
  4919. if(smalltalk.assert($1)){
  4920. return self._confirm();
  4921. };
  4922. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,1)})}));
  4923. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLTabSelectionWidget)})},
  4924. args: [],
  4925. source: "setupKeyBindings\x0a\x09super setupKeyBindings.\x0a\x09'.dialog' asJQuery keyup: [ :e |\x0a\x09\x09e keyCode = String cr asciiValue ifTrue: [ self confirm ] ]",
  4926. messageSends: ["setupKeyBindings", "keyup:", "asJQuery", "ifTrue:", "=", "keyCode", "asciiValue", "cr", "confirm"],
  4927. referencedClasses: ["String"]
  4928. }),
  4929. smalltalk.HLTabSelectionWidget);
  4930. smalltalk.addMethod(
  4931. smalltalk.method({
  4932. selector: "tabList",
  4933. category: 'rendering',
  4934. fn: function (){
  4935. var self=this;
  4936. function $HLTabListWidget(){return smalltalk.HLTabListWidget||(typeof HLTabListWidget=="undefined"?nil:HLTabListWidget)}
  4937. return smalltalk.withContext(function($ctx1) {
  4938. var $1,$2,$3,$4;
  4939. $1=self["@tabList"];
  4940. if(($receiver = $1) == nil || $receiver == null){
  4941. self["@tabList"]=_st($HLTabListWidget())._new();
  4942. self["@tabList"];
  4943. $2=self["@tabList"];
  4944. _st($2)._callback_((function(tab){
  4945. return smalltalk.withContext(function($ctx2) {
  4946. self._selectTab_(tab);
  4947. return _st(self["@tabList"])._focus();
  4948. }, function($ctx2) {$ctx2.fillBlock({tab:tab},$ctx1,2)})}));
  4949. _st($2)._selectedItem_(self._selectedTab());
  4950. $3=_st($2)._items_(self._tabs());
  4951. $3;
  4952. } else {
  4953. $1;
  4954. };
  4955. $4=self["@tabList"];
  4956. return $4;
  4957. }, function($ctx1) {$ctx1.fill(self,"tabList",{},smalltalk.HLTabSelectionWidget)})},
  4958. args: [],
  4959. source: "tabList\x0a\x09tabList ifNil: [ \x0a\x09\x09tabList := HLTabListWidget new.\x0a\x09\x09tabList\x0a\x09\x09\x09callback: [ :tab | self selectTab: tab. tabList focus ];\x0a\x09\x09\x09selectedItem: self selectedTab;\x0a\x09\x09\x09items: self tabs ].\x0a\x09\x0a\x09^ tabList",
  4960. messageSends: ["ifNil:", "new", "callback:", "selectTab:", "focus", "selectedItem:", "selectedTab", "items:", "tabs"],
  4961. referencedClasses: ["HLTabListWidget"]
  4962. }),
  4963. smalltalk.HLTabSelectionWidget);
  4964. smalltalk.addMethod(
  4965. smalltalk.method({
  4966. selector: "tabs",
  4967. category: 'accessing',
  4968. fn: function (){
  4969. var self=this;
  4970. return smalltalk.withContext(function($ctx1) {
  4971. var $2,$1;
  4972. $2=self["@tabs"];
  4973. if(($receiver = $2) == nil || $receiver == null){
  4974. $1=[];
  4975. } else {
  4976. $1=$2;
  4977. };
  4978. return $1;
  4979. }, function($ctx1) {$ctx1.fill(self,"tabs",{},smalltalk.HLTabSelectionWidget)})},
  4980. args: [],
  4981. source: "tabs\x0a\x09^ tabs ifNil: [ #() ]",
  4982. messageSends: ["ifNil:"],
  4983. referencedClasses: []
  4984. }),
  4985. smalltalk.HLTabSelectionWidget);
  4986. smalltalk.addMethod(
  4987. smalltalk.method({
  4988. selector: "tabs:",
  4989. category: 'accessing',
  4990. fn: function (aCollection){
  4991. var self=this;
  4992. return smalltalk.withContext(function($ctx1) {
  4993. self["@tabs"]=aCollection;
  4994. return self}, function($ctx1) {$ctx1.fill(self,"tabs:",{aCollection:aCollection},smalltalk.HLTabSelectionWidget)})},
  4995. args: ["aCollection"],
  4996. source: "tabs: aCollection\x0a\x09tabs := aCollection",
  4997. messageSends: [],
  4998. referencedClasses: []
  4999. }),
  5000. smalltalk.HLTabSelectionWidget);
  5001. smalltalk.addClass('HLProgressBarWidget', smalltalk.HLWidget, ['label', 'parent', 'workBlock', 'collection', 'bar'], 'Helios-Core');
  5002. smalltalk.HLProgressBarWidget.comment="I am a widget used to display a progress bar while iterating over a collection.";
  5003. smalltalk.addMethod(
  5004. smalltalk.method({
  5005. selector: "collection",
  5006. category: 'accessing',
  5007. fn: function (){
  5008. var self=this;
  5009. return smalltalk.withContext(function($ctx1) {
  5010. var $1;
  5011. $1=self["@collection"];
  5012. return $1;
  5013. }, function($ctx1) {$ctx1.fill(self,"collection",{},smalltalk.HLProgressBarWidget)})},
  5014. args: [],
  5015. source: "collection\x0a\x09^ collection",
  5016. messageSends: [],
  5017. referencedClasses: []
  5018. }),
  5019. smalltalk.HLProgressBarWidget);
  5020. smalltalk.addMethod(
  5021. smalltalk.method({
  5022. selector: "collection:",
  5023. category: 'accessing',
  5024. fn: function (aCollection){
  5025. var self=this;
  5026. return smalltalk.withContext(function($ctx1) {
  5027. self["@collection"]=aCollection;
  5028. return self}, function($ctx1) {$ctx1.fill(self,"collection:",{aCollection:aCollection},smalltalk.HLProgressBarWidget)})},
  5029. args: ["aCollection"],
  5030. source: "collection: aCollection\x0a\x09collection := aCollection",
  5031. messageSends: [],
  5032. referencedClasses: []
  5033. }),
  5034. smalltalk.HLProgressBarWidget);
  5035. smalltalk.addMethod(
  5036. smalltalk.method({
  5037. selector: "evaluateAt:",
  5038. category: 'actions',
  5039. fn: function (anInteger){
  5040. var self=this;
  5041. return smalltalk.withContext(function($ctx1) {
  5042. var $3,$5,$4,$2,$1,$7,$9,$8,$6,$10,$12,$11;
  5043. $3=anInteger;
  5044. $5=self._collection();
  5045. $ctx1.sendIdx["collection"]=1;
  5046. $4=_st($5)._size();
  5047. $ctx1.sendIdx["size"]=1;
  5048. $2=_st($3).__slash($4);
  5049. $1=_st($2).__star((100));
  5050. self._updateProgress_($1);
  5051. $7=anInteger;
  5052. $9=self._collection();
  5053. $ctx1.sendIdx["collection"]=2;
  5054. $8=_st($9)._size();
  5055. $6=_st($7).__lt_eq($8);
  5056. if(smalltalk.assert($6)){
  5057. _st((function(){
  5058. return smalltalk.withContext(function($ctx2) {
  5059. $10=self._workBlock();
  5060. $12=self._collection();
  5061. $11=_st($12)._at_(anInteger);
  5062. _st($10)._value_($11);
  5063. return self._evaluateAt_(_st(anInteger).__plus((1)));
  5064. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}))._valueWithTimeout_((10));
  5065. $ctx1.sendIdx["valueWithTimeout:"]=1;
  5066. } else {
  5067. _st((function(){
  5068. return smalltalk.withContext(function($ctx2) {
  5069. return self._remove();
  5070. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}))._valueWithTimeout_((500));
  5071. };
  5072. return self}, function($ctx1) {$ctx1.fill(self,"evaluateAt:",{anInteger:anInteger},smalltalk.HLProgressBarWidget)})},
  5073. args: ["anInteger"],
  5074. source: "evaluateAt: anInteger\x0a\x09self updateProgress: (anInteger / self collection size) * 100.\x0a\x09anInteger <= self collection size\x0a\x09\x09ifTrue: [ \x0a\x09\x09\x09[ \x0a\x09\x09\x09\x09self workBlock value: (self collection at: anInteger).\x0a\x09\x09\x09\x09self evaluateAt: anInteger + 1 ] valueWithTimeout: 10 ]\x0a\x09\x09ifFalse: [ [ self remove ] valueWithTimeout: 500 ]",
  5075. messageSends: ["updateProgress:", "*", "/", "size", "collection", "ifTrue:ifFalse:", "<=", "valueWithTimeout:", "value:", "workBlock", "at:", "evaluateAt:", "+", "remove"],
  5076. referencedClasses: []
  5077. }),
  5078. smalltalk.HLProgressBarWidget);
  5079. smalltalk.addMethod(
  5080. smalltalk.method({
  5081. selector: "label",
  5082. category: 'accessing',
  5083. fn: function (){
  5084. var self=this;
  5085. return smalltalk.withContext(function($ctx1) {
  5086. var $1;
  5087. $1=self["@label"];
  5088. return $1;
  5089. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLProgressBarWidget)})},
  5090. args: [],
  5091. source: "label\x0a\x09^ label",
  5092. messageSends: [],
  5093. referencedClasses: []
  5094. }),
  5095. smalltalk.HLProgressBarWidget);
  5096. smalltalk.addMethod(
  5097. smalltalk.method({
  5098. selector: "label:",
  5099. category: 'accessing',
  5100. fn: function (aString){
  5101. var self=this;
  5102. return smalltalk.withContext(function($ctx1) {
  5103. self["@label"]=aString;
  5104. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.HLProgressBarWidget)})},
  5105. args: ["aString"],
  5106. source: "label: aString\x0a\x09label := aString",
  5107. messageSends: [],
  5108. referencedClasses: []
  5109. }),
  5110. smalltalk.HLProgressBarWidget);
  5111. smalltalk.addMethod(
  5112. smalltalk.method({
  5113. selector: "parent",
  5114. category: 'accessing',
  5115. fn: function (){
  5116. var self=this;
  5117. return smalltalk.withContext(function($ctx1) {
  5118. var $1;
  5119. $1=self["@parent"];
  5120. return $1;
  5121. }, function($ctx1) {$ctx1.fill(self,"parent",{},smalltalk.HLProgressBarWidget)})},
  5122. args: [],
  5123. source: "parent\x0a\x09^ parent",
  5124. messageSends: [],
  5125. referencedClasses: []
  5126. }),
  5127. smalltalk.HLProgressBarWidget);
  5128. smalltalk.addMethod(
  5129. smalltalk.method({
  5130. selector: "parent:",
  5131. category: 'accessing',
  5132. fn: function (aProgress){
  5133. var self=this;
  5134. return smalltalk.withContext(function($ctx1) {
  5135. self["@parent"]=aProgress;
  5136. return self}, function($ctx1) {$ctx1.fill(self,"parent:",{aProgress:aProgress},smalltalk.HLProgressBarWidget)})},
  5137. args: ["aProgress"],
  5138. source: "parent: aProgress\x0a\x09parent := aProgress",
  5139. messageSends: [],
  5140. referencedClasses: []
  5141. }),
  5142. smalltalk.HLProgressBarWidget);
  5143. smalltalk.addMethod(
  5144. smalltalk.method({
  5145. selector: "remove",
  5146. category: 'actions',
  5147. fn: function (){
  5148. var self=this;
  5149. return smalltalk.withContext(function($ctx1) {
  5150. _st(self._parent())._removeProgressBar_(self);
  5151. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLProgressBarWidget)})},
  5152. args: [],
  5153. source: "remove\x0a\x09self parent removeProgressBar: self",
  5154. messageSends: ["removeProgressBar:", "parent"],
  5155. referencedClasses: []
  5156. }),
  5157. smalltalk.HLProgressBarWidget);
  5158. smalltalk.addMethod(
  5159. smalltalk.method({
  5160. selector: "renderContentOn:",
  5161. category: 'rendering',
  5162. fn: function (html){
  5163. var self=this;
  5164. return smalltalk.withContext(function($ctx1) {
  5165. var $1,$2,$4,$5,$3;
  5166. $1=_st(_st(html)._span())._with_(self._label());
  5167. $ctx1.sendIdx["with:"]=1;
  5168. $2=_st(html)._div();
  5169. $ctx1.sendIdx["div"]=1;
  5170. _st($2)._class_("progress");
  5171. $ctx1.sendIdx["class:"]=1;
  5172. $3=_st($2)._with_((function(){
  5173. return smalltalk.withContext(function($ctx2) {
  5174. $4=_st(html)._div();
  5175. _st($4)._class_("bar");
  5176. $5=_st($4)._style_("width: 0%");
  5177. self["@bar"]=$5;
  5178. return self["@bar"];
  5179. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  5180. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLProgressBarWidget)})},
  5181. args: ["html"],
  5182. source: "renderContentOn: html\x0a\x09html span with: self label.\x0a\x09html div \x0a\x09\x09class: 'progress';\x0a\x09\x09with: [\x0a\x09\x09\x09bar := html div \x0a\x09\x09\x09\x09class: 'bar';\x0a\x09\x09\x09\x09style: 'width: 0%' ]",
  5183. messageSends: ["with:", "span", "label", "class:", "div", "style:"],
  5184. referencedClasses: []
  5185. }),
  5186. smalltalk.HLProgressBarWidget);
  5187. smalltalk.addMethod(
  5188. smalltalk.method({
  5189. selector: "start",
  5190. category: 'actions',
  5191. fn: function (){
  5192. var self=this;
  5193. return smalltalk.withContext(function($ctx1) {
  5194. self._evaluateAt_((1));
  5195. return self}, function($ctx1) {$ctx1.fill(self,"start",{},smalltalk.HLProgressBarWidget)})},
  5196. args: [],
  5197. source: "start\x0a\x09\x22Make sure the UI has some time to update itself between each iteration\x22\x0a\x09\x0a\x09self evaluateAt: 1",
  5198. messageSends: ["evaluateAt:"],
  5199. referencedClasses: []
  5200. }),
  5201. smalltalk.HLProgressBarWidget);
  5202. smalltalk.addMethod(
  5203. smalltalk.method({
  5204. selector: "updateProgress:",
  5205. category: 'actions',
  5206. fn: function (anInteger){
  5207. var self=this;
  5208. return smalltalk.withContext(function($ctx1) {
  5209. _st(_st(self["@bar"])._asJQuery())._css_put_("width",_st(_st(anInteger)._asString()).__comma("%"));
  5210. return self}, function($ctx1) {$ctx1.fill(self,"updateProgress:",{anInteger:anInteger},smalltalk.HLProgressBarWidget)})},
  5211. args: ["anInteger"],
  5212. source: "updateProgress: anInteger\x0a\x09bar asJQuery css: 'width' put: anInteger asString, '%'",
  5213. messageSends: ["css:put:", "asJQuery", ",", "asString"],
  5214. referencedClasses: []
  5215. }),
  5216. smalltalk.HLProgressBarWidget);
  5217. smalltalk.addMethod(
  5218. smalltalk.method({
  5219. selector: "workBlock",
  5220. category: 'accessing',
  5221. fn: function (){
  5222. var self=this;
  5223. return smalltalk.withContext(function($ctx1) {
  5224. var $1;
  5225. $1=self["@workBlock"];
  5226. return $1;
  5227. }, function($ctx1) {$ctx1.fill(self,"workBlock",{},smalltalk.HLProgressBarWidget)})},
  5228. args: [],
  5229. source: "workBlock\x0a\x09^ workBlock",
  5230. messageSends: [],
  5231. referencedClasses: []
  5232. }),
  5233. smalltalk.HLProgressBarWidget);
  5234. smalltalk.addMethod(
  5235. smalltalk.method({
  5236. selector: "workBlock:",
  5237. category: 'accessing',
  5238. fn: function (aBlock){
  5239. var self=this;
  5240. return smalltalk.withContext(function($ctx1) {
  5241. self["@workBlock"]=aBlock;
  5242. return self}, function($ctx1) {$ctx1.fill(self,"workBlock:",{aBlock:aBlock},smalltalk.HLProgressBarWidget)})},
  5243. args: ["aBlock"],
  5244. source: "workBlock: aBlock\x0a\x09workBlock := aBlock",
  5245. messageSends: [],
  5246. referencedClasses: []
  5247. }),
  5248. smalltalk.HLProgressBarWidget);
  5249. smalltalk.HLProgressBarWidget.klass.iVarNames = ['default'];
  5250. smalltalk.addMethod(
  5251. smalltalk.method({
  5252. selector: "default",
  5253. category: 'accessing',
  5254. fn: function (){
  5255. var self=this;
  5256. return smalltalk.withContext(function($ctx1) {
  5257. var $2,$1;
  5258. $2=self["@default"];
  5259. if(($receiver = $2) == nil || $receiver == null){
  5260. self["@default"]=self._new();
  5261. $1=self["@default"];
  5262. } else {
  5263. $1=$2;
  5264. };
  5265. return $1;
  5266. }, function($ctx1) {$ctx1.fill(self,"default",{},smalltalk.HLProgressBarWidget.klass)})},
  5267. args: [],
  5268. source: "default\x0a\x09^ default ifNil: [ default := self new ]",
  5269. messageSends: ["ifNil:", "new"],
  5270. referencedClasses: []
  5271. }),
  5272. smalltalk.HLProgressBarWidget.klass);
  5273. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  5274. smalltalk.addMethod(
  5275. smalltalk.method({
  5276. selector: "canBeOpenAsTab",
  5277. category: 'testing',
  5278. fn: function (){
  5279. var self=this;
  5280. return smalltalk.withContext(function($ctx1) {
  5281. return true;
  5282. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSUnit.klass)})},
  5283. args: [],
  5284. source: "canBeOpenAsTab\x0a\x09^ true",
  5285. messageSends: [],
  5286. referencedClasses: []
  5287. }),
  5288. smalltalk.HLSUnit.klass);
  5289. smalltalk.addMethod(
  5290. smalltalk.method({
  5291. selector: "tabClass",
  5292. category: 'accessing',
  5293. fn: function (){
  5294. var self=this;
  5295. return smalltalk.withContext(function($ctx1) {
  5296. return "sunit";
  5297. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLSUnit.klass)})},
  5298. args: [],
  5299. source: "tabClass\x0a\x09^ 'sunit'",
  5300. messageSends: [],
  5301. referencedClasses: []
  5302. }),
  5303. smalltalk.HLSUnit.klass);
  5304. smalltalk.addMethod(
  5305. smalltalk.method({
  5306. selector: "tabLabel",
  5307. category: 'accessing',
  5308. fn: function (){
  5309. var self=this;
  5310. return smalltalk.withContext(function($ctx1) {
  5311. return "SUnit";
  5312. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLSUnit.klass)})},
  5313. args: [],
  5314. source: "tabLabel\x0a\x09^ 'SUnit'",
  5315. messageSends: [],
  5316. referencedClasses: []
  5317. }),
  5318. smalltalk.HLSUnit.klass);
  5319. smalltalk.addMethod(
  5320. smalltalk.method({
  5321. selector: "tabPriority",
  5322. category: 'accessing',
  5323. fn: function (){
  5324. var self=this;
  5325. return smalltalk.withContext(function($ctx1) {
  5326. return (1000);
  5327. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLSUnit.klass)})},
  5328. args: [],
  5329. source: "tabPriority\x0a\x09^ 1000",
  5330. messageSends: [],
  5331. referencedClasses: []
  5332. }),
  5333. smalltalk.HLSUnit.klass);
  5334. });