1
0

Helios-Core.js 186 KB

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