2
0

Helios-Core.js 194 KB

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