Helios-Core.js 237 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011
  1. define("helios/Helios-Core", ["amber/boot", "amber_core/Kernel-Infrastructure", "amber_core/Kernel-Objects", "amber_core/Web"], function($boot){
  2. var smalltalk=$boot.vm,nil=$boot.nil,_st=$boot.asReceiver,globals=$boot.globals;
  3. smalltalk.addPackage('Helios-Core');
  4. smalltalk.packages["Helios-Core"].transport = {"type":"amd","amdNamespace":"helios"};
  5. smalltalk.addClass('HLModel', globals.InterfacingObject, ['announcer', 'environment'], 'Helios-Core');
  6. globals.HLModel.comment="I am the abstract superclass of all models of Helios.\x0aI am the \x22Model\x22 part of the MVC pattern implementation in Helios.\x0a\x0aI provide access to an `Environment` object and both a local (model-specific) and global (system-specific) announcer.\x0a\x0aThe `#withChangesDo:` method is handy for performing model changes ensuring that all widgets are aware of the change and can prevent it from happening.\x0a\x0aModifications of the system should be done via commands (see `HLCommand` and subclasses).";
  7. smalltalk.addMethod(
  8. smalltalk.method({
  9. selector: "announcer",
  10. protocol: 'accessing',
  11. fn: function (){
  12. var self=this;
  13. function $Announcer(){return globals.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  14. return smalltalk.withContext(function($ctx1) {
  15. var $2,$1,$receiver;
  16. $2=self["@announcer"];
  17. if(($receiver = $2) == null || $receiver.isNil){
  18. self["@announcer"]=_st($Announcer())._new();
  19. $1=self["@announcer"];
  20. } else {
  21. $1=$2;
  22. };
  23. return $1;
  24. }, function($ctx1) {$ctx1.fill(self,"announcer",{},globals.HLModel)})},
  25. args: [],
  26. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  27. messageSends: ["ifNil:", "new"],
  28. referencedClasses: ["Announcer"]
  29. }),
  30. globals.HLModel);
  31. smalltalk.addMethod(
  32. smalltalk.method({
  33. selector: "environment",
  34. protocol: 'accessing',
  35. fn: function (){
  36. var self=this;
  37. return smalltalk.withContext(function($ctx1) {
  38. var $2,$1,$receiver;
  39. $2=self["@environment"];
  40. if(($receiver = $2) == null || $receiver.isNil){
  41. $1=_st(self._manager())._environment();
  42. } else {
  43. $1=$2;
  44. };
  45. return $1;
  46. }, function($ctx1) {$ctx1.fill(self,"environment",{},globals.HLModel)})},
  47. args: [],
  48. source: "environment\x0a\x09^ environment ifNil: [ self manager environment ]",
  49. messageSends: ["ifNil:", "environment", "manager"],
  50. referencedClasses: []
  51. }),
  52. globals.HLModel);
  53. smalltalk.addMethod(
  54. smalltalk.method({
  55. selector: "environment:",
  56. protocol: 'accessing',
  57. fn: function (anEnvironment){
  58. var self=this;
  59. self["@environment"]=anEnvironment;
  60. return self},
  61. args: ["anEnvironment"],
  62. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  63. messageSends: [],
  64. referencedClasses: []
  65. }),
  66. globals.HLModel);
  67. smalltalk.addMethod(
  68. smalltalk.method({
  69. selector: "isBrowserModel",
  70. protocol: 'testing',
  71. fn: function (){
  72. var self=this;
  73. return false;
  74. },
  75. args: [],
  76. source: "isBrowserModel\x0a\x09^ false",
  77. messageSends: [],
  78. referencedClasses: []
  79. }),
  80. globals.HLModel);
  81. smalltalk.addMethod(
  82. smalltalk.method({
  83. selector: "isReferencesModel",
  84. protocol: 'testing',
  85. fn: function (){
  86. var self=this;
  87. return false;
  88. },
  89. args: [],
  90. source: "isReferencesModel\x0a\x09^ false",
  91. messageSends: [],
  92. referencedClasses: []
  93. }),
  94. globals.HLModel);
  95. smalltalk.addMethod(
  96. smalltalk.method({
  97. selector: "isToolModel",
  98. protocol: 'testing',
  99. fn: function (){
  100. var self=this;
  101. return false;
  102. },
  103. args: [],
  104. source: "isToolModel\x0a\x09^ false",
  105. messageSends: [],
  106. referencedClasses: []
  107. }),
  108. globals.HLModel);
  109. smalltalk.addMethod(
  110. smalltalk.method({
  111. selector: "manager",
  112. protocol: 'accessing',
  113. fn: function (){
  114. var self=this;
  115. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  116. return smalltalk.withContext(function($ctx1) {
  117. var $1;
  118. $1=_st($HLManager())._current();
  119. return $1;
  120. }, function($ctx1) {$ctx1.fill(self,"manager",{},globals.HLModel)})},
  121. args: [],
  122. source: "manager\x0a\x09^ HLManager current",
  123. messageSends: ["current"],
  124. referencedClasses: ["HLManager"]
  125. }),
  126. globals.HLModel);
  127. smalltalk.addMethod(
  128. smalltalk.method({
  129. selector: "systemAnnouncer",
  130. protocol: 'accessing',
  131. fn: function (){
  132. var self=this;
  133. return smalltalk.withContext(function($ctx1) {
  134. var $1;
  135. $1=_st(self._environment())._systemAnnouncer();
  136. return $1;
  137. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},globals.HLModel)})},
  138. args: [],
  139. source: "systemAnnouncer\x0a\x09^ self environment systemAnnouncer",
  140. messageSends: ["systemAnnouncer", "environment"],
  141. referencedClasses: []
  142. }),
  143. globals.HLModel);
  144. smalltalk.addMethod(
  145. smalltalk.method({
  146. selector: "withChangesDo:",
  147. protocol: 'error handling',
  148. fn: function (aBlock){
  149. var self=this;
  150. function $HLAboutToChange(){return globals.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  151. function $HLChangeForbidden(){return globals.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  152. return smalltalk.withContext(function($ctx1) {
  153. var $1,$2;
  154. _st((function(){
  155. return smalltalk.withContext(function($ctx2) {
  156. $1=_st($HLAboutToChange())._new();
  157. _st($1)._actionBlock_(aBlock);
  158. $2=_st($1)._yourself();
  159. _st(self._announcer())._announce_($2);
  160. return _st(aBlock)._value();
  161. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($HLChangeForbidden(),(function(ex){
  162. }));
  163. return self}, function($ctx1) {$ctx1.fill(self,"withChangesDo:",{aBlock:aBlock},globals.HLModel)})},
  164. args: ["aBlock"],
  165. source: "withChangesDo: aBlock\x0a\x09[ \x0a\x09\x09self announcer announce: (HLAboutToChange new\x0a\x09\x09\x09actionBlock: aBlock;\x0a\x09\x09\x09yourself).\x0a\x09\x09aBlock value.\x0a\x09]\x0a\x09\x09on: HLChangeForbidden \x0a\x09\x09do: [ :ex | ]",
  166. messageSends: ["on:do:", "announce:", "announcer", "actionBlock:", "new", "yourself", "value"],
  167. referencedClasses: ["HLAboutToChange", "HLChangeForbidden"]
  168. }),
  169. globals.HLModel);
  170. smalltalk.addClass('HLFinder', globals.HLModel, [], 'Helios-Core');
  171. globals.HLFinder.comment="I am the `Finder` service handler of Helios.\x0a\x0aFinding a class will open a new class browser, while finding a method will open a references browser.";
  172. smalltalk.addMethod(
  173. smalltalk.method({
  174. selector: "findClass:",
  175. protocol: 'finding',
  176. fn: function (aClass){
  177. var self=this;
  178. function $HLBrowser(){return globals.HLBrowser||(typeof HLBrowser=="undefined"?nil:HLBrowser)}
  179. return smalltalk.withContext(function($ctx1) {
  180. _st(_st($HLBrowser())._openAsTab())._openClassNamed_(_st(aClass)._name());
  181. return self}, function($ctx1) {$ctx1.fill(self,"findClass:",{aClass:aClass},globals.HLFinder)})},
  182. args: ["aClass"],
  183. source: "findClass: aClass\x0a\x09HLBrowser openAsTab openClassNamed: aClass name",
  184. messageSends: ["openClassNamed:", "openAsTab", "name"],
  185. referencedClasses: ["HLBrowser"]
  186. }),
  187. globals.HLFinder);
  188. smalltalk.addMethod(
  189. smalltalk.method({
  190. selector: "findMethod:",
  191. protocol: 'finding',
  192. fn: function (aCompiledMethod){
  193. var self=this;
  194. function $HLBrowser(){return globals.HLBrowser||(typeof HLBrowser=="undefined"?nil:HLBrowser)}
  195. return smalltalk.withContext(function($ctx1) {
  196. _st(_st($HLBrowser())._openAsTab())._openMethod_(aCompiledMethod);
  197. return self}, function($ctx1) {$ctx1.fill(self,"findMethod:",{aCompiledMethod:aCompiledMethod},globals.HLFinder)})},
  198. args: ["aCompiledMethod"],
  199. source: "findMethod: aCompiledMethod\x0a\x09HLBrowser openAsTab openMethod: aCompiledMethod",
  200. messageSends: ["openMethod:", "openAsTab"],
  201. referencedClasses: ["HLBrowser"]
  202. }),
  203. globals.HLFinder);
  204. smalltalk.addMethod(
  205. smalltalk.method({
  206. selector: "findString:",
  207. protocol: 'finding',
  208. fn: function (aString){
  209. var self=this;
  210. var foundClass;
  211. function $HLReferences(){return globals.HLReferences||(typeof HLReferences=="undefined"?nil:HLReferences)}
  212. return smalltalk.withContext(function($ctx1) {
  213. var $1,$receiver;
  214. foundClass=_st(_st(self._environment())._classes())._detect_ifNone_((function(each){
  215. return smalltalk.withContext(function($ctx2) {
  216. return _st(_st(each)._name()).__eq(aString);
  217. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
  218. return nil;
  219. }));
  220. $1=foundClass;
  221. if(($receiver = $1) == null || $receiver.isNil){
  222. _st(_st($HLReferences())._openAsTab())._search_(aString);
  223. } else {
  224. self._findClass_(foundClass);
  225. };
  226. return self}, function($ctx1) {$ctx1.fill(self,"findString:",{aString:aString,foundClass:foundClass},globals.HLFinder)})},
  227. args: ["aString"],
  228. source: "findString: aString\x0a\x09| foundClass |\x0a\x09\x0a\x09foundClass := self environment classes \x0a\x09\x09detect: [ :each | each name = aString ]\x0a\x09\x09ifNone: [ nil ].\x0a\x09\x0a\x09foundClass \x0a\x09\x09ifNil: [ HLReferences openAsTab search: aString ]\x0a\x09\x09ifNotNil: [ self findClass: foundClass ]",
  229. messageSends: ["detect:ifNone:", "classes", "environment", "=", "name", "ifNil:ifNotNil:", "search:", "openAsTab", "findClass:"],
  230. referencedClasses: ["HLReferences"]
  231. }),
  232. globals.HLFinder);
  233. smalltalk.addClass('HLToolModel', globals.HLModel, ['selectedClass', 'selectedPackage', 'selectedProtocol', 'selectedSelector'], 'Helios-Core');
  234. globals.HLToolModel.comment="I am a model specific to package and class manipulation. All browsers should either use me or a subclass as their model.\x0a\x0aI provide methods for package, class, protocol and method manipulation and access, forwarding to my environment.\x0a\x0aI also handle compilation of classes and methods as well as compilation and parsing errors.";
  235. smalltalk.addMethod(
  236. smalltalk.method({
  237. selector: "addInstVarNamed:",
  238. protocol: 'actions',
  239. fn: function (aString){
  240. var self=this;
  241. function $HLInstVarAdded(){return globals.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  242. return smalltalk.withContext(function($ctx1) {
  243. var $1,$2,$3,$4;
  244. $1=self._environment();
  245. $2=self._selectedClass();
  246. $ctx1.sendIdx["selectedClass"]=1;
  247. _st($1)._addInstVarNamed_to_(aString,$2);
  248. $3=_st($HLInstVarAdded())._new();
  249. _st($3)._theClass_(self._selectedClass());
  250. _st($3)._variableName_(aString);
  251. $4=_st($3)._yourself();
  252. _st(self._announcer())._announce_($4);
  253. return self}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:",{aString:aString},globals.HLToolModel)})},
  254. args: ["aString"],
  255. 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)",
  256. messageSends: ["addInstVarNamed:to:", "environment", "selectedClass", "announce:", "announcer", "theClass:", "new", "variableName:", "yourself"],
  257. referencedClasses: ["HLInstVarAdded"]
  258. }),
  259. globals.HLToolModel);
  260. smalltalk.addMethod(
  261. smalltalk.method({
  262. selector: "allProtocol",
  263. protocol: 'defaults',
  264. fn: function (){
  265. var self=this;
  266. return "-- all --";
  267. },
  268. args: [],
  269. source: "allProtocol\x0a\x09^ '-- all --'",
  270. messageSends: [],
  271. referencedClasses: []
  272. }),
  273. globals.HLToolModel);
  274. smalltalk.addMethod(
  275. smalltalk.method({
  276. selector: "allSelectors",
  277. protocol: 'accessing',
  278. fn: function (){
  279. var self=this;
  280. return smalltalk.withContext(function($ctx1) {
  281. var $1;
  282. $1=_st(self._environment())._allSelectors();
  283. return $1;
  284. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},globals.HLToolModel)})},
  285. args: [],
  286. source: "allSelectors\x0a\x09^ self environment allSelectors",
  287. messageSends: ["allSelectors", "environment"],
  288. referencedClasses: []
  289. }),
  290. globals.HLToolModel);
  291. smalltalk.addMethod(
  292. smalltalk.method({
  293. selector: "availableClassNames",
  294. protocol: 'accessing',
  295. fn: function (){
  296. var self=this;
  297. return smalltalk.withContext(function($ctx1) {
  298. var $1;
  299. $1=_st(self._environment())._availableClassNames();
  300. return $1;
  301. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},globals.HLToolModel)})},
  302. args: [],
  303. source: "availableClassNames\x0a\x09^ self environment availableClassNames",
  304. messageSends: ["availableClassNames", "environment"],
  305. referencedClasses: []
  306. }),
  307. globals.HLToolModel);
  308. smalltalk.addMethod(
  309. smalltalk.method({
  310. selector: "availablePackageNames",
  311. protocol: 'accessing',
  312. fn: function (){
  313. var self=this;
  314. return smalltalk.withContext(function($ctx1) {
  315. var $1;
  316. $1=_st(self._environment())._availablePackageNames();
  317. return $1;
  318. }, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},globals.HLToolModel)})},
  319. args: [],
  320. source: "availablePackageNames\x0a\x09^ self environment availablePackageNames",
  321. messageSends: ["availablePackageNames", "environment"],
  322. referencedClasses: []
  323. }),
  324. globals.HLToolModel);
  325. smalltalk.addMethod(
  326. smalltalk.method({
  327. selector: "availablePackages",
  328. protocol: 'accessing',
  329. fn: function (){
  330. var self=this;
  331. return smalltalk.withContext(function($ctx1) {
  332. var $1;
  333. $1=_st(self._environment())._availablePackageNames();
  334. return $1;
  335. }, function($ctx1) {$ctx1.fill(self,"availablePackages",{},globals.HLToolModel)})},
  336. args: [],
  337. source: "availablePackages\x0a\x09^ self environment availablePackageNames",
  338. messageSends: ["availablePackageNames", "environment"],
  339. referencedClasses: []
  340. }),
  341. globals.HLToolModel);
  342. smalltalk.addMethod(
  343. smalltalk.method({
  344. selector: "availableProtocols",
  345. protocol: 'accessing',
  346. fn: function (){
  347. var self=this;
  348. return smalltalk.withContext(function($ctx1) {
  349. var $1;
  350. $1=_st(self._environment())._availableProtocolsFor_(self._selectedClass());
  351. return $1;
  352. }, function($ctx1) {$ctx1.fill(self,"availableProtocols",{},globals.HLToolModel)})},
  353. args: [],
  354. source: "availableProtocols\x0a\x09^ self environment availableProtocolsFor: self selectedClass",
  355. messageSends: ["availableProtocolsFor:", "environment", "selectedClass"],
  356. referencedClasses: []
  357. }),
  358. globals.HLToolModel);
  359. smalltalk.addMethod(
  360. smalltalk.method({
  361. selector: "commitPackageOnSuccess:onError:",
  362. protocol: 'commands actions',
  363. fn: function (aBlock,anotherBlock){
  364. var self=this;
  365. return smalltalk.withContext(function($ctx1) {
  366. _st(self._environment())._commitPackage_onSuccess_onError_(self._packageToCommit(),aBlock,anotherBlock);
  367. return self}, function($ctx1) {$ctx1.fill(self,"commitPackageOnSuccess:onError:",{aBlock:aBlock,anotherBlock:anotherBlock},globals.HLToolModel)})},
  368. args: ["aBlock", "anotherBlock"],
  369. source: "commitPackageOnSuccess: aBlock onError: anotherBlock\x0a\x09self environment \x0a\x09\x09commitPackage: self packageToCommit\x0a\x09\x09onSuccess: aBlock\x0a\x09\x09onError: anotherBlock",
  370. messageSends: ["commitPackage:onSuccess:onError:", "environment", "packageToCommit"],
  371. referencedClasses: []
  372. }),
  373. globals.HLToolModel);
  374. smalltalk.addMethod(
  375. smalltalk.method({
  376. selector: "compilationProtocol",
  377. protocol: 'private',
  378. fn: function (){
  379. var self=this;
  380. var currentProtocol;
  381. return smalltalk.withContext(function($ctx1) {
  382. var $1,$2,$4,$3,$receiver;
  383. currentProtocol=self._selectedProtocol();
  384. $1=currentProtocol;
  385. if(($receiver = $1) == null || $receiver.isNil){
  386. currentProtocol=self._unclassifiedProtocol();
  387. $ctx1.sendIdx["unclassifiedProtocol"]=1;
  388. currentProtocol;
  389. } else {
  390. $1;
  391. };
  392. $2=self._selectedMethod();
  393. $ctx1.sendIdx["selectedMethod"]=1;
  394. if(($receiver = $2) == null || $receiver.isNil){
  395. $2;
  396. } else {
  397. currentProtocol=_st(self._selectedMethod())._protocol();
  398. currentProtocol;
  399. };
  400. $4=_st(currentProtocol).__eq(self._allProtocol());
  401. if(smalltalk.assert($4)){
  402. $3=self._unclassifiedProtocol();
  403. } else {
  404. $3=currentProtocol;
  405. };
  406. return $3;
  407. }, function($ctx1) {$ctx1.fill(self,"compilationProtocol",{currentProtocol:currentProtocol},globals.HLToolModel)})},
  408. args: [],
  409. 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 ]",
  410. messageSends: ["selectedProtocol", "ifNil:", "unclassifiedProtocol", "ifNotNil:", "selectedMethod", "protocol", "ifTrue:ifFalse:", "=", "allProtocol"],
  411. referencedClasses: []
  412. }),
  413. globals.HLToolModel);
  414. smalltalk.addMethod(
  415. smalltalk.method({
  416. selector: "compileClassComment:",
  417. protocol: 'compiling',
  418. fn: function (aString){
  419. var self=this;
  420. return smalltalk.withContext(function($ctx1) {
  421. _st(self._environment())._compileClassComment_for_(aString,self._selectedClass());
  422. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:",{aString:aString},globals.HLToolModel)})},
  423. args: ["aString"],
  424. source: "compileClassComment: aString\x0a\x09self environment \x0a\x09\x09compileClassComment: aString \x0a\x09\x09for: self selectedClass",
  425. messageSends: ["compileClassComment:for:", "environment", "selectedClass"],
  426. referencedClasses: []
  427. }),
  428. globals.HLToolModel);
  429. smalltalk.addMethod(
  430. smalltalk.method({
  431. selector: "compileClassDefinition:",
  432. protocol: 'compiling',
  433. fn: function (aString){
  434. var self=this;
  435. return smalltalk.withContext(function($ctx1) {
  436. _st(self._environment())._compileClassDefinition_(aString);
  437. return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},globals.HLToolModel)})},
  438. args: ["aString"],
  439. source: "compileClassDefinition: aString\x0a\x09self environment compileClassDefinition: aString",
  440. messageSends: ["compileClassDefinition:", "environment"],
  441. referencedClasses: []
  442. }),
  443. globals.HLToolModel);
  444. smalltalk.addMethod(
  445. smalltalk.method({
  446. selector: "compileMethod:",
  447. protocol: 'compiling',
  448. fn: function (aString){
  449. var self=this;
  450. var method;
  451. return smalltalk.withContext(function($ctx1) {
  452. self._withCompileErrorHandling_((function(){
  453. return smalltalk.withContext(function($ctx2) {
  454. method=_st(self._environment())._compileMethod_for_protocol_(aString,self._selectedClass(),self._compilationProtocol());
  455. method;
  456. return self._selectedMethod_(method);
  457. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  458. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString,method:method},globals.HLToolModel)})},
  459. args: ["aString"],
  460. 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 ]",
  461. messageSends: ["withCompileErrorHandling:", "compileMethod:for:protocol:", "environment", "selectedClass", "compilationProtocol", "selectedMethod:"],
  462. referencedClasses: []
  463. }),
  464. globals.HLToolModel);
  465. smalltalk.addMethod(
  466. smalltalk.method({
  467. selector: "copyClassTo:",
  468. protocol: 'commands actions',
  469. fn: function (aClassName){
  470. var self=this;
  471. return smalltalk.withContext(function($ctx1) {
  472. self._withChangesDo_((function(){
  473. return smalltalk.withContext(function($ctx2) {
  474. return _st(self._environment())._copyClass_to_(_st(self._selectedClass())._theNonMetaClass(),aClassName);
  475. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  476. return self}, function($ctx1) {$ctx1.fill(self,"copyClassTo:",{aClassName:aClassName},globals.HLToolModel)})},
  477. args: ["aClassName"],
  478. source: "copyClassTo: aClassName\x0a\x09self withChangesDo: [ \x0a\x09\x09self environment \x0a\x09\x09\x09copyClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09to: aClassName ]",
  479. messageSends: ["withChangesDo:", "copyClass:to:", "environment", "theNonMetaClass", "selectedClass"],
  480. referencedClasses: []
  481. }),
  482. globals.HLToolModel);
  483. smalltalk.addMethod(
  484. smalltalk.method({
  485. selector: "forceSelectedClass:",
  486. protocol: 'accessing',
  487. fn: function (aClass){
  488. var self=this;
  489. return smalltalk.withContext(function($ctx1) {
  490. var $1;
  491. self._withChangesDo_((function(){
  492. return smalltalk.withContext(function($ctx2) {
  493. self._selectedClass_(nil);
  494. $ctx2.sendIdx["selectedClass:"]=1;
  495. $1=self._selectedClass_(aClass);
  496. return $1;
  497. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  498. return self}, function($ctx1) {$ctx1.fill(self,"forceSelectedClass:",{aClass:aClass},globals.HLToolModel)})},
  499. args: ["aClass"],
  500. source: "forceSelectedClass: aClass\x0a\x09self withChangesDo: [\x0a\x09\x09self \x09\x0a\x09\x09\x09selectedClass: nil;\x0a\x09\x09\x09selectedClass: aClass ]",
  501. messageSends: ["withChangesDo:", "selectedClass:"],
  502. referencedClasses: []
  503. }),
  504. globals.HLToolModel);
  505. smalltalk.addMethod(
  506. smalltalk.method({
  507. selector: "forceSelectedMethod:",
  508. protocol: 'accessing',
  509. fn: function (aMethod){
  510. var self=this;
  511. return smalltalk.withContext(function($ctx1) {
  512. var $1;
  513. self._withChangesDo_((function(){
  514. return smalltalk.withContext(function($ctx2) {
  515. self._selectedMethod_(nil);
  516. $ctx2.sendIdx["selectedMethod:"]=1;
  517. $1=self._selectedMethod_(aMethod);
  518. return $1;
  519. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  520. return self}, function($ctx1) {$ctx1.fill(self,"forceSelectedMethod:",{aMethod:aMethod},globals.HLToolModel)})},
  521. args: ["aMethod"],
  522. source: "forceSelectedMethod: aMethod\x0a\x09self withChangesDo: [\x0a\x09\x09self \x09\x0a\x09\x09\x09selectedMethod: nil;\x0a\x09\x09\x09selectedMethod: aMethod ]",
  523. messageSends: ["withChangesDo:", "selectedMethod:"],
  524. referencedClasses: []
  525. }),
  526. globals.HLToolModel);
  527. smalltalk.addMethod(
  528. smalltalk.method({
  529. selector: "forceSelectedPackage:",
  530. protocol: 'accessing',
  531. fn: function (aPackage){
  532. var self=this;
  533. return smalltalk.withContext(function($ctx1) {
  534. var $1;
  535. self._withChangesDo_((function(){
  536. return smalltalk.withContext(function($ctx2) {
  537. self._selectedPackage_(nil);
  538. $ctx2.sendIdx["selectedPackage:"]=1;
  539. $1=self._selectedPackage_(aPackage);
  540. return $1;
  541. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  542. return self}, function($ctx1) {$ctx1.fill(self,"forceSelectedPackage:",{aPackage:aPackage},globals.HLToolModel)})},
  543. args: ["aPackage"],
  544. source: "forceSelectedPackage: aPackage\x0a\x09self withChangesDo: [\x0a\x09\x09self \x09\x0a\x09\x09\x09selectedPackage: nil;\x0a\x09\x09\x09selectedPackage: aPackage ]",
  545. messageSends: ["withChangesDo:", "selectedPackage:"],
  546. referencedClasses: []
  547. }),
  548. globals.HLToolModel);
  549. smalltalk.addMethod(
  550. smalltalk.method({
  551. selector: "forceSelectedProtocol:",
  552. protocol: 'accessing',
  553. fn: function (aProtocol){
  554. var self=this;
  555. return smalltalk.withContext(function($ctx1) {
  556. var $1;
  557. self._withChangesDo_((function(){
  558. return smalltalk.withContext(function($ctx2) {
  559. self._selectedProtocol_(nil);
  560. $ctx2.sendIdx["selectedProtocol:"]=1;
  561. $1=self._selectedProtocol_(aProtocol);
  562. return $1;
  563. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  564. return self}, function($ctx1) {$ctx1.fill(self,"forceSelectedProtocol:",{aProtocol:aProtocol},globals.HLToolModel)})},
  565. args: ["aProtocol"],
  566. source: "forceSelectedProtocol: aProtocol\x0a\x09self withChangesDo: [\x0a\x09\x09self \x09\x0a\x09\x09\x09selectedProtocol: nil;\x0a\x09\x09\x09selectedProtocol: aProtocol ]",
  567. messageSends: ["withChangesDo:", "selectedProtocol:"],
  568. referencedClasses: []
  569. }),
  570. globals.HLToolModel);
  571. smalltalk.addMethod(
  572. smalltalk.method({
  573. selector: "handleCompileError:",
  574. protocol: 'error handling',
  575. fn: function (anError){
  576. var self=this;
  577. function $HLCompileErrorRaised(){return globals.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  578. return smalltalk.withContext(function($ctx1) {
  579. var $1,$2;
  580. $1=_st($HLCompileErrorRaised())._new();
  581. _st($1)._error_(anError);
  582. $2=_st($1)._yourself();
  583. _st(self._announcer())._announce_($2);
  584. return self}, function($ctx1) {$ctx1.fill(self,"handleCompileError:",{anError:anError},globals.HLToolModel)})},
  585. args: ["anError"],
  586. source: "handleCompileError: anError\x0a\x09self announcer announce: (HLCompileErrorRaised new\x0a\x09\x09error: anError;\x0a\x09\x09yourself)",
  587. messageSends: ["announce:", "announcer", "error:", "new", "yourself"],
  588. referencedClasses: ["HLCompileErrorRaised"]
  589. }),
  590. globals.HLToolModel);
  591. smalltalk.addMethod(
  592. smalltalk.method({
  593. selector: "handleParseError:",
  594. protocol: 'error handling',
  595. fn: function (anError){
  596. var self=this;
  597. var split,line,column,messageToInsert;
  598. function $HLParseErrorRaised(){return globals.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  599. return smalltalk.withContext(function($ctx1) {
  600. var $1,$3,$2,$4,$6,$7,$8,$9,$5;
  601. split=_st(_st(anError)._messageText())._tokenize_(" : ");
  602. $ctx1.sendIdx["tokenize:"]=1;
  603. messageToInsert=_st(split)._second();
  604. $ctx1.sendIdx["second"]=1;
  605. $1=_st(split)._first();
  606. $ctx1.sendIdx["first"]=1;
  607. $3=_st(split)._first();
  608. $ctx1.sendIdx["first"]=2;
  609. $2=_st($3)._size();
  610. split=_st($1)._copyFrom_to_((21),$2);
  611. split=_st(split)._tokenize_(" column ");
  612. line=_st(split)._first();
  613. column=_st(split)._second();
  614. $4=self._announcer();
  615. $6=_st($HLParseErrorRaised())._new();
  616. $7=$6;
  617. $8=_st(line)._asNumber();
  618. $ctx1.sendIdx["asNumber"]=1;
  619. _st($7)._line_($8);
  620. _st($6)._column_(_st(column)._asNumber());
  621. _st($6)._message_(messageToInsert);
  622. _st($6)._error_(anError);
  623. $9=_st($6)._yourself();
  624. $5=$9;
  625. _st($4)._announce_($5);
  626. return self}, function($ctx1) {$ctx1.fill(self,"handleParseError:",{anError:anError,split:split,line:line,column:column,messageToInsert:messageToInsert},globals.HLToolModel)})},
  627. args: ["anError"],
  628. 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)",
  629. messageSends: ["tokenize:", "messageText", "second", "copyFrom:to:", "first", "size", "announce:", "announcer", "line:", "new", "asNumber", "column:", "message:", "error:", "yourself"],
  630. referencedClasses: ["HLParseErrorRaised"]
  631. }),
  632. globals.HLToolModel);
  633. smalltalk.addMethod(
  634. smalltalk.method({
  635. selector: "handleUnkownVariableError:",
  636. protocol: 'error handling',
  637. fn: function (anError){
  638. var self=this;
  639. function $HLUnknownVariableErrorRaised(){return globals.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  640. return smalltalk.withContext(function($ctx1) {
  641. var $1,$2;
  642. $1=_st($HLUnknownVariableErrorRaised())._new();
  643. _st($1)._error_(anError);
  644. $2=_st($1)._yourself();
  645. _st(self._announcer())._announce_($2);
  646. return self}, function($ctx1) {$ctx1.fill(self,"handleUnkownVariableError:",{anError:anError},globals.HLToolModel)})},
  647. args: ["anError"],
  648. source: "handleUnkownVariableError: anError\x0a\x09self announcer announce: (HLUnknownVariableErrorRaised new\x0a\x09\x09error: anError;\x0a\x09\x09yourself)",
  649. messageSends: ["announce:", "announcer", "error:", "new", "yourself"],
  650. referencedClasses: ["HLUnknownVariableErrorRaised"]
  651. }),
  652. globals.HLToolModel);
  653. smalltalk.addMethod(
  654. smalltalk.method({
  655. selector: "isToolModel",
  656. protocol: 'testing',
  657. fn: function (){
  658. var self=this;
  659. return true;
  660. },
  661. args: [],
  662. source: "isToolModel\x0a\x09^ true",
  663. messageSends: [],
  664. referencedClasses: []
  665. }),
  666. globals.HLToolModel);
  667. smalltalk.addMethod(
  668. smalltalk.method({
  669. selector: "moveClassToPackage:",
  670. protocol: 'commands actions',
  671. fn: function (aPackageName){
  672. var self=this;
  673. return smalltalk.withContext(function($ctx1) {
  674. self._withChangesDo_((function(){
  675. return smalltalk.withContext(function($ctx2) {
  676. return _st(self._environment())._moveClass_toPackage_(_st(self._selectedClass())._theNonMetaClass(),aPackageName);
  677. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  678. return self}, function($ctx1) {$ctx1.fill(self,"moveClassToPackage:",{aPackageName:aPackageName},globals.HLToolModel)})},
  679. args: ["aPackageName"],
  680. source: "moveClassToPackage: aPackageName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09toPackage: aPackageName ]",
  681. messageSends: ["withChangesDo:", "moveClass:toPackage:", "environment", "theNonMetaClass", "selectedClass"],
  682. referencedClasses: []
  683. }),
  684. globals.HLToolModel);
  685. smalltalk.addMethod(
  686. smalltalk.method({
  687. selector: "moveMethodToClass:",
  688. protocol: 'commands actions',
  689. fn: function (aClassName){
  690. var self=this;
  691. return smalltalk.withContext(function($ctx1) {
  692. self._withChangesDo_((function(){
  693. return smalltalk.withContext(function($ctx2) {
  694. return _st(self._environment())._moveMethod_toClass_(self._selectedMethod(),aClassName);
  695. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  696. return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToClass:",{aClassName:aClassName},globals.HLToolModel)})},
  697. args: ["aClassName"],
  698. source: "moveMethodToClass: aClassName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveMethod: self selectedMethod \x0a\x09\x09\x09toClass: aClassName ]",
  699. messageSends: ["withChangesDo:", "moveMethod:toClass:", "environment", "selectedMethod"],
  700. referencedClasses: []
  701. }),
  702. globals.HLToolModel);
  703. smalltalk.addMethod(
  704. smalltalk.method({
  705. selector: "moveMethodToProtocol:",
  706. protocol: 'commands actions',
  707. fn: function (aProtocol){
  708. var self=this;
  709. return smalltalk.withContext(function($ctx1) {
  710. self._withChangesDo_((function(){
  711. return smalltalk.withContext(function($ctx2) {
  712. return _st(self._environment())._moveMethod_toProtocol_(self._selectedMethod(),aProtocol);
  713. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  714. return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToProtocol:",{aProtocol:aProtocol},globals.HLToolModel)})},
  715. args: ["aProtocol"],
  716. source: "moveMethodToProtocol: aProtocol\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveMethod: self selectedMethod \x0a\x09\x09\x09toProtocol: aProtocol ]",
  717. messageSends: ["withChangesDo:", "moveMethod:toProtocol:", "environment", "selectedMethod"],
  718. referencedClasses: []
  719. }),
  720. globals.HLToolModel);
  721. smalltalk.addMethod(
  722. smalltalk.method({
  723. selector: "openClassNamed:",
  724. protocol: 'commands actions',
  725. fn: function (aString){
  726. var self=this;
  727. var class_;
  728. return smalltalk.withContext(function($ctx1) {
  729. self._withChangesDo_((function(){
  730. return smalltalk.withContext(function($ctx2) {
  731. class_=_st(self._environment())._classNamed_(aString);
  732. class_;
  733. self._selectedPackage_(_st(class_)._package());
  734. return self._selectedClass_(class_);
  735. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  736. return self}, function($ctx1) {$ctx1.fill(self,"openClassNamed:",{aString:aString,class_:class_},globals.HLToolModel)})},
  737. args: ["aString"],
  738. 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 ]",
  739. messageSends: ["withChangesDo:", "classNamed:", "environment", "selectedPackage:", "package", "selectedClass:"],
  740. referencedClasses: []
  741. }),
  742. globals.HLToolModel);
  743. smalltalk.addMethod(
  744. smalltalk.method({
  745. selector: "packageToCommit",
  746. protocol: 'accessing',
  747. fn: function (){
  748. var self=this;
  749. return smalltalk.withContext(function($ctx1) {
  750. var $2,$1,$receiver;
  751. $2=self._selectedMethod();
  752. if(($receiver = $2) == null || $receiver.isNil){
  753. $1=self._selectedPackage();
  754. } else {
  755. var method;
  756. method=$receiver;
  757. $1=_st(method)._package();
  758. };
  759. return $1;
  760. }, function($ctx1) {$ctx1.fill(self,"packageToCommit",{},globals.HLToolModel)})},
  761. args: [],
  762. source: "packageToCommit\x0a\x09\x22Answer the package to commit depending on the context:\x0a\x09- if a Method is selected, answer its package\x0a\x09- else answer the `selectedPackage`\x22\x0a\x09\x0a\x09^ self selectedMethod \x0a\x09\x09ifNil: [ self selectedPackage ]\x0a\x09\x09ifNotNil: [ :method | method package ]",
  763. messageSends: ["ifNil:ifNotNil:", "selectedMethod", "selectedPackage", "package"],
  764. referencedClasses: []
  765. }),
  766. globals.HLToolModel);
  767. smalltalk.addMethod(
  768. smalltalk.method({
  769. selector: "packages",
  770. protocol: 'accessing',
  771. fn: function (){
  772. var self=this;
  773. return smalltalk.withContext(function($ctx1) {
  774. var $1;
  775. $1=_st(self._environment())._packages();
  776. return $1;
  777. }, function($ctx1) {$ctx1.fill(self,"packages",{},globals.HLToolModel)})},
  778. args: [],
  779. source: "packages\x0a\x09^ self environment packages",
  780. messageSends: ["packages", "environment"],
  781. referencedClasses: []
  782. }),
  783. globals.HLToolModel);
  784. smalltalk.addMethod(
  785. smalltalk.method({
  786. selector: "removeClass",
  787. protocol: 'commands actions',
  788. fn: function (){
  789. var self=this;
  790. return smalltalk.withContext(function($ctx1) {
  791. var $1,$5,$4,$3,$2;
  792. self._withChangesDo_((function(){
  793. return smalltalk.withContext(function($ctx2) {
  794. $1=self._manager();
  795. $5=self._selectedClass();
  796. $ctx2.sendIdx["selectedClass"]=1;
  797. $4=_st($5)._theNonMetaClass();
  798. $ctx2.sendIdx["theNonMetaClass"]=1;
  799. $3=_st($4)._name();
  800. $2="Do you REALLY want to remove class ".__comma($3);
  801. return _st($1)._confirm_ifTrue_($2,(function(){
  802. return smalltalk.withContext(function($ctx3) {
  803. return _st(self._environment())._removeClass_(_st(self._selectedClass())._theNonMetaClass());
  804. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  805. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  806. return self}, function($ctx1) {$ctx1.fill(self,"removeClass",{},globals.HLToolModel)})},
  807. args: [],
  808. source: "removeClass\x0a\x09self withChangesDo: [\x0a\x09\x09self manager \x0a\x09\x09\x09confirm: 'Do you REALLY want to remove class ', self selectedClass theNonMetaClass name\x0a\x09\x09\x09ifTrue: [ self environment removeClass: self selectedClass theNonMetaClass ] ]",
  809. messageSends: ["withChangesDo:", "confirm:ifTrue:", "manager", ",", "name", "theNonMetaClass", "selectedClass", "removeClass:", "environment"],
  810. referencedClasses: []
  811. }),
  812. globals.HLToolModel);
  813. smalltalk.addMethod(
  814. smalltalk.method({
  815. selector: "removeMethod",
  816. protocol: 'commands actions',
  817. fn: function (){
  818. var self=this;
  819. return smalltalk.withContext(function($ctx1) {
  820. var $1,$7,$6,$5,$4,$3,$9,$8,$2;
  821. self._withChangesDo_((function(){
  822. return smalltalk.withContext(function($ctx2) {
  823. $1=self._manager();
  824. $7=self._selectedMethod();
  825. $ctx2.sendIdx["selectedMethod"]=1;
  826. $6=_st($7)._methodClass();
  827. $5=_st($6)._name();
  828. $4="Do you REALLY want to remove method ".__comma($5);
  829. $3=_st($4).__comma(" >> #");
  830. $ctx2.sendIdx[","]=2;
  831. $9=self._selectedMethod();
  832. $ctx2.sendIdx["selectedMethod"]=2;
  833. $8=_st($9)._selector();
  834. $2=_st($3).__comma($8);
  835. $ctx2.sendIdx[","]=1;
  836. return _st($1)._confirm_ifTrue_($2,(function(){
  837. return smalltalk.withContext(function($ctx3) {
  838. return _st(self._environment())._removeMethod_(self._selectedMethod());
  839. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  840. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  841. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod",{},globals.HLToolModel)})},
  842. args: [],
  843. 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 ] ]",
  844. messageSends: ["withChangesDo:", "confirm:ifTrue:", "manager", ",", "name", "methodClass", "selectedMethod", "selector", "removeMethod:", "environment"],
  845. referencedClasses: []
  846. }),
  847. globals.HLToolModel);
  848. smalltalk.addMethod(
  849. smalltalk.method({
  850. selector: "removeProtocol",
  851. protocol: 'commands actions',
  852. fn: function (){
  853. var self=this;
  854. return smalltalk.withContext(function($ctx1) {
  855. var $1,$3,$2;
  856. self._withChangesDo_((function(){
  857. return smalltalk.withContext(function($ctx2) {
  858. $1=self._manager();
  859. $3=self._selectedProtocol();
  860. $ctx2.sendIdx["selectedProtocol"]=1;
  861. $2="Do you REALLY want to remove protocol ".__comma($3);
  862. return _st($1)._confirm_ifTrue_($2,(function(){
  863. return smalltalk.withContext(function($ctx3) {
  864. return _st(self._environment())._removeProtocol_from_(self._selectedProtocol(),self._selectedClass());
  865. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  866. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  867. return self}, function($ctx1) {$ctx1.fill(self,"removeProtocol",{},globals.HLToolModel)})},
  868. args: [],
  869. 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 ] ]",
  870. messageSends: ["withChangesDo:", "confirm:ifTrue:", "manager", ",", "selectedProtocol", "removeProtocol:from:", "environment", "selectedClass"],
  871. referencedClasses: []
  872. }),
  873. globals.HLToolModel);
  874. smalltalk.addMethod(
  875. smalltalk.method({
  876. selector: "renameClassTo:",
  877. protocol: 'commands actions',
  878. fn: function (aClassName){
  879. var self=this;
  880. return smalltalk.withContext(function($ctx1) {
  881. self._withChangesDo_((function(){
  882. return smalltalk.withContext(function($ctx2) {
  883. return _st(self._environment())._renameClass_to_(_st(self._selectedClass())._theNonMetaClass(),aClassName);
  884. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  885. return self}, function($ctx1) {$ctx1.fill(self,"renameClassTo:",{aClassName:aClassName},globals.HLToolModel)})},
  886. args: ["aClassName"],
  887. source: "renameClassTo: aClassName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09renameClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09to: aClassName ]",
  888. messageSends: ["withChangesDo:", "renameClass:to:", "environment", "theNonMetaClass", "selectedClass"],
  889. referencedClasses: []
  890. }),
  891. globals.HLToolModel);
  892. smalltalk.addMethod(
  893. smalltalk.method({
  894. selector: "renameProtocolTo:",
  895. protocol: 'commands actions',
  896. fn: function (aString){
  897. var self=this;
  898. return smalltalk.withContext(function($ctx1) {
  899. self._withChangesDo_((function(){
  900. return smalltalk.withContext(function($ctx2) {
  901. return _st(self._environment())._renameProtocol_to_in_(self._selectedProtocol(),aString,self._selectedClass());
  902. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  903. return self}, function($ctx1) {$ctx1.fill(self,"renameProtocolTo:",{aString:aString},globals.HLToolModel)})},
  904. args: ["aString"],
  905. 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 ]",
  906. messageSends: ["withChangesDo:", "renameProtocol:to:in:", "environment", "selectedProtocol", "selectedClass"],
  907. referencedClasses: []
  908. }),
  909. globals.HLToolModel);
  910. smalltalk.addMethod(
  911. smalltalk.method({
  912. selector: "save:",
  913. protocol: 'actions',
  914. fn: function (aString){
  915. var self=this;
  916. function $HLSourceCodeSaved(){return globals.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  917. return smalltalk.withContext(function($ctx1) {
  918. var $1;
  919. _st(self._announcer())._announce_(_st($HLSourceCodeSaved())._new());
  920. $1=self._shouldCompileClassDefinition_(aString);
  921. if(smalltalk.assert($1)){
  922. self._compileClassDefinition_(aString);
  923. } else {
  924. self._compileMethod_(aString);
  925. };
  926. return self}, function($ctx1) {$ctx1.fill(self,"save:",{aString:aString},globals.HLToolModel)})},
  927. args: ["aString"],
  928. 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 ]",
  929. messageSends: ["announce:", "announcer", "new", "ifTrue:ifFalse:", "shouldCompileClassDefinition:", "compileClassDefinition:", "compileMethod:"],
  930. referencedClasses: ["HLSourceCodeSaved"]
  931. }),
  932. globals.HLToolModel);
  933. smalltalk.addMethod(
  934. smalltalk.method({
  935. selector: "saveSourceCode",
  936. protocol: 'actions',
  937. fn: function (){
  938. var self=this;
  939. function $HLSaveSourceCode(){return globals.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  940. return smalltalk.withContext(function($ctx1) {
  941. _st(self._announcer())._announce_(_st($HLSaveSourceCode())._new());
  942. return self}, function($ctx1) {$ctx1.fill(self,"saveSourceCode",{},globals.HLToolModel)})},
  943. args: [],
  944. source: "saveSourceCode\x0a\x09self announcer announce: HLSaveSourceCode new",
  945. messageSends: ["announce:", "announcer", "new"],
  946. referencedClasses: ["HLSaveSourceCode"]
  947. }),
  948. globals.HLToolModel);
  949. smalltalk.addMethod(
  950. smalltalk.method({
  951. selector: "selectedClass",
  952. protocol: 'accessing',
  953. fn: function (){
  954. var self=this;
  955. var $1;
  956. $1=self["@selectedClass"];
  957. return $1;
  958. },
  959. args: [],
  960. source: "selectedClass\x0a\x09^ selectedClass",
  961. messageSends: [],
  962. referencedClasses: []
  963. }),
  964. globals.HLToolModel);
  965. smalltalk.addMethod(
  966. smalltalk.method({
  967. selector: "selectedClass:",
  968. protocol: 'accessing',
  969. fn: function (aClass){
  970. var self=this;
  971. function $HLClassSelected(){return globals.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  972. return smalltalk.withContext(function($ctx1) {
  973. var $3,$2,$1,$4,$6,$5,$7,$receiver;
  974. $3=self._selectedClass();
  975. $ctx1.sendIdx["selectedClass"]=1;
  976. $2=_st($3).__eq(aClass);
  977. $ctx1.sendIdx["="]=1;
  978. $1=_st($2)._and_((function(){
  979. return smalltalk.withContext(function($ctx2) {
  980. return _st(aClass)._isNil();
  981. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  982. if(smalltalk.assert($1)){
  983. return self;
  984. };
  985. self._withChangesDo_((function(){
  986. return smalltalk.withContext(function($ctx2) {
  987. $4=_st(self["@selectedClass"]).__eq(aClass);
  988. if(smalltalk.assert($4)){
  989. self._selectedProtocol_(nil);
  990. $ctx2.sendIdx["selectedProtocol:"]=1;
  991. };
  992. if(($receiver = aClass) == null || $receiver.isNil){
  993. self["@selectedClass"]=nil;
  994. self["@selectedClass"];
  995. } else {
  996. $6=_st(aClass)._theNonMetaClass();
  997. $ctx2.sendIdx["theNonMetaClass"]=1;
  998. $5=_st($6)._package();
  999. self._selectedPackage_($5);
  1000. $7=self._showInstance();
  1001. if(smalltalk.assert($7)){
  1002. self["@selectedClass"]=_st(aClass)._theNonMetaClass();
  1003. self["@selectedClass"];
  1004. } else {
  1005. self["@selectedClass"]=_st(aClass)._theMetaClass();
  1006. self["@selectedClass"];
  1007. };
  1008. };
  1009. self._selectedProtocol_(nil);
  1010. return _st(self._announcer())._announce_(_st($HLClassSelected())._on_(self._selectedClass()));
  1011. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  1012. return self}, function($ctx1) {$ctx1.fill(self,"selectedClass:",{aClass:aClass},globals.HLToolModel)})},
  1013. args: ["aClass"],
  1014. 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) ]",
  1015. messageSends: ["ifTrue:", "and:", "=", "selectedClass", "isNil", "withChangesDo:", "selectedProtocol:", "ifNil:ifNotNil:", "selectedPackage:", "package", "theNonMetaClass", "ifTrue:ifFalse:", "showInstance", "theMetaClass", "announce:", "announcer", "on:"],
  1016. referencedClasses: ["HLClassSelected"]
  1017. }),
  1018. globals.HLToolModel);
  1019. smalltalk.addMethod(
  1020. smalltalk.method({
  1021. selector: "selectedMethod",
  1022. protocol: 'accessing',
  1023. fn: function (){
  1024. var self=this;
  1025. return smalltalk.withContext(function($ctx1) {
  1026. var $2,$1,$receiver;
  1027. $2=self._selectedClass();
  1028. $ctx1.sendIdx["selectedClass"]=1;
  1029. if(($receiver = $2) == null || $receiver.isNil){
  1030. $1=$2;
  1031. } else {
  1032. $1=_st(_st(self._selectedClass())._methodDictionary())._at_ifAbsent_(self["@selectedSelector"],(function(){
  1033. return nil;
  1034. }));
  1035. };
  1036. return $1;
  1037. }, function($ctx1) {$ctx1.fill(self,"selectedMethod",{},globals.HLToolModel)})},
  1038. args: [],
  1039. source: "selectedMethod\x0a\x09^ self selectedClass ifNotNil: [ \x0a\x09\x09self selectedClass methodDictionary \x0a\x09\x09\x09at: selectedSelector \x0a\x09\x09\x09ifAbsent: [ nil ] ]",
  1040. messageSends: ["ifNotNil:", "selectedClass", "at:ifAbsent:", "methodDictionary"],
  1041. referencedClasses: []
  1042. }),
  1043. globals.HLToolModel);
  1044. smalltalk.addMethod(
  1045. smalltalk.method({
  1046. selector: "selectedMethod:",
  1047. protocol: 'accessing',
  1048. fn: function (aCompiledMethod){
  1049. var self=this;
  1050. function $HLMethodSelected(){return globals.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1051. return smalltalk.withContext(function($ctx1) {
  1052. var $1,$receiver;
  1053. $1=_st(self["@selectedSelector"]).__eq(aCompiledMethod);
  1054. if(smalltalk.assert($1)){
  1055. return self;
  1056. };
  1057. self._withChangesDo_((function(){
  1058. return smalltalk.withContext(function($ctx2) {
  1059. if(($receiver = aCompiledMethod) == null || $receiver.isNil){
  1060. self["@selectedSelector"]=nil;
  1061. self["@selectedSelector"];
  1062. } else {
  1063. self["@selectedClass"]=_st(aCompiledMethod)._methodClass();
  1064. self["@selectedClass"];
  1065. self["@selectedPackage"]=_st(_st(self["@selectedClass"])._theNonMetaClass())._package();
  1066. self["@selectedPackage"];
  1067. self["@selectedSelector"]=_st(aCompiledMethod)._selector();
  1068. self["@selectedSelector"];
  1069. };
  1070. return _st(self._announcer())._announce_(_st($HLMethodSelected())._on_(aCompiledMethod));
  1071. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1072. return self}, function($ctx1) {$ctx1.fill(self,"selectedMethod:",{aCompiledMethod:aCompiledMethod},globals.HLToolModel)})},
  1073. args: ["aCompiledMethod"],
  1074. 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) ]",
  1075. messageSends: ["ifTrue:", "=", "withChangesDo:", "ifNil:ifNotNil:", "methodClass", "package", "theNonMetaClass", "selector", "announce:", "announcer", "on:"],
  1076. referencedClasses: ["HLMethodSelected"]
  1077. }),
  1078. globals.HLToolModel);
  1079. smalltalk.addMethod(
  1080. smalltalk.method({
  1081. selector: "selectedPackage",
  1082. protocol: 'accessing',
  1083. fn: function (){
  1084. var self=this;
  1085. var $1;
  1086. $1=self["@selectedPackage"];
  1087. return $1;
  1088. },
  1089. args: [],
  1090. source: "selectedPackage\x0a\x09^ selectedPackage",
  1091. messageSends: [],
  1092. referencedClasses: []
  1093. }),
  1094. globals.HLToolModel);
  1095. smalltalk.addMethod(
  1096. smalltalk.method({
  1097. selector: "selectedPackage:",
  1098. protocol: 'accessing',
  1099. fn: function (aPackage){
  1100. var self=this;
  1101. function $HLPackageSelected(){return globals.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  1102. return smalltalk.withContext(function($ctx1) {
  1103. var $1;
  1104. $1=_st(self["@selectedPackage"]).__eq(aPackage);
  1105. if(smalltalk.assert($1)){
  1106. return self;
  1107. };
  1108. self._withChangesDo_((function(){
  1109. return smalltalk.withContext(function($ctx2) {
  1110. self["@selectedPackage"]=aPackage;
  1111. self["@selectedPackage"];
  1112. self._selectedClass_(nil);
  1113. return _st(self._announcer())._announce_(_st($HLPackageSelected())._on_(aPackage));
  1114. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1115. return self}, function($ctx1) {$ctx1.fill(self,"selectedPackage:",{aPackage:aPackage},globals.HLToolModel)})},
  1116. args: ["aPackage"],
  1117. 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) ]",
  1118. messageSends: ["ifTrue:", "=", "withChangesDo:", "selectedClass:", "announce:", "announcer", "on:"],
  1119. referencedClasses: ["HLPackageSelected"]
  1120. }),
  1121. globals.HLToolModel);
  1122. smalltalk.addMethod(
  1123. smalltalk.method({
  1124. selector: "selectedProtocol",
  1125. protocol: 'accessing',
  1126. fn: function (){
  1127. var self=this;
  1128. var $1;
  1129. $1=self["@selectedProtocol"];
  1130. return $1;
  1131. },
  1132. args: [],
  1133. source: "selectedProtocol\x0a\x09^ selectedProtocol",
  1134. messageSends: [],
  1135. referencedClasses: []
  1136. }),
  1137. globals.HLToolModel);
  1138. smalltalk.addMethod(
  1139. smalltalk.method({
  1140. selector: "selectedProtocol:",
  1141. protocol: 'accessing',
  1142. fn: function (aString){
  1143. var self=this;
  1144. function $HLProtocolSelected(){return globals.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1145. return smalltalk.withContext(function($ctx1) {
  1146. var $1;
  1147. $1=_st(self["@selectedProtocol"]).__eq(aString);
  1148. if(smalltalk.assert($1)){
  1149. return self;
  1150. };
  1151. self._withChangesDo_((function(){
  1152. return smalltalk.withContext(function($ctx2) {
  1153. self["@selectedProtocol"]=aString;
  1154. self["@selectedProtocol"];
  1155. self._selectedMethod_(nil);
  1156. return _st(self._announcer())._announce_(_st($HLProtocolSelected())._on_(aString));
  1157. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1158. return self}, function($ctx1) {$ctx1.fill(self,"selectedProtocol:",{aString:aString},globals.HLToolModel)})},
  1159. args: ["aString"],
  1160. 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) ]",
  1161. messageSends: ["ifTrue:", "=", "withChangesDo:", "selectedMethod:", "announce:", "announcer", "on:"],
  1162. referencedClasses: ["HLProtocolSelected"]
  1163. }),
  1164. globals.HLToolModel);
  1165. smalltalk.addMethod(
  1166. smalltalk.method({
  1167. selector: "shouldCompileClassDefinition:",
  1168. protocol: 'testing',
  1169. fn: function (aString){
  1170. var self=this;
  1171. return smalltalk.withContext(function($ctx1) {
  1172. var $1;
  1173. $1=_st(_st(self._selectedClass())._isNil())._or_((function(){
  1174. return smalltalk.withContext(function($ctx2) {
  1175. return _st(aString)._match_("^\x5cs*[A-Z]");
  1176. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1177. return $1;
  1178. }, function($ctx1) {$ctx1.fill(self,"shouldCompileClassDefinition:",{aString:aString},globals.HLToolModel)})},
  1179. args: ["aString"],
  1180. source: "shouldCompileClassDefinition: aString\x0a\x09^ self selectedClass isNil or: [\x0a\x09\x09aString match: '^\x5cs*[A-Z]' ]",
  1181. messageSends: ["or:", "isNil", "selectedClass", "match:"],
  1182. referencedClasses: []
  1183. }),
  1184. globals.HLToolModel);
  1185. smalltalk.addMethod(
  1186. smalltalk.method({
  1187. selector: "unclassifiedProtocol",
  1188. protocol: 'defaults',
  1189. fn: function (){
  1190. var self=this;
  1191. return "as yet unclassified";
  1192. },
  1193. args: [],
  1194. source: "unclassifiedProtocol\x0a\x09^ 'as yet unclassified'",
  1195. messageSends: [],
  1196. referencedClasses: []
  1197. }),
  1198. globals.HLToolModel);
  1199. smalltalk.addMethod(
  1200. smalltalk.method({
  1201. selector: "withCompileErrorHandling:",
  1202. protocol: 'error handling',
  1203. fn: function (aBlock){
  1204. var self=this;
  1205. function $ParseError(){return globals.ParseError||(typeof ParseError=="undefined"?nil:ParseError)}
  1206. function $UnknownVariableError(){return globals.UnknownVariableError||(typeof UnknownVariableError=="undefined"?nil:UnknownVariableError)}
  1207. function $CompilerError(){return globals.CompilerError||(typeof CompilerError=="undefined"?nil:CompilerError)}
  1208. return smalltalk.withContext(function($ctx1) {
  1209. var $1,$2;
  1210. $1=self._environment();
  1211. $ctx1.sendIdx["environment"]=1;
  1212. _st($1)._evaluate_on_do_((function(){
  1213. return smalltalk.withContext(function($ctx2) {
  1214. $2=self._environment();
  1215. $ctx2.sendIdx["environment"]=2;
  1216. return _st($2)._evaluate_on_do_((function(){
  1217. return smalltalk.withContext(function($ctx3) {
  1218. return _st(self._environment())._evaluate_on_do_(aBlock,$ParseError(),(function(ex){
  1219. return smalltalk.withContext(function($ctx4) {
  1220. return self._handleParseError_(ex);
  1221. }, function($ctx4) {$ctx4.fillBlock({ex:ex},$ctx3,3)})}));
  1222. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}),$UnknownVariableError(),(function(ex){
  1223. return smalltalk.withContext(function($ctx3) {
  1224. return self._handleUnkownVariableError_(ex);
  1225. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2,4)})}));
  1226. $ctx2.sendIdx["evaluate:on:do:"]=2;
  1227. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),$CompilerError(),(function(ex){
  1228. return smalltalk.withContext(function($ctx2) {
  1229. return self._handleCompileError_(ex);
  1230. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,5)})}));
  1231. $ctx1.sendIdx["evaluate:on:do:"]=1;
  1232. return self}, function($ctx1) {$ctx1.fill(self,"withCompileErrorHandling:",{aBlock:aBlock},globals.HLToolModel)})},
  1233. args: ["aBlock"],
  1234. 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 ]",
  1235. messageSends: ["evaluate:on:do:", "environment", "handleParseError:", "handleUnkownVariableError:", "handleCompileError:"],
  1236. referencedClasses: ["ParseError", "UnknownVariableError", "CompilerError"]
  1237. }),
  1238. globals.HLToolModel);
  1239. smalltalk.addMethod(
  1240. smalltalk.method({
  1241. selector: "withHelperLabelled:do:",
  1242. protocol: 'private',
  1243. fn: function (aString,aBlock){
  1244. var self=this;
  1245. return smalltalk.withContext(function($ctx1) {
  1246. var $1,$3,$4,$2,$5;
  1247. $1="#helper"._asJQuery();
  1248. $ctx1.sendIdx["asJQuery"]=1;
  1249. _st($1)._remove();
  1250. $ctx1.sendIdx["remove"]=1;
  1251. $2=(function(html){
  1252. return smalltalk.withContext(function($ctx2) {
  1253. $3=_st(html)._div();
  1254. _st($3)._id_("helper");
  1255. $4=_st($3)._with_(aString);
  1256. return $4;
  1257. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})});
  1258. $5="body"._asJQuery();
  1259. $ctx1.sendIdx["asJQuery"]=2;
  1260. _st($2)._appendToJQuery_($5);
  1261. _st((function(){
  1262. return smalltalk.withContext(function($ctx2) {
  1263. _st(aBlock)._value();
  1264. return _st("#helper"._asJQuery())._remove();
  1265. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}))._valueWithTimeout_((10));
  1266. return self}, function($ctx1) {$ctx1.fill(self,"withHelperLabelled:do:",{aString:aString,aBlock:aBlock},globals.HLToolModel)})},
  1267. args: ["aString", "aBlock"],
  1268. 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",
  1269. messageSends: ["remove", "asJQuery", "appendToJQuery:", "id:", "div", "with:", "valueWithTimeout:", "value"],
  1270. referencedClasses: []
  1271. }),
  1272. globals.HLToolModel);
  1273. smalltalk.addMethod(
  1274. smalltalk.method({
  1275. selector: "on:",
  1276. protocol: 'actions',
  1277. fn: function (anEnvironment){
  1278. var self=this;
  1279. return smalltalk.withContext(function($ctx1) {
  1280. var $2,$3,$1;
  1281. $2=self._new();
  1282. _st($2)._environment_(anEnvironment);
  1283. $3=_st($2)._yourself();
  1284. $1=$3;
  1285. return $1;
  1286. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},globals.HLToolModel.klass)})},
  1287. args: ["anEnvironment"],
  1288. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  1289. messageSends: ["environment:", "new", "yourself"],
  1290. referencedClasses: []
  1291. }),
  1292. globals.HLToolModel.klass);
  1293. smalltalk.addClass('HLProgressHandler', globals.Object, [], 'Helios-Core');
  1294. globals.HLProgressHandler.comment="I am a specific progress handler for Helios, displaying progresses in a modal window.";
  1295. smalltalk.addMethod(
  1296. smalltalk.method({
  1297. selector: "do:on:displaying:",
  1298. protocol: 'progress handling',
  1299. fn: function (aBlock,aCollection,aString){
  1300. var self=this;
  1301. function $HLProgressWidget(){return globals.HLProgressWidget||(typeof HLProgressWidget=="undefined"?nil:HLProgressWidget)}
  1302. return smalltalk.withContext(function($ctx1) {
  1303. _st(_st($HLProgressWidget())._default())._do_on_displaying_(aBlock,aCollection,aString);
  1304. return self}, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString},globals.HLProgressHandler)})},
  1305. args: ["aBlock", "aCollection", "aString"],
  1306. source: "do: aBlock on: aCollection displaying: aString\x0a\x09HLProgressWidget default\x0a\x09\x09do: aBlock \x0a\x09\x09on: aCollection \x0a\x09\x09displaying: aString",
  1307. messageSends: ["do:on:displaying:", "default"],
  1308. referencedClasses: ["HLProgressWidget"]
  1309. }),
  1310. globals.HLProgressHandler);
  1311. smalltalk.addClass('HLWidget', globals.Widget, ['wrapper'], 'Helios-Core');
  1312. globals.HLWidget.comment="I am the abstract superclass of all Helios widgets.\x0a\x0aI provide common methods, additional behavior to widgets useful for Helios, like dialog creation, command execution and tab creation.\x0a\x0a## API\x0a\x0a1. Rendering\x0a\x0a Instead of overriding `#renderOn:` as with other Widget subclasses, my subclasses should override `#renderContentOn:`.\x0a\x0a2. Refreshing\x0a\x0a To re-render a widget, use `#refresh`.\x0a\x0a3. Key bindings registration and tabs\x0a\x0a When displayed as a tab, the widget has a chance to register keybindings with the `#registerBindingsOn:` hook method.\x0a \x0a4. Unregistration\x0a\x0a When a widget has subscribed to announcements or other actions that need to be cleared when closing the tab, the hook method `#unregister` will be called by helios.\x0a\x0a5. Tabs\x0a\x0a To enable a widget class to be open as a tab, override the class-side `#canBeOpenAsTab` method to answer `true`. `#tabClass` and `#tabPriority` can be overridden too to respectively change the css class of the tab and the order of tabs in the main menu.\x0a\x0a6. Command execution\x0a\x0a An helios command (instance of `HLCommand` or one of its subclass) can be executed with `#execute:`.";
  1313. smalltalk.addMethod(
  1314. smalltalk.method({
  1315. selector: "bindKeyDown:keyUp:",
  1316. protocol: 'keybindings',
  1317. fn: function (keyDownBlock,keyUpBlock){
  1318. var self=this;
  1319. return smalltalk.withContext(function($ctx1) {
  1320. var $1,$2;
  1321. $1=_st(self._wrapper())._asJQuery();
  1322. _st($1)._keydown_(keyDownBlock);
  1323. $2=_st($1)._keyup_(keyUpBlock);
  1324. return self}, function($ctx1) {$ctx1.fill(self,"bindKeyDown:keyUp:",{keyDownBlock:keyDownBlock,keyUpBlock:keyUpBlock},globals.HLWidget)})},
  1325. args: ["keyDownBlock", "keyUpBlock"],
  1326. source: "bindKeyDown: keyDownBlock keyUp: keyUpBlock\x0a\x09self wrapper asJQuery\x0a\x09\x09keydown: keyDownBlock;\x0a\x09\x09keyup: keyUpBlock",
  1327. messageSends: ["keydown:", "asJQuery", "wrapper", "keyup:"],
  1328. referencedClasses: []
  1329. }),
  1330. globals.HLWidget);
  1331. smalltalk.addMethod(
  1332. smalltalk.method({
  1333. selector: "canHaveFocus",
  1334. protocol: 'testing',
  1335. fn: function (){
  1336. var self=this;
  1337. return false;
  1338. },
  1339. args: [],
  1340. source: "canHaveFocus\x0a\x09^ false",
  1341. messageSends: [],
  1342. referencedClasses: []
  1343. }),
  1344. globals.HLWidget);
  1345. smalltalk.addMethod(
  1346. smalltalk.method({
  1347. selector: "confirm:ifTrue:",
  1348. protocol: 'actions',
  1349. fn: function (aString,aBlock){
  1350. var self=this;
  1351. return smalltalk.withContext(function($ctx1) {
  1352. _st(self._manager())._confirm_ifTrue_(aString,aBlock);
  1353. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},globals.HLWidget)})},
  1354. args: ["aString", "aBlock"],
  1355. source: "confirm: aString ifTrue: aBlock\x0a\x09self manager confirm: aString ifTrue: aBlock",
  1356. messageSends: ["confirm:ifTrue:", "manager"],
  1357. referencedClasses: []
  1358. }),
  1359. globals.HLWidget);
  1360. smalltalk.addMethod(
  1361. smalltalk.method({
  1362. selector: "confirm:ifTrue:ifFalse:",
  1363. protocol: 'actions',
  1364. fn: function (aString,aBlock,anotherBlock){
  1365. var self=this;
  1366. return smalltalk.withContext(function($ctx1) {
  1367. _st(self._manager())._confirm_ifTrue_ifFalse_(aString,aBlock,anotherBlock);
  1368. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:ifFalse:",{aString:aString,aBlock:aBlock,anotherBlock:anotherBlock},globals.HLWidget)})},
  1369. args: ["aString", "aBlock", "anotherBlock"],
  1370. source: "confirm: aString ifTrue: aBlock ifFalse: anotherBlock\x0a\x09self manager \x0a\x09\x09confirm: aString \x0a\x09\x09ifTrue: aBlock\x0a\x09\x09ifFalse: anotherBlock",
  1371. messageSends: ["confirm:ifTrue:ifFalse:", "manager"],
  1372. referencedClasses: []
  1373. }),
  1374. globals.HLWidget);
  1375. smalltalk.addMethod(
  1376. smalltalk.method({
  1377. selector: "cssClass",
  1378. protocol: 'accessing',
  1379. fn: function (){
  1380. var self=this;
  1381. return "hl_widget";
  1382. },
  1383. args: [],
  1384. source: "cssClass\x0a\x09^ 'hl_widget'",
  1385. messageSends: [],
  1386. referencedClasses: []
  1387. }),
  1388. globals.HLWidget);
  1389. smalltalk.addMethod(
  1390. smalltalk.method({
  1391. selector: "defaultTabLabel",
  1392. protocol: 'defaults',
  1393. fn: function (){
  1394. var self=this;
  1395. return smalltalk.withContext(function($ctx1) {
  1396. var $1;
  1397. $1=_st(self._class())._tabLabel();
  1398. return $1;
  1399. }, function($ctx1) {$ctx1.fill(self,"defaultTabLabel",{},globals.HLWidget)})},
  1400. args: [],
  1401. source: "defaultTabLabel\x0a\x09^ self class tabLabel",
  1402. messageSends: ["tabLabel", "class"],
  1403. referencedClasses: []
  1404. }),
  1405. globals.HLWidget);
  1406. smalltalk.addMethod(
  1407. smalltalk.method({
  1408. selector: "execute:",
  1409. protocol: 'actions',
  1410. fn: function (aCommand){
  1411. var self=this;
  1412. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1413. return smalltalk.withContext(function($ctx1) {
  1414. var $1,$2;
  1415. $1=_st(_st($HLManager())._current())._keyBinder();
  1416. _st($1)._activate();
  1417. $2=_st($1)._applyBinding_(_st(aCommand)._asBinding());
  1418. return self}, function($ctx1) {$ctx1.fill(self,"execute:",{aCommand:aCommand},globals.HLWidget)})},
  1419. args: ["aCommand"],
  1420. source: "execute: aCommand\x0a\x09HLManager current keyBinder\x0a\x09\x09activate;\x0a\x09\x09applyBinding: aCommand asBinding",
  1421. messageSends: ["activate", "keyBinder", "current", "applyBinding:", "asBinding"],
  1422. referencedClasses: ["HLManager"]
  1423. }),
  1424. globals.HLWidget);
  1425. smalltalk.addMethod(
  1426. smalltalk.method({
  1427. selector: "inform:",
  1428. protocol: 'actions',
  1429. fn: function (aString){
  1430. var self=this;
  1431. return smalltalk.withContext(function($ctx1) {
  1432. _st(self._manager())._inform_(aString);
  1433. return self}, function($ctx1) {$ctx1.fill(self,"inform:",{aString:aString},globals.HLWidget)})},
  1434. args: ["aString"],
  1435. source: "inform: aString\x0a\x09self manager inform: aString",
  1436. messageSends: ["inform:", "manager"],
  1437. referencedClasses: []
  1438. }),
  1439. globals.HLWidget);
  1440. smalltalk.addMethod(
  1441. smalltalk.method({
  1442. selector: "manager",
  1443. protocol: 'accessing',
  1444. fn: function (){
  1445. var self=this;
  1446. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1447. return smalltalk.withContext(function($ctx1) {
  1448. var $1;
  1449. $1=_st($HLManager())._current();
  1450. return $1;
  1451. }, function($ctx1) {$ctx1.fill(self,"manager",{},globals.HLWidget)})},
  1452. args: [],
  1453. source: "manager\x0a\x09^ HLManager current",
  1454. messageSends: ["current"],
  1455. referencedClasses: ["HLManager"]
  1456. }),
  1457. globals.HLWidget);
  1458. smalltalk.addMethod(
  1459. smalltalk.method({
  1460. selector: "openAsTab",
  1461. protocol: 'actions',
  1462. fn: function (){
  1463. var self=this;
  1464. function $HLTabWidget(){return globals.HLTabWidget||(typeof HLTabWidget=="undefined"?nil:HLTabWidget)}
  1465. return smalltalk.withContext(function($ctx1) {
  1466. _st(_st($HLTabWidget())._on_labelled_(self,self._defaultTabLabel()))._add();
  1467. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{},globals.HLWidget)})},
  1468. args: [],
  1469. source: "openAsTab\x0a\x09(HLTabWidget on: self labelled: self defaultTabLabel)\x0a\x09\x09add",
  1470. messageSends: ["add", "on:labelled:", "defaultTabLabel"],
  1471. referencedClasses: ["HLTabWidget"]
  1472. }),
  1473. globals.HLWidget);
  1474. smalltalk.addMethod(
  1475. smalltalk.method({
  1476. selector: "refresh",
  1477. protocol: 'updating',
  1478. fn: function (){
  1479. var self=this;
  1480. return smalltalk.withContext(function($ctx1) {
  1481. var $1,$3,$2,$receiver;
  1482. $1=self._wrapper();
  1483. $ctx1.sendIdx["wrapper"]=1;
  1484. if(($receiver = $1) == null || $receiver.isNil){
  1485. return self;
  1486. } else {
  1487. $1;
  1488. };
  1489. $3=self._wrapper();
  1490. $ctx1.sendIdx["wrapper"]=2;
  1491. $2=_st($3)._asJQuery();
  1492. $ctx1.sendIdx["asJQuery"]=1;
  1493. _st($2)._empty();
  1494. _st((function(html){
  1495. return smalltalk.withContext(function($ctx2) {
  1496. return self._renderContentOn_(html);
  1497. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,2)})}))._appendToJQuery_(_st(self._wrapper())._asJQuery());
  1498. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},globals.HLWidget)})},
  1499. args: [],
  1500. source: "refresh\x0a\x09self wrapper ifNil: [ ^ self ].\x0a \x0a\x09self wrapper asJQuery empty.\x0a [ :html | self renderContentOn: html ] appendToJQuery: self wrapper asJQuery",
  1501. messageSends: ["ifNil:", "wrapper", "empty", "asJQuery", "appendToJQuery:", "renderContentOn:"],
  1502. referencedClasses: []
  1503. }),
  1504. globals.HLWidget);
  1505. smalltalk.addMethod(
  1506. smalltalk.method({
  1507. selector: "registerBindings",
  1508. protocol: 'keybindings',
  1509. fn: function (){
  1510. var self=this;
  1511. return smalltalk.withContext(function($ctx1) {
  1512. self._registerBindingsOn_(_st(_st(self._manager())._keyBinder())._bindings());
  1513. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},globals.HLWidget)})},
  1514. args: [],
  1515. source: "registerBindings\x0a\x09self registerBindingsOn: self manager keyBinder bindings",
  1516. messageSends: ["registerBindingsOn:", "bindings", "keyBinder", "manager"],
  1517. referencedClasses: []
  1518. }),
  1519. globals.HLWidget);
  1520. smalltalk.addMethod(
  1521. smalltalk.method({
  1522. selector: "registerBindingsOn:",
  1523. protocol: 'keybindings',
  1524. fn: function (aBindingGroup){
  1525. var self=this;
  1526. return self},
  1527. args: ["aBindingGroup"],
  1528. source: "registerBindingsOn: aBindingGroup",
  1529. messageSends: [],
  1530. referencedClasses: []
  1531. }),
  1532. globals.HLWidget);
  1533. smalltalk.addMethod(
  1534. smalltalk.method({
  1535. selector: "removeTab",
  1536. protocol: 'accessing',
  1537. fn: function (){
  1538. var self=this;
  1539. return smalltalk.withContext(function($ctx1) {
  1540. _st(self._manager())._removeTabForWidget_(self);
  1541. return self}, function($ctx1) {$ctx1.fill(self,"removeTab",{},globals.HLWidget)})},
  1542. args: [],
  1543. source: "removeTab\x0a\x09self manager removeTabForWidget: self",
  1544. messageSends: ["removeTabForWidget:", "manager"],
  1545. referencedClasses: []
  1546. }),
  1547. globals.HLWidget);
  1548. smalltalk.addMethod(
  1549. smalltalk.method({
  1550. selector: "renderContentOn:",
  1551. protocol: 'rendering',
  1552. fn: function (html){
  1553. var self=this;
  1554. return self},
  1555. args: ["html"],
  1556. source: "renderContentOn: html",
  1557. messageSends: [],
  1558. referencedClasses: []
  1559. }),
  1560. globals.HLWidget);
  1561. smalltalk.addMethod(
  1562. smalltalk.method({
  1563. selector: "renderOn:",
  1564. protocol: 'rendering',
  1565. fn: function (html){
  1566. var self=this;
  1567. return smalltalk.withContext(function($ctx1) {
  1568. var $1,$2;
  1569. $1=_st(html)._div();
  1570. _st($1)._class_(self._cssClass());
  1571. $2=_st($1)._yourself();
  1572. self["@wrapper"]=$2;
  1573. _st((function(renderer){
  1574. return smalltalk.withContext(function($ctx2) {
  1575. return self._renderContentOn_(renderer);
  1576. }, function($ctx2) {$ctx2.fillBlock({renderer:renderer},$ctx1,1)})}))._appendToJQuery_(_st(self["@wrapper"])._asJQuery());
  1577. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},globals.HLWidget)})},
  1578. args: ["html"],
  1579. source: "renderOn: html\x0a\x09wrapper := html div\x0a\x09\x09class: self cssClass;\x0a\x09\x09yourself.\x0a [ :renderer | self renderContentOn: renderer ] appendToJQuery: wrapper asJQuery",
  1580. messageSends: ["class:", "div", "cssClass", "yourself", "appendToJQuery:", "renderContentOn:", "asJQuery"],
  1581. referencedClasses: []
  1582. }),
  1583. globals.HLWidget);
  1584. smalltalk.addMethod(
  1585. smalltalk.method({
  1586. selector: "request:do:",
  1587. protocol: 'actions',
  1588. fn: function (aString,aBlock){
  1589. var self=this;
  1590. return smalltalk.withContext(function($ctx1) {
  1591. _st(self._manager())._request_do_(aString,aBlock);
  1592. return self}, function($ctx1) {$ctx1.fill(self,"request:do:",{aString:aString,aBlock:aBlock},globals.HLWidget)})},
  1593. args: ["aString", "aBlock"],
  1594. source: "request: aString do: aBlock\x0a\x09self manager request: aString do: aBlock",
  1595. messageSends: ["request:do:", "manager"],
  1596. referencedClasses: []
  1597. }),
  1598. globals.HLWidget);
  1599. smalltalk.addMethod(
  1600. smalltalk.method({
  1601. selector: "request:value:do:",
  1602. protocol: 'actions',
  1603. fn: function (aString,valueString,aBlock){
  1604. var self=this;
  1605. return smalltalk.withContext(function($ctx1) {
  1606. _st(self._manager())._request_value_do_(aString,valueString,aBlock);
  1607. return self}, function($ctx1) {$ctx1.fill(self,"request:value:do:",{aString:aString,valueString:valueString,aBlock:aBlock},globals.HLWidget)})},
  1608. args: ["aString", "valueString", "aBlock"],
  1609. source: "request: aString value: valueString do: aBlock\x0a\x09self manager \x0a\x09\x09request: aString \x0a\x09\x09value: valueString\x0a\x09\x09do: aBlock",
  1610. messageSends: ["request:value:do:", "manager"],
  1611. referencedClasses: []
  1612. }),
  1613. globals.HLWidget);
  1614. smalltalk.addMethod(
  1615. smalltalk.method({
  1616. selector: "setTabLabel:",
  1617. protocol: 'accessing',
  1618. fn: function (aString){
  1619. var self=this;
  1620. function $HLTabLabelChanged(){return globals.HLTabLabelChanged||(typeof HLTabLabelChanged=="undefined"?nil:HLTabLabelChanged)}
  1621. return smalltalk.withContext(function($ctx1) {
  1622. var $1,$2;
  1623. $1=_st($HLTabLabelChanged())._new();
  1624. _st($1)._widget_(self);
  1625. _st($1)._label_(aString);
  1626. $2=_st($1)._yourself();
  1627. _st(_st(self._manager())._announcer())._announce_($2);
  1628. return self}, function($ctx1) {$ctx1.fill(self,"setTabLabel:",{aString:aString},globals.HLWidget)})},
  1629. args: ["aString"],
  1630. source: "setTabLabel: aString\x0a\x09self manager announcer announce: (HLTabLabelChanged new\x0a\x09\x09widget: self;\x0a\x09\x09label: aString;\x0a\x09\x09yourself)",
  1631. messageSends: ["announce:", "announcer", "manager", "widget:", "new", "label:", "yourself"],
  1632. referencedClasses: ["HLTabLabelChanged"]
  1633. }),
  1634. globals.HLWidget);
  1635. smalltalk.addMethod(
  1636. smalltalk.method({
  1637. selector: "tabClass",
  1638. protocol: 'accessing',
  1639. fn: function (){
  1640. var self=this;
  1641. return smalltalk.withContext(function($ctx1) {
  1642. var $1;
  1643. $1=_st(self._class())._tabClass();
  1644. return $1;
  1645. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},globals.HLWidget)})},
  1646. args: [],
  1647. source: "tabClass\x0a\x09^ self class tabClass",
  1648. messageSends: ["tabClass", "class"],
  1649. referencedClasses: []
  1650. }),
  1651. globals.HLWidget);
  1652. smalltalk.addMethod(
  1653. smalltalk.method({
  1654. selector: "unbindKeyDownKeyUp",
  1655. protocol: 'keybindings',
  1656. fn: function (){
  1657. var self=this;
  1658. return smalltalk.withContext(function($ctx1) {
  1659. var $1,$2;
  1660. $1=_st(self._wrapper())._asJQuery();
  1661. _st($1)._unbind_("keydown");
  1662. $ctx1.sendIdx["unbind:"]=1;
  1663. $2=_st($1)._unbind_("keyup");
  1664. return self}, function($ctx1) {$ctx1.fill(self,"unbindKeyDownKeyUp",{},globals.HLWidget)})},
  1665. args: [],
  1666. source: "unbindKeyDownKeyUp\x0a\x09self wrapper asJQuery\x0a\x09\x09unbind: 'keydown';\x0a\x09\x09unbind: 'keyup'",
  1667. messageSends: ["unbind:", "asJQuery", "wrapper"],
  1668. referencedClasses: []
  1669. }),
  1670. globals.HLWidget);
  1671. smalltalk.addMethod(
  1672. smalltalk.method({
  1673. selector: "unregister",
  1674. protocol: 'actions',
  1675. fn: function (){
  1676. var self=this;
  1677. return self},
  1678. args: [],
  1679. 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",
  1680. messageSends: [],
  1681. referencedClasses: []
  1682. }),
  1683. globals.HLWidget);
  1684. smalltalk.addMethod(
  1685. smalltalk.method({
  1686. selector: "wrapper",
  1687. protocol: 'accessing',
  1688. fn: function (){
  1689. var self=this;
  1690. var $1;
  1691. $1=self["@wrapper"];
  1692. return $1;
  1693. },
  1694. args: [],
  1695. source: "wrapper\x0a\x09^ wrapper",
  1696. messageSends: [],
  1697. referencedClasses: []
  1698. }),
  1699. globals.HLWidget);
  1700. smalltalk.addMethod(
  1701. smalltalk.method({
  1702. selector: "canBeOpenAsTab",
  1703. protocol: 'testing',
  1704. fn: function (){
  1705. var self=this;
  1706. return false;
  1707. },
  1708. args: [],
  1709. source: "canBeOpenAsTab\x0a\x09^ false",
  1710. messageSends: [],
  1711. referencedClasses: []
  1712. }),
  1713. globals.HLWidget.klass);
  1714. smalltalk.addMethod(
  1715. smalltalk.method({
  1716. selector: "openAsTab",
  1717. protocol: 'accessing',
  1718. fn: function (){
  1719. var self=this;
  1720. var instance;
  1721. function $HLTabWidget(){return globals.HLTabWidget||(typeof HLTabWidget=="undefined"?nil:HLTabWidget)}
  1722. return smalltalk.withContext(function($ctx1) {
  1723. var $1;
  1724. instance=self._new();
  1725. _st(_st($HLTabWidget())._on_labelled_(instance,_st(instance)._defaultTabLabel()))._add();
  1726. $1=instance;
  1727. return $1;
  1728. }, function($ctx1) {$ctx1.fill(self,"openAsTab",{instance:instance},globals.HLWidget.klass)})},
  1729. args: [],
  1730. source: "openAsTab\x0a\x09| instance |\x0a\x09\x0a\x09instance := self new.\x0a\x09(HLTabWidget \x0a\x09\x09on: instance \x0a\x09\x09labelled: instance defaultTabLabel) add.\x0a\x09^ instance",
  1731. messageSends: ["new", "add", "on:labelled:", "defaultTabLabel"],
  1732. referencedClasses: ["HLTabWidget"]
  1733. }),
  1734. globals.HLWidget.klass);
  1735. smalltalk.addMethod(
  1736. smalltalk.method({
  1737. selector: "tabClass",
  1738. protocol: 'accessing',
  1739. fn: function (){
  1740. var self=this;
  1741. return "";
  1742. },
  1743. args: [],
  1744. source: "tabClass\x0a\x09^ ''",
  1745. messageSends: [],
  1746. referencedClasses: []
  1747. }),
  1748. globals.HLWidget.klass);
  1749. smalltalk.addMethod(
  1750. smalltalk.method({
  1751. selector: "tabLabel",
  1752. protocol: 'accessing',
  1753. fn: function (){
  1754. var self=this;
  1755. return "Tab";
  1756. },
  1757. args: [],
  1758. source: "tabLabel\x0a\x09^ 'Tab'",
  1759. messageSends: [],
  1760. referencedClasses: []
  1761. }),
  1762. globals.HLWidget.klass);
  1763. smalltalk.addMethod(
  1764. smalltalk.method({
  1765. selector: "tabPriority",
  1766. protocol: 'accessing',
  1767. fn: function (){
  1768. var self=this;
  1769. return (500);
  1770. },
  1771. args: [],
  1772. source: "tabPriority\x0a\x09^ 500",
  1773. messageSends: [],
  1774. referencedClasses: []
  1775. }),
  1776. globals.HLWidget.klass);
  1777. smalltalk.addClass('HLFocusableWidget', globals.HLWidget, [], 'Helios-Core');
  1778. globals.HLFocusableWidget.comment="I am a widget that can be focused.\x0a\x0a## API \x0a\x0aInstead of overriding `#renderOn:` as with other `Widget` subclasses, my subclasses should override `#renderContentOn:`.\x0a\x0aTo bring the focus to the widget, use the `#focus` method.";
  1779. smalltalk.addMethod(
  1780. smalltalk.method({
  1781. selector: "blur",
  1782. protocol: 'events',
  1783. fn: function (){
  1784. var self=this;
  1785. return smalltalk.withContext(function($ctx1) {
  1786. _st(_st(self._wrapper())._asJQuery())._blur();
  1787. return self}, function($ctx1) {$ctx1.fill(self,"blur",{},globals.HLFocusableWidget)})},
  1788. args: [],
  1789. source: "blur\x0a\x09self wrapper asJQuery blur",
  1790. messageSends: ["blur", "asJQuery", "wrapper"],
  1791. referencedClasses: []
  1792. }),
  1793. globals.HLFocusableWidget);
  1794. smalltalk.addMethod(
  1795. smalltalk.method({
  1796. selector: "canHaveFocus",
  1797. protocol: 'testing',
  1798. fn: function (){
  1799. var self=this;
  1800. return true;
  1801. },
  1802. args: [],
  1803. source: "canHaveFocus\x0a\x09^ true",
  1804. messageSends: [],
  1805. referencedClasses: []
  1806. }),
  1807. globals.HLFocusableWidget);
  1808. smalltalk.addMethod(
  1809. smalltalk.method({
  1810. selector: "focus",
  1811. protocol: 'events',
  1812. fn: function (){
  1813. var self=this;
  1814. return smalltalk.withContext(function($ctx1) {
  1815. _st(_st(self._wrapper())._asJQuery())._focus();
  1816. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLFocusableWidget)})},
  1817. args: [],
  1818. source: "focus\x0a\x09self wrapper asJQuery focus",
  1819. messageSends: ["focus", "asJQuery", "wrapper"],
  1820. referencedClasses: []
  1821. }),
  1822. globals.HLFocusableWidget);
  1823. smalltalk.addMethod(
  1824. smalltalk.method({
  1825. selector: "focusClass",
  1826. protocol: 'accessing',
  1827. fn: function (){
  1828. var self=this;
  1829. return "focused";
  1830. },
  1831. args: [],
  1832. source: "focusClass\x0a\x09^ 'focused'",
  1833. messageSends: [],
  1834. referencedClasses: []
  1835. }),
  1836. globals.HLFocusableWidget);
  1837. smalltalk.addMethod(
  1838. smalltalk.method({
  1839. selector: "hasFocus",
  1840. protocol: 'testing',
  1841. fn: function (){
  1842. var self=this;
  1843. return smalltalk.withContext(function($ctx1) {
  1844. var $3,$2,$1;
  1845. $3=self._wrapper();
  1846. $ctx1.sendIdx["wrapper"]=1;
  1847. $2=_st($3)._notNil();
  1848. $1=_st($2)._and_((function(){
  1849. return smalltalk.withContext(function($ctx2) {
  1850. return _st(_st(self._wrapper())._asJQuery())._hasClass_(self._focusClass());
  1851. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1852. return $1;
  1853. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},globals.HLFocusableWidget)})},
  1854. args: [],
  1855. source: "hasFocus\x0a\x09^ self wrapper notNil and: [ self wrapper asJQuery hasClass: self focusClass ]",
  1856. messageSends: ["and:", "notNil", "wrapper", "hasClass:", "asJQuery", "focusClass"],
  1857. referencedClasses: []
  1858. }),
  1859. globals.HLFocusableWidget);
  1860. smalltalk.addMethod(
  1861. smalltalk.method({
  1862. selector: "renderContentOn:",
  1863. protocol: 'rendering',
  1864. fn: function (html){
  1865. var self=this;
  1866. return self},
  1867. args: ["html"],
  1868. source: "renderContentOn: html",
  1869. messageSends: [],
  1870. referencedClasses: []
  1871. }),
  1872. globals.HLFocusableWidget);
  1873. smalltalk.addMethod(
  1874. smalltalk.method({
  1875. selector: "renderOn:",
  1876. protocol: 'rendering',
  1877. fn: function (html){
  1878. var self=this;
  1879. return smalltalk.withContext(function($ctx1) {
  1880. var $1,$2,$3,$5,$4,$6,$7;
  1881. $1=_st(html)._div();
  1882. _st($1)._class_(self._cssClass());
  1883. $2=_st($1)._yourself();
  1884. self["@wrapper"]=$2;
  1885. _st(self["@wrapper"])._with_((function(){
  1886. return smalltalk.withContext(function($ctx2) {
  1887. return self._renderContentOn_(html);
  1888. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1889. $3=self["@wrapper"];
  1890. _st($3)._at_put_("tabindex","0");
  1891. _st($3)._onBlur_((function(){
  1892. return smalltalk.withContext(function($ctx2) {
  1893. $5=self._wrapper();
  1894. $ctx2.sendIdx["wrapper"]=1;
  1895. $4=_st($5)._asJQuery();
  1896. $ctx2.sendIdx["asJQuery"]=1;
  1897. $6=self._focusClass();
  1898. $ctx2.sendIdx["focusClass"]=1;
  1899. return _st($4)._removeClass_($6);
  1900. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1901. $7=_st($3)._onFocus_((function(){
  1902. return smalltalk.withContext(function($ctx2) {
  1903. return _st(_st(self._wrapper())._asJQuery())._addClass_(self._focusClass());
  1904. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  1905. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},globals.HLFocusableWidget)})},
  1906. args: ["html"],
  1907. source: "renderOn: html\x0a wrapper := html div \x0a \x09class: self cssClass;\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 ]",
  1908. messageSends: ["class:", "div", "cssClass", "yourself", "with:", "renderContentOn:", "at:put:", "onBlur:", "removeClass:", "asJQuery", "wrapper", "focusClass", "onFocus:", "addClass:"],
  1909. referencedClasses: []
  1910. }),
  1911. globals.HLFocusableWidget);
  1912. smalltalk.addClass('HLListWidget', globals.HLFocusableWidget, ['items', 'selectedItem'], 'Helios-Core');
  1913. smalltalk.addMethod(
  1914. smalltalk.method({
  1915. selector: "activateFirstListItem",
  1916. protocol: 'actions',
  1917. fn: function (){
  1918. var self=this;
  1919. return smalltalk.withContext(function($ctx1) {
  1920. self._activateListItem_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li.inactive"))._eq_((0)));
  1921. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{},globals.HLListWidget)})},
  1922. args: [],
  1923. source: "activateFirstListItem\x0a\x09self activateListItem: ((wrapper asJQuery find: 'li.inactive') eq: 0)",
  1924. messageSends: ["activateListItem:", "eq:", "find:", "asJQuery"],
  1925. referencedClasses: []
  1926. }),
  1927. globals.HLListWidget);
  1928. smalltalk.addMethod(
  1929. smalltalk.method({
  1930. selector: "activateItem:",
  1931. protocol: 'actions',
  1932. fn: function (anObject){
  1933. var self=this;
  1934. return smalltalk.withContext(function($ctx1) {
  1935. self._activateListItem_(self._findListItemFor_(anObject));
  1936. return self}, function($ctx1) {$ctx1.fill(self,"activateItem:",{anObject:anObject},globals.HLListWidget)})},
  1937. args: ["anObject"],
  1938. source: "activateItem: anObject\x0a\x09self activateListItem: (self findListItemFor: anObject)",
  1939. messageSends: ["activateListItem:", "findListItemFor:"],
  1940. referencedClasses: []
  1941. }),
  1942. globals.HLListWidget);
  1943. smalltalk.addMethod(
  1944. smalltalk.method({
  1945. selector: "activateListItem:",
  1946. protocol: 'actions',
  1947. fn: function (aListItem){
  1948. var self=this;
  1949. var item;
  1950. return smalltalk.withContext(function($ctx1) {
  1951. var $1,$2,$3,$4,$receiver;
  1952. $1=_st(aListItem)._get_((0));
  1953. if(($receiver = $1) == null || $receiver.isNil){
  1954. return self;
  1955. } else {
  1956. $1;
  1957. };
  1958. $2=_st(_st(aListItem)._parent())._children();
  1959. $3=self._activeItemCssClass();
  1960. $ctx1.sendIdx["activeItemCssClass"]=1;
  1961. _st($2)._removeClass_($3);
  1962. _st(aListItem)._addClass_(self._activeItemCssClass());
  1963. self._ensureVisible_(aListItem);
  1964. item=_st(aListItem)._data_("item");
  1965. $4=_st(self._selectedItem()).__eq_eq(item);
  1966. if(! smalltalk.assert($4)){
  1967. self._selectItem_(item);
  1968. };
  1969. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,item:item},globals.HLListWidget)})},
  1970. args: ["aListItem"],
  1971. source: "activateListItem: aListItem\x0a\x09| item |\x0a\x09\x0a\x09(aListItem get: 0) ifNil: [ ^ self ].\x0a\x09aListItem parent children removeClass: self activeItemCssClass.\x0a\x09aListItem addClass: self activeItemCssClass.\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 ]",
  1972. messageSends: ["ifNil:", "get:", "removeClass:", "children", "parent", "activeItemCssClass", "addClass:", "ensureVisible:", "data:", "ifFalse:", "==", "selectedItem", "selectItem:"],
  1973. referencedClasses: []
  1974. }),
  1975. globals.HLListWidget);
  1976. smalltalk.addMethod(
  1977. smalltalk.method({
  1978. selector: "activateNextListItem",
  1979. protocol: 'actions',
  1980. fn: function (){
  1981. var self=this;
  1982. return smalltalk.withContext(function($ctx1) {
  1983. var $4,$3,$6,$5,$2,$1;
  1984. $4=self._wrapper();
  1985. $ctx1.sendIdx["wrapper"]=1;
  1986. $3=_st($4)._asJQuery();
  1987. $ctx1.sendIdx["asJQuery"]=1;
  1988. $6=self._activeItemCssClass();
  1989. $ctx1.sendIdx["activeItemCssClass"]=1;
  1990. $5="li.".__comma($6);
  1991. $ctx1.sendIdx[","]=1;
  1992. $2=_st($3)._find_($5);
  1993. $ctx1.sendIdx["find:"]=1;
  1994. $1=_st($2)._next();
  1995. self._activateListItem_($1);
  1996. _st(_st(_st(_st(self._wrapper())._asJQuery())._find_(" .".__comma(self._activeItemCssClass())))._get())._ifEmpty_((function(){
  1997. return smalltalk.withContext(function($ctx2) {
  1998. return self._activateFirstListItem();
  1999. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2000. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},globals.HLListWidget)})},
  2001. args: [],
  2002. source: "activateNextListItem\x0a\x09self activateListItem: (self wrapper asJQuery find: ('li.', self activeItemCssClass)) next.\x0a\x09\x0a\x09\x22select the first item if none is selected\x22\x0a\x09(self wrapper asJQuery find: (' .', self activeItemCssClass)) get ifEmpty: [\x0a\x09\x09self activateFirstListItem ]",
  2003. messageSends: ["activateListItem:", "next", "find:", "asJQuery", "wrapper", ",", "activeItemCssClass", "ifEmpty:", "get", "activateFirstListItem"],
  2004. referencedClasses: []
  2005. }),
  2006. globals.HLListWidget);
  2007. smalltalk.addMethod(
  2008. smalltalk.method({
  2009. selector: "activatePreviousListItem",
  2010. protocol: 'actions',
  2011. fn: function (){
  2012. var self=this;
  2013. return smalltalk.withContext(function($ctx1) {
  2014. self._activateListItem_(_st(_st(_st(self._wrapper())._asJQuery())._find_("li.".__comma(self._activeItemCssClass())))._prev());
  2015. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},globals.HLListWidget)})},
  2016. args: [],
  2017. source: "activatePreviousListItem\x0a\x09self activateListItem: (self wrapper asJQuery find: ('li.', self activeItemCssClass)) prev",
  2018. messageSends: ["activateListItem:", "prev", "find:", "asJQuery", "wrapper", ",", "activeItemCssClass"],
  2019. referencedClasses: []
  2020. }),
  2021. globals.HLListWidget);
  2022. smalltalk.addMethod(
  2023. smalltalk.method({
  2024. selector: "activeItemCssClass",
  2025. protocol: 'accessing',
  2026. fn: function (){
  2027. var self=this;
  2028. return "active";
  2029. },
  2030. args: [],
  2031. source: "activeItemCssClass\x0a\x09^'active'",
  2032. messageSends: [],
  2033. referencedClasses: []
  2034. }),
  2035. globals.HLListWidget);
  2036. smalltalk.addMethod(
  2037. smalltalk.method({
  2038. selector: "buttonsDivCssClass",
  2039. protocol: 'accessing',
  2040. fn: function (){
  2041. var self=this;
  2042. return "pane_actions form-actions";
  2043. },
  2044. args: [],
  2045. source: "buttonsDivCssClass\x0a\x09^ 'pane_actions form-actions'",
  2046. messageSends: [],
  2047. referencedClasses: []
  2048. }),
  2049. globals.HLListWidget);
  2050. smalltalk.addMethod(
  2051. smalltalk.method({
  2052. selector: "cssClassForItem:",
  2053. protocol: 'accessing',
  2054. fn: function (anObject){
  2055. var self=this;
  2056. return "";
  2057. },
  2058. args: ["anObject"],
  2059. source: "cssClassForItem: anObject\x0a\x09^ ''",
  2060. messageSends: [],
  2061. referencedClasses: []
  2062. }),
  2063. globals.HLListWidget);
  2064. smalltalk.addMethod(
  2065. smalltalk.method({
  2066. selector: "defaultItems",
  2067. protocol: 'defaults',
  2068. fn: function (){
  2069. var self=this;
  2070. var $1;
  2071. $1=[];
  2072. return $1;
  2073. },
  2074. args: [],
  2075. source: "defaultItems\x0a\x09^ #()",
  2076. messageSends: [],
  2077. referencedClasses: []
  2078. }),
  2079. globals.HLListWidget);
  2080. smalltalk.addMethod(
  2081. smalltalk.method({
  2082. selector: "ensureVisible:",
  2083. protocol: 'actions',
  2084. fn: function (aListItem){
  2085. var self=this;
  2086. var parent,position;
  2087. return smalltalk.withContext(function($ctx1) {
  2088. var $1,$4,$3,$2,$5,$9,$8,$11,$10,$7,$6,$15,$14,$16,$13,$17,$12,$18,$22,$23,$21,$20,$19,$receiver;
  2089. $1=_st(aListItem)._get_((0));
  2090. $ctx1.sendIdx["get:"]=1;
  2091. if(($receiver = $1) == null || $receiver.isNil){
  2092. return self;
  2093. } else {
  2094. $1;
  2095. };
  2096. position=self._positionOf_(aListItem);
  2097. parent=_st(aListItem)._parent();
  2098. $4=_st(aListItem)._position();
  2099. $ctx1.sendIdx["position"]=1;
  2100. $3=_st($4)._top();
  2101. $ctx1.sendIdx["top"]=1;
  2102. $2=_st($3).__lt((0));
  2103. if(smalltalk.assert($2)){
  2104. $5=_st(parent)._get_((0));
  2105. $ctx1.sendIdx["get:"]=2;
  2106. $9=_st(parent)._get_((0));
  2107. $ctx1.sendIdx["get:"]=3;
  2108. $8=_st($9)._scrollTop();
  2109. $ctx1.sendIdx["scrollTop"]=1;
  2110. $11=_st(aListItem)._position();
  2111. $ctx1.sendIdx["position"]=2;
  2112. $10=_st($11)._top();
  2113. $ctx1.sendIdx["top"]=2;
  2114. $7=_st($8).__plus($10);
  2115. $ctx1.sendIdx["+"]=1;
  2116. $6=_st($7).__minus((10));
  2117. $ctx1.sendIdx["-"]=1;
  2118. _st($5)._scrollTop_($6);
  2119. $ctx1.sendIdx["scrollTop:"]=1;
  2120. };
  2121. $15=_st(aListItem)._position();
  2122. $ctx1.sendIdx["position"]=3;
  2123. $14=_st($15)._top();
  2124. $ctx1.sendIdx["top"]=3;
  2125. $16=_st(aListItem)._height();
  2126. $ctx1.sendIdx["height"]=1;
  2127. $13=_st($14).__plus($16);
  2128. $ctx1.sendIdx["+"]=2;
  2129. $17=_st(parent)._height();
  2130. $ctx1.sendIdx["height"]=2;
  2131. $12=_st($13).__gt($17);
  2132. if(smalltalk.assert($12)){
  2133. $18=_st(parent)._get_((0));
  2134. $ctx1.sendIdx["get:"]=4;
  2135. $22=_st(_st(parent)._get_((0)))._scrollTop();
  2136. $23=_st(aListItem)._height();
  2137. $ctx1.sendIdx["height"]=3;
  2138. $21=_st($22).__plus($23);
  2139. $20=_st($21).__minus(_st(_st(parent)._height()).__minus(_st(_st(aListItem)._position())._top()));
  2140. $ctx1.sendIdx["-"]=2;
  2141. $19=_st($20).__plus((10));
  2142. $ctx1.sendIdx["+"]=3;
  2143. _st($18)._scrollTop_($19);
  2144. };
  2145. return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,parent:parent,position:position},globals.HLListWidget)})},
  2146. args: ["aListItem"],
  2147. 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 ]",
  2148. messageSends: ["ifNil:", "get:", "positionOf:", "parent", "ifTrue:", "<", "top", "position", "scrollTop:", "-", "+", "scrollTop", ">", "height"],
  2149. referencedClasses: []
  2150. }),
  2151. globals.HLListWidget);
  2152. smalltalk.addMethod(
  2153. smalltalk.method({
  2154. selector: "findListItemFor:",
  2155. protocol: 'accessing',
  2156. fn: function (anObject){
  2157. var self=this;
  2158. return smalltalk.withContext(function($ctx1) {
  2159. var $4,$3,$2,$1;
  2160. $4=_st(self["@wrapper"])._asJQuery();
  2161. $ctx1.sendIdx["asJQuery"]=1;
  2162. $3=_st($4)._find_("li");
  2163. $2=_st($3)._filter_(_st((function(thisArg,otherArg){
  2164. return smalltalk.withContext(function($ctx2) {
  2165. return _st(_st(_st(thisArg)._asJQuery())._data_("item")).__eq(anObject);
  2166. }, function($ctx2) {$ctx2.fillBlock({thisArg:thisArg,otherArg:otherArg},$ctx1,1)})}))._currySelf());
  2167. $1=_st($2)._eq_((0));
  2168. return $1;
  2169. }, function($ctx1) {$ctx1.fill(self,"findListItemFor:",{anObject:anObject},globals.HLListWidget)})},
  2170. args: ["anObject"],
  2171. source: "findListItemFor: anObject\x0a\x09^ (((wrapper asJQuery find: 'li') \x0a\x09\x09filter: [ :thisArg :otherArg | (thisArg asJQuery data: 'item') = anObject ] currySelf) eq: 0)",
  2172. messageSends: ["eq:", "filter:", "find:", "asJQuery", "currySelf", "=", "data:"],
  2173. referencedClasses: []
  2174. }),
  2175. globals.HLListWidget);
  2176. smalltalk.addMethod(
  2177. smalltalk.method({
  2178. selector: "focus",
  2179. protocol: 'actions',
  2180. fn: function (){
  2181. var self=this;
  2182. return smalltalk.withContext(function($ctx1) {
  2183. var $1,$2,$receiver;
  2184. ($ctx1.supercall = true, globals.HLListWidget.superclass.fn.prototype._focus.apply(_st(self), []));
  2185. $ctx1.supercall = false;
  2186. $1=_st(self._items())._isEmpty();
  2187. if(! smalltalk.assert($1)){
  2188. $2=self._selectedItem();
  2189. if(($receiver = $2) == null || $receiver.isNil){
  2190. self._activateFirstListItem();
  2191. } else {
  2192. $2;
  2193. };
  2194. };
  2195. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLListWidget)})},
  2196. args: [],
  2197. source: "focus\x0a\x09super focus.\x0a self items isEmpty ifFalse: [ \x0a\x09\x09self selectedItem ifNil: [ self activateFirstListItem ] ]",
  2198. messageSends: ["focus", "ifFalse:", "isEmpty", "items", "ifNil:", "selectedItem", "activateFirstListItem"],
  2199. referencedClasses: []
  2200. }),
  2201. globals.HLListWidget);
  2202. smalltalk.addMethod(
  2203. smalltalk.method({
  2204. selector: "items",
  2205. protocol: 'accessing',
  2206. fn: function (){
  2207. var self=this;
  2208. return smalltalk.withContext(function($ctx1) {
  2209. var $2,$1,$receiver;
  2210. $2=self["@items"];
  2211. if(($receiver = $2) == null || $receiver.isNil){
  2212. self["@items"]=self._defaultItems();
  2213. $1=self["@items"];
  2214. } else {
  2215. $1=$2;
  2216. };
  2217. return $1;
  2218. }, function($ctx1) {$ctx1.fill(self,"items",{},globals.HLListWidget)})},
  2219. args: [],
  2220. source: "items\x0a\x09^ items ifNil: [ items := self defaultItems ]",
  2221. messageSends: ["ifNil:", "defaultItems"],
  2222. referencedClasses: []
  2223. }),
  2224. globals.HLListWidget);
  2225. smalltalk.addMethod(
  2226. smalltalk.method({
  2227. selector: "items:",
  2228. protocol: 'accessing',
  2229. fn: function (aCollection){
  2230. var self=this;
  2231. self["@items"]=aCollection;
  2232. return self},
  2233. args: ["aCollection"],
  2234. source: "items: aCollection\x0a\x09items := aCollection",
  2235. messageSends: [],
  2236. referencedClasses: []
  2237. }),
  2238. globals.HLListWidget);
  2239. smalltalk.addMethod(
  2240. smalltalk.method({
  2241. selector: "listCssClass",
  2242. protocol: 'accessing',
  2243. fn: function (){
  2244. var self=this;
  2245. return "nav nav-pills nav-stacked";
  2246. },
  2247. args: [],
  2248. source: "listCssClass \x0a\x09^'nav nav-pills nav-stacked'",
  2249. messageSends: [],
  2250. referencedClasses: []
  2251. }),
  2252. globals.HLListWidget);
  2253. smalltalk.addMethod(
  2254. smalltalk.method({
  2255. selector: "listCssClassForItem:",
  2256. protocol: 'accessing',
  2257. fn: function (anObject){
  2258. var self=this;
  2259. return smalltalk.withContext(function($ctx1) {
  2260. var $2,$1;
  2261. $2=_st(self._selectedItem()).__eq(anObject);
  2262. if(smalltalk.assert($2)){
  2263. $1=self._activeItemCssClass();
  2264. } else {
  2265. $1="inactive";
  2266. };
  2267. return $1;
  2268. }, function($ctx1) {$ctx1.fill(self,"listCssClassForItem:",{anObject:anObject},globals.HLListWidget)})},
  2269. args: ["anObject"],
  2270. source: "listCssClassForItem: anObject\x0a\x09^ self selectedItem = anObject\x0a\x09\x09ifTrue: [ self activeItemCssClass ]\x0a\x09\x09ifFalse: [ 'inactive' ]",
  2271. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem", "activeItemCssClass"],
  2272. referencedClasses: []
  2273. }),
  2274. globals.HLListWidget);
  2275. smalltalk.addMethod(
  2276. smalltalk.method({
  2277. selector: "positionOf:",
  2278. protocol: 'accessing',
  2279. fn: function (aListItem){
  2280. var self=this;
  2281. return smalltalk.withContext(function($ctx1) {
  2282. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  2283. ;
  2284. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem},globals.HLListWidget)})},
  2285. args: ["aListItem"],
  2286. source: "positionOf: aListItem\x0a\x09<\x0a \x09return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1\x0a\x09>",
  2287. messageSends: [],
  2288. referencedClasses: []
  2289. }),
  2290. globals.HLListWidget);
  2291. smalltalk.addMethod(
  2292. smalltalk.method({
  2293. selector: "reactivateListItem:",
  2294. protocol: 'actions',
  2295. fn: function (aListItem){
  2296. var self=this;
  2297. return smalltalk.withContext(function($ctx1) {
  2298. self._activateListItem_(aListItem);
  2299. self._reselectItem_(self._selectedItem());
  2300. return self}, function($ctx1) {$ctx1.fill(self,"reactivateListItem:",{aListItem:aListItem},globals.HLListWidget)})},
  2301. args: ["aListItem"],
  2302. source: "reactivateListItem: aListItem\x0a\x09self activateListItem: aListItem.\x0a\x09self reselectItem: self selectedItem",
  2303. messageSends: ["activateListItem:", "reselectItem:", "selectedItem"],
  2304. referencedClasses: []
  2305. }),
  2306. globals.HLListWidget);
  2307. smalltalk.addMethod(
  2308. smalltalk.method({
  2309. selector: "refresh",
  2310. protocol: 'actions',
  2311. fn: function (){
  2312. var self=this;
  2313. return smalltalk.withContext(function($ctx1) {
  2314. var $1,$receiver;
  2315. ($ctx1.supercall = true, globals.HLListWidget.superclass.fn.prototype._refresh.apply(_st(self), []));
  2316. $ctx1.supercall = false;
  2317. $1=self._selectedItem();
  2318. $ctx1.sendIdx["selectedItem"]=1;
  2319. if(($receiver = $1) == null || $receiver.isNil){
  2320. $1;
  2321. } else {
  2322. self._ensureVisible_(self._findListItemFor_(self._selectedItem()));
  2323. };
  2324. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},globals.HLListWidget)})},
  2325. args: [],
  2326. source: "refresh\x0a\x09super refresh.\x0a\x09self selectedItem ifNotNil: [self ensureVisible: (self findListItemFor: self selectedItem)].",
  2327. messageSends: ["refresh", "ifNotNil:", "selectedItem", "ensureVisible:", "findListItemFor:"],
  2328. referencedClasses: []
  2329. }),
  2330. globals.HLListWidget);
  2331. smalltalk.addMethod(
  2332. smalltalk.method({
  2333. selector: "renderButtonsOn:",
  2334. protocol: 'rendering',
  2335. fn: function (html){
  2336. var self=this;
  2337. return self},
  2338. args: ["html"],
  2339. source: "renderButtonsOn: html",
  2340. messageSends: [],
  2341. referencedClasses: []
  2342. }),
  2343. globals.HLListWidget);
  2344. smalltalk.addMethod(
  2345. smalltalk.method({
  2346. selector: "renderContentOn:",
  2347. protocol: 'rendering',
  2348. fn: function (html){
  2349. var self=this;
  2350. return smalltalk.withContext(function($ctx1) {
  2351. var $1,$2,$3,$4;
  2352. $1=_st(html)._ul();
  2353. _st($1)._class_(self._listCssClass());
  2354. $ctx1.sendIdx["class:"]=1;
  2355. _st($1)._with_((function(){
  2356. return smalltalk.withContext(function($ctx2) {
  2357. return self._renderListOn_(html);
  2358. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2359. $ctx1.sendIdx["with:"]=1;
  2360. $2=_st($1)._onClick_((function(){
  2361. return smalltalk.withContext(function($ctx2) {
  2362. return self._focus();
  2363. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  2364. $3=_st(html)._div();
  2365. _st($3)._class_(self._buttonsDivCssClass());
  2366. $4=_st($3)._with_((function(){
  2367. return smalltalk.withContext(function($ctx2) {
  2368. return self._renderButtonsOn_(html);
  2369. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  2370. self._setupKeyBindings();
  2371. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLListWidget)})},
  2372. args: ["html"],
  2373. source: "renderContentOn: html\x0a\x09html ul \x0a \x09class: self listCssClass;\x0a with: [ self renderListOn: html ];\x0a\x09\x09onClick: [ self focus ].\x0a html div class: self buttonsDivCssClass; with: [\x0a \x09self renderButtonsOn: html ].\x0a \x0a self setupKeyBindings",
  2374. messageSends: ["class:", "ul", "listCssClass", "with:", "renderListOn:", "onClick:", "focus", "div", "buttonsDivCssClass", "renderButtonsOn:", "setupKeyBindings"],
  2375. referencedClasses: []
  2376. }),
  2377. globals.HLListWidget);
  2378. smalltalk.addMethod(
  2379. smalltalk.method({
  2380. selector: "renderItem:on:",
  2381. protocol: 'rendering',
  2382. fn: function (anObject,html){
  2383. var self=this;
  2384. var li;
  2385. return smalltalk.withContext(function($ctx1) {
  2386. var $1,$2,$4,$5,$3;
  2387. li=_st(html)._li();
  2388. $1=_st(li)._asJQuery();
  2389. $ctx1.sendIdx["asJQuery"]=1;
  2390. _st($1)._data_put_("item",anObject);
  2391. $2=li;
  2392. _st($2)._class_(self._listCssClassForItem_(anObject));
  2393. $ctx1.sendIdx["class:"]=1;
  2394. $3=_st($2)._with_((function(){
  2395. return smalltalk.withContext(function($ctx2) {
  2396. $4=_st(html)._a();
  2397. _st($4)._with_((function(){
  2398. return smalltalk.withContext(function($ctx3) {
  2399. _st(_st(html)._tag_("i"))._class_(self._cssClassForItem_(anObject));
  2400. return self._renderItemLabel_on_(anObject,html);
  2401. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  2402. $5=_st($4)._onClick_((function(){
  2403. return smalltalk.withContext(function($ctx3) {
  2404. return self._reactivateListItem_(_st(li)._asJQuery());
  2405. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  2406. return $5;
  2407. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2408. $ctx1.sendIdx["with:"]=1;
  2409. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},globals.HLListWidget)})},
  2410. args: ["anObject", "html"],
  2411. 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 reactivateListItem: li asJQuery ] ]",
  2412. messageSends: ["li", "data:put:", "asJQuery", "class:", "listCssClassForItem:", "with:", "a", "tag:", "cssClassForItem:", "renderItemLabel:on:", "onClick:", "reactivateListItem:"],
  2413. referencedClasses: []
  2414. }),
  2415. globals.HLListWidget);
  2416. smalltalk.addMethod(
  2417. smalltalk.method({
  2418. selector: "renderItemLabel:on:",
  2419. protocol: 'rendering',
  2420. fn: function (anObject,html){
  2421. var self=this;
  2422. return smalltalk.withContext(function($ctx1) {
  2423. _st(html)._with_(_st(anObject)._asString());
  2424. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html},globals.HLListWidget)})},
  2425. args: ["anObject", "html"],
  2426. source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject asString",
  2427. messageSends: ["with:", "asString"],
  2428. referencedClasses: []
  2429. }),
  2430. globals.HLListWidget);
  2431. smalltalk.addMethod(
  2432. smalltalk.method({
  2433. selector: "renderListOn:",
  2434. protocol: 'rendering',
  2435. fn: function (html){
  2436. var self=this;
  2437. return smalltalk.withContext(function($ctx1) {
  2438. _st(self._items())._do_((function(each){
  2439. return smalltalk.withContext(function($ctx2) {
  2440. return self._renderItem_on_(each,html);
  2441. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  2442. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html},globals.HLListWidget)})},
  2443. args: ["html"],
  2444. source: "renderListOn: html\x0a\x09self items do: [ :each | \x0a \x09self renderItem: each on: html ]",
  2445. messageSends: ["do:", "items", "renderItem:on:"],
  2446. referencedClasses: []
  2447. }),
  2448. globals.HLListWidget);
  2449. smalltalk.addMethod(
  2450. smalltalk.method({
  2451. selector: "reselectItem:",
  2452. protocol: 'actions',
  2453. fn: function (anObject){
  2454. var self=this;
  2455. return self},
  2456. args: ["anObject"],
  2457. source: "reselectItem: anObject",
  2458. messageSends: [],
  2459. referencedClasses: []
  2460. }),
  2461. globals.HLListWidget);
  2462. smalltalk.addMethod(
  2463. smalltalk.method({
  2464. selector: "selectItem:",
  2465. protocol: 'actions',
  2466. fn: function (anObject){
  2467. var self=this;
  2468. return smalltalk.withContext(function($ctx1) {
  2469. self._selectedItem_(anObject);
  2470. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject},globals.HLListWidget)})},
  2471. args: ["anObject"],
  2472. source: "selectItem: anObject\x0a\x09self selectedItem: anObject",
  2473. messageSends: ["selectedItem:"],
  2474. referencedClasses: []
  2475. }),
  2476. globals.HLListWidget);
  2477. smalltalk.addMethod(
  2478. smalltalk.method({
  2479. selector: "selectedItem",
  2480. protocol: 'accessing',
  2481. fn: function (){
  2482. var self=this;
  2483. var $1;
  2484. $1=self["@selectedItem"];
  2485. return $1;
  2486. },
  2487. args: [],
  2488. source: "selectedItem\x0a\x09^ selectedItem",
  2489. messageSends: [],
  2490. referencedClasses: []
  2491. }),
  2492. globals.HLListWidget);
  2493. smalltalk.addMethod(
  2494. smalltalk.method({
  2495. selector: "selectedItem:",
  2496. protocol: 'accessing',
  2497. fn: function (anObject){
  2498. var self=this;
  2499. self["@selectedItem"]=anObject;
  2500. return self},
  2501. args: ["anObject"],
  2502. source: "selectedItem: anObject\x0a\x09selectedItem := anObject",
  2503. messageSends: [],
  2504. referencedClasses: []
  2505. }),
  2506. globals.HLListWidget);
  2507. smalltalk.addMethod(
  2508. smalltalk.method({
  2509. selector: "setupKeyBindings",
  2510. protocol: 'events',
  2511. fn: function (){
  2512. var self=this;
  2513. function $HLRepeatedKeyDownHandler(){return globals.HLRepeatedKeyDownHandler||(typeof HLRepeatedKeyDownHandler=="undefined"?nil:HLRepeatedKeyDownHandler)}
  2514. return smalltalk.withContext(function($ctx1) {
  2515. var $1,$2,$3;
  2516. $1=_st($HLRepeatedKeyDownHandler())._on_(self);
  2517. _st($1)._whileKeyDown_do_((38),(function(){
  2518. return smalltalk.withContext(function($ctx2) {
  2519. return self._activatePreviousListItem();
  2520. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2521. $ctx1.sendIdx["whileKeyDown:do:"]=1;
  2522. _st($1)._whileKeyDown_do_((40),(function(){
  2523. return smalltalk.withContext(function($ctx2) {
  2524. return self._activateNextListItem();
  2525. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  2526. $2=_st($1)._rebindKeys();
  2527. _st(_st(self._wrapper())._asJQuery())._keydown_((function(e){
  2528. return smalltalk.withContext(function($ctx2) {
  2529. $3=_st(_st(e)._which()).__eq((13));
  2530. if(smalltalk.assert($3)){
  2531. return self._reselectItem_(self._selectedItem());
  2532. };
  2533. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,3)})}));
  2534. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},globals.HLListWidget)})},
  2535. args: [],
  2536. source: "setupKeyBindings \x0a\x09(HLRepeatedKeyDownHandler on: self)\x0a\x09\x09whileKeyDown: 38 do: [ self activatePreviousListItem ];\x0a\x09\x09whileKeyDown: 40 do: [ self activateNextListItem ];\x0a\x09\x09rebindKeys.\x0a\x09\x09\x0a\x09self wrapper asJQuery keydown: [ :e |\x0a e which = 13 ifTrue: [ \x0a \x09self reselectItem: self selectedItem ] ]",
  2537. messageSends: ["whileKeyDown:do:", "on:", "activatePreviousListItem", "activateNextListItem", "rebindKeys", "keydown:", "asJQuery", "wrapper", "ifTrue:", "=", "which", "reselectItem:", "selectedItem"],
  2538. referencedClasses: ["HLRepeatedKeyDownHandler"]
  2539. }),
  2540. globals.HLListWidget);
  2541. smalltalk.addClass('HLNavigationListWidget', globals.HLListWidget, ['previous', 'next'], 'Helios-Core');
  2542. smalltalk.addMethod(
  2543. smalltalk.method({
  2544. selector: "next",
  2545. protocol: 'accessing',
  2546. fn: function (){
  2547. var self=this;
  2548. var $1;
  2549. $1=self["@next"];
  2550. return $1;
  2551. },
  2552. args: [],
  2553. source: "next\x0a\x09^ next",
  2554. messageSends: [],
  2555. referencedClasses: []
  2556. }),
  2557. globals.HLNavigationListWidget);
  2558. smalltalk.addMethod(
  2559. smalltalk.method({
  2560. selector: "next:",
  2561. protocol: 'accessing',
  2562. fn: function (aWidget){
  2563. var self=this;
  2564. return smalltalk.withContext(function($ctx1) {
  2565. var $1;
  2566. self["@next"]=aWidget;
  2567. $1=_st(_st(aWidget)._previous()).__eq(self);
  2568. if(! smalltalk.assert($1)){
  2569. _st(aWidget)._previous_(self);
  2570. };
  2571. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget},globals.HLNavigationListWidget)})},
  2572. args: ["aWidget"],
  2573. source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
  2574. messageSends: ["ifFalse:", "=", "previous", "previous:"],
  2575. referencedClasses: []
  2576. }),
  2577. globals.HLNavigationListWidget);
  2578. smalltalk.addMethod(
  2579. smalltalk.method({
  2580. selector: "nextFocus",
  2581. protocol: 'actions',
  2582. fn: function (){
  2583. var self=this;
  2584. return smalltalk.withContext(function($ctx1) {
  2585. var $1,$receiver;
  2586. $1=self._next();
  2587. $ctx1.sendIdx["next"]=1;
  2588. if(($receiver = $1) == null || $receiver.isNil){
  2589. $1;
  2590. } else {
  2591. _st(self._next())._focus();
  2592. };
  2593. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{},globals.HLNavigationListWidget)})},
  2594. args: [],
  2595. source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
  2596. messageSends: ["ifNotNil:", "next", "focus"],
  2597. referencedClasses: []
  2598. }),
  2599. globals.HLNavigationListWidget);
  2600. smalltalk.addMethod(
  2601. smalltalk.method({
  2602. selector: "previous",
  2603. protocol: 'accessing',
  2604. fn: function (){
  2605. var self=this;
  2606. var $1;
  2607. $1=self["@previous"];
  2608. return $1;
  2609. },
  2610. args: [],
  2611. source: "previous\x0a\x09^ previous",
  2612. messageSends: [],
  2613. referencedClasses: []
  2614. }),
  2615. globals.HLNavigationListWidget);
  2616. smalltalk.addMethod(
  2617. smalltalk.method({
  2618. selector: "previous:",
  2619. protocol: 'accessing',
  2620. fn: function (aWidget){
  2621. var self=this;
  2622. return smalltalk.withContext(function($ctx1) {
  2623. var $1;
  2624. self["@previous"]=aWidget;
  2625. $1=_st(_st(aWidget)._next()).__eq(self);
  2626. if(! smalltalk.assert($1)){
  2627. _st(aWidget)._next_(self);
  2628. };
  2629. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},globals.HLNavigationListWidget)})},
  2630. args: ["aWidget"],
  2631. source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
  2632. messageSends: ["ifFalse:", "=", "next", "next:"],
  2633. referencedClasses: []
  2634. }),
  2635. globals.HLNavigationListWidget);
  2636. smalltalk.addMethod(
  2637. smalltalk.method({
  2638. selector: "previousFocus",
  2639. protocol: 'actions',
  2640. fn: function (){
  2641. var self=this;
  2642. return smalltalk.withContext(function($ctx1) {
  2643. var $1,$receiver;
  2644. $1=self._previous();
  2645. $ctx1.sendIdx["previous"]=1;
  2646. if(($receiver = $1) == null || $receiver.isNil){
  2647. $1;
  2648. } else {
  2649. _st(self._previous())._focus();
  2650. };
  2651. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{},globals.HLNavigationListWidget)})},
  2652. args: [],
  2653. source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
  2654. messageSends: ["ifNotNil:", "previous", "focus"],
  2655. referencedClasses: []
  2656. }),
  2657. globals.HLNavigationListWidget);
  2658. smalltalk.addMethod(
  2659. smalltalk.method({
  2660. selector: "setupKeyBindings",
  2661. protocol: 'events',
  2662. fn: function (){
  2663. var self=this;
  2664. return smalltalk.withContext(function($ctx1) {
  2665. var $2,$1,$3;
  2666. ($ctx1.supercall = true, globals.HLNavigationListWidget.superclass.fn.prototype._setupKeyBindings.apply(_st(self), []));
  2667. $ctx1.supercall = false;
  2668. _st(_st(self._wrapper())._asJQuery())._keydown_((function(e){
  2669. return smalltalk.withContext(function($ctx2) {
  2670. $2=_st(e)._which();
  2671. $ctx2.sendIdx["which"]=1;
  2672. $1=_st($2).__eq((39));
  2673. $ctx2.sendIdx["="]=1;
  2674. if(smalltalk.assert($1)){
  2675. self._nextFocus();
  2676. };
  2677. $3=_st(_st(e)._which()).__eq((37));
  2678. if(smalltalk.assert($3)){
  2679. return self._previousFocus();
  2680. };
  2681. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,1)})}));
  2682. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},globals.HLNavigationListWidget)})},
  2683. args: [],
  2684. 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 ] ]",
  2685. messageSends: ["setupKeyBindings", "keydown:", "asJQuery", "wrapper", "ifTrue:", "=", "which", "nextFocus", "previousFocus"],
  2686. referencedClasses: []
  2687. }),
  2688. globals.HLNavigationListWidget);
  2689. smalltalk.addClass('HLToolListWidget', globals.HLNavigationListWidget, ['model'], 'Helios-Core');
  2690. smalltalk.addMethod(
  2691. smalltalk.method({
  2692. selector: "activateListItem:",
  2693. protocol: 'actions',
  2694. fn: function (anItem){
  2695. var self=this;
  2696. return smalltalk.withContext(function($ctx1) {
  2697. _st(self._model())._withChangesDo_((function(){
  2698. return smalltalk.withContext(function($ctx2) {
  2699. return ($ctx2.supercall = true, globals.HLToolListWidget.superclass.fn.prototype._activateListItem_.apply(_st(self), [anItem]));
  2700. $ctx2.supercall = false;
  2701. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2702. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{anItem:anItem},globals.HLToolListWidget)})},
  2703. args: ["anItem"],
  2704. source: "activateListItem: anItem\x0a\x09self model withChangesDo: [ super activateListItem: anItem ]",
  2705. messageSends: ["withChangesDo:", "model", "activateListItem:"],
  2706. referencedClasses: []
  2707. }),
  2708. globals.HLToolListWidget);
  2709. smalltalk.addMethod(
  2710. smalltalk.method({
  2711. selector: "activateNextListItem",
  2712. protocol: 'actions',
  2713. fn: function (){
  2714. var self=this;
  2715. return smalltalk.withContext(function($ctx1) {
  2716. _st(self._model())._withChangesDo_((function(){
  2717. return smalltalk.withContext(function($ctx2) {
  2718. return ($ctx2.supercall = true, globals.HLToolListWidget.superclass.fn.prototype._activateNextListItem.apply(_st(self), []));
  2719. $ctx2.supercall = false;
  2720. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2721. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},globals.HLToolListWidget)})},
  2722. args: [],
  2723. source: "activateNextListItem\x0a\x09self model withChangesDo: [ super activateNextListItem ]",
  2724. messageSends: ["withChangesDo:", "model", "activateNextListItem"],
  2725. referencedClasses: []
  2726. }),
  2727. globals.HLToolListWidget);
  2728. smalltalk.addMethod(
  2729. smalltalk.method({
  2730. selector: "activatePreviousListItem",
  2731. protocol: 'actions',
  2732. fn: function (){
  2733. var self=this;
  2734. return smalltalk.withContext(function($ctx1) {
  2735. _st(self._model())._withChangesDo_((function(){
  2736. return smalltalk.withContext(function($ctx2) {
  2737. return ($ctx2.supercall = true, globals.HLToolListWidget.superclass.fn.prototype._activatePreviousListItem.apply(_st(self), []));
  2738. $ctx2.supercall = false;
  2739. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2740. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},globals.HLToolListWidget)})},
  2741. args: [],
  2742. source: "activatePreviousListItem\x0a\x09self model withChangesDo: [ super activatePreviousListItem ]",
  2743. messageSends: ["withChangesDo:", "model", "activatePreviousListItem"],
  2744. referencedClasses: []
  2745. }),
  2746. globals.HLToolListWidget);
  2747. smalltalk.addMethod(
  2748. smalltalk.method({
  2749. selector: "commandCategory",
  2750. protocol: '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",{},globals.HLToolListWidget)})},
  2758. args: [],
  2759. source: "commandCategory\x0a\x09^ self label",
  2760. messageSends: ["label"],
  2761. referencedClasses: []
  2762. }),
  2763. globals.HLToolListWidget);
  2764. smalltalk.addMethod(
  2765. smalltalk.method({
  2766. selector: "label",
  2767. protocol: 'accessing',
  2768. fn: function (){
  2769. var self=this;
  2770. return "List";
  2771. },
  2772. args: [],
  2773. source: "label\x0a\x09^ 'List'",
  2774. messageSends: [],
  2775. referencedClasses: []
  2776. }),
  2777. globals.HLToolListWidget);
  2778. smalltalk.addMethod(
  2779. smalltalk.method({
  2780. selector: "menuCommands",
  2781. protocol: 'accessing',
  2782. fn: function (){
  2783. var self=this;
  2784. function $HLToolCommand(){return globals.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  2785. return smalltalk.withContext(function($ctx1) {
  2786. var $2,$1;
  2787. $1=_st(_st(_st(_st($HLToolCommand())._concreteClasses())._select_((function(each){
  2788. return smalltalk.withContext(function($ctx2) {
  2789. $2=self._model();
  2790. $ctx2.sendIdx["model"]=1;
  2791. return _st(each)._isValidFor_($2);
  2792. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._collect_((function(each){
  2793. return smalltalk.withContext(function($ctx2) {
  2794. return _st(each)._for_(self._model());
  2795. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})})))._select_((function(each){
  2796. return smalltalk.withContext(function($ctx2) {
  2797. return _st(_st(_st(each)._category()).__eq(self._commandCategory()))._and_((function(){
  2798. return smalltalk.withContext(function($ctx3) {
  2799. return _st(_st(each)._isAction())._and_((function(){
  2800. return smalltalk.withContext(function($ctx4) {
  2801. return _st(each)._isActive();
  2802. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)})}));
  2803. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  2804. $ctx2.sendIdx["and:"]=1;
  2805. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})}));
  2806. $ctx1.sendIdx["select:"]=1;
  2807. return $1;
  2808. }, function($ctx1) {$ctx1.fill(self,"menuCommands",{},globals.HLToolListWidget)})},
  2809. args: [],
  2810. 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 ] ] ]",
  2811. messageSends: ["select:", "collect:", "concreteClasses", "isValidFor:", "model", "for:", "and:", "=", "category", "commandCategory", "isAction", "isActive"],
  2812. referencedClasses: ["HLToolCommand"]
  2813. }),
  2814. globals.HLToolListWidget);
  2815. smalltalk.addMethod(
  2816. smalltalk.method({
  2817. selector: "model",
  2818. protocol: 'accessing',
  2819. fn: function (){
  2820. var self=this;
  2821. var $1;
  2822. $1=self["@model"];
  2823. return $1;
  2824. },
  2825. args: [],
  2826. source: "model\x0a\x09^ model",
  2827. messageSends: [],
  2828. referencedClasses: []
  2829. }),
  2830. globals.HLToolListWidget);
  2831. smalltalk.addMethod(
  2832. smalltalk.method({
  2833. selector: "model:",
  2834. protocol: 'accessing',
  2835. fn: function (aBrowserModel){
  2836. var self=this;
  2837. return smalltalk.withContext(function($ctx1) {
  2838. var $1;
  2839. self["@model"]=aBrowserModel;
  2840. self._observeSystem();
  2841. $1=self._observeModel();
  2842. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aBrowserModel:aBrowserModel},globals.HLToolListWidget)})},
  2843. args: ["aBrowserModel"],
  2844. source: "model: aBrowserModel\x0a\x09model := aBrowserModel.\x0a \x0a self \x0a\x09\x09observeSystem;\x0a\x09\x09observeModel",
  2845. messageSends: ["observeSystem", "observeModel"],
  2846. referencedClasses: []
  2847. }),
  2848. globals.HLToolListWidget);
  2849. smalltalk.addMethod(
  2850. smalltalk.method({
  2851. selector: "observeModel",
  2852. protocol: 'actions',
  2853. fn: function (){
  2854. var self=this;
  2855. return self},
  2856. args: [],
  2857. source: "observeModel",
  2858. messageSends: [],
  2859. referencedClasses: []
  2860. }),
  2861. globals.HLToolListWidget);
  2862. smalltalk.addMethod(
  2863. smalltalk.method({
  2864. selector: "observeSystem",
  2865. protocol: 'actions',
  2866. fn: function (){
  2867. var self=this;
  2868. return self},
  2869. args: [],
  2870. source: "observeSystem",
  2871. messageSends: [],
  2872. referencedClasses: []
  2873. }),
  2874. globals.HLToolListWidget);
  2875. smalltalk.addMethod(
  2876. smalltalk.method({
  2877. selector: "reactivateListItem:",
  2878. protocol: 'actions',
  2879. fn: function (anItem){
  2880. var self=this;
  2881. return smalltalk.withContext(function($ctx1) {
  2882. _st(self._model())._withChangesDo_((function(){
  2883. return smalltalk.withContext(function($ctx2) {
  2884. return ($ctx2.supercall = true, globals.HLToolListWidget.superclass.fn.prototype._reactivateListItem_.apply(_st(self), [anItem]));
  2885. $ctx2.supercall = false;
  2886. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2887. return self}, function($ctx1) {$ctx1.fill(self,"reactivateListItem:",{anItem:anItem},globals.HLToolListWidget)})},
  2888. args: ["anItem"],
  2889. source: "reactivateListItem: anItem\x0a\x09self model withChangesDo: [ super reactivateListItem: anItem ]",
  2890. messageSends: ["withChangesDo:", "model", "reactivateListItem:"],
  2891. referencedClasses: []
  2892. }),
  2893. globals.HLToolListWidget);
  2894. smalltalk.addMethod(
  2895. smalltalk.method({
  2896. selector: "renderContentOn:",
  2897. protocol: 'rendering',
  2898. fn: function (html){
  2899. var self=this;
  2900. return smalltalk.withContext(function($ctx1) {
  2901. self._renderHeadOn_(html);
  2902. ($ctx1.supercall = true, globals.HLToolListWidget.superclass.fn.prototype._renderContentOn_.apply(_st(self), [html]));
  2903. $ctx1.supercall = false;
  2904. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLToolListWidget)})},
  2905. args: ["html"],
  2906. source: "renderContentOn: html\x0a\x09self renderHeadOn: html.\x09\x0a\x09super renderContentOn: html",
  2907. messageSends: ["renderHeadOn:", "renderContentOn:"],
  2908. referencedClasses: []
  2909. }),
  2910. globals.HLToolListWidget);
  2911. smalltalk.addMethod(
  2912. smalltalk.method({
  2913. selector: "renderHeadOn:",
  2914. protocol: 'rendering',
  2915. fn: function (html){
  2916. var self=this;
  2917. return smalltalk.withContext(function($ctx1) {
  2918. var $1,$2;
  2919. $1=_st(html)._div();
  2920. _st($1)._class_("list-label");
  2921. $2=_st($1)._with_((function(){
  2922. return smalltalk.withContext(function($ctx2) {
  2923. _st(html)._with_(self._label());
  2924. return self._renderMenuOn_(html);
  2925. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2926. $ctx1.sendIdx["with:"]=1;
  2927. return self}, function($ctx1) {$ctx1.fill(self,"renderHeadOn:",{html:html},globals.HLToolListWidget)})},
  2928. args: ["html"],
  2929. 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 ]",
  2930. messageSends: ["class:", "div", "with:", "label", "renderMenuOn:"],
  2931. referencedClasses: []
  2932. }),
  2933. globals.HLToolListWidget);
  2934. smalltalk.addMethod(
  2935. smalltalk.method({
  2936. selector: "renderMenuOn:",
  2937. protocol: 'rendering',
  2938. fn: function (html){
  2939. var self=this;
  2940. var commands;
  2941. return smalltalk.withContext(function($ctx1) {
  2942. var $1,$2,$4,$5,$6,$8,$9,$7,$3;
  2943. commands=self._menuCommands();
  2944. $ctx1.sendIdx["menuCommands"]=1;
  2945. $1=_st(commands)._isEmpty();
  2946. if(smalltalk.assert($1)){
  2947. return self;
  2948. };
  2949. $2=_st(html)._div();
  2950. _st($2)._class_("btn-group cog");
  2951. $ctx1.sendIdx["class:"]=1;
  2952. $3=_st($2)._with_((function(){
  2953. return smalltalk.withContext(function($ctx2) {
  2954. $4=_st(html)._a();
  2955. $ctx2.sendIdx["a"]=1;
  2956. _st($4)._class_("btn dropdown-toggle");
  2957. $ctx2.sendIdx["class:"]=2;
  2958. _st($4)._at_put_("data-toggle","dropdown");
  2959. $5=_st($4)._with_((function(){
  2960. return smalltalk.withContext(function($ctx3) {
  2961. return _st(_st(html)._tag_("i"))._class_("icon-chevron-down");
  2962. $ctx3.sendIdx["class:"]=3;
  2963. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  2964. $ctx2.sendIdx["with:"]=2;
  2965. $5;
  2966. $6=_st(html)._ul();
  2967. _st($6)._class_("dropdown-menu pull-right");
  2968. $7=_st($6)._with_((function(){
  2969. return smalltalk.withContext(function($ctx3) {
  2970. return _st(self._menuCommands())._do_((function(each){
  2971. return smalltalk.withContext(function($ctx4) {
  2972. return _st(_st(html)._li())._with_((function(){
  2973. return smalltalk.withContext(function($ctx5) {
  2974. $8=_st(html)._a();
  2975. _st($8)._with_(_st(each)._menuLabel());
  2976. $9=_st($8)._onClick_((function(){
  2977. return smalltalk.withContext(function($ctx6) {
  2978. return self._execute_(each);
  2979. }, function($ctx6) {$ctx6.fillBlock({},$ctx5,7)})}));
  2980. return $9;
  2981. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,6)})}));
  2982. $ctx4.sendIdx["with:"]=4;
  2983. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,5)})}));
  2984. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  2985. $ctx2.sendIdx["with:"]=3;
  2986. return $7;
  2987. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  2988. $ctx1.sendIdx["with:"]=1;
  2989. return self}, function($ctx1) {$ctx1.fill(self,"renderMenuOn:",{html:html,commands:commands},globals.HLToolListWidget)})},
  2990. args: ["html"],
  2991. 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-chevron-down' ].\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 ] ] ] ] ]",
  2992. messageSends: ["menuCommands", "ifTrue:", "isEmpty", "class:", "div", "with:", "a", "at:put:", "tag:", "ul", "do:", "li", "menuLabel", "onClick:", "execute:"],
  2993. referencedClasses: []
  2994. }),
  2995. globals.HLToolListWidget);
  2996. smalltalk.addMethod(
  2997. smalltalk.method({
  2998. selector: "selectedItem:",
  2999. protocol: 'accessing',
  3000. fn: function (anItem){
  3001. var self=this;
  3002. return smalltalk.withContext(function($ctx1) {
  3003. ($ctx1.supercall = true, globals.HLToolListWidget.superclass.fn.prototype._selectedItem_.apply(_st(self), [anItem]));
  3004. $ctx1.supercall = false;
  3005. self._updateMenu();
  3006. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anItem:anItem},globals.HLToolListWidget)})},
  3007. args: ["anItem"],
  3008. source: "selectedItem: anItem\x0a\x09\x22Selection changed, update the cog menu\x22\x0a\x09\x0a\x09super selectedItem: anItem.\x0a\x09self updateMenu",
  3009. messageSends: ["selectedItem:", "updateMenu"],
  3010. referencedClasses: []
  3011. }),
  3012. globals.HLToolListWidget);
  3013. smalltalk.addMethod(
  3014. smalltalk.method({
  3015. selector: "unregister",
  3016. protocol: 'actions',
  3017. fn: function (){
  3018. var self=this;
  3019. return smalltalk.withContext(function($ctx1) {
  3020. var $2,$1;
  3021. ($ctx1.supercall = true, globals.HLToolListWidget.superclass.fn.prototype._unregister.apply(_st(self), []));
  3022. $ctx1.supercall = false;
  3023. $2=self._model();
  3024. $ctx1.sendIdx["model"]=1;
  3025. $1=_st($2)._announcer();
  3026. _st($1)._unsubscribe_(self);
  3027. $ctx1.sendIdx["unsubscribe:"]=1;
  3028. _st(_st(self._model())._systemAnnouncer())._unsubscribe_(self);
  3029. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLToolListWidget)})},
  3030. args: [],
  3031. source: "unregister\x0a\x09super unregister.\x0a\x09\x0a\x09self model announcer unsubscribe: self.\x0a\x09self model systemAnnouncer unsubscribe: self",
  3032. messageSends: ["unregister", "unsubscribe:", "announcer", "model", "systemAnnouncer"],
  3033. referencedClasses: []
  3034. }),
  3035. globals.HLToolListWidget);
  3036. smalltalk.addMethod(
  3037. smalltalk.method({
  3038. selector: "updateMenu",
  3039. protocol: 'updating',
  3040. fn: function (){
  3041. var self=this;
  3042. return smalltalk.withContext(function($ctx1) {
  3043. var $3,$2,$1;
  3044. $3=self._wrapper();
  3045. $ctx1.sendIdx["wrapper"]=1;
  3046. $2=_st($3)._asJQuery();
  3047. $ctx1.sendIdx["asJQuery"]=1;
  3048. $1=_st($2)._find_(".cog");
  3049. $ctx1.sendIdx["find:"]=1;
  3050. _st($1)._remove();
  3051. _st((function(html){
  3052. return smalltalk.withContext(function($ctx2) {
  3053. return self._renderMenuOn_(html);
  3054. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}))._appendToJQuery_(_st(_st(self._wrapper())._asJQuery())._find_(".list-label"));
  3055. return self}, function($ctx1) {$ctx1.fill(self,"updateMenu",{},globals.HLToolListWidget)})},
  3056. args: [],
  3057. 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')",
  3058. messageSends: ["remove", "find:", "asJQuery", "wrapper", "appendToJQuery:", "renderMenuOn:"],
  3059. referencedClasses: []
  3060. }),
  3061. globals.HLToolListWidget);
  3062. smalltalk.addMethod(
  3063. smalltalk.method({
  3064. selector: "on:",
  3065. protocol: 'instance creation',
  3066. fn: function (aModel){
  3067. var self=this;
  3068. return smalltalk.withContext(function($ctx1) {
  3069. var $2,$3,$1;
  3070. $2=self._new();
  3071. _st($2)._model_(aModel);
  3072. $3=_st($2)._yourself();
  3073. $1=$3;
  3074. return $1;
  3075. }, function($ctx1) {$ctx1.fill(self,"on:",{aModel:aModel},globals.HLToolListWidget.klass)})},
  3076. args: ["aModel"],
  3077. source: "on: aModel\x0a\x09^ self new \x0a \x09model: aModel;\x0a yourself",
  3078. messageSends: ["model:", "new", "yourself"],
  3079. referencedClasses: []
  3080. }),
  3081. globals.HLToolListWidget.klass);
  3082. smalltalk.addClass('HLTabListWidget', globals.HLListWidget, ['callback'], 'Helios-Core');
  3083. globals.HLTabListWidget.comment="I am a widget used to display a list of helios tabs.\x0a\x0aWhen a tab is selected, `callback` is evaluated with the selected tab as argument.";
  3084. smalltalk.addMethod(
  3085. smalltalk.method({
  3086. selector: "callback",
  3087. protocol: 'accessing',
  3088. fn: function (){
  3089. var self=this;
  3090. return smalltalk.withContext(function($ctx1) {
  3091. var $2,$1,$receiver;
  3092. $2=self["@callback"];
  3093. if(($receiver = $2) == null || $receiver.isNil){
  3094. $1=(function(){
  3095. });
  3096. } else {
  3097. $1=$2;
  3098. };
  3099. return $1;
  3100. }, function($ctx1) {$ctx1.fill(self,"callback",{},globals.HLTabListWidget)})},
  3101. args: [],
  3102. source: "callback\x0a\x09^ callback ifNil: [ [] ]",
  3103. messageSends: ["ifNil:"],
  3104. referencedClasses: []
  3105. }),
  3106. globals.HLTabListWidget);
  3107. smalltalk.addMethod(
  3108. smalltalk.method({
  3109. selector: "callback:",
  3110. protocol: 'accessing',
  3111. fn: function (aBlock){
  3112. var self=this;
  3113. self["@callback"]=aBlock;
  3114. return self},
  3115. args: ["aBlock"],
  3116. source: "callback: aBlock\x0a\x09callback := aBlock",
  3117. messageSends: [],
  3118. referencedClasses: []
  3119. }),
  3120. globals.HLTabListWidget);
  3121. smalltalk.addMethod(
  3122. smalltalk.method({
  3123. selector: "renderItemLabel:on:",
  3124. protocol: 'rendering',
  3125. fn: function (aTab,html){
  3126. var self=this;
  3127. return smalltalk.withContext(function($ctx1) {
  3128. var $1,$2;
  3129. $1=_st(html)._span();
  3130. _st($1)._class_(_st(aTab)._cssClass());
  3131. $2=_st($1)._with_(_st(aTab)._label());
  3132. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{aTab:aTab,html:html},globals.HLTabListWidget)})},
  3133. args: ["aTab", "html"],
  3134. source: "renderItemLabel: aTab on: html\x0a\x09html span\x0a\x09\x09class: aTab cssClass;\x0a\x09\x09with: aTab label",
  3135. messageSends: ["class:", "span", "cssClass", "with:", "label"],
  3136. referencedClasses: []
  3137. }),
  3138. globals.HLTabListWidget);
  3139. smalltalk.addMethod(
  3140. smalltalk.method({
  3141. selector: "selectItem:",
  3142. protocol: 'actions',
  3143. fn: function (aTab){
  3144. var self=this;
  3145. return smalltalk.withContext(function($ctx1) {
  3146. ($ctx1.supercall = true, globals.HLTabListWidget.superclass.fn.prototype._selectItem_.apply(_st(self), [aTab]));
  3147. $ctx1.supercall = false;
  3148. _st(self._callback())._value_(aTab);
  3149. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{aTab:aTab},globals.HLTabListWidget)})},
  3150. args: ["aTab"],
  3151. source: "selectItem: aTab\x0a\x09super selectItem: aTab.\x0a\x09self callback value: aTab",
  3152. messageSends: ["selectItem:", "value:", "callback"],
  3153. referencedClasses: []
  3154. }),
  3155. globals.HLTabListWidget);
  3156. smalltalk.addClass('HLInformationWidget', globals.HLWidget, ['informationString'], 'Helios-Core');
  3157. globals.HLInformationWidget.comment="I display an information dialog.\x0a\x0a## API\x0a\x0a`HLWidget >> #inform:` is a convenience method for creating information dialogs.";
  3158. smalltalk.addMethod(
  3159. smalltalk.method({
  3160. selector: "informationString",
  3161. protocol: 'accessing',
  3162. fn: function (){
  3163. var self=this;
  3164. return smalltalk.withContext(function($ctx1) {
  3165. var $2,$1,$receiver;
  3166. $2=self["@informationString"];
  3167. if(($receiver = $2) == null || $receiver.isNil){
  3168. $1="";
  3169. } else {
  3170. $1=$2;
  3171. };
  3172. return $1;
  3173. }, function($ctx1) {$ctx1.fill(self,"informationString",{},globals.HLInformationWidget)})},
  3174. args: [],
  3175. source: "informationString\x0a\x09^ informationString ifNil: [ '' ]",
  3176. messageSends: ["ifNil:"],
  3177. referencedClasses: []
  3178. }),
  3179. globals.HLInformationWidget);
  3180. smalltalk.addMethod(
  3181. smalltalk.method({
  3182. selector: "informationString:",
  3183. protocol: 'accessing',
  3184. fn: function (anObject){
  3185. var self=this;
  3186. self["@informationString"]=anObject;
  3187. return self},
  3188. args: ["anObject"],
  3189. source: "informationString: anObject\x0a\x09informationString := anObject",
  3190. messageSends: [],
  3191. referencedClasses: []
  3192. }),
  3193. globals.HLInformationWidget);
  3194. smalltalk.addMethod(
  3195. smalltalk.method({
  3196. selector: "remove",
  3197. protocol: 'actions',
  3198. fn: function (){
  3199. var self=this;
  3200. return smalltalk.withContext(function($ctx1) {
  3201. var $2,$1;
  3202. _st((function(){
  3203. return smalltalk.withContext(function($ctx2) {
  3204. $2=self._wrapper();
  3205. $ctx2.sendIdx["wrapper"]=1;
  3206. $1=_st($2)._asJQuery();
  3207. $ctx2.sendIdx["asJQuery"]=1;
  3208. _st($1)._fadeOut_((100));
  3209. return _st((function(){
  3210. return smalltalk.withContext(function($ctx3) {
  3211. return _st(_st(self._wrapper())._asJQuery())._remove();
  3212. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}))._valueWithTimeout_((400));
  3213. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._valueWithTimeout_((1500));
  3214. $ctx1.sendIdx["valueWithTimeout:"]=1;
  3215. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},globals.HLInformationWidget)})},
  3216. args: [],
  3217. source: "remove\x0a\x09[ \x0a\x09\x09self wrapper asJQuery fadeOut: 100.\x0a\x09\x09[ self wrapper asJQuery remove ]\x0a\x09\x09\x09valueWithTimeout: 400.\x0a\x09]\x0a\x09\x09valueWithTimeout: 1500",
  3218. messageSends: ["valueWithTimeout:", "fadeOut:", "asJQuery", "wrapper", "remove"],
  3219. referencedClasses: []
  3220. }),
  3221. globals.HLInformationWidget);
  3222. smalltalk.addMethod(
  3223. smalltalk.method({
  3224. selector: "renderContentOn:",
  3225. protocol: 'rendering',
  3226. fn: function (html){
  3227. var self=this;
  3228. return smalltalk.withContext(function($ctx1) {
  3229. var $1,$2;
  3230. $1=_st(html)._div();
  3231. _st($1)._class_("growl");
  3232. $2=_st($1)._with_(self._informationString());
  3233. self._remove();
  3234. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLInformationWidget)})},
  3235. args: ["html"],
  3236. source: "renderContentOn: html\x0a\x09html div \x0a\x09\x09class: 'growl'; \x0a\x09\x09with: self informationString.\x0a\x09\x09\x0a\x09self remove",
  3237. messageSends: ["class:", "div", "with:", "informationString", "remove"],
  3238. referencedClasses: []
  3239. }),
  3240. globals.HLInformationWidget);
  3241. smalltalk.addMethod(
  3242. smalltalk.method({
  3243. selector: "show",
  3244. protocol: 'actions',
  3245. fn: function (){
  3246. var self=this;
  3247. return smalltalk.withContext(function($ctx1) {
  3248. self._appendToJQuery_("body"._asJQuery());
  3249. return self}, function($ctx1) {$ctx1.fill(self,"show",{},globals.HLInformationWidget)})},
  3250. args: [],
  3251. source: "show\x0a\x09self appendToJQuery: 'body' asJQuery",
  3252. messageSends: ["appendToJQuery:", "asJQuery"],
  3253. referencedClasses: []
  3254. }),
  3255. globals.HLInformationWidget);
  3256. smalltalk.addClass('HLManager', globals.HLWidget, ['tabsWidget', 'environment', 'history', 'announcer'], 'Helios-Core');
  3257. smalltalk.addMethod(
  3258. smalltalk.method({
  3259. selector: "activate:",
  3260. protocol: 'actions',
  3261. fn: function (aTab){
  3262. var self=this;
  3263. return smalltalk.withContext(function($ctx1) {
  3264. _st(self._tabsWidget())._activate_(aTab);
  3265. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},globals.HLManager)})},
  3266. args: ["aTab"],
  3267. source: "activate: aTab\x0a\x09self tabsWidget activate: aTab",
  3268. messageSends: ["activate:", "tabsWidget"],
  3269. referencedClasses: []
  3270. }),
  3271. globals.HLManager);
  3272. smalltalk.addMethod(
  3273. smalltalk.method({
  3274. selector: "activeTab",
  3275. protocol: 'accessing',
  3276. fn: function (){
  3277. var self=this;
  3278. return smalltalk.withContext(function($ctx1) {
  3279. var $1;
  3280. $1=_st(self._tabsWidget())._activeTab();
  3281. return $1;
  3282. }, function($ctx1) {$ctx1.fill(self,"activeTab",{},globals.HLManager)})},
  3283. args: [],
  3284. source: "activeTab\x0a\x09^ self tabsWidget activeTab",
  3285. messageSends: ["activeTab", "tabsWidget"],
  3286. referencedClasses: []
  3287. }),
  3288. globals.HLManager);
  3289. smalltalk.addMethod(
  3290. smalltalk.method({
  3291. selector: "addTab:",
  3292. protocol: 'actions',
  3293. fn: function (aTab){
  3294. var self=this;
  3295. return smalltalk.withContext(function($ctx1) {
  3296. _st(self._tabsWidget())._addTab_(aTab);
  3297. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab},globals.HLManager)})},
  3298. args: ["aTab"],
  3299. source: "addTab: aTab\x0a\x09self tabsWidget addTab: aTab",
  3300. messageSends: ["addTab:", "tabsWidget"],
  3301. referencedClasses: []
  3302. }),
  3303. globals.HLManager);
  3304. smalltalk.addMethod(
  3305. smalltalk.method({
  3306. selector: "announcer",
  3307. protocol: 'accessing',
  3308. fn: function (){
  3309. var self=this;
  3310. function $Announcer(){return globals.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  3311. return smalltalk.withContext(function($ctx1) {
  3312. var $2,$1,$receiver;
  3313. $2=self["@announcer"];
  3314. if(($receiver = $2) == null || $receiver.isNil){
  3315. self["@announcer"]=_st($Announcer())._new();
  3316. $1=self["@announcer"];
  3317. } else {
  3318. $1=$2;
  3319. };
  3320. return $1;
  3321. }, function($ctx1) {$ctx1.fill(self,"announcer",{},globals.HLManager)})},
  3322. args: [],
  3323. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  3324. messageSends: ["ifNil:", "new"],
  3325. referencedClasses: ["Announcer"]
  3326. }),
  3327. globals.HLManager);
  3328. smalltalk.addMethod(
  3329. smalltalk.method({
  3330. selector: "confirm:ifFalse:",
  3331. protocol: 'actions',
  3332. fn: function (aString,aBlock){
  3333. var self=this;
  3334. return smalltalk.withContext(function($ctx1) {
  3335. self._confirm_ifTrue_ifFalse_(aString,(function(){
  3336. }),aBlock);
  3337. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifFalse:",{aString:aString,aBlock:aBlock},globals.HLManager)})},
  3338. args: ["aString", "aBlock"],
  3339. source: "confirm: aString ifFalse: aBlock\x0a\x09self \x0a\x09\x09confirm: aString\x0a\x09\x09ifTrue: []\x0a\x09\x09ifFalse: aBlock",
  3340. messageSends: ["confirm:ifTrue:ifFalse:"],
  3341. referencedClasses: []
  3342. }),
  3343. globals.HLManager);
  3344. smalltalk.addMethod(
  3345. smalltalk.method({
  3346. selector: "confirm:ifTrue:",
  3347. protocol: 'actions',
  3348. fn: function (aString,aBlock){
  3349. var self=this;
  3350. return smalltalk.withContext(function($ctx1) {
  3351. self._confirm_ifTrue_ifFalse_(aString,aBlock,(function(){
  3352. }));
  3353. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},globals.HLManager)})},
  3354. args: ["aString", "aBlock"],
  3355. source: "confirm: aString ifTrue: aBlock\x0a\x09self \x0a\x09\x09confirm: aString\x0a\x09\x09ifTrue: aBlock\x0a\x09\x09ifFalse: []",
  3356. messageSends: ["confirm:ifTrue:ifFalse:"],
  3357. referencedClasses: []
  3358. }),
  3359. globals.HLManager);
  3360. smalltalk.addMethod(
  3361. smalltalk.method({
  3362. selector: "confirm:ifTrue:ifFalse:",
  3363. protocol: 'actions',
  3364. fn: function (aString,aBlock,anotherBlock){
  3365. var self=this;
  3366. function $HLConfirmationWidget(){return globals.HLConfirmationWidget||(typeof HLConfirmationWidget=="undefined"?nil:HLConfirmationWidget)}
  3367. return smalltalk.withContext(function($ctx1) {
  3368. var $1,$2;
  3369. $1=_st($HLConfirmationWidget())._new();
  3370. _st($1)._confirmationString_(aString);
  3371. _st($1)._actionBlock_(aBlock);
  3372. _st($1)._cancelBlock_(anotherBlock);
  3373. $2=_st($1)._show();
  3374. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:ifFalse:",{aString:aString,aBlock:aBlock,anotherBlock:anotherBlock},globals.HLManager)})},
  3375. args: ["aString", "aBlock", "anotherBlock"],
  3376. source: "confirm: aString ifTrue: aBlock ifFalse: anotherBlock\x0a\x09HLConfirmationWidget new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09cancelBlock: anotherBlock;\x0a\x09\x09show",
  3377. messageSends: ["confirmationString:", "new", "actionBlock:", "cancelBlock:", "show"],
  3378. referencedClasses: ["HLConfirmationWidget"]
  3379. }),
  3380. globals.HLManager);
  3381. smalltalk.addMethod(
  3382. smalltalk.method({
  3383. selector: "defaultEnvironment",
  3384. protocol: 'defaults',
  3385. fn: function (){
  3386. var self=this;
  3387. function $Environment(){return globals.Environment||(typeof Environment=="undefined"?nil:Environment)}
  3388. return smalltalk.withContext(function($ctx1) {
  3389. var $1;
  3390. $1=_st($Environment())._new();
  3391. return $1;
  3392. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{},globals.HLManager)})},
  3393. args: [],
  3394. source: "defaultEnvironment\x0a\x09\x22If helios is loaded from within a frame, answer the parent window environment\x22\x0a\x09\x0a\x09 ^ Environment new",
  3395. messageSends: ["new"],
  3396. referencedClasses: ["Environment"]
  3397. }),
  3398. globals.HLManager);
  3399. smalltalk.addMethod(
  3400. smalltalk.method({
  3401. selector: "environment",
  3402. protocol: 'accessing',
  3403. fn: function (){
  3404. var self=this;
  3405. return smalltalk.withContext(function($ctx1) {
  3406. var $2,$1,$receiver;
  3407. $2=self["@environment"];
  3408. if(($receiver = $2) == null || $receiver.isNil){
  3409. self["@environment"]=self._defaultEnvironment();
  3410. $1=self["@environment"];
  3411. } else {
  3412. $1=$2;
  3413. };
  3414. return $1;
  3415. }, function($ctx1) {$ctx1.fill(self,"environment",{},globals.HLManager)})},
  3416. args: [],
  3417. source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
  3418. messageSends: ["ifNil:", "defaultEnvironment"],
  3419. referencedClasses: []
  3420. }),
  3421. globals.HLManager);
  3422. smalltalk.addMethod(
  3423. smalltalk.method({
  3424. selector: "environment:",
  3425. protocol: 'accessing',
  3426. fn: function (anEnvironment){
  3427. var self=this;
  3428. self["@environment"]=anEnvironment;
  3429. return self},
  3430. args: ["anEnvironment"],
  3431. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  3432. messageSends: [],
  3433. referencedClasses: []
  3434. }),
  3435. globals.HLManager);
  3436. smalltalk.addMethod(
  3437. smalltalk.method({
  3438. selector: "history",
  3439. protocol: 'accessing',
  3440. fn: function (){
  3441. var self=this;
  3442. function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3443. return smalltalk.withContext(function($ctx1) {
  3444. var $2,$1,$receiver;
  3445. $2=self["@history"];
  3446. if(($receiver = $2) == null || $receiver.isNil){
  3447. self["@history"]=_st($OrderedCollection())._new();
  3448. $1=self["@history"];
  3449. } else {
  3450. $1=$2;
  3451. };
  3452. return $1;
  3453. }, function($ctx1) {$ctx1.fill(self,"history",{},globals.HLManager)})},
  3454. args: [],
  3455. source: "history\x0a\x09^ history ifNil: [ history := OrderedCollection new ]",
  3456. messageSends: ["ifNil:", "new"],
  3457. referencedClasses: ["OrderedCollection"]
  3458. }),
  3459. globals.HLManager);
  3460. smalltalk.addMethod(
  3461. smalltalk.method({
  3462. selector: "history:",
  3463. protocol: 'accessing',
  3464. fn: function (aCollection){
  3465. var self=this;
  3466. self["@history"]=aCollection;
  3467. return self},
  3468. args: ["aCollection"],
  3469. source: "history: aCollection\x0a\x09history := aCollection",
  3470. messageSends: [],
  3471. referencedClasses: []
  3472. }),
  3473. globals.HLManager);
  3474. smalltalk.addMethod(
  3475. smalltalk.method({
  3476. selector: "inform:",
  3477. protocol: 'actions',
  3478. fn: function (aString){
  3479. var self=this;
  3480. function $HLInformationWidget(){return globals.HLInformationWidget||(typeof HLInformationWidget=="undefined"?nil:HLInformationWidget)}
  3481. return smalltalk.withContext(function($ctx1) {
  3482. var $1,$2;
  3483. $1=_st($HLInformationWidget())._new();
  3484. _st($1)._informationString_(aString);
  3485. $2=_st($1)._show();
  3486. return self}, function($ctx1) {$ctx1.fill(self,"inform:",{aString:aString},globals.HLManager)})},
  3487. args: ["aString"],
  3488. source: "inform: aString\x0a\x09HLInformationWidget new\x0a\x09\x09informationString: aString;\x0a\x09\x09show",
  3489. messageSends: ["informationString:", "new", "show"],
  3490. referencedClasses: ["HLInformationWidget"]
  3491. }),
  3492. globals.HLManager);
  3493. smalltalk.addMethod(
  3494. smalltalk.method({
  3495. selector: "keyBinder",
  3496. protocol: 'accessing',
  3497. fn: function (){
  3498. var self=this;
  3499. function $HLKeyBinder(){return globals.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
  3500. return smalltalk.withContext(function($ctx1) {
  3501. var $1;
  3502. $1=_st($HLKeyBinder())._current();
  3503. return $1;
  3504. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{},globals.HLManager)})},
  3505. args: [],
  3506. source: "keyBinder\x0a\x09^ HLKeyBinder current",
  3507. messageSends: ["current"],
  3508. referencedClasses: ["HLKeyBinder"]
  3509. }),
  3510. globals.HLManager);
  3511. smalltalk.addMethod(
  3512. smalltalk.method({
  3513. selector: "registerErrorHandler",
  3514. protocol: 'services',
  3515. fn: function (){
  3516. var self=this;
  3517. function $HLErrorHandler(){return globals.HLErrorHandler||(typeof HLErrorHandler=="undefined"?nil:HLErrorHandler)}
  3518. function $ErrorHandler(){return globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  3519. return smalltalk.withContext(function($ctx1) {
  3520. var $1,$2;
  3521. $1=self._environment();
  3522. $2=_st($HLErrorHandler())._new();
  3523. $ctx1.sendIdx["new"]=1;
  3524. _st($1)._registerErrorHandler_($2);
  3525. _st($ErrorHandler())._register_(_st($HLErrorHandler())._new());
  3526. return self}, function($ctx1) {$ctx1.fill(self,"registerErrorHandler",{},globals.HLManager)})},
  3527. args: [],
  3528. source: "registerErrorHandler\x0a\x09self environment registerErrorHandler: HLErrorHandler new.\x0a\x09ErrorHandler register: HLErrorHandler new",
  3529. messageSends: ["registerErrorHandler:", "environment", "new", "register:"],
  3530. referencedClasses: ["HLErrorHandler", "ErrorHandler"]
  3531. }),
  3532. globals.HLManager);
  3533. smalltalk.addMethod(
  3534. smalltalk.method({
  3535. selector: "registerFinder",
  3536. protocol: 'services',
  3537. fn: function (){
  3538. var self=this;
  3539. function $HLFinder(){return globals.HLFinder||(typeof HLFinder=="undefined"?nil:HLFinder)}
  3540. function $Finder(){return globals.Finder||(typeof Finder=="undefined"?nil:Finder)}
  3541. return smalltalk.withContext(function($ctx1) {
  3542. var $1,$2;
  3543. $1=self._environment();
  3544. $2=_st($HLFinder())._new();
  3545. $ctx1.sendIdx["new"]=1;
  3546. _st($1)._registerFinder_($2);
  3547. _st($Finder())._register_(_st($HLFinder())._new());
  3548. return self}, function($ctx1) {$ctx1.fill(self,"registerFinder",{},globals.HLManager)})},
  3549. args: [],
  3550. source: "registerFinder\x0a\x09self environment registerFinder: HLFinder new.\x0a\x09Finder register: HLFinder new",
  3551. messageSends: ["registerFinder:", "environment", "new", "register:"],
  3552. referencedClasses: ["HLFinder", "Finder"]
  3553. }),
  3554. globals.HLManager);
  3555. smalltalk.addMethod(
  3556. smalltalk.method({
  3557. selector: "registerInspector",
  3558. protocol: 'services',
  3559. fn: function (){
  3560. var self=this;
  3561. function $HLInspector(){return globals.HLInspector||(typeof HLInspector=="undefined"?nil:HLInspector)}
  3562. function $Inspector(){return globals.Inspector||(typeof Inspector=="undefined"?nil:Inspector)}
  3563. return smalltalk.withContext(function($ctx1) {
  3564. _st(self._environment())._registerInspector_($HLInspector());
  3565. _st($Inspector())._register_($HLInspector());
  3566. return self}, function($ctx1) {$ctx1.fill(self,"registerInspector",{},globals.HLManager)})},
  3567. args: [],
  3568. source: "registerInspector\x0a\x09self environment registerInspector: HLInspector.\x0a\x09Inspector register: HLInspector",
  3569. messageSends: ["registerInspector:", "environment", "register:"],
  3570. referencedClasses: ["HLInspector", "Inspector"]
  3571. }),
  3572. globals.HLManager);
  3573. smalltalk.addMethod(
  3574. smalltalk.method({
  3575. selector: "registerProgressHandler",
  3576. protocol: 'services',
  3577. fn: function (){
  3578. var self=this;
  3579. function $HLProgressHandler(){return globals.HLProgressHandler||(typeof HLProgressHandler=="undefined"?nil:HLProgressHandler)}
  3580. function $ProgressHandler(){return globals.ProgressHandler||(typeof ProgressHandler=="undefined"?nil:ProgressHandler)}
  3581. return smalltalk.withContext(function($ctx1) {
  3582. var $1,$2;
  3583. $1=self._environment();
  3584. $2=_st($HLProgressHandler())._new();
  3585. $ctx1.sendIdx["new"]=1;
  3586. _st($1)._registerProgressHandler_($2);
  3587. _st($ProgressHandler())._register_(_st($HLProgressHandler())._new());
  3588. return self}, function($ctx1) {$ctx1.fill(self,"registerProgressHandler",{},globals.HLManager)})},
  3589. args: [],
  3590. source: "registerProgressHandler\x0a\x09self environment registerProgressHandler: HLProgressHandler new.\x0a\x09ProgressHandler register: HLProgressHandler new",
  3591. messageSends: ["registerProgressHandler:", "environment", "new", "register:"],
  3592. referencedClasses: ["HLProgressHandler", "ProgressHandler"]
  3593. }),
  3594. globals.HLManager);
  3595. smalltalk.addMethod(
  3596. smalltalk.method({
  3597. selector: "registerServices",
  3598. protocol: 'private',
  3599. fn: function (){
  3600. var self=this;
  3601. return smalltalk.withContext(function($ctx1) {
  3602. var $1;
  3603. self._registerInspector();
  3604. self._registerErrorHandler();
  3605. self._registerProgressHandler();
  3606. self._registerTranscript();
  3607. $1=self._registerFinder();
  3608. return self}, function($ctx1) {$ctx1.fill(self,"registerServices",{},globals.HLManager)})},
  3609. args: [],
  3610. source: "registerServices\x0a\x09self\x0a\x09\x09registerInspector;\x0a\x09\x09registerErrorHandler;\x0a\x09\x09registerProgressHandler;\x0a\x09\x09registerTranscript;\x0a\x09\x09registerFinder",
  3611. messageSends: ["registerInspector", "registerErrorHandler", "registerProgressHandler", "registerTranscript", "registerFinder"],
  3612. referencedClasses: []
  3613. }),
  3614. globals.HLManager);
  3615. smalltalk.addMethod(
  3616. smalltalk.method({
  3617. selector: "registerTranscript",
  3618. protocol: 'services',
  3619. fn: function (){
  3620. var self=this;
  3621. function $HLTranscriptHandler(){return globals.HLTranscriptHandler||(typeof HLTranscriptHandler=="undefined"?nil:HLTranscriptHandler)}
  3622. return smalltalk.withContext(function($ctx1) {
  3623. _st(self._environment())._registerTranscript_($HLTranscriptHandler());
  3624. return self}, function($ctx1) {$ctx1.fill(self,"registerTranscript",{},globals.HLManager)})},
  3625. args: [],
  3626. source: "registerTranscript\x0a\x09self environment registerTranscript: HLTranscriptHandler",
  3627. messageSends: ["registerTranscript:", "environment"],
  3628. referencedClasses: ["HLTranscriptHandler"]
  3629. }),
  3630. globals.HLManager);
  3631. smalltalk.addMethod(
  3632. smalltalk.method({
  3633. selector: "removeActiveTab",
  3634. protocol: 'actions',
  3635. fn: function (){
  3636. var self=this;
  3637. return smalltalk.withContext(function($ctx1) {
  3638. _st(self._tabsWidget())._removeActiveTab();
  3639. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{},globals.HLManager)})},
  3640. args: [],
  3641. source: "removeActiveTab\x0a\x09self tabsWidget removeActiveTab",
  3642. messageSends: ["removeActiveTab", "tabsWidget"],
  3643. referencedClasses: []
  3644. }),
  3645. globals.HLManager);
  3646. smalltalk.addMethod(
  3647. smalltalk.method({
  3648. selector: "removeTabForWidget:",
  3649. protocol: 'actions',
  3650. fn: function (aWidget){
  3651. var self=this;
  3652. return smalltalk.withContext(function($ctx1) {
  3653. _st(self._tabsWidget())._removeTabForWidget_(aWidget);
  3654. return self}, function($ctx1) {$ctx1.fill(self,"removeTabForWidget:",{aWidget:aWidget},globals.HLManager)})},
  3655. args: ["aWidget"],
  3656. source: "removeTabForWidget: aWidget\x0a\x09self tabsWidget removeTabForWidget: aWidget",
  3657. messageSends: ["removeTabForWidget:", "tabsWidget"],
  3658. referencedClasses: []
  3659. }),
  3660. globals.HLManager);
  3661. smalltalk.addMethod(
  3662. smalltalk.method({
  3663. selector: "renderContentOn:",
  3664. protocol: 'rendering',
  3665. fn: function (html){
  3666. var self=this;
  3667. function $HLWelcomeWidget(){return globals.HLWelcomeWidget||(typeof HLWelcomeWidget=="undefined"?nil:HLWelcomeWidget)}
  3668. return smalltalk.withContext(function($ctx1) {
  3669. _st(html)._with_(self._tabsWidget());
  3670. $ctx1.sendIdx["with:"]=1;
  3671. _st(html)._with_(_st($HLWelcomeWidget())._new());
  3672. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLManager)})},
  3673. args: ["html"],
  3674. source: "renderContentOn: html\x0a\x09html with: self tabsWidget.\x0a\x09html with: HLWelcomeWidget new",
  3675. messageSends: ["with:", "tabsWidget", "new"],
  3676. referencedClasses: ["HLWelcomeWidget"]
  3677. }),
  3678. globals.HLManager);
  3679. smalltalk.addMethod(
  3680. smalltalk.method({
  3681. selector: "request:do:",
  3682. protocol: 'actions',
  3683. fn: function (aString,aBlock){
  3684. var self=this;
  3685. return smalltalk.withContext(function($ctx1) {
  3686. self._request_value_do_(aString,"",aBlock);
  3687. return self}, function($ctx1) {$ctx1.fill(self,"request:do:",{aString:aString,aBlock:aBlock},globals.HLManager)})},
  3688. args: ["aString", "aBlock"],
  3689. source: "request: aString do: aBlock\x0a\x09self \x0a\x09\x09request: aString\x0a\x09\x09value: ''\x0a\x09\x09do: aBlock",
  3690. messageSends: ["request:value:do:"],
  3691. referencedClasses: []
  3692. }),
  3693. globals.HLManager);
  3694. smalltalk.addMethod(
  3695. smalltalk.method({
  3696. selector: "request:value:do:",
  3697. protocol: 'actions',
  3698. fn: function (aString,valueString,aBlock){
  3699. var self=this;
  3700. function $HLRequestWidget(){return globals.HLRequestWidget||(typeof HLRequestWidget=="undefined"?nil:HLRequestWidget)}
  3701. return smalltalk.withContext(function($ctx1) {
  3702. var $1,$2;
  3703. $1=_st($HLRequestWidget())._new();
  3704. _st($1)._confirmationString_(aString);
  3705. _st($1)._actionBlock_(aBlock);
  3706. _st($1)._value_(valueString);
  3707. $2=_st($1)._show();
  3708. return self}, function($ctx1) {$ctx1.fill(self,"request:value:do:",{aString:aString,valueString:valueString,aBlock:aBlock},globals.HLManager)})},
  3709. args: ["aString", "valueString", "aBlock"],
  3710. 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",
  3711. messageSends: ["confirmationString:", "new", "actionBlock:", "value:", "show"],
  3712. referencedClasses: ["HLRequestWidget"]
  3713. }),
  3714. globals.HLManager);
  3715. smalltalk.addMethod(
  3716. smalltalk.method({
  3717. selector: "setEditorTheme:",
  3718. protocol: 'accessing',
  3719. fn: function (aTheme){
  3720. var self=this;
  3721. return smalltalk.withContext(function($ctx1) {
  3722. _st("helios.editorTheme"._asSetting())._value_(aTheme);
  3723. return self}, function($ctx1) {$ctx1.fill(self,"setEditorTheme:",{aTheme:aTheme},globals.HLManager)})},
  3724. args: ["aTheme"],
  3725. source: "setEditorTheme: aTheme\x0a\x0a\x09'helios.editorTheme' asSetting value: aTheme",
  3726. messageSends: ["value:", "asSetting"],
  3727. referencedClasses: []
  3728. }),
  3729. globals.HLManager);
  3730. smalltalk.addMethod(
  3731. smalltalk.method({
  3732. selector: "setTheme:",
  3733. protocol: 'accessing',
  3734. fn: function (aTheme){
  3735. var self=this;
  3736. var currentTheme;
  3737. return smalltalk.withContext(function($ctx1) {
  3738. var $1,$2;
  3739. currentTheme="helios.theme"._asSettingIfAbsent_("default");
  3740. $1="body"._asJQuery();
  3741. _st($1)._removeClass_(_st(currentTheme)._value());
  3742. $2=_st($1)._addClass_(aTheme);
  3743. _st("helios.theme"._asSetting())._value_(aTheme);
  3744. return self}, function($ctx1) {$ctx1.fill(self,"setTheme:",{aTheme:aTheme,currentTheme:currentTheme},globals.HLManager)})},
  3745. args: ["aTheme"],
  3746. source: "setTheme: aTheme\x0a\x09| currentTheme |\x0a\x0a\x09currentTheme := 'helios.theme' asSettingIfAbsent: 'default'.\x0a\x09\x0a\x09'body' asJQuery\x0a\x09\x09removeClass: currentTheme value;\x0a\x09\x09addClass: aTheme.\x0a\x09\x09\x0a\x09\x0a\x09'helios.theme' asSetting value: aTheme",
  3747. messageSends: ["asSettingIfAbsent:", "removeClass:", "asJQuery", "value", "addClass:", "value:", "asSetting"],
  3748. referencedClasses: []
  3749. }),
  3750. globals.HLManager);
  3751. smalltalk.addMethod(
  3752. smalltalk.method({
  3753. selector: "setup",
  3754. protocol: 'initialization',
  3755. fn: function (){
  3756. var self=this;
  3757. return smalltalk.withContext(function($ctx1) {
  3758. var $1;
  3759. self._registerServices();
  3760. $1=self._setupEvents();
  3761. $ctx1.sendIdx["setupEvents"]=1;
  3762. _st(self._keyBinder())._setupEvents();
  3763. $ctx1.sendIdx["setupEvents"]=2;
  3764. _st(self._tabsWidget())._setupEvents();
  3765. self._setupTheme();
  3766. _st("#helper"._asJQuery())._fadeOut();
  3767. return self}, function($ctx1) {$ctx1.fill(self,"setup",{},globals.HLManager)})},
  3768. args: [],
  3769. source: "setup\x0a\x09self \x0a\x09\x09registerServices;\x0a\x09\x09setupEvents.\x0a self keyBinder setupEvents.\x0a\x09self tabsWidget setupEvents.\x0a\x09self setupTheme.\x0a\x09\x0a\x09\x0a\x09'#helper' asJQuery fadeOut",
  3770. messageSends: ["registerServices", "setupEvents", "keyBinder", "tabsWidget", "setupTheme", "fadeOut", "asJQuery"],
  3771. referencedClasses: []
  3772. }),
  3773. globals.HLManager);
  3774. smalltalk.addMethod(
  3775. smalltalk.method({
  3776. selector: "setupEvents",
  3777. protocol: 'private',
  3778. fn: function (){
  3779. var self=this;
  3780. return smalltalk.withContext(function($ctx1) {
  3781. var $1,$2,$3,$4,$5;
  3782. $1="body"._asJQuery();
  3783. $ctx1.sendIdx["asJQuery"]=1;
  3784. _st($1)._keydown_((function(event){
  3785. return smalltalk.withContext(function($ctx2) {
  3786. $2=_st(event)._ctrlKey();
  3787. if(smalltalk.assert($2)){
  3788. $3="body"._asJQuery();
  3789. $ctx2.sendIdx["asJQuery"]=2;
  3790. return _st($3)._addClass_("navigation");
  3791. };
  3792. }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1,1)})}));
  3793. $4="body"._asJQuery();
  3794. $ctx1.sendIdx["asJQuery"]=3;
  3795. _st($4)._keyup_((function(event){
  3796. return smalltalk.withContext(function($ctx2) {
  3797. $5="body"._asJQuery();
  3798. $ctx2.sendIdx["asJQuery"]=4;
  3799. return _st($5)._removeClass_("navigation");
  3800. }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1,3)})}));
  3801. _st(_st(window)._asJQuery())._resize_((function(event){
  3802. return smalltalk.withContext(function($ctx2) {
  3803. return self._refresh();
  3804. }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1,4)})}));
  3805. return self}, function($ctx1) {$ctx1.fill(self,"setupEvents",{},globals.HLManager)})},
  3806. args: [],
  3807. source: "setupEvents\x0a\x09'body' asJQuery keydown: [ :event |\x0a\x09\x09\x09\x0a\x09\x09\x22On ctrl keydown, adds a 'navigation' css class to <body>\x0a\x09\x09for the CodeMirror navigation links. See `HLCodeWidget`.\x22\x0a\x09\x09event ctrlKey ifTrue: [\x0a\x09\x09\x09'body' asJQuery addClass: 'navigation' ] ].\x0a\x09\x09\x09\x0a\x09'body' asJQuery keyup: [ :event |\x0a\x09\x09'body' asJQuery removeClass: 'navigation' ].\x0a\x09\x09\x0a\x09window asJQuery resize: [ :event |\x0a\x09\x09self refresh ]",
  3808. messageSends: ["keydown:", "asJQuery", "ifTrue:", "ctrlKey", "addClass:", "keyup:", "removeClass:", "resize:", "refresh"],
  3809. referencedClasses: []
  3810. }),
  3811. globals.HLManager);
  3812. smalltalk.addMethod(
  3813. smalltalk.method({
  3814. selector: "setupTheme",
  3815. protocol: 'private',
  3816. fn: function (){
  3817. var self=this;
  3818. return smalltalk.withContext(function($ctx1) {
  3819. var $1;
  3820. self._setTheme_("default");
  3821. $1=self._setEditorTheme_("default");
  3822. return self}, function($ctx1) {$ctx1.fill(self,"setupTheme",{},globals.HLManager)})},
  3823. args: [],
  3824. source: "setupTheme\x0a\x09\x22self \x0a\x09\x09setTheme: 'niflheim';\x0a\x09\x09setEditorTheme: 'niflheim'.\x22\x0a\x09\x09\x0a\x09self \x0a\x09\x09setTheme: 'default';\x0a\x09\x09setEditorTheme: 'default'.",
  3825. messageSends: ["setTheme:", "setEditorTheme:"],
  3826. referencedClasses: []
  3827. }),
  3828. globals.HLManager);
  3829. smalltalk.addMethod(
  3830. smalltalk.method({
  3831. selector: "tabWidth",
  3832. protocol: 'accessing',
  3833. fn: function (){
  3834. var self=this;
  3835. return smalltalk.withContext(function($ctx1) {
  3836. var $1;
  3837. $1=_st(_st(_st(_st(window)._asJQuery())._width()).__minus((90))).__slash(_st(self._tabs())._size());
  3838. return $1;
  3839. }, function($ctx1) {$ctx1.fill(self,"tabWidth",{},globals.HLManager)})},
  3840. args: [],
  3841. source: "tabWidth\x0a\x09^ (window asJQuery width - 90) / self tabs size",
  3842. messageSends: ["/", "-", "width", "asJQuery", "size", "tabs"],
  3843. referencedClasses: []
  3844. }),
  3845. globals.HLManager);
  3846. smalltalk.addMethod(
  3847. smalltalk.method({
  3848. selector: "tabs",
  3849. protocol: 'accessing',
  3850. fn: function (){
  3851. var self=this;
  3852. return smalltalk.withContext(function($ctx1) {
  3853. var $1;
  3854. $1=_st(self._tabsWidget())._tabs();
  3855. return $1;
  3856. }, function($ctx1) {$ctx1.fill(self,"tabs",{},globals.HLManager)})},
  3857. args: [],
  3858. source: "tabs\x0a\x09^ self tabsWidget tabs",
  3859. messageSends: ["tabs", "tabsWidget"],
  3860. referencedClasses: []
  3861. }),
  3862. globals.HLManager);
  3863. smalltalk.addMethod(
  3864. smalltalk.method({
  3865. selector: "tabsWidget",
  3866. protocol: 'accessing',
  3867. fn: function (){
  3868. var self=this;
  3869. function $HLTabsWidget(){return globals.HLTabsWidget||(typeof HLTabsWidget=="undefined"?nil:HLTabsWidget)}
  3870. return smalltalk.withContext(function($ctx1) {
  3871. var $2,$1,$receiver;
  3872. $2=self["@tabsWidget"];
  3873. if(($receiver = $2) == null || $receiver.isNil){
  3874. self["@tabsWidget"]=_st($HLTabsWidget())._new();
  3875. $1=self["@tabsWidget"];
  3876. } else {
  3877. $1=$2;
  3878. };
  3879. return $1;
  3880. }, function($ctx1) {$ctx1.fill(self,"tabsWidget",{},globals.HLManager)})},
  3881. args: [],
  3882. source: "tabsWidget\x0a\x09^ tabsWidget ifNil: [ tabsWidget := HLTabsWidget new ]",
  3883. messageSends: ["ifNil:", "new"],
  3884. referencedClasses: ["HLTabsWidget"]
  3885. }),
  3886. globals.HLManager);
  3887. globals.HLManager.klass.iVarNames = ['current'];
  3888. smalltalk.addMethod(
  3889. smalltalk.method({
  3890. selector: "current",
  3891. protocol: 'accessing',
  3892. fn: function (){
  3893. var self=this;
  3894. return smalltalk.withContext(function($ctx1) {
  3895. var $2,$1,$receiver;
  3896. $2=self["@current"];
  3897. if(($receiver = $2) == null || $receiver.isNil){
  3898. self["@current"]=_st(self._basicNew())._initialize();
  3899. $1=self["@current"];
  3900. } else {
  3901. $1=$2;
  3902. };
  3903. return $1;
  3904. }, function($ctx1) {$ctx1.fill(self,"current",{},globals.HLManager.klass)})},
  3905. args: [],
  3906. source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
  3907. messageSends: ["ifNil:", "initialize", "basicNew"],
  3908. referencedClasses: []
  3909. }),
  3910. globals.HLManager.klass);
  3911. smalltalk.addMethod(
  3912. smalltalk.method({
  3913. selector: "new",
  3914. protocol: 'instance creation',
  3915. fn: function (){
  3916. var self=this;
  3917. return smalltalk.withContext(function($ctx1) {
  3918. self._shouldNotImplement();
  3919. return self}, function($ctx1) {$ctx1.fill(self,"new",{},globals.HLManager.klass)})},
  3920. args: [],
  3921. source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
  3922. messageSends: ["shouldNotImplement"],
  3923. referencedClasses: []
  3924. }),
  3925. globals.HLManager.klass);
  3926. smalltalk.addMethod(
  3927. smalltalk.method({
  3928. selector: "setup",
  3929. protocol: 'initialization',
  3930. fn: function (){
  3931. var self=this;
  3932. return smalltalk.withContext(function($ctx1) {
  3933. var $1,$2;
  3934. $1=self._current();
  3935. _st($1)._setup();
  3936. $2=_st($1)._appendToJQuery_("body"._asJQuery());
  3937. return self}, function($ctx1) {$ctx1.fill(self,"setup",{},globals.HLManager.klass)})},
  3938. args: [],
  3939. source: "setup\x0a\x09self current \x0a\x09\x09setup;\x0a\x09\x09appendToJQuery: 'body' asJQuery",
  3940. messageSends: ["setup", "current", "appendToJQuery:", "asJQuery"],
  3941. referencedClasses: []
  3942. }),
  3943. globals.HLManager.klass);
  3944. smalltalk.addClass('HLModalWidget', globals.HLWidget, [], 'Helios-Core');
  3945. globals.HLModalWidget.comment="I implement an abstract modal widget.";
  3946. smalltalk.addMethod(
  3947. smalltalk.method({
  3948. selector: "giveFocusToButton:",
  3949. protocol: 'private',
  3950. fn: function (aButton){
  3951. var self=this;
  3952. return smalltalk.withContext(function($ctx1) {
  3953. _st(_st(aButton)._asJQuery())._focus();
  3954. return self}, function($ctx1) {$ctx1.fill(self,"giveFocusToButton:",{aButton:aButton},globals.HLModalWidget)})},
  3955. args: ["aButton"],
  3956. source: "giveFocusToButton: aButton\x0a\x09aButton asJQuery focus",
  3957. messageSends: ["focus", "asJQuery"],
  3958. referencedClasses: []
  3959. }),
  3960. globals.HLModalWidget);
  3961. smalltalk.addMethod(
  3962. smalltalk.method({
  3963. selector: "hasButtons",
  3964. protocol: 'rendering',
  3965. fn: function (){
  3966. var self=this;
  3967. return true;
  3968. },
  3969. args: [],
  3970. source: "hasButtons\x0a\x09^ true",
  3971. messageSends: [],
  3972. referencedClasses: []
  3973. }),
  3974. globals.HLModalWidget);
  3975. smalltalk.addMethod(
  3976. smalltalk.method({
  3977. selector: "remove",
  3978. protocol: 'actions',
  3979. fn: function (){
  3980. var self=this;
  3981. return smalltalk.withContext(function($ctx1) {
  3982. var $1,$2;
  3983. $1=".dialog"._asJQuery();
  3984. $ctx1.sendIdx["asJQuery"]=1;
  3985. _st($1)._removeClass_("active");
  3986. _st((function(){
  3987. return smalltalk.withContext(function($ctx2) {
  3988. $2="#overlay"._asJQuery();
  3989. $ctx2.sendIdx["asJQuery"]=2;
  3990. _st($2)._remove();
  3991. $ctx2.sendIdx["remove"]=1;
  3992. return _st(_st(self["@wrapper"])._asJQuery())._remove();
  3993. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._valueWithTimeout_((300));
  3994. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},globals.HLModalWidget)})},
  3995. args: [],
  3996. source: "remove\x0a\x09'.dialog' asJQuery removeClass: 'active'.\x0a\x09[ \x0a\x09\x09'#overlay' asJQuery remove.\x0a\x09\x09wrapper asJQuery remove\x0a\x09] valueWithTimeout: 300",
  3997. messageSends: ["removeClass:", "asJQuery", "valueWithTimeout:", "remove"],
  3998. referencedClasses: []
  3999. }),
  4000. globals.HLModalWidget);
  4001. smalltalk.addMethod(
  4002. smalltalk.method({
  4003. selector: "renderButtonsOn:",
  4004. protocol: 'rendering',
  4005. fn: function (html){
  4006. var self=this;
  4007. return self},
  4008. args: ["html"],
  4009. source: "renderButtonsOn: html",
  4010. messageSends: [],
  4011. referencedClasses: []
  4012. }),
  4013. globals.HLModalWidget);
  4014. smalltalk.addMethod(
  4015. smalltalk.method({
  4016. selector: "renderContentOn:",
  4017. protocol: 'rendering',
  4018. fn: function (html){
  4019. var self=this;
  4020. var confirmButton;
  4021. return smalltalk.withContext(function($ctx1) {
  4022. var $1,$2,$4,$3;
  4023. $1=_st(html)._div();
  4024. $ctx1.sendIdx["div"]=1;
  4025. _st($1)._id_("overlay");
  4026. $2=_st(html)._div();
  4027. _st($2)._class_("dialog ".__comma(self._cssClass()));
  4028. $3=_st($2)._with_((function(){
  4029. return smalltalk.withContext(function($ctx2) {
  4030. self._renderMainOn_(html);
  4031. $4=self._hasButtons();
  4032. if(smalltalk.assert($4)){
  4033. return self._renderButtonsOn_(html);
  4034. };
  4035. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4036. _st(".dialog"._asJQuery())._addClass_("active");
  4037. self._setupKeyBindings();
  4038. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html,confirmButton:confirmButton},globals.HLModalWidget)})},
  4039. args: ["html"],
  4040. source: "renderContentOn: html\x0a\x09| confirmButton |\x0a\x09\x0a\x09html div id: 'overlay'.\x0a\x09\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",
  4041. messageSends: ["id:", "div", "class:", ",", "cssClass", "with:", "renderMainOn:", "ifTrue:", "hasButtons", "renderButtonsOn:", "addClass:", "asJQuery", "setupKeyBindings"],
  4042. referencedClasses: []
  4043. }),
  4044. globals.HLModalWidget);
  4045. smalltalk.addMethod(
  4046. smalltalk.method({
  4047. selector: "renderMainOn:",
  4048. protocol: 'rendering',
  4049. fn: function (html){
  4050. var self=this;
  4051. return self},
  4052. args: ["html"],
  4053. source: "renderMainOn: html",
  4054. messageSends: [],
  4055. referencedClasses: []
  4056. }),
  4057. globals.HLModalWidget);
  4058. smalltalk.addMethod(
  4059. smalltalk.method({
  4060. selector: "setupKeyBindings",
  4061. protocol: 'rendering',
  4062. fn: function (){
  4063. var self=this;
  4064. function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
  4065. return smalltalk.withContext(function($ctx1) {
  4066. var $1;
  4067. _st(".dialog"._asJQuery())._keyup_((function(e){
  4068. return smalltalk.withContext(function($ctx2) {
  4069. $1=_st(_st(e)._keyCode()).__eq(_st(_st($String())._esc())._asciiValue());
  4070. if(smalltalk.assert($1)){
  4071. return self._cancel();
  4072. };
  4073. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,1)})}));
  4074. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},globals.HLModalWidget)})},
  4075. args: [],
  4076. source: "setupKeyBindings\x0a\x09'.dialog' asJQuery keyup: [ :e |\x0a\x09\x09e keyCode = String esc asciiValue ifTrue: [ self cancel ] ]",
  4077. messageSends: ["keyup:", "asJQuery", "ifTrue:", "=", "keyCode", "asciiValue", "esc", "cancel"],
  4078. referencedClasses: ["String"]
  4079. }),
  4080. globals.HLModalWidget);
  4081. smalltalk.addMethod(
  4082. smalltalk.method({
  4083. selector: "show",
  4084. protocol: 'actions',
  4085. fn: function (){
  4086. var self=this;
  4087. return smalltalk.withContext(function($ctx1) {
  4088. self._appendToJQuery_("body"._asJQuery());
  4089. return self}, function($ctx1) {$ctx1.fill(self,"show",{},globals.HLModalWidget)})},
  4090. args: [],
  4091. source: "show\x0a\x09self appendToJQuery: 'body' asJQuery",
  4092. messageSends: ["appendToJQuery:", "asJQuery"],
  4093. referencedClasses: []
  4094. }),
  4095. globals.HLModalWidget);
  4096. smalltalk.addClass('HLConfirmationWidget', globals.HLModalWidget, ['cancelButtonLabel', 'confirmButtonLabel', 'confirmationString', 'actionBlock', 'cancelBlock'], 'Helios-Core');
  4097. globals.HLConfirmationWidget.comment="I display confirmation dialog. \x0a\x0a## API\x0a\x0aHLWidget contains convenience methods like `HLWidget >> #confirm:ifTrue:` for creating confirmation dialogs.";
  4098. smalltalk.addMethod(
  4099. smalltalk.method({
  4100. selector: "actionBlock",
  4101. protocol: 'accessing',
  4102. fn: function (){
  4103. var self=this;
  4104. return smalltalk.withContext(function($ctx1) {
  4105. var $2,$1,$receiver;
  4106. $2=self["@actionBlock"];
  4107. if(($receiver = $2) == null || $receiver.isNil){
  4108. $1=(function(){
  4109. });
  4110. } else {
  4111. $1=$2;
  4112. };
  4113. return $1;
  4114. }, function($ctx1) {$ctx1.fill(self,"actionBlock",{},globals.HLConfirmationWidget)})},
  4115. args: [],
  4116. source: "actionBlock\x0a\x09^ actionBlock ifNil: [ [] ]",
  4117. messageSends: ["ifNil:"],
  4118. referencedClasses: []
  4119. }),
  4120. globals.HLConfirmationWidget);
  4121. smalltalk.addMethod(
  4122. smalltalk.method({
  4123. selector: "actionBlock:",
  4124. protocol: 'accessing',
  4125. fn: function (aBlock){
  4126. var self=this;
  4127. self["@actionBlock"]=aBlock;
  4128. return self},
  4129. args: ["aBlock"],
  4130. source: "actionBlock: aBlock\x0a\x09actionBlock := aBlock",
  4131. messageSends: [],
  4132. referencedClasses: []
  4133. }),
  4134. globals.HLConfirmationWidget);
  4135. smalltalk.addMethod(
  4136. smalltalk.method({
  4137. selector: "cancel",
  4138. protocol: 'actions',
  4139. fn: function (){
  4140. var self=this;
  4141. return smalltalk.withContext(function($ctx1) {
  4142. _st(self._cancelBlock())._value();
  4143. self._remove();
  4144. return self}, function($ctx1) {$ctx1.fill(self,"cancel",{},globals.HLConfirmationWidget)})},
  4145. args: [],
  4146. source: "cancel\x0a\x09self cancelBlock value.\x0a\x09self remove",
  4147. messageSends: ["value", "cancelBlock", "remove"],
  4148. referencedClasses: []
  4149. }),
  4150. globals.HLConfirmationWidget);
  4151. smalltalk.addMethod(
  4152. smalltalk.method({
  4153. selector: "cancelBlock",
  4154. protocol: 'accessing',
  4155. fn: function (){
  4156. var self=this;
  4157. return smalltalk.withContext(function($ctx1) {
  4158. var $2,$1,$receiver;
  4159. $2=self["@cancelBlock"];
  4160. if(($receiver = $2) == null || $receiver.isNil){
  4161. $1=(function(){
  4162. });
  4163. } else {
  4164. $1=$2;
  4165. };
  4166. return $1;
  4167. }, function($ctx1) {$ctx1.fill(self,"cancelBlock",{},globals.HLConfirmationWidget)})},
  4168. args: [],
  4169. source: "cancelBlock\x0a\x09^ cancelBlock ifNil: [ [] ]",
  4170. messageSends: ["ifNil:"],
  4171. referencedClasses: []
  4172. }),
  4173. globals.HLConfirmationWidget);
  4174. smalltalk.addMethod(
  4175. smalltalk.method({
  4176. selector: "cancelBlock:",
  4177. protocol: 'accessing',
  4178. fn: function (aBlock){
  4179. var self=this;
  4180. self["@cancelBlock"]=aBlock;
  4181. return self},
  4182. args: ["aBlock"],
  4183. source: "cancelBlock: aBlock\x0a\x09cancelBlock := aBlock",
  4184. messageSends: [],
  4185. referencedClasses: []
  4186. }),
  4187. globals.HLConfirmationWidget);
  4188. smalltalk.addMethod(
  4189. smalltalk.method({
  4190. selector: "cancelButtonLabel",
  4191. protocol: 'accessing',
  4192. fn: function (){
  4193. var self=this;
  4194. return smalltalk.withContext(function($ctx1) {
  4195. var $2,$1,$receiver;
  4196. $2=self["@cancelButtonLabel"];
  4197. if(($receiver = $2) == null || $receiver.isNil){
  4198. $1="Cancel";
  4199. } else {
  4200. $1=$2;
  4201. };
  4202. return $1;
  4203. }, function($ctx1) {$ctx1.fill(self,"cancelButtonLabel",{},globals.HLConfirmationWidget)})},
  4204. args: [],
  4205. source: "cancelButtonLabel\x0a\x09^ cancelButtonLabel ifNil: [ 'Cancel' ]",
  4206. messageSends: ["ifNil:"],
  4207. referencedClasses: []
  4208. }),
  4209. globals.HLConfirmationWidget);
  4210. smalltalk.addMethod(
  4211. smalltalk.method({
  4212. selector: "cancelButtonLabel:",
  4213. protocol: 'accessing',
  4214. fn: function (aString){
  4215. var self=this;
  4216. var $1;
  4217. self["@cancelButtonLabel"]=aString;
  4218. $1=self["@cancelButtonLabel"];
  4219. return $1;
  4220. },
  4221. args: ["aString"],
  4222. source: "cancelButtonLabel: aString\x0a\x09^ cancelButtonLabel := aString",
  4223. messageSends: [],
  4224. referencedClasses: []
  4225. }),
  4226. globals.HLConfirmationWidget);
  4227. smalltalk.addMethod(
  4228. smalltalk.method({
  4229. selector: "confirm",
  4230. protocol: 'actions',
  4231. fn: function (){
  4232. var self=this;
  4233. return smalltalk.withContext(function($ctx1) {
  4234. self._remove();
  4235. _st(self._actionBlock())._value();
  4236. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},globals.HLConfirmationWidget)})},
  4237. args: [],
  4238. source: "confirm\x0a\x09self remove.\x0a\x09self actionBlock value",
  4239. messageSends: ["remove", "value", "actionBlock"],
  4240. referencedClasses: []
  4241. }),
  4242. globals.HLConfirmationWidget);
  4243. smalltalk.addMethod(
  4244. smalltalk.method({
  4245. selector: "confirmButtonLabel",
  4246. protocol: 'accessing',
  4247. fn: function (){
  4248. var self=this;
  4249. return smalltalk.withContext(function($ctx1) {
  4250. var $2,$1,$receiver;
  4251. $2=self["@confirmButtonLabel"];
  4252. if(($receiver = $2) == null || $receiver.isNil){
  4253. $1="Confirm";
  4254. } else {
  4255. $1=$2;
  4256. };
  4257. return $1;
  4258. }, function($ctx1) {$ctx1.fill(self,"confirmButtonLabel",{},globals.HLConfirmationWidget)})},
  4259. args: [],
  4260. source: "confirmButtonLabel\x0a\x09^ confirmButtonLabel ifNil: [ 'Confirm' ]",
  4261. messageSends: ["ifNil:"],
  4262. referencedClasses: []
  4263. }),
  4264. globals.HLConfirmationWidget);
  4265. smalltalk.addMethod(
  4266. smalltalk.method({
  4267. selector: "confirmButtonLabel:",
  4268. protocol: 'accessing',
  4269. fn: function (aString){
  4270. var self=this;
  4271. var $1;
  4272. self["@confirmButtonLabel"]=aString;
  4273. $1=self["@confirmButtonLabel"];
  4274. return $1;
  4275. },
  4276. args: ["aString"],
  4277. source: "confirmButtonLabel: aString\x0a\x09^ confirmButtonLabel := aString",
  4278. messageSends: [],
  4279. referencedClasses: []
  4280. }),
  4281. globals.HLConfirmationWidget);
  4282. smalltalk.addMethod(
  4283. smalltalk.method({
  4284. selector: "confirmationString",
  4285. protocol: 'accessing',
  4286. fn: function (){
  4287. var self=this;
  4288. return smalltalk.withContext(function($ctx1) {
  4289. var $2,$1,$receiver;
  4290. $2=self["@confirmationString"];
  4291. if(($receiver = $2) == null || $receiver.isNil){
  4292. $1="Confirm";
  4293. } else {
  4294. $1=$2;
  4295. };
  4296. return $1;
  4297. }, function($ctx1) {$ctx1.fill(self,"confirmationString",{},globals.HLConfirmationWidget)})},
  4298. args: [],
  4299. source: "confirmationString\x0a\x09^ confirmationString ifNil: [ 'Confirm' ]",
  4300. messageSends: ["ifNil:"],
  4301. referencedClasses: []
  4302. }),
  4303. globals.HLConfirmationWidget);
  4304. smalltalk.addMethod(
  4305. smalltalk.method({
  4306. selector: "confirmationString:",
  4307. protocol: 'accessing',
  4308. fn: function (aString){
  4309. var self=this;
  4310. self["@confirmationString"]=aString;
  4311. return self},
  4312. args: ["aString"],
  4313. source: "confirmationString: aString\x0a\x09confirmationString := aString",
  4314. messageSends: [],
  4315. referencedClasses: []
  4316. }),
  4317. globals.HLConfirmationWidget);
  4318. smalltalk.addMethod(
  4319. smalltalk.method({
  4320. selector: "renderButtonsOn:",
  4321. protocol: 'rendering',
  4322. fn: function (html){
  4323. var self=this;
  4324. var confirmButton;
  4325. return smalltalk.withContext(function($ctx1) {
  4326. var $1,$3,$4,$5,$6,$2;
  4327. $1=_st(html)._div();
  4328. _st($1)._class_("buttons");
  4329. $ctx1.sendIdx["class:"]=1;
  4330. $2=_st($1)._with_((function(){
  4331. return smalltalk.withContext(function($ctx2) {
  4332. $3=_st(html)._button();
  4333. $ctx2.sendIdx["button"]=1;
  4334. _st($3)._class_("button");
  4335. $ctx2.sendIdx["class:"]=2;
  4336. _st($3)._with_(self._cancelButtonLabel());
  4337. $ctx2.sendIdx["with:"]=2;
  4338. $4=_st($3)._onClick_((function(){
  4339. return smalltalk.withContext(function($ctx3) {
  4340. return self._cancel();
  4341. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  4342. $ctx2.sendIdx["onClick:"]=1;
  4343. $4;
  4344. $5=_st(html)._button();
  4345. _st($5)._class_("button default");
  4346. _st($5)._with_(self._confirmButtonLabel());
  4347. $6=_st($5)._onClick_((function(){
  4348. return smalltalk.withContext(function($ctx3) {
  4349. return self._confirm();
  4350. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  4351. confirmButton=$6;
  4352. return confirmButton;
  4353. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4354. $ctx1.sendIdx["with:"]=1;
  4355. self._giveFocusToButton_(confirmButton);
  4356. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html,confirmButton:confirmButton},globals.HLConfirmationWidget)})},
  4357. args: ["html"],
  4358. 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: self cancelButtonLabel;\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: self confirmButtonLabel;\x0a\x09\x09\x09\x09onClick: [ self confirm ] ].\x0a\x0a\x09self giveFocusToButton:confirmButton",
  4359. messageSends: ["class:", "div", "with:", "button", "cancelButtonLabel", "onClick:", "cancel", "confirmButtonLabel", "confirm", "giveFocusToButton:"],
  4360. referencedClasses: []
  4361. }),
  4362. globals.HLConfirmationWidget);
  4363. smalltalk.addMethod(
  4364. smalltalk.method({
  4365. selector: "renderMainOn:",
  4366. protocol: 'rendering',
  4367. fn: function (html){
  4368. var self=this;
  4369. return smalltalk.withContext(function($ctx1) {
  4370. var $1,$2;
  4371. $1=_st(html)._span();
  4372. _st($1)._class_("head");
  4373. $2=_st($1)._with_(self._confirmationString());
  4374. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},globals.HLConfirmationWidget)})},
  4375. args: ["html"],
  4376. source: "renderMainOn: html\x0a\x09html span \x0a\x09\x09class: 'head'; \x0a\x09\x09with: self confirmationString",
  4377. messageSends: ["class:", "span", "with:", "confirmationString"],
  4378. referencedClasses: []
  4379. }),
  4380. globals.HLConfirmationWidget);
  4381. smalltalk.addClass('HLRequestWidget', globals.HLConfirmationWidget, ['input', 'multiline', 'value'], 'Helios-Core');
  4382. globals.HLRequestWidget.comment="I display a modal window requesting user input.\x0a\x0a## API\x0a\x0a`HLWidget >> #request:do:` and `#request:value:do:` are convenience methods for creating modal request dialogs.";
  4383. smalltalk.addMethod(
  4384. smalltalk.method({
  4385. selector: "beMultiline",
  4386. protocol: 'accessing',
  4387. fn: function (){
  4388. var self=this;
  4389. self["@multiline"]=true;
  4390. return self},
  4391. args: [],
  4392. source: "beMultiline\x0a\x09multiline := true",
  4393. messageSends: [],
  4394. referencedClasses: []
  4395. }),
  4396. globals.HLRequestWidget);
  4397. smalltalk.addMethod(
  4398. smalltalk.method({
  4399. selector: "beSingleline",
  4400. protocol: 'accessing',
  4401. fn: function (){
  4402. var self=this;
  4403. self["@multiline"]=false;
  4404. return self},
  4405. args: [],
  4406. source: "beSingleline\x0a\x09multiline := false",
  4407. messageSends: [],
  4408. referencedClasses: []
  4409. }),
  4410. globals.HLRequestWidget);
  4411. smalltalk.addMethod(
  4412. smalltalk.method({
  4413. selector: "confirm",
  4414. protocol: 'actions',
  4415. fn: function (){
  4416. var self=this;
  4417. var val;
  4418. return smalltalk.withContext(function($ctx1) {
  4419. val=_st(_st(self["@input"])._asJQuery())._val();
  4420. self._remove();
  4421. _st(self._actionBlock())._value_(val);
  4422. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{val:val},globals.HLRequestWidget)})},
  4423. args: [],
  4424. source: "confirm\x0a\x09| val |\x0a\x09val := input asJQuery val.\x0a\x09self remove.\x0a\x09self actionBlock value: val",
  4425. messageSends: ["val", "asJQuery", "remove", "value:", "actionBlock"],
  4426. referencedClasses: []
  4427. }),
  4428. globals.HLRequestWidget);
  4429. smalltalk.addMethod(
  4430. smalltalk.method({
  4431. selector: "cssClass",
  4432. protocol: 'accessing',
  4433. fn: function (){
  4434. var self=this;
  4435. return "large";
  4436. },
  4437. args: [],
  4438. source: "cssClass\x0a\x09^ 'large'",
  4439. messageSends: [],
  4440. referencedClasses: []
  4441. }),
  4442. globals.HLRequestWidget);
  4443. smalltalk.addMethod(
  4444. smalltalk.method({
  4445. selector: "giveFocusToButton:",
  4446. protocol: 'private',
  4447. fn: function (aButton){
  4448. var self=this;
  4449. return self},
  4450. args: ["aButton"],
  4451. source: "giveFocusToButton: aButton",
  4452. messageSends: [],
  4453. referencedClasses: []
  4454. }),
  4455. globals.HLRequestWidget);
  4456. smalltalk.addMethod(
  4457. smalltalk.method({
  4458. selector: "isMultiline",
  4459. protocol: 'testing',
  4460. fn: function (){
  4461. var self=this;
  4462. return smalltalk.withContext(function($ctx1) {
  4463. var $2,$1,$receiver;
  4464. $2=self["@multiline"];
  4465. if(($receiver = $2) == null || $receiver.isNil){
  4466. $1=true;
  4467. } else {
  4468. $1=$2;
  4469. };
  4470. return $1;
  4471. }, function($ctx1) {$ctx1.fill(self,"isMultiline",{},globals.HLRequestWidget)})},
  4472. args: [],
  4473. source: "isMultiline\x0a\x09^ multiline ifNil: [ true ]",
  4474. messageSends: ["ifNil:"],
  4475. referencedClasses: []
  4476. }),
  4477. globals.HLRequestWidget);
  4478. smalltalk.addMethod(
  4479. smalltalk.method({
  4480. selector: "renderMainOn:",
  4481. protocol: 'rendering',
  4482. fn: function (html){
  4483. var self=this;
  4484. return smalltalk.withContext(function($ctx1) {
  4485. var $1,$2,$3,$4,$5,$6;
  4486. ($ctx1.supercall = true, globals.HLRequestWidget.superclass.fn.prototype._renderMainOn_.apply(_st(self), [html]));
  4487. $ctx1.supercall = false;
  4488. $1=self._isMultiline();
  4489. if(smalltalk.assert($1)){
  4490. self["@input"]=_st(html)._textarea();
  4491. self["@input"];
  4492. } else {
  4493. $2=_st(html)._input();
  4494. _st($2)._type_("text");
  4495. _st($2)._onKeyDown_((function(event){
  4496. return smalltalk.withContext(function($ctx2) {
  4497. $3=_st(_st(event)._keyCode()).__eq((13));
  4498. if(smalltalk.assert($3)){
  4499. return self._confirm();
  4500. };
  4501. }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1,3)})}));
  4502. $4=_st($2)._yourself();
  4503. self["@input"]=$4;
  4504. self["@input"];
  4505. };
  4506. $5=_st(self["@input"])._asJQuery();
  4507. _st($5)._val_(self._value());
  4508. $6=_st($5)._focus();
  4509. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},globals.HLRequestWidget)})},
  4510. args: ["html"],
  4511. source: "renderMainOn: html\x0a\x09super renderMainOn: html.\x0a\x09self isMultiline\x0a\x09\x09ifTrue: [ input := html textarea ]\x0a\x09\x09ifFalse: [ input := html input \x0a\x09\x09\x09type: 'text';\x0a\x09\x09\x09onKeyDown: [ :event |\x0a\x09\x09\x09\x09event keyCode = 13 ifTrue: [\x0a\x09\x09\x09\x09\x09self confirm ] ];\x0a\x09\x09\x09yourself ].\x0a\x09input asJQuery \x0a\x09\x09val: self value;\x0a\x09\x09focus",
  4512. messageSends: ["renderMainOn:", "ifTrue:ifFalse:", "isMultiline", "textarea", "type:", "input", "onKeyDown:", "ifTrue:", "=", "keyCode", "confirm", "yourself", "val:", "asJQuery", "value", "focus"],
  4513. referencedClasses: []
  4514. }),
  4515. globals.HLRequestWidget);
  4516. smalltalk.addMethod(
  4517. smalltalk.method({
  4518. selector: "value",
  4519. protocol: 'accessing',
  4520. fn: function (){
  4521. var self=this;
  4522. return smalltalk.withContext(function($ctx1) {
  4523. var $2,$1,$receiver;
  4524. $2=self["@value"];
  4525. if(($receiver = $2) == null || $receiver.isNil){
  4526. $1="";
  4527. } else {
  4528. $1=$2;
  4529. };
  4530. return $1;
  4531. }, function($ctx1) {$ctx1.fill(self,"value",{},globals.HLRequestWidget)})},
  4532. args: [],
  4533. source: "value\x0a\x09^ value ifNil: [ '' ]",
  4534. messageSends: ["ifNil:"],
  4535. referencedClasses: []
  4536. }),
  4537. globals.HLRequestWidget);
  4538. smalltalk.addMethod(
  4539. smalltalk.method({
  4540. selector: "value:",
  4541. protocol: 'accessing',
  4542. fn: function (aString){
  4543. var self=this;
  4544. self["@value"]=aString;
  4545. return self},
  4546. args: ["aString"],
  4547. source: "value: aString\x0a\x09value := aString",
  4548. messageSends: [],
  4549. referencedClasses: []
  4550. }),
  4551. globals.HLRequestWidget);
  4552. smalltalk.addClass('HLProgressWidget', globals.HLModalWidget, ['progressBars', 'visible'], 'Helios-Core');
  4553. globals.HLProgressWidget.comment="I am a widget used to display progress modal dialogs.\x0a\x0aMy default instance is accessed with `HLProgressWidget class >> #default`.\x0a\x0aSee `HLProgressHandler` for usage.";
  4554. smalltalk.addMethod(
  4555. smalltalk.method({
  4556. selector: "addProgressBar:",
  4557. protocol: 'actions',
  4558. fn: function (aProgressBar){
  4559. var self=this;
  4560. return smalltalk.withContext(function($ctx1) {
  4561. self._show();
  4562. _st(self._progressBars())._add_(aProgressBar);
  4563. _st(aProgressBar)._appendToJQuery_(_st(_st(self._wrapper())._asJQuery())._find_(".dialog"));
  4564. return self}, function($ctx1) {$ctx1.fill(self,"addProgressBar:",{aProgressBar:aProgressBar},globals.HLProgressWidget)})},
  4565. args: ["aProgressBar"],
  4566. source: "addProgressBar: aProgressBar\x0a\x09self show.\x0a\x09self progressBars add: aProgressBar.\x0a\x09aProgressBar appendToJQuery: (self wrapper asJQuery find: '.dialog')",
  4567. messageSends: ["show", "add:", "progressBars", "appendToJQuery:", "find:", "asJQuery", "wrapper"],
  4568. referencedClasses: []
  4569. }),
  4570. globals.HLProgressWidget);
  4571. smalltalk.addMethod(
  4572. smalltalk.method({
  4573. selector: "do:on:displaying:",
  4574. protocol: 'actions',
  4575. fn: function (aBlock,aCollection,aString){
  4576. var self=this;
  4577. var progressBar;
  4578. function $HLProgressBarWidget(){return globals.HLProgressBarWidget||(typeof HLProgressBarWidget=="undefined"?nil:HLProgressBarWidget)}
  4579. return smalltalk.withContext(function($ctx1) {
  4580. var $1,$2;
  4581. $1=_st($HLProgressBarWidget())._new();
  4582. _st($1)._parent_(self);
  4583. _st($1)._label_(aString);
  4584. _st($1)._workBlock_(aBlock);
  4585. _st($1)._collection_(aCollection);
  4586. $2=_st($1)._yourself();
  4587. progressBar=$2;
  4588. self._addProgressBar_(progressBar);
  4589. _st(progressBar)._start();
  4590. return self}, function($ctx1) {$ctx1.fill(self,"do:on:displaying:",{aBlock:aBlock,aCollection:aCollection,aString:aString,progressBar:progressBar},globals.HLProgressWidget)})},
  4591. args: ["aBlock", "aCollection", "aString"],
  4592. 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",
  4593. messageSends: ["parent:", "new", "label:", "workBlock:", "collection:", "yourself", "addProgressBar:", "start"],
  4594. referencedClasses: ["HLProgressBarWidget"]
  4595. }),
  4596. globals.HLProgressWidget);
  4597. smalltalk.addMethod(
  4598. smalltalk.method({
  4599. selector: "flush",
  4600. protocol: 'actions',
  4601. fn: function (){
  4602. var self=this;
  4603. return smalltalk.withContext(function($ctx1) {
  4604. _st(self._progressBars())._do_((function(each){
  4605. return smalltalk.withContext(function($ctx2) {
  4606. return self._removeProgressBar_(each);
  4607. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  4608. return self}, function($ctx1) {$ctx1.fill(self,"flush",{},globals.HLProgressWidget)})},
  4609. args: [],
  4610. source: "flush\x0a\x09self progressBars do: [ :each |\x0a\x09\x09self removeProgressBar: each ]",
  4611. messageSends: ["do:", "progressBars", "removeProgressBar:"],
  4612. referencedClasses: []
  4613. }),
  4614. globals.HLProgressWidget);
  4615. smalltalk.addMethod(
  4616. smalltalk.method({
  4617. selector: "hasButtons",
  4618. protocol: 'testing',
  4619. fn: function (){
  4620. var self=this;
  4621. return false;
  4622. },
  4623. args: [],
  4624. source: "hasButtons\x0a\x09^ false",
  4625. messageSends: [],
  4626. referencedClasses: []
  4627. }),
  4628. globals.HLProgressWidget);
  4629. smalltalk.addMethod(
  4630. smalltalk.method({
  4631. selector: "isVisible",
  4632. protocol: 'testing',
  4633. fn: function (){
  4634. var self=this;
  4635. return smalltalk.withContext(function($ctx1) {
  4636. var $2,$1,$receiver;
  4637. $2=self["@visible"];
  4638. if(($receiver = $2) == null || $receiver.isNil){
  4639. $1=false;
  4640. } else {
  4641. $1=$2;
  4642. };
  4643. return $1;
  4644. }, function($ctx1) {$ctx1.fill(self,"isVisible",{},globals.HLProgressWidget)})},
  4645. args: [],
  4646. source: "isVisible\x0a\x09^ visible ifNil: [ false ]",
  4647. messageSends: ["ifNil:"],
  4648. referencedClasses: []
  4649. }),
  4650. globals.HLProgressWidget);
  4651. smalltalk.addMethod(
  4652. smalltalk.method({
  4653. selector: "progressBars",
  4654. protocol: 'accessing',
  4655. fn: function (){
  4656. var self=this;
  4657. function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  4658. return smalltalk.withContext(function($ctx1) {
  4659. var $2,$1,$receiver;
  4660. $2=self["@progressBars"];
  4661. if(($receiver = $2) == null || $receiver.isNil){
  4662. self["@progressBars"]=_st($OrderedCollection())._new();
  4663. $1=self["@progressBars"];
  4664. } else {
  4665. $1=$2;
  4666. };
  4667. return $1;
  4668. }, function($ctx1) {$ctx1.fill(self,"progressBars",{},globals.HLProgressWidget)})},
  4669. args: [],
  4670. source: "progressBars\x0a\x09^ progressBars ifNil: [ progressBars := OrderedCollection new ]",
  4671. messageSends: ["ifNil:", "new"],
  4672. referencedClasses: ["OrderedCollection"]
  4673. }),
  4674. globals.HLProgressWidget);
  4675. smalltalk.addMethod(
  4676. smalltalk.method({
  4677. selector: "remove",
  4678. protocol: 'actions',
  4679. fn: function (){
  4680. var self=this;
  4681. return smalltalk.withContext(function($ctx1) {
  4682. var $1;
  4683. $1=self._isVisible();
  4684. if(smalltalk.assert($1)){
  4685. self["@visible"]=false;
  4686. self["@visible"];
  4687. ($ctx1.supercall = true, globals.HLProgressWidget.superclass.fn.prototype._remove.apply(_st(self), []));
  4688. $ctx1.supercall = false;
  4689. };
  4690. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},globals.HLProgressWidget)})},
  4691. args: [],
  4692. source: "remove\x0a\x09self isVisible ifTrue: [\x0a\x09\x09visible := false.\x0a\x09\x09super remove ]",
  4693. messageSends: ["ifTrue:", "isVisible", "remove"],
  4694. referencedClasses: []
  4695. }),
  4696. globals.HLProgressWidget);
  4697. smalltalk.addMethod(
  4698. smalltalk.method({
  4699. selector: "removeProgressBar:",
  4700. protocol: 'actions',
  4701. fn: function (aProgressBar){
  4702. var self=this;
  4703. return smalltalk.withContext(function($ctx1) {
  4704. var $1;
  4705. $1=self._progressBars();
  4706. $ctx1.sendIdx["progressBars"]=1;
  4707. _st($1)._remove_ifAbsent_(aProgressBar,(function(){
  4708. }));
  4709. _st(_st(_st(aProgressBar)._wrapper())._asJQuery())._remove();
  4710. $ctx1.sendIdx["remove"]=1;
  4711. _st(self._progressBars())._ifEmpty_((function(){
  4712. return smalltalk.withContext(function($ctx2) {
  4713. return self._remove();
  4714. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  4715. return self}, function($ctx1) {$ctx1.fill(self,"removeProgressBar:",{aProgressBar:aProgressBar},globals.HLProgressWidget)})},
  4716. args: ["aProgressBar"],
  4717. source: "removeProgressBar: aProgressBar\x0a\x09self progressBars remove: aProgressBar ifAbsent: [].\x0a\x09aProgressBar wrapper asJQuery remove.\x0a\x09\x0a\x09self progressBars ifEmpty: [ self remove ]",
  4718. messageSends: ["remove:ifAbsent:", "progressBars", "remove", "asJQuery", "wrapper", "ifEmpty:"],
  4719. referencedClasses: []
  4720. }),
  4721. globals.HLProgressWidget);
  4722. smalltalk.addMethod(
  4723. smalltalk.method({
  4724. selector: "renderMainOn:",
  4725. protocol: 'rendering',
  4726. fn: function (html){
  4727. var self=this;
  4728. return smalltalk.withContext(function($ctx1) {
  4729. _st(self._progressBars())._do_((function(each){
  4730. return smalltalk.withContext(function($ctx2) {
  4731. return _st(html)._with_(each);
  4732. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  4733. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},globals.HLProgressWidget)})},
  4734. args: ["html"],
  4735. source: "renderMainOn: html\x0a\x09self progressBars do: [ :each |\x0a\x09\x09html with: each ]",
  4736. messageSends: ["do:", "progressBars", "with:"],
  4737. referencedClasses: []
  4738. }),
  4739. globals.HLProgressWidget);
  4740. smalltalk.addMethod(
  4741. smalltalk.method({
  4742. selector: "show",
  4743. protocol: 'actions',
  4744. fn: function (){
  4745. var self=this;
  4746. return smalltalk.withContext(function($ctx1) {
  4747. var $1;
  4748. $1=self._isVisible();
  4749. if(! smalltalk.assert($1)){
  4750. self["@visible"]=true;
  4751. self["@visible"];
  4752. ($ctx1.supercall = true, globals.HLProgressWidget.superclass.fn.prototype._show.apply(_st(self), []));
  4753. $ctx1.supercall = false;
  4754. };
  4755. return self}, function($ctx1) {$ctx1.fill(self,"show",{},globals.HLProgressWidget)})},
  4756. args: [],
  4757. source: "show\x0a\x09self isVisible ifFalse: [\x0a\x09\x09visible := true.\x0a\x09\x09super show ]",
  4758. messageSends: ["ifFalse:", "isVisible", "show"],
  4759. referencedClasses: []
  4760. }),
  4761. globals.HLProgressWidget);
  4762. globals.HLProgressWidget.klass.iVarNames = ['default'];
  4763. smalltalk.addMethod(
  4764. smalltalk.method({
  4765. selector: "default",
  4766. protocol: 'accessing',
  4767. fn: function (){
  4768. var self=this;
  4769. return smalltalk.withContext(function($ctx1) {
  4770. var $2,$1,$receiver;
  4771. $2=self["@default"];
  4772. if(($receiver = $2) == null || $receiver.isNil){
  4773. self["@default"]=self._new();
  4774. $1=self["@default"];
  4775. } else {
  4776. $1=$2;
  4777. };
  4778. return $1;
  4779. }, function($ctx1) {$ctx1.fill(self,"default",{},globals.HLProgressWidget.klass)})},
  4780. args: [],
  4781. source: "default\x0a\x09^ default ifNil: [ default := self new ]",
  4782. messageSends: ["ifNil:", "new"],
  4783. referencedClasses: []
  4784. }),
  4785. globals.HLProgressWidget.klass);
  4786. smalltalk.addClass('HLTabSelectionWidget', globals.HLModalWidget, ['tabs', 'tabList', 'selectedTab', 'selectCallback', 'cancelCallback', 'confirmCallback'], 'Helios-Core');
  4787. globals.HLTabSelectionWidget.comment="I am a modal window used to select or create tabs.";
  4788. smalltalk.addMethod(
  4789. smalltalk.method({
  4790. selector: "cancel",
  4791. protocol: 'actions',
  4792. fn: function (){
  4793. var self=this;
  4794. return smalltalk.withContext(function($ctx1) {
  4795. self._remove();
  4796. _st(self._cancelCallback())._value();
  4797. return self}, function($ctx1) {$ctx1.fill(self,"cancel",{},globals.HLTabSelectionWidget)})},
  4798. args: [],
  4799. source: "cancel\x0a\x09self remove.\x0a\x09self cancelCallback value",
  4800. messageSends: ["remove", "value", "cancelCallback"],
  4801. referencedClasses: []
  4802. }),
  4803. globals.HLTabSelectionWidget);
  4804. smalltalk.addMethod(
  4805. smalltalk.method({
  4806. selector: "cancelCallback",
  4807. protocol: 'accessing',
  4808. fn: function (){
  4809. var self=this;
  4810. return smalltalk.withContext(function($ctx1) {
  4811. var $2,$1,$receiver;
  4812. $2=self["@cancelCallback"];
  4813. if(($receiver = $2) == null || $receiver.isNil){
  4814. $1=(function(){
  4815. });
  4816. } else {
  4817. $1=$2;
  4818. };
  4819. return $1;
  4820. }, function($ctx1) {$ctx1.fill(self,"cancelCallback",{},globals.HLTabSelectionWidget)})},
  4821. args: [],
  4822. source: "cancelCallback\x0a\x09^ cancelCallback ifNil: [ [] ]",
  4823. messageSends: ["ifNil:"],
  4824. referencedClasses: []
  4825. }),
  4826. globals.HLTabSelectionWidget);
  4827. smalltalk.addMethod(
  4828. smalltalk.method({
  4829. selector: "cancelCallback:",
  4830. protocol: 'accessing',
  4831. fn: function (aBlock){
  4832. var self=this;
  4833. self["@cancelCallback"]=aBlock;
  4834. return self},
  4835. args: ["aBlock"],
  4836. source: "cancelCallback: aBlock\x0a\x09cancelCallback := aBlock",
  4837. messageSends: [],
  4838. referencedClasses: []
  4839. }),
  4840. globals.HLTabSelectionWidget);
  4841. smalltalk.addMethod(
  4842. smalltalk.method({
  4843. selector: "confirm",
  4844. protocol: 'actions',
  4845. fn: function (){
  4846. var self=this;
  4847. return smalltalk.withContext(function($ctx1) {
  4848. self._remove();
  4849. _st(self._confirmCallback())._value_(self._selectedTab());
  4850. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},globals.HLTabSelectionWidget)})},
  4851. args: [],
  4852. source: "confirm\x0a\x09self remove.\x0a\x09self confirmCallback value: self selectedTab",
  4853. messageSends: ["remove", "value:", "confirmCallback", "selectedTab"],
  4854. referencedClasses: []
  4855. }),
  4856. globals.HLTabSelectionWidget);
  4857. smalltalk.addMethod(
  4858. smalltalk.method({
  4859. selector: "confirmCallback",
  4860. protocol: 'accessing',
  4861. fn: function (){
  4862. var self=this;
  4863. return smalltalk.withContext(function($ctx1) {
  4864. var $2,$1,$receiver;
  4865. $2=self["@confirmCallback"];
  4866. if(($receiver = $2) == null || $receiver.isNil){
  4867. $1=(function(){
  4868. });
  4869. } else {
  4870. $1=$2;
  4871. };
  4872. return $1;
  4873. }, function($ctx1) {$ctx1.fill(self,"confirmCallback",{},globals.HLTabSelectionWidget)})},
  4874. args: [],
  4875. source: "confirmCallback\x0a\x09^ confirmCallback ifNil: [ [] ]",
  4876. messageSends: ["ifNil:"],
  4877. referencedClasses: []
  4878. }),
  4879. globals.HLTabSelectionWidget);
  4880. smalltalk.addMethod(
  4881. smalltalk.method({
  4882. selector: "confirmCallback:",
  4883. protocol: 'accessing',
  4884. fn: function (aBlock){
  4885. var self=this;
  4886. self["@confirmCallback"]=aBlock;
  4887. return self},
  4888. args: ["aBlock"],
  4889. source: "confirmCallback: aBlock\x0a\x09confirmCallback := aBlock",
  4890. messageSends: [],
  4891. referencedClasses: []
  4892. }),
  4893. globals.HLTabSelectionWidget);
  4894. smalltalk.addMethod(
  4895. smalltalk.method({
  4896. selector: "renderButtonsOn:",
  4897. protocol: 'rendering',
  4898. fn: function (html){
  4899. var self=this;
  4900. var confirmButton;
  4901. return smalltalk.withContext(function($ctx1) {
  4902. var $1,$3,$4,$5,$6,$2;
  4903. $1=_st(html)._div();
  4904. _st($1)._class_("buttons");
  4905. $ctx1.sendIdx["class:"]=1;
  4906. $2=_st($1)._with_((function(){
  4907. return smalltalk.withContext(function($ctx2) {
  4908. $3=_st(html)._button();
  4909. $ctx2.sendIdx["button"]=1;
  4910. _st($3)._class_("button");
  4911. $ctx2.sendIdx["class:"]=2;
  4912. _st($3)._with_("Cancel");
  4913. $ctx2.sendIdx["with:"]=2;
  4914. $4=_st($3)._onClick_((function(){
  4915. return smalltalk.withContext(function($ctx3) {
  4916. return self._cancel();
  4917. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  4918. $ctx2.sendIdx["onClick:"]=1;
  4919. $4;
  4920. $5=_st(html)._button();
  4921. _st($5)._class_("button default");
  4922. _st($5)._with_("Select tab");
  4923. $6=_st($5)._onClick_((function(){
  4924. return smalltalk.withContext(function($ctx3) {
  4925. return self._confirm();
  4926. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  4927. confirmButton=$6;
  4928. return confirmButton;
  4929. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  4930. $ctx1.sendIdx["with:"]=1;
  4931. self._giveFocusToButton_(confirmButton);
  4932. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html,confirmButton:confirmButton},globals.HLTabSelectionWidget)})},
  4933. args: ["html"],
  4934. 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: 'Select tab';\x0a\x09\x09\x09\x09onClick: [ self confirm ] ].\x0a\x0a\x09self giveFocusToButton:confirmButton",
  4935. messageSends: ["class:", "div", "with:", "button", "onClick:", "cancel", "confirm", "giveFocusToButton:"],
  4936. referencedClasses: []
  4937. }),
  4938. globals.HLTabSelectionWidget);
  4939. smalltalk.addMethod(
  4940. smalltalk.method({
  4941. selector: "renderContentOn:",
  4942. protocol: 'rendering',
  4943. fn: function (html){
  4944. var self=this;
  4945. return smalltalk.withContext(function($ctx1) {
  4946. ($ctx1.supercall = true, globals.HLTabSelectionWidget.superclass.fn.prototype._renderContentOn_.apply(_st(self), [html]));
  4947. $ctx1.supercall = false;
  4948. _st(self._tabList())._focus();
  4949. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLTabSelectionWidget)})},
  4950. args: ["html"],
  4951. source: "renderContentOn: html\x0a\x09super renderContentOn: html.\x0a\x09self tabList focus",
  4952. messageSends: ["renderContentOn:", "focus", "tabList"],
  4953. referencedClasses: []
  4954. }),
  4955. globals.HLTabSelectionWidget);
  4956. smalltalk.addMethod(
  4957. smalltalk.method({
  4958. selector: "renderMainOn:",
  4959. protocol: 'rendering',
  4960. fn: function (html){
  4961. var self=this;
  4962. return smalltalk.withContext(function($ctx1) {
  4963. var $1,$2;
  4964. $1=_st(html)._div();
  4965. _st($1)._class_("title");
  4966. $2=_st($1)._with_("Tab selection");
  4967. $ctx1.sendIdx["with:"]=1;
  4968. _st(html)._with_(self._tabList());
  4969. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},globals.HLTabSelectionWidget)})},
  4970. args: ["html"],
  4971. source: "renderMainOn: html\x0a\x09html div \x0a\x09\x09class: 'title'; \x0a\x09\x09with: 'Tab selection'.\x0a\x09\x0a\x09html with: self tabList",
  4972. messageSends: ["class:", "div", "with:", "tabList"],
  4973. referencedClasses: []
  4974. }),
  4975. globals.HLTabSelectionWidget);
  4976. smalltalk.addMethod(
  4977. smalltalk.method({
  4978. selector: "renderTab:on:",
  4979. protocol: 'rendering',
  4980. fn: function (aTab,html){
  4981. var self=this;
  4982. return smalltalk.withContext(function($ctx1) {
  4983. var $1,$2;
  4984. $1=_st(html)._span();
  4985. _st($1)._class_(_st(aTab)._cssClass());
  4986. $2=_st($1)._with_(_st(aTab)._label());
  4987. return self}, function($ctx1) {$ctx1.fill(self,"renderTab:on:",{aTab:aTab,html:html},globals.HLTabSelectionWidget)})},
  4988. args: ["aTab", "html"],
  4989. source: "renderTab: aTab on: html\x0a\x09html \x0a\x09\x09span \x0a\x09\x09\x09class: aTab cssClass;\x0a\x09\x09\x09with: aTab label",
  4990. messageSends: ["class:", "span", "cssClass", "with:", "label"],
  4991. referencedClasses: []
  4992. }),
  4993. globals.HLTabSelectionWidget);
  4994. smalltalk.addMethod(
  4995. smalltalk.method({
  4996. selector: "renderTabsOn:",
  4997. protocol: 'rendering',
  4998. fn: function (html){
  4999. var self=this;
  5000. return smalltalk.withContext(function($ctx1) {
  5001. var $1,$2;
  5002. _st(self._tabs())._do_((function(each){
  5003. return smalltalk.withContext(function($ctx2) {
  5004. return _st(_st(html)._li())._with_((function(){
  5005. return smalltalk.withContext(function($ctx3) {
  5006. $1=_st(html)._a();
  5007. _st($1)._with_((function(){
  5008. return smalltalk.withContext(function($ctx4) {
  5009. return self._renderTab_on_(each,html);
  5010. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
  5011. $2=_st($1)._onClick_((function(){
  5012. return smalltalk.withContext(function($ctx4) {
  5013. return self._selectTab_(each);
  5014. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)})}));
  5015. return $2;
  5016. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  5017. $ctx2.sendIdx["with:"]=1;
  5018. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  5019. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},globals.HLTabSelectionWidget)})},
  5020. args: ["html"],
  5021. 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 ] ] ]",
  5022. messageSends: ["do:", "tabs", "with:", "li", "a", "renderTab:on:", "onClick:", "selectTab:"],
  5023. referencedClasses: []
  5024. }),
  5025. globals.HLTabSelectionWidget);
  5026. smalltalk.addMethod(
  5027. smalltalk.method({
  5028. selector: "selectCallback",
  5029. protocol: 'accessing',
  5030. fn: function (){
  5031. var self=this;
  5032. return smalltalk.withContext(function($ctx1) {
  5033. var $2,$1,$receiver;
  5034. $2=self["@selectCallback"];
  5035. if(($receiver = $2) == null || $receiver.isNil){
  5036. $1=(function(){
  5037. });
  5038. } else {
  5039. $1=$2;
  5040. };
  5041. return $1;
  5042. }, function($ctx1) {$ctx1.fill(self,"selectCallback",{},globals.HLTabSelectionWidget)})},
  5043. args: [],
  5044. source: "selectCallback\x0a\x09^ selectCallback ifNil: [ [] ]",
  5045. messageSends: ["ifNil:"],
  5046. referencedClasses: []
  5047. }),
  5048. globals.HLTabSelectionWidget);
  5049. smalltalk.addMethod(
  5050. smalltalk.method({
  5051. selector: "selectCallback:",
  5052. protocol: 'accessing',
  5053. fn: function (aBlock){
  5054. var self=this;
  5055. self["@selectCallback"]=aBlock;
  5056. return self},
  5057. args: ["aBlock"],
  5058. source: "selectCallback: aBlock\x0a\x09selectCallback := aBlock",
  5059. messageSends: [],
  5060. referencedClasses: []
  5061. }),
  5062. globals.HLTabSelectionWidget);
  5063. smalltalk.addMethod(
  5064. smalltalk.method({
  5065. selector: "selectTab:",
  5066. protocol: 'actions',
  5067. fn: function (aTab){
  5068. var self=this;
  5069. return smalltalk.withContext(function($ctx1) {
  5070. self._selectedTab_(aTab);
  5071. _st(self._selectCallback())._value_(aTab);
  5072. return self}, function($ctx1) {$ctx1.fill(self,"selectTab:",{aTab:aTab},globals.HLTabSelectionWidget)})},
  5073. args: ["aTab"],
  5074. source: "selectTab: aTab\x0a\x09self selectedTab: aTab.\x0a\x09self selectCallback value: aTab",
  5075. messageSends: ["selectedTab:", "value:", "selectCallback"],
  5076. referencedClasses: []
  5077. }),
  5078. globals.HLTabSelectionWidget);
  5079. smalltalk.addMethod(
  5080. smalltalk.method({
  5081. selector: "selectedTab",
  5082. protocol: 'accessing',
  5083. fn: function (){
  5084. var self=this;
  5085. var $1;
  5086. $1=self["@selectedTab"];
  5087. return $1;
  5088. },
  5089. args: [],
  5090. source: "selectedTab\x0a\x09^ selectedTab",
  5091. messageSends: [],
  5092. referencedClasses: []
  5093. }),
  5094. globals.HLTabSelectionWidget);
  5095. smalltalk.addMethod(
  5096. smalltalk.method({
  5097. selector: "selectedTab:",
  5098. protocol: 'accessing',
  5099. fn: function (aTab){
  5100. var self=this;
  5101. self["@selectedTab"]=aTab;
  5102. return self},
  5103. args: ["aTab"],
  5104. source: "selectedTab: aTab\x0a\x09selectedTab := aTab",
  5105. messageSends: [],
  5106. referencedClasses: []
  5107. }),
  5108. globals.HLTabSelectionWidget);
  5109. smalltalk.addMethod(
  5110. smalltalk.method({
  5111. selector: "setupKeyBindings",
  5112. protocol: 'actions',
  5113. fn: function (){
  5114. var self=this;
  5115. function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
  5116. return smalltalk.withContext(function($ctx1) {
  5117. var $1;
  5118. ($ctx1.supercall = true, globals.HLTabSelectionWidget.superclass.fn.prototype._setupKeyBindings.apply(_st(self), []));
  5119. $ctx1.supercall = false;
  5120. _st(".dialog"._asJQuery())._keyup_((function(e){
  5121. return smalltalk.withContext(function($ctx2) {
  5122. $1=_st(_st(e)._keyCode()).__eq(_st(_st($String())._cr())._asciiValue());
  5123. if(smalltalk.assert($1)){
  5124. return self._confirm();
  5125. };
  5126. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,1)})}));
  5127. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},globals.HLTabSelectionWidget)})},
  5128. args: [],
  5129. source: "setupKeyBindings\x0a\x09super setupKeyBindings.\x0a\x09'.dialog' asJQuery keyup: [ :e |\x0a\x09\x09e keyCode = String cr asciiValue ifTrue: [ self confirm ] ]",
  5130. messageSends: ["setupKeyBindings", "keyup:", "asJQuery", "ifTrue:", "=", "keyCode", "asciiValue", "cr", "confirm"],
  5131. referencedClasses: ["String"]
  5132. }),
  5133. globals.HLTabSelectionWidget);
  5134. smalltalk.addMethod(
  5135. smalltalk.method({
  5136. selector: "tabList",
  5137. protocol: 'rendering',
  5138. fn: function (){
  5139. var self=this;
  5140. function $HLTabListWidget(){return globals.HLTabListWidget||(typeof HLTabListWidget=="undefined"?nil:HLTabListWidget)}
  5141. return smalltalk.withContext(function($ctx1) {
  5142. var $1,$2,$3,$4,$receiver;
  5143. $1=self["@tabList"];
  5144. if(($receiver = $1) == null || $receiver.isNil){
  5145. self["@tabList"]=_st($HLTabListWidget())._new();
  5146. self["@tabList"];
  5147. $2=self["@tabList"];
  5148. _st($2)._callback_((function(tab){
  5149. return smalltalk.withContext(function($ctx2) {
  5150. self._selectTab_(tab);
  5151. return _st(self["@tabList"])._focus();
  5152. }, function($ctx2) {$ctx2.fillBlock({tab:tab},$ctx1,2)})}));
  5153. _st($2)._selectedItem_(self._selectedTab());
  5154. $3=_st($2)._items_(self._tabs());
  5155. $3;
  5156. } else {
  5157. $1;
  5158. };
  5159. $4=self["@tabList"];
  5160. return $4;
  5161. }, function($ctx1) {$ctx1.fill(self,"tabList",{},globals.HLTabSelectionWidget)})},
  5162. args: [],
  5163. 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",
  5164. messageSends: ["ifNil:", "new", "callback:", "selectTab:", "focus", "selectedItem:", "selectedTab", "items:", "tabs"],
  5165. referencedClasses: ["HLTabListWidget"]
  5166. }),
  5167. globals.HLTabSelectionWidget);
  5168. smalltalk.addMethod(
  5169. smalltalk.method({
  5170. selector: "tabs",
  5171. protocol: 'accessing',
  5172. fn: function (){
  5173. var self=this;
  5174. return smalltalk.withContext(function($ctx1) {
  5175. var $2,$1,$receiver;
  5176. $2=self["@tabs"];
  5177. if(($receiver = $2) == null || $receiver.isNil){
  5178. $1=[];
  5179. } else {
  5180. $1=$2;
  5181. };
  5182. return $1;
  5183. }, function($ctx1) {$ctx1.fill(self,"tabs",{},globals.HLTabSelectionWidget)})},
  5184. args: [],
  5185. source: "tabs\x0a\x09^ tabs ifNil: [ #() ]",
  5186. messageSends: ["ifNil:"],
  5187. referencedClasses: []
  5188. }),
  5189. globals.HLTabSelectionWidget);
  5190. smalltalk.addMethod(
  5191. smalltalk.method({
  5192. selector: "tabs:",
  5193. protocol: 'accessing',
  5194. fn: function (aCollection){
  5195. var self=this;
  5196. self["@tabs"]=aCollection;
  5197. return self},
  5198. args: ["aCollection"],
  5199. source: "tabs: aCollection\x0a\x09tabs := aCollection",
  5200. messageSends: [],
  5201. referencedClasses: []
  5202. }),
  5203. globals.HLTabSelectionWidget);
  5204. smalltalk.addClass('HLProgressBarWidget', globals.HLWidget, ['label', 'parent', 'workBlock', 'collection', 'bar'], 'Helios-Core');
  5205. globals.HLProgressBarWidget.comment="I am a widget used to display a progress bar while iterating over a collection.";
  5206. smalltalk.addMethod(
  5207. smalltalk.method({
  5208. selector: "collection",
  5209. protocol: 'accessing',
  5210. fn: function (){
  5211. var self=this;
  5212. var $1;
  5213. $1=self["@collection"];
  5214. return $1;
  5215. },
  5216. args: [],
  5217. source: "collection\x0a\x09^ collection",
  5218. messageSends: [],
  5219. referencedClasses: []
  5220. }),
  5221. globals.HLProgressBarWidget);
  5222. smalltalk.addMethod(
  5223. smalltalk.method({
  5224. selector: "collection:",
  5225. protocol: 'accessing',
  5226. fn: function (aCollection){
  5227. var self=this;
  5228. self["@collection"]=aCollection;
  5229. return self},
  5230. args: ["aCollection"],
  5231. source: "collection: aCollection\x0a\x09collection := aCollection",
  5232. messageSends: [],
  5233. referencedClasses: []
  5234. }),
  5235. globals.HLProgressBarWidget);
  5236. smalltalk.addMethod(
  5237. smalltalk.method({
  5238. selector: "evaluateAt:",
  5239. protocol: 'actions',
  5240. fn: function (anInteger){
  5241. var self=this;
  5242. return smalltalk.withContext(function($ctx1) {
  5243. var $4,$3,$2,$1,$7,$6,$5;
  5244. $4=self._collection();
  5245. $ctx1.sendIdx["collection"]=1;
  5246. $3=_st($4)._size();
  5247. $ctx1.sendIdx["size"]=1;
  5248. $2=_st(anInteger).__slash($3);
  5249. $1=_st($2).__star((100));
  5250. self._updateProgress_($1);
  5251. $7=self._collection();
  5252. $ctx1.sendIdx["collection"]=2;
  5253. $6=_st($7)._size();
  5254. $5=_st(anInteger).__lt_eq($6);
  5255. if(smalltalk.assert($5)){
  5256. _st((function(){
  5257. return smalltalk.withContext(function($ctx2) {
  5258. _st(self._workBlock())._value_(_st(self._collection())._at_(anInteger));
  5259. return self._evaluateAt_(_st(anInteger).__plus((1)));
  5260. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}))._valueWithTimeout_((10));
  5261. $ctx1.sendIdx["valueWithTimeout:"]=1;
  5262. } else {
  5263. _st((function(){
  5264. return smalltalk.withContext(function($ctx2) {
  5265. return self._remove();
  5266. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}))._valueWithTimeout_((500));
  5267. };
  5268. return self}, function($ctx1) {$ctx1.fill(self,"evaluateAt:",{anInteger:anInteger},globals.HLProgressBarWidget)})},
  5269. args: ["anInteger"],
  5270. 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 ]",
  5271. messageSends: ["updateProgress:", "*", "/", "size", "collection", "ifTrue:ifFalse:", "<=", "valueWithTimeout:", "value:", "workBlock", "at:", "evaluateAt:", "+", "remove"],
  5272. referencedClasses: []
  5273. }),
  5274. globals.HLProgressBarWidget);
  5275. smalltalk.addMethod(
  5276. smalltalk.method({
  5277. selector: "label",
  5278. protocol: 'accessing',
  5279. fn: function (){
  5280. var self=this;
  5281. var $1;
  5282. $1=self["@label"];
  5283. return $1;
  5284. },
  5285. args: [],
  5286. source: "label\x0a\x09^ label",
  5287. messageSends: [],
  5288. referencedClasses: []
  5289. }),
  5290. globals.HLProgressBarWidget);
  5291. smalltalk.addMethod(
  5292. smalltalk.method({
  5293. selector: "label:",
  5294. protocol: 'accessing',
  5295. fn: function (aString){
  5296. var self=this;
  5297. self["@label"]=aString;
  5298. return self},
  5299. args: ["aString"],
  5300. source: "label: aString\x0a\x09label := aString",
  5301. messageSends: [],
  5302. referencedClasses: []
  5303. }),
  5304. globals.HLProgressBarWidget);
  5305. smalltalk.addMethod(
  5306. smalltalk.method({
  5307. selector: "parent",
  5308. protocol: 'accessing',
  5309. fn: function (){
  5310. var self=this;
  5311. var $1;
  5312. $1=self["@parent"];
  5313. return $1;
  5314. },
  5315. args: [],
  5316. source: "parent\x0a\x09^ parent",
  5317. messageSends: [],
  5318. referencedClasses: []
  5319. }),
  5320. globals.HLProgressBarWidget);
  5321. smalltalk.addMethod(
  5322. smalltalk.method({
  5323. selector: "parent:",
  5324. protocol: 'accessing',
  5325. fn: function (aProgress){
  5326. var self=this;
  5327. self["@parent"]=aProgress;
  5328. return self},
  5329. args: ["aProgress"],
  5330. source: "parent: aProgress\x0a\x09parent := aProgress",
  5331. messageSends: [],
  5332. referencedClasses: []
  5333. }),
  5334. globals.HLProgressBarWidget);
  5335. smalltalk.addMethod(
  5336. smalltalk.method({
  5337. selector: "remove",
  5338. protocol: 'actions',
  5339. fn: function (){
  5340. var self=this;
  5341. return smalltalk.withContext(function($ctx1) {
  5342. _st(self._parent())._removeProgressBar_(self);
  5343. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},globals.HLProgressBarWidget)})},
  5344. args: [],
  5345. source: "remove\x0a\x09self parent removeProgressBar: self",
  5346. messageSends: ["removeProgressBar:", "parent"],
  5347. referencedClasses: []
  5348. }),
  5349. globals.HLProgressBarWidget);
  5350. smalltalk.addMethod(
  5351. smalltalk.method({
  5352. selector: "renderContentOn:",
  5353. protocol: 'rendering',
  5354. fn: function (html){
  5355. var self=this;
  5356. return smalltalk.withContext(function($ctx1) {
  5357. var $1,$3,$4,$2;
  5358. _st(_st(html)._span())._with_(self._label());
  5359. $ctx1.sendIdx["with:"]=1;
  5360. $1=_st(html)._div();
  5361. $ctx1.sendIdx["div"]=1;
  5362. _st($1)._class_("progress");
  5363. $ctx1.sendIdx["class:"]=1;
  5364. $2=_st($1)._with_((function(){
  5365. return smalltalk.withContext(function($ctx2) {
  5366. $3=_st(html)._div();
  5367. _st($3)._class_("bar");
  5368. $4=_st($3)._style_("width: 0%");
  5369. self["@bar"]=$4;
  5370. return self["@bar"];
  5371. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  5372. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLProgressBarWidget)})},
  5373. args: ["html"],
  5374. 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%' ]",
  5375. messageSends: ["with:", "span", "label", "class:", "div", "style:"],
  5376. referencedClasses: []
  5377. }),
  5378. globals.HLProgressBarWidget);
  5379. smalltalk.addMethod(
  5380. smalltalk.method({
  5381. selector: "start",
  5382. protocol: 'actions',
  5383. fn: function (){
  5384. var self=this;
  5385. return smalltalk.withContext(function($ctx1) {
  5386. self._evaluateAt_((1));
  5387. return self}, function($ctx1) {$ctx1.fill(self,"start",{},globals.HLProgressBarWidget)})},
  5388. args: [],
  5389. source: "start\x0a\x09\x22Make sure the UI has some time to update itself between each iteration\x22\x0a\x09\x0a\x09self evaluateAt: 1",
  5390. messageSends: ["evaluateAt:"],
  5391. referencedClasses: []
  5392. }),
  5393. globals.HLProgressBarWidget);
  5394. smalltalk.addMethod(
  5395. smalltalk.method({
  5396. selector: "updateProgress:",
  5397. protocol: 'actions',
  5398. fn: function (anInteger){
  5399. var self=this;
  5400. return smalltalk.withContext(function($ctx1) {
  5401. _st(_st(self["@bar"])._asJQuery())._css_put_("width",_st(_st(anInteger)._asString()).__comma("%"));
  5402. return self}, function($ctx1) {$ctx1.fill(self,"updateProgress:",{anInteger:anInteger},globals.HLProgressBarWidget)})},
  5403. args: ["anInteger"],
  5404. source: "updateProgress: anInteger\x0a\x09bar asJQuery css: 'width' put: anInteger asString, '%'",
  5405. messageSends: ["css:put:", "asJQuery", ",", "asString"],
  5406. referencedClasses: []
  5407. }),
  5408. globals.HLProgressBarWidget);
  5409. smalltalk.addMethod(
  5410. smalltalk.method({
  5411. selector: "workBlock",
  5412. protocol: 'accessing',
  5413. fn: function (){
  5414. var self=this;
  5415. var $1;
  5416. $1=self["@workBlock"];
  5417. return $1;
  5418. },
  5419. args: [],
  5420. source: "workBlock\x0a\x09^ workBlock",
  5421. messageSends: [],
  5422. referencedClasses: []
  5423. }),
  5424. globals.HLProgressBarWidget);
  5425. smalltalk.addMethod(
  5426. smalltalk.method({
  5427. selector: "workBlock:",
  5428. protocol: 'accessing',
  5429. fn: function (aBlock){
  5430. var self=this;
  5431. self["@workBlock"]=aBlock;
  5432. return self},
  5433. args: ["aBlock"],
  5434. source: "workBlock: aBlock\x0a\x09workBlock := aBlock",
  5435. messageSends: [],
  5436. referencedClasses: []
  5437. }),
  5438. globals.HLProgressBarWidget);
  5439. globals.HLProgressBarWidget.klass.iVarNames = ['default'];
  5440. smalltalk.addMethod(
  5441. smalltalk.method({
  5442. selector: "default",
  5443. protocol: 'accessing',
  5444. fn: function (){
  5445. var self=this;
  5446. return smalltalk.withContext(function($ctx1) {
  5447. var $2,$1,$receiver;
  5448. $2=self["@default"];
  5449. if(($receiver = $2) == null || $receiver.isNil){
  5450. self["@default"]=self._new();
  5451. $1=self["@default"];
  5452. } else {
  5453. $1=$2;
  5454. };
  5455. return $1;
  5456. }, function($ctx1) {$ctx1.fill(self,"default",{},globals.HLProgressBarWidget.klass)})},
  5457. args: [],
  5458. source: "default\x0a\x09^ default ifNil: [ default := self new ]",
  5459. messageSends: ["ifNil:", "new"],
  5460. referencedClasses: []
  5461. }),
  5462. globals.HLProgressBarWidget.klass);
  5463. smalltalk.addClass('HLTabWidget', globals.HLWidget, ['widget', 'label', 'root'], 'Helios-Core');
  5464. globals.HLTabWidget.comment="I am a widget specialized into building another widget as an Helios tab.\x0a\x0aI should not be used directly, `HLWidget class >> #openAsTab` should be used instead.\x0a\x0a## Example\x0a\x0a HLWorkspace openAsTab";
  5465. smalltalk.addMethod(
  5466. smalltalk.method({
  5467. selector: "activate",
  5468. protocol: 'accessing',
  5469. fn: function (){
  5470. var self=this;
  5471. return smalltalk.withContext(function($ctx1) {
  5472. _st(self._manager())._activate_(self);
  5473. return self}, function($ctx1) {$ctx1.fill(self,"activate",{},globals.HLTabWidget)})},
  5474. args: [],
  5475. source: "activate\x0a\x09self manager activate: self",
  5476. messageSends: ["activate:", "manager"],
  5477. referencedClasses: []
  5478. }),
  5479. globals.HLTabWidget);
  5480. smalltalk.addMethod(
  5481. smalltalk.method({
  5482. selector: "add",
  5483. protocol: 'actions',
  5484. fn: function (){
  5485. var self=this;
  5486. return smalltalk.withContext(function($ctx1) {
  5487. _st(self._manager())._addTab_(self);
  5488. self._observeManager();
  5489. return self}, function($ctx1) {$ctx1.fill(self,"add",{},globals.HLTabWidget)})},
  5490. args: [],
  5491. source: "add\x0a\x09self manager addTab: self.\x0a\x09self observeManager",
  5492. messageSends: ["addTab:", "manager", "observeManager"],
  5493. referencedClasses: []
  5494. }),
  5495. globals.HLTabWidget);
  5496. smalltalk.addMethod(
  5497. smalltalk.method({
  5498. selector: "cssClass",
  5499. protocol: 'accessing',
  5500. fn: function (){
  5501. var self=this;
  5502. return smalltalk.withContext(function($ctx1) {
  5503. var $1;
  5504. $1=_st(self._widget())._tabClass();
  5505. return $1;
  5506. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},globals.HLTabWidget)})},
  5507. args: [],
  5508. source: "cssClass\x0a\x09^ self widget tabClass",
  5509. messageSends: ["tabClass", "widget"],
  5510. referencedClasses: []
  5511. }),
  5512. globals.HLTabWidget);
  5513. smalltalk.addMethod(
  5514. smalltalk.method({
  5515. selector: "focus",
  5516. protocol: 'accessing',
  5517. fn: function (){
  5518. var self=this;
  5519. return smalltalk.withContext(function($ctx1) {
  5520. var $2,$1;
  5521. $2=self._widget();
  5522. $ctx1.sendIdx["widget"]=1;
  5523. $1=_st($2)._canHaveFocus();
  5524. if(smalltalk.assert($1)){
  5525. _st(self._widget())._focus();
  5526. };
  5527. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLTabWidget)})},
  5528. args: [],
  5529. source: "focus\x0a\x09self widget canHaveFocus ifTrue: [\x0a\x09\x09self widget focus ]",
  5530. messageSends: ["ifTrue:", "canHaveFocus", "widget", "focus"],
  5531. referencedClasses: []
  5532. }),
  5533. globals.HLTabWidget);
  5534. smalltalk.addMethod(
  5535. smalltalk.method({
  5536. selector: "hide",
  5537. protocol: 'actions',
  5538. fn: function (){
  5539. var self=this;
  5540. return smalltalk.withContext(function($ctx1) {
  5541. var $1,$receiver;
  5542. $1=self["@root"];
  5543. if(($receiver = $1) == null || $receiver.isNil){
  5544. $1;
  5545. } else {
  5546. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","hidden");
  5547. };
  5548. return self}, function($ctx1) {$ctx1.fill(self,"hide",{},globals.HLTabWidget)})},
  5549. args: [],
  5550. source: "hide\x0a\x09root ifNotNil: [ root asJQuery css: 'visibility' put: 'hidden' ]",
  5551. messageSends: ["ifNotNil:", "css:put:", "asJQuery"],
  5552. referencedClasses: []
  5553. }),
  5554. globals.HLTabWidget);
  5555. smalltalk.addMethod(
  5556. smalltalk.method({
  5557. selector: "isActive",
  5558. protocol: 'testing',
  5559. fn: function (){
  5560. var self=this;
  5561. return smalltalk.withContext(function($ctx1) {
  5562. var $1;
  5563. $1=_st(_st(self._manager())._activeTab()).__eq(self);
  5564. return $1;
  5565. }, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLTabWidget)})},
  5566. args: [],
  5567. source: "isActive\x0a\x09^ self manager activeTab = self",
  5568. messageSends: ["=", "activeTab", "manager"],
  5569. referencedClasses: []
  5570. }),
  5571. globals.HLTabWidget);
  5572. smalltalk.addMethod(
  5573. smalltalk.method({
  5574. selector: "label",
  5575. protocol: 'accessing',
  5576. fn: function (){
  5577. var self=this;
  5578. return smalltalk.withContext(function($ctx1) {
  5579. var $2,$1,$receiver;
  5580. $2=self["@label"];
  5581. if(($receiver = $2) == null || $receiver.isNil){
  5582. $1="";
  5583. } else {
  5584. $1=$2;
  5585. };
  5586. return $1;
  5587. }, function($ctx1) {$ctx1.fill(self,"label",{},globals.HLTabWidget)})},
  5588. args: [],
  5589. source: "label\x0a\x09^ label ifNil: [ '' ]",
  5590. messageSends: ["ifNil:"],
  5591. referencedClasses: []
  5592. }),
  5593. globals.HLTabWidget);
  5594. smalltalk.addMethod(
  5595. smalltalk.method({
  5596. selector: "label:",
  5597. protocol: 'accessing',
  5598. fn: function (aString){
  5599. var self=this;
  5600. self["@label"]=aString;
  5601. return self},
  5602. args: ["aString"],
  5603. source: "label: aString\x0a\x09label := aString",
  5604. messageSends: [],
  5605. referencedClasses: []
  5606. }),
  5607. globals.HLTabWidget);
  5608. smalltalk.addMethod(
  5609. smalltalk.method({
  5610. selector: "manager",
  5611. protocol: 'accessing',
  5612. fn: function (){
  5613. var self=this;
  5614. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  5615. return smalltalk.withContext(function($ctx1) {
  5616. var $1;
  5617. $1=_st($HLManager())._current();
  5618. return $1;
  5619. }, function($ctx1) {$ctx1.fill(self,"manager",{},globals.HLTabWidget)})},
  5620. args: [],
  5621. source: "manager\x0a\x09^ HLManager current",
  5622. messageSends: ["current"],
  5623. referencedClasses: ["HLManager"]
  5624. }),
  5625. globals.HLTabWidget);
  5626. smalltalk.addMethod(
  5627. smalltalk.method({
  5628. selector: "observeManager",
  5629. protocol: 'actions',
  5630. fn: function (){
  5631. var self=this;
  5632. function $HLTabLabelChanged(){return globals.HLTabLabelChanged||(typeof HLTabLabelChanged=="undefined"?nil:HLTabLabelChanged)}
  5633. return smalltalk.withContext(function($ctx1) {
  5634. _st(_st(self._manager())._announcer())._on_send_to_($HLTabLabelChanged(),"onTabLabelChanged:",self);
  5635. return self}, function($ctx1) {$ctx1.fill(self,"observeManager",{},globals.HLTabWidget)})},
  5636. args: [],
  5637. source: "observeManager\x0a\x09self manager announcer \x0a\x09\x09on: HLTabLabelChanged\x0a\x09\x09send: #onTabLabelChanged:\x0a\x09\x09to: self",
  5638. messageSends: ["on:send:to:", "announcer", "manager"],
  5639. referencedClasses: ["HLTabLabelChanged"]
  5640. }),
  5641. globals.HLTabWidget);
  5642. smalltalk.addMethod(
  5643. smalltalk.method({
  5644. selector: "onTabLabelChanged:",
  5645. protocol: 'reactions',
  5646. fn: function (anAnnouncement){
  5647. var self=this;
  5648. return smalltalk.withContext(function($ctx1) {
  5649. var $2,$1,$4,$5,$3;
  5650. $2=_st(anAnnouncement)._widget();
  5651. $ctx1.sendIdx["widget"]=1;
  5652. $1=_st($2).__eq(self._widget());
  5653. $ctx1.sendIdx["="]=1;
  5654. if(smalltalk.assert($1)){
  5655. $4=self._label();
  5656. $ctx1.sendIdx["label"]=1;
  5657. $5=_st(anAnnouncement)._label();
  5658. $ctx1.sendIdx["label"]=2;
  5659. $3=_st($4).__eq($5);
  5660. if(! smalltalk.assert($3)){
  5661. self._label_(_st(anAnnouncement)._label());
  5662. _st(self._manager())._refresh();
  5663. };
  5664. };
  5665. return self}, function($ctx1) {$ctx1.fill(self,"onTabLabelChanged:",{anAnnouncement:anAnnouncement},globals.HLTabWidget)})},
  5666. args: ["anAnnouncement"],
  5667. source: "onTabLabelChanged: anAnnouncement\x0a\x09anAnnouncement widget = self widget ifTrue: [\x0a\x09\x09self label = anAnnouncement label ifFalse: [\x0a\x09\x09\x09self label: anAnnouncement label.\x0a\x09\x09\x09self manager refresh ] ]",
  5668. messageSends: ["ifTrue:", "=", "widget", "ifFalse:", "label", "label:", "refresh", "manager"],
  5669. referencedClasses: []
  5670. }),
  5671. globals.HLTabWidget);
  5672. smalltalk.addMethod(
  5673. smalltalk.method({
  5674. selector: "registerBindings",
  5675. protocol: 'actions',
  5676. fn: function (){
  5677. var self=this;
  5678. return smalltalk.withContext(function($ctx1) {
  5679. _st(self._widget())._registerBindings();
  5680. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},globals.HLTabWidget)})},
  5681. args: [],
  5682. source: "registerBindings\x0a\x09self widget registerBindings",
  5683. messageSends: ["registerBindings", "widget"],
  5684. referencedClasses: []
  5685. }),
  5686. globals.HLTabWidget);
  5687. smalltalk.addMethod(
  5688. smalltalk.method({
  5689. selector: "remove",
  5690. protocol: 'actions',
  5691. fn: function (){
  5692. var self=this;
  5693. return smalltalk.withContext(function($ctx1) {
  5694. var $1,$receiver;
  5695. self._unregister();
  5696. $ctx1.sendIdx["unregister"]=1;
  5697. _st(self._widget())._unregister();
  5698. $1=self["@root"];
  5699. if(($receiver = $1) == null || $receiver.isNil){
  5700. $1;
  5701. } else {
  5702. _st(_st(self["@root"])._asJQuery())._remove();
  5703. };
  5704. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},globals.HLTabWidget)})},
  5705. args: [],
  5706. source: "remove\x0a\x09self unregister.\x0a\x09self widget unregister.\x0a\x09root ifNotNil: [ root asJQuery remove ]",
  5707. messageSends: ["unregister", "widget", "ifNotNil:", "remove", "asJQuery"],
  5708. referencedClasses: []
  5709. }),
  5710. globals.HLTabWidget);
  5711. smalltalk.addMethod(
  5712. smalltalk.method({
  5713. selector: "renderOn:",
  5714. protocol: 'rendering',
  5715. fn: function (html){
  5716. var self=this;
  5717. return smalltalk.withContext(function($ctx1) {
  5718. var $1,$2;
  5719. $1=_st(html)._div();
  5720. _st($1)._class_("tab");
  5721. $2=_st($1)._yourself();
  5722. self["@root"]=$2;
  5723. self._renderTab();
  5724. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},globals.HLTabWidget)})},
  5725. args: ["html"],
  5726. source: "renderOn: html\x0a\x09root := html div\x0a\x09\x09class: 'tab';\x0a\x09\x09yourself.\x0a\x09self renderTab",
  5727. messageSends: ["class:", "div", "yourself", "renderTab"],
  5728. referencedClasses: []
  5729. }),
  5730. globals.HLTabWidget);
  5731. smalltalk.addMethod(
  5732. smalltalk.method({
  5733. selector: "renderTab",
  5734. protocol: 'rendering',
  5735. fn: function (){
  5736. var self=this;
  5737. return smalltalk.withContext(function($ctx1) {
  5738. var $1,$2;
  5739. _st(self["@root"])._contents_((function(html){
  5740. return smalltalk.withContext(function($ctx2) {
  5741. $1=_st(html)._div();
  5742. _st($1)._class_("amber_box");
  5743. $2=_st($1)._with_((function(){
  5744. return smalltalk.withContext(function($ctx3) {
  5745. return _st(self._widget())._renderOn_(html);
  5746. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  5747. return $2;
  5748. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}));
  5749. return self}, function($ctx1) {$ctx1.fill(self,"renderTab",{},globals.HLTabWidget)})},
  5750. args: [],
  5751. source: "renderTab\x0a\x09root contents: [ :html |\x0a\x09\x09html div\x0a\x09\x09\x09class: 'amber_box';\x0a\x09\x09\x09with: [ self widget renderOn: html ] ]",
  5752. messageSends: ["contents:", "class:", "div", "with:", "renderOn:", "widget"],
  5753. referencedClasses: []
  5754. }),
  5755. globals.HLTabWidget);
  5756. smalltalk.addMethod(
  5757. smalltalk.method({
  5758. selector: "show",
  5759. protocol: 'actions',
  5760. fn: function (){
  5761. var self=this;
  5762. return smalltalk.withContext(function($ctx1) {
  5763. var $1,$2,$receiver;
  5764. $1=self["@root"];
  5765. if(($receiver = $1) == null || $receiver.isNil){
  5766. $2="body"._asJQuery();
  5767. $ctx1.sendIdx["asJQuery"]=1;
  5768. self._appendToJQuery_($2);
  5769. } else {
  5770. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","visible");
  5771. };
  5772. return self}, function($ctx1) {$ctx1.fill(self,"show",{},globals.HLTabWidget)})},
  5773. args: [],
  5774. source: "show\x0a\x09root\x0a\x09\x09ifNil: [ self appendToJQuery: 'body' asJQuery ]\x0a\x09\x09ifNotNil: [ root asJQuery css: 'visibility' put: 'visible' ]",
  5775. messageSends: ["ifNil:ifNotNil:", "appendToJQuery:", "asJQuery", "css:put:"],
  5776. referencedClasses: []
  5777. }),
  5778. globals.HLTabWidget);
  5779. smalltalk.addMethod(
  5780. smalltalk.method({
  5781. selector: "unregister",
  5782. protocol: 'actions',
  5783. fn: function (){
  5784. var self=this;
  5785. return smalltalk.withContext(function($ctx1) {
  5786. _st(_st(self._manager())._announcer())._unsubscribe_(self);
  5787. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLTabWidget)})},
  5788. args: [],
  5789. source: "unregister\x0a\x09self manager announcer unsubscribe: self",
  5790. messageSends: ["unsubscribe:", "announcer", "manager"],
  5791. referencedClasses: []
  5792. }),
  5793. globals.HLTabWidget);
  5794. smalltalk.addMethod(
  5795. smalltalk.method({
  5796. selector: "widget",
  5797. protocol: 'accessing',
  5798. fn: function (){
  5799. var self=this;
  5800. var $1;
  5801. $1=self["@widget"];
  5802. return $1;
  5803. },
  5804. args: [],
  5805. source: "widget\x0a\x09^ widget",
  5806. messageSends: [],
  5807. referencedClasses: []
  5808. }),
  5809. globals.HLTabWidget);
  5810. smalltalk.addMethod(
  5811. smalltalk.method({
  5812. selector: "widget:",
  5813. protocol: 'accessing',
  5814. fn: function (aWidget){
  5815. var self=this;
  5816. self["@widget"]=aWidget;
  5817. return self},
  5818. args: ["aWidget"],
  5819. source: "widget: aWidget\x0a\x09widget := aWidget",
  5820. messageSends: [],
  5821. referencedClasses: []
  5822. }),
  5823. globals.HLTabWidget);
  5824. smalltalk.addMethod(
  5825. smalltalk.method({
  5826. selector: "on:labelled:",
  5827. protocol: 'instance creation',
  5828. fn: function (aWidget,aString){
  5829. var self=this;
  5830. return smalltalk.withContext(function($ctx1) {
  5831. var $2,$3,$1;
  5832. $2=self._new();
  5833. _st($2)._widget_(aWidget);
  5834. _st($2)._label_(aString);
  5835. $3=_st($2)._yourself();
  5836. $1=$3;
  5837. return $1;
  5838. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString},globals.HLTabWidget.klass)})},
  5839. args: ["aWidget", "aString"],
  5840. source: "on: aWidget labelled: aString\x0a\x09^ self new\x0a\x09\x09widget: aWidget;\x0a\x09\x09label: aString;\x0a\x09\x09yourself",
  5841. messageSends: ["widget:", "new", "label:", "yourself"],
  5842. referencedClasses: []
  5843. }),
  5844. globals.HLTabWidget.klass);
  5845. smalltalk.addClass('HLTabsWidget', globals.HLWidget, ['tabs', 'activeTab', 'history', 'selectionDisabled'], 'Helios-Core');
  5846. smalltalk.addMethod(
  5847. smalltalk.method({
  5848. selector: "activate:",
  5849. protocol: 'actions',
  5850. fn: function (aTab){
  5851. var self=this;
  5852. return smalltalk.withContext(function($ctx1) {
  5853. var $1,$2;
  5854. $1=self._isSelectionDisabled();
  5855. if(smalltalk.assert($1)){
  5856. return self;
  5857. };
  5858. _st(_st(self._manager())._keyBinder())._flushBindings();
  5859. _st(aTab)._registerBindings();
  5860. self["@activeTab"]=aTab;
  5861. self._refresh();
  5862. self._addToHistory_(aTab);
  5863. $2=self._show_(aTab);
  5864. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},globals.HLTabsWidget)})},
  5865. args: ["aTab"],
  5866. source: "activate: aTab\x0a\x09self isSelectionDisabled ifTrue: [ ^ self ].\x0a\x0a\x09self manager keyBinder flushBindings.\x0a\x09aTab registerBindings.\x0a\x09activeTab := aTab.\x0a\x09\x0a\x09self \x0a\x09\x09refresh;\x0a\x09\x09addToHistory: aTab;\x0a\x09\x09show: aTab",
  5867. messageSends: ["ifTrue:", "isSelectionDisabled", "flushBindings", "keyBinder", "manager", "registerBindings", "refresh", "addToHistory:", "show:"],
  5868. referencedClasses: []
  5869. }),
  5870. globals.HLTabsWidget);
  5871. smalltalk.addMethod(
  5872. smalltalk.method({
  5873. selector: "activateNextTab",
  5874. protocol: 'actions',
  5875. fn: function (){
  5876. var self=this;
  5877. var nextTab;
  5878. return smalltalk.withContext(function($ctx1) {
  5879. var $1,$2,$5,$4,$3;
  5880. var $early={};
  5881. try {
  5882. $1=self._tabs();
  5883. $ctx1.sendIdx["tabs"]=1;
  5884. _st($1)._ifEmpty_((function(){
  5885. throw $early=[self];
  5886. }));
  5887. $2=self._tabs();
  5888. $ctx1.sendIdx["tabs"]=2;
  5889. $5=self._tabs();
  5890. $ctx1.sendIdx["tabs"]=3;
  5891. $4=_st($5)._indexOf_(self._activeTab());
  5892. $3=_st($4).__plus((1));
  5893. nextTab=_st($2)._at_ifAbsent_($3,(function(){
  5894. return smalltalk.withContext(function($ctx2) {
  5895. return _st(self._tabs())._first();
  5896. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  5897. self._activate_(nextTab);
  5898. return self}
  5899. catch(e) {if(e===$early)return e[0]; throw e}
  5900. }, function($ctx1) {$ctx1.fill(self,"activateNextTab",{nextTab:nextTab},globals.HLTabsWidget)})},
  5901. args: [],
  5902. source: "activateNextTab\x0a\x09| nextTab |\x0a\x09\x0a\x09self tabs ifEmpty: [ ^ self ].\x0a\x09\x0a\x09nextTab := self tabs \x0a\x09\x09at: (self tabs indexOf: self activeTab) + 1 \x0a\x09\x09ifAbsent: [ self tabs first ].\x0a\x09\x09\x0a\x09self activate: nextTab",
  5903. messageSends: ["ifEmpty:", "tabs", "at:ifAbsent:", "+", "indexOf:", "activeTab", "first", "activate:"],
  5904. referencedClasses: []
  5905. }),
  5906. globals.HLTabsWidget);
  5907. smalltalk.addMethod(
  5908. smalltalk.method({
  5909. selector: "activatePreviousTab",
  5910. protocol: 'actions',
  5911. fn: function (){
  5912. var self=this;
  5913. var previousTab;
  5914. return smalltalk.withContext(function($ctx1) {
  5915. var $1,$2,$5,$4,$3;
  5916. var $early={};
  5917. try {
  5918. $1=self._tabs();
  5919. $ctx1.sendIdx["tabs"]=1;
  5920. _st($1)._ifEmpty_((function(){
  5921. throw $early=[self];
  5922. }));
  5923. $2=self._tabs();
  5924. $ctx1.sendIdx["tabs"]=2;
  5925. $5=self._tabs();
  5926. $ctx1.sendIdx["tabs"]=3;
  5927. $4=_st($5)._indexOf_(self._activeTab());
  5928. $3=_st($4).__minus((1));
  5929. previousTab=_st($2)._at_ifAbsent_($3,(function(){
  5930. return smalltalk.withContext(function($ctx2) {
  5931. return _st(self._tabs())._last();
  5932. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  5933. self._activate_(previousTab);
  5934. return self}
  5935. catch(e) {if(e===$early)return e[0]; throw e}
  5936. }, function($ctx1) {$ctx1.fill(self,"activatePreviousTab",{previousTab:previousTab},globals.HLTabsWidget)})},
  5937. args: [],
  5938. source: "activatePreviousTab\x0a\x09| previousTab |\x0a\x09\x0a\x09self tabs ifEmpty: [ ^ self ].\x0a\x09\x0a\x09previousTab := self tabs \x0a\x09\x09at: (self tabs indexOf: self activeTab) - 1 \x0a\x09\x09ifAbsent: [ self tabs last ].\x0a\x09\x09\x0a\x09self activate: previousTab",
  5939. messageSends: ["ifEmpty:", "tabs", "at:ifAbsent:", "-", "indexOf:", "activeTab", "last", "activate:"],
  5940. referencedClasses: []
  5941. }),
  5942. globals.HLTabsWidget);
  5943. smalltalk.addMethod(
  5944. smalltalk.method({
  5945. selector: "activeTab",
  5946. protocol: 'accessing',
  5947. fn: function (){
  5948. var self=this;
  5949. var $1;
  5950. $1=self["@activeTab"];
  5951. return $1;
  5952. },
  5953. args: [],
  5954. source: "activeTab\x0a\x09^ activeTab",
  5955. messageSends: [],
  5956. referencedClasses: []
  5957. }),
  5958. globals.HLTabsWidget);
  5959. smalltalk.addMethod(
  5960. smalltalk.method({
  5961. selector: "addTab:",
  5962. protocol: 'actions',
  5963. fn: function (aTab){
  5964. var self=this;
  5965. return smalltalk.withContext(function($ctx1) {
  5966. _st(self._tabs())._add_(aTab);
  5967. self._activate_(aTab);
  5968. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab},globals.HLTabsWidget)})},
  5969. args: ["aTab"],
  5970. source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
  5971. messageSends: ["add:", "tabs", "activate:"],
  5972. referencedClasses: []
  5973. }),
  5974. globals.HLTabsWidget);
  5975. smalltalk.addMethod(
  5976. smalltalk.method({
  5977. selector: "addToHistory:",
  5978. protocol: 'actions',
  5979. fn: function (aTab){
  5980. var self=this;
  5981. return smalltalk.withContext(function($ctx1) {
  5982. self._removeFromHistory_(aTab);
  5983. _st(self._history())._add_(aTab);
  5984. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab},globals.HLTabsWidget)})},
  5985. args: ["aTab"],
  5986. source: "addToHistory: aTab\x0a\x09self removeFromHistory: aTab.\x0a\x09self history add: aTab",
  5987. messageSends: ["removeFromHistory:", "add:", "history"],
  5988. referencedClasses: []
  5989. }),
  5990. globals.HLTabsWidget);
  5991. smalltalk.addMethod(
  5992. smalltalk.method({
  5993. selector: "disableSelection",
  5994. protocol: 'actions',
  5995. fn: function (){
  5996. var self=this;
  5997. self["@selectionDisabled"]=true;
  5998. return self},
  5999. args: [],
  6000. source: "disableSelection\x0a\x09selectionDisabled := true",
  6001. messageSends: [],
  6002. referencedClasses: []
  6003. }),
  6004. globals.HLTabsWidget);
  6005. smalltalk.addMethod(
  6006. smalltalk.method({
  6007. selector: "enableSelection",
  6008. protocol: 'actions',
  6009. fn: function (){
  6010. var self=this;
  6011. self["@selectionDisabled"]=false;
  6012. return self},
  6013. args: [],
  6014. source: "enableSelection\x0a\x09selectionDisabled := false",
  6015. messageSends: [],
  6016. referencedClasses: []
  6017. }),
  6018. globals.HLTabsWidget);
  6019. smalltalk.addMethod(
  6020. smalltalk.method({
  6021. selector: "history",
  6022. protocol: 'accessing',
  6023. fn: function (){
  6024. var self=this;
  6025. function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  6026. return smalltalk.withContext(function($ctx1) {
  6027. var $2,$1,$receiver;
  6028. $2=self["@history"];
  6029. if(($receiver = $2) == null || $receiver.isNil){
  6030. self["@history"]=_st($OrderedCollection())._new();
  6031. $1=self["@history"];
  6032. } else {
  6033. $1=$2;
  6034. };
  6035. return $1;
  6036. }, function($ctx1) {$ctx1.fill(self,"history",{},globals.HLTabsWidget)})},
  6037. args: [],
  6038. source: "history\x0a\x09^ history ifNil: [ history := OrderedCollection new ]",
  6039. messageSends: ["ifNil:", "new"],
  6040. referencedClasses: ["OrderedCollection"]
  6041. }),
  6042. globals.HLTabsWidget);
  6043. smalltalk.addMethod(
  6044. smalltalk.method({
  6045. selector: "history:",
  6046. protocol: 'accessing',
  6047. fn: function (aCollection){
  6048. var self=this;
  6049. self["@history"]=aCollection;
  6050. return self},
  6051. args: ["aCollection"],
  6052. source: "history: aCollection\x0a\x09history := aCollection",
  6053. messageSends: [],
  6054. referencedClasses: []
  6055. }),
  6056. globals.HLTabsWidget);
  6057. smalltalk.addMethod(
  6058. smalltalk.method({
  6059. selector: "isSelectionDisabled",
  6060. protocol: 'testing',
  6061. fn: function (){
  6062. var self=this;
  6063. return smalltalk.withContext(function($ctx1) {
  6064. var $2,$1,$receiver;
  6065. $2=self["@selectionDisabled"];
  6066. if(($receiver = $2) == null || $receiver.isNil){
  6067. $1=false;
  6068. } else {
  6069. $1=$2;
  6070. };
  6071. return $1;
  6072. }, function($ctx1) {$ctx1.fill(self,"isSelectionDisabled",{},globals.HLTabsWidget)})},
  6073. args: [],
  6074. source: "isSelectionDisabled\x0a\x09^ selectionDisabled ifNil: [ false ]",
  6075. messageSends: ["ifNil:"],
  6076. referencedClasses: []
  6077. }),
  6078. globals.HLTabsWidget);
  6079. smalltalk.addMethod(
  6080. smalltalk.method({
  6081. selector: "removeActiveTab",
  6082. protocol: 'actions',
  6083. fn: function (){
  6084. var self=this;
  6085. return smalltalk.withContext(function($ctx1) {
  6086. self._removeTab_(self._activeTab());
  6087. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{},globals.HLTabsWidget)})},
  6088. args: [],
  6089. source: "removeActiveTab\x0a\x09self removeTab: self activeTab",
  6090. messageSends: ["removeTab:", "activeTab"],
  6091. referencedClasses: []
  6092. }),
  6093. globals.HLTabsWidget);
  6094. smalltalk.addMethod(
  6095. smalltalk.method({
  6096. selector: "removeFromHistory:",
  6097. protocol: 'actions',
  6098. fn: function (aTab){
  6099. var self=this;
  6100. return smalltalk.withContext(function($ctx1) {
  6101. self._history_(_st(self._history())._reject_((function(each){
  6102. return smalltalk.withContext(function($ctx2) {
  6103. return _st(each).__eq_eq(aTab);
  6104. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})));
  6105. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab},globals.HLTabsWidget)})},
  6106. args: ["aTab"],
  6107. source: "removeFromHistory: aTab\x0a\x09self history: (self history reject: [ :each | each == aTab ])",
  6108. messageSends: ["history:", "reject:", "history", "=="],
  6109. referencedClasses: []
  6110. }),
  6111. globals.HLTabsWidget);
  6112. smalltalk.addMethod(
  6113. smalltalk.method({
  6114. selector: "removeTab:",
  6115. protocol: 'actions',
  6116. fn: function (aTab){
  6117. var self=this;
  6118. return smalltalk.withContext(function($ctx1) {
  6119. var $2,$1,$3;
  6120. $2=self._tabs();
  6121. $ctx1.sendIdx["tabs"]=1;
  6122. $1=_st($2)._includes_(aTab);
  6123. if(! smalltalk.assert($1)){
  6124. return self;
  6125. };
  6126. self._removeFromHistory_(aTab);
  6127. _st(self._tabs())._remove_(aTab);
  6128. _st(_st(self._manager())._keyBinder())._flushBindings();
  6129. _st(aTab)._remove();
  6130. self._refresh();
  6131. $3=self._history();
  6132. $ctx1.sendIdx["history"]=1;
  6133. _st($3)._ifNotEmpty_((function(){
  6134. return smalltalk.withContext(function($ctx2) {
  6135. return _st(_st(self._history())._last())._activate();
  6136. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  6137. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},globals.HLTabsWidget)})},
  6138. args: ["aTab"],
  6139. source: "removeTab: aTab\x0a\x09(self tabs includes: aTab) ifFalse: [ ^ self ].\x0a\x0a\x09self removeFromHistory: aTab.\x0a\x09self tabs remove: aTab.\x0a\x09self manager keyBinder flushBindings.\x0a\x09aTab remove.\x0a\x09self refresh.\x0a\x09self history ifNotEmpty: [\x0a\x09\x09self history last activate ]",
  6140. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "manager", "remove", "refresh", "ifNotEmpty:", "history", "activate", "last"],
  6141. referencedClasses: []
  6142. }),
  6143. globals.HLTabsWidget);
  6144. smalltalk.addMethod(
  6145. smalltalk.method({
  6146. selector: "removeTabForWidget:",
  6147. protocol: 'actions',
  6148. fn: function (aWidget){
  6149. var self=this;
  6150. return smalltalk.withContext(function($ctx1) {
  6151. var $early={};
  6152. try {
  6153. self._removeTab_(_st(self._tabs())._detect_ifNone_((function(each){
  6154. return smalltalk.withContext(function($ctx2) {
  6155. return _st(_st(each)._widget()).__eq(aWidget);
  6156. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
  6157. throw $early=[self];
  6158. })));
  6159. return self}
  6160. catch(e) {if(e===$early)return e[0]; throw e}
  6161. }, function($ctx1) {$ctx1.fill(self,"removeTabForWidget:",{aWidget:aWidget},globals.HLTabsWidget)})},
  6162. args: ["aWidget"],
  6163. source: "removeTabForWidget: aWidget\x0a\x09self removeTab: (self tabs \x0a\x09\x09detect: [ :each | each widget = aWidget ]\x0a\x09\x09ifNone: [ ^ self ])",
  6164. messageSends: ["removeTab:", "detect:ifNone:", "tabs", "=", "widget"],
  6165. referencedClasses: []
  6166. }),
  6167. globals.HLTabsWidget);
  6168. smalltalk.addMethod(
  6169. smalltalk.method({
  6170. selector: "renderAddOn:",
  6171. protocol: 'rendering',
  6172. fn: function (html){
  6173. var self=this;
  6174. function $HLWidget(){return globals.HLWidget||(typeof HLWidget=="undefined"?nil:HLWidget)}
  6175. return smalltalk.withContext(function($ctx1) {
  6176. var $1,$3,$4,$5,$7,$8,$9,$6,$2;
  6177. $1=_st(html)._div();
  6178. _st($1)._class_("dropdown new_tab");
  6179. $ctx1.sendIdx["class:"]=1;
  6180. $2=_st($1)._with_((function(){
  6181. return smalltalk.withContext(function($ctx2) {
  6182. $3=_st(html)._a();
  6183. $ctx2.sendIdx["a"]=1;
  6184. _st($3)._class_("dropdown-toggle");
  6185. $ctx2.sendIdx["class:"]=2;
  6186. _st($3)._at_put_("data-toggle","dropdown");
  6187. $4=_st($3)._with_((function(){
  6188. return smalltalk.withContext(function($ctx3) {
  6189. return _st(_st(html)._tag_("b"))._class_("caret");
  6190. $ctx3.sendIdx["class:"]=3;
  6191. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  6192. $ctx2.sendIdx["with:"]=2;
  6193. $4;
  6194. $5=_st(html)._ul();
  6195. _st($5)._class_("dropdown-menu");
  6196. $6=_st($5)._with_((function(){
  6197. return smalltalk.withContext(function($ctx3) {
  6198. return _st(_st(_st(_st($HLWidget())._withAllSubclasses())._select_((function(each){
  6199. return smalltalk.withContext(function($ctx4) {
  6200. return _st(each)._canBeOpenAsTab();
  6201. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,4)})})))._sorted_((function(a,b){
  6202. return smalltalk.withContext(function($ctx4) {
  6203. $7=_st(a)._tabPriority();
  6204. $ctx4.sendIdx["tabPriority"]=1;
  6205. return _st($7).__lt(_st(b)._tabPriority());
  6206. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx3,5)})})))._do_((function(each){
  6207. return smalltalk.withContext(function($ctx4) {
  6208. return _st(_st(html)._li())._with_((function(){
  6209. return smalltalk.withContext(function($ctx5) {
  6210. $8=_st(html)._a();
  6211. _st($8)._with_(_st(each)._tabLabel());
  6212. $9=_st($8)._onClick_((function(){
  6213. return smalltalk.withContext(function($ctx6) {
  6214. return _st(each)._openAsTab();
  6215. }, function($ctx6) {$ctx6.fillBlock({},$ctx5,8)})}));
  6216. return $9;
  6217. }, function($ctx5) {$ctx5.fillBlock({},$ctx4,7)})}));
  6218. $ctx4.sendIdx["with:"]=4;
  6219. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx3,6)})}));
  6220. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  6221. $ctx2.sendIdx["with:"]=3;
  6222. return $6;
  6223. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  6224. $ctx1.sendIdx["with:"]=1;
  6225. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html},globals.HLTabsWidget)})},
  6226. args: ["html"],
  6227. source: "renderAddOn: html\x0a html div \x0a \x09class: 'dropdown new_tab';\x0a with: [ \x0a\x09\x09\x09html a \x0a \x09\x09class: 'dropdown-toggle';\x0a \x09 \x09at: 'data-toggle' put: 'dropdown';\x0a \x09with: [\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 ] ] ] ] ]",
  6228. messageSends: ["class:", "div", "with:", "a", "at:put:", "tag:", "ul", "do:", "sorted:", "select:", "withAllSubclasses", "canBeOpenAsTab", "<", "tabPriority", "li", "tabLabel", "onClick:", "openAsTab"],
  6229. referencedClasses: ["HLWidget"]
  6230. }),
  6231. globals.HLTabsWidget);
  6232. smalltalk.addMethod(
  6233. smalltalk.method({
  6234. selector: "renderContentOn:",
  6235. protocol: 'rendering',
  6236. fn: function (html){
  6237. var self=this;
  6238. return smalltalk.withContext(function($ctx1) {
  6239. var $1,$3,$4,$2;
  6240. $1=_st(html)._div();
  6241. $ctx1.sendIdx["div"]=1;
  6242. _st($1)._class_("navbar navbar-fixed-top");
  6243. $ctx1.sendIdx["class:"]=1;
  6244. $2=_st($1)._with_((function(){
  6245. return smalltalk.withContext(function($ctx2) {
  6246. $3=_st(html)._div();
  6247. _st($3)._class_("navbar-inner");
  6248. $4=_st($3)._with_((function(){
  6249. return smalltalk.withContext(function($ctx3) {
  6250. return self._renderTabsOn_(html);
  6251. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  6252. return $4;
  6253. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  6254. $ctx1.sendIdx["with:"]=1;
  6255. self._renderAddOn_(html);
  6256. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLTabsWidget)})},
  6257. args: ["html"],
  6258. 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 ] ].\x0a\x09\x09\x09\x0a\x09self renderAddOn: html",
  6259. messageSends: ["class:", "div", "with:", "renderTabsOn:", "renderAddOn:"],
  6260. referencedClasses: []
  6261. }),
  6262. globals.HLTabsWidget);
  6263. smalltalk.addMethod(
  6264. smalltalk.method({
  6265. selector: "renderTab:on:",
  6266. protocol: 'rendering',
  6267. fn: function (aTab,html){
  6268. var self=this;
  6269. var li;
  6270. return smalltalk.withContext(function($ctx1) {
  6271. var $1,$2,$3,$4,$6,$5,$7,$8,$9,$10,$11,$12;
  6272. $1=_st(html)._li();
  6273. $2=$1;
  6274. $3=_st("width: ".__comma(_st(self._tabWidth())._asString())).__comma("px");
  6275. $ctx1.sendIdx[","]=1;
  6276. _st($2)._style_($3);
  6277. $4=$1;
  6278. $6=_st(aTab)._isActive();
  6279. if(smalltalk.assert($6)){
  6280. $5="tab active";
  6281. } else {
  6282. $5="tab inactive";
  6283. };
  6284. _st($4)._class_($5);
  6285. $ctx1.sendIdx["class:"]=1;
  6286. _st($1)._with_((function(){
  6287. return smalltalk.withContext(function($ctx2) {
  6288. return _st(_st(html)._a())._with_((function(){
  6289. return smalltalk.withContext(function($ctx3) {
  6290. $7=_st(_st(html)._tag_("i"))._class_("close");
  6291. $ctx3.sendIdx["class:"]=2;
  6292. _st($7)._onClick_((function(){
  6293. return smalltalk.withContext(function($ctx4) {
  6294. return self._removeTab_(aTab);
  6295. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,5)})}));
  6296. $ctx3.sendIdx["onClick:"]=1;
  6297. $8=_st(html)._span();
  6298. _st($8)._class_(_st(aTab)._cssClass());
  6299. $9=$8;
  6300. $10=_st(aTab)._label();
  6301. $ctx3.sendIdx["label"]=1;
  6302. _st($9)._title_($10);
  6303. $11=_st($8)._with_(_st(aTab)._label());
  6304. return $11;
  6305. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  6306. $ctx2.sendIdx["with:"]=2;
  6307. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  6308. $ctx1.sendIdx["with:"]=1;
  6309. $12=_st($1)._onClick_((function(){
  6310. return smalltalk.withContext(function($ctx2) {
  6311. return _st(aTab)._activate();
  6312. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})}));
  6313. li=$12;
  6314. _st(_st(_st(li)._asJQuery())._get_((0)))._at_put_("tab-data",aTab);
  6315. return self}, function($ctx1) {$ctx1.fill(self,"renderTab:on:",{aTab:aTab,html:html,li:li},globals.HLTabsWidget)})},
  6316. args: ["aTab", "html"],
  6317. source: "renderTab: aTab on: html\x0a\x09| li |\x0a\x09li := html li \x0a\x09\x09style: 'width: ', self tabWidth asString, 'px';\x0a\x09\x09class: (aTab isActive ifTrue: [ 'tab active' ] ifFalse: [ 'tab inactive' ]);\x0a\x09\x09with: [\x0a\x09\x09\x09html a\x0a\x09\x09\x09with: [\x0a\x09\x09\x09\x09((html tag: 'i') class: 'close')\x0a\x09\x09\x09\x09\x09onClick: [ self removeTab: aTab ].\x0a\x09\x09\x09\x09html span \x0a\x09\x09\x09\x09\x09class: aTab cssClass;\x0a\x09\x09\x09\x09\x09title: aTab label;\x0a\x09\x09\x09\x09\x09with: aTab label ] ];\x0a\x09\x09onClick: [ aTab activate ].\x0a\x09\x0a\x09(li asJQuery get: 0) at: 'tab-data' put: aTab",
  6318. messageSends: ["style:", "li", ",", "asString", "tabWidth", "class:", "ifTrue:ifFalse:", "isActive", "with:", "a", "onClick:", "tag:", "removeTab:", "span", "cssClass", "title:", "label", "activate", "at:put:", "get:", "asJQuery"],
  6319. referencedClasses: []
  6320. }),
  6321. globals.HLTabsWidget);
  6322. smalltalk.addMethod(
  6323. smalltalk.method({
  6324. selector: "renderTabsOn:",
  6325. protocol: 'rendering',
  6326. fn: function (html){
  6327. var self=this;
  6328. var ul;
  6329. return smalltalk.withContext(function($ctx1) {
  6330. var $1,$2;
  6331. $1=_st(html)._ul();
  6332. _st($1)._class_("nav main-tabs");
  6333. $2=_st($1)._with_((function(){
  6334. return smalltalk.withContext(function($ctx2) {
  6335. return _st(self._tabs())._do_((function(each){
  6336. return smalltalk.withContext(function($ctx3) {
  6337. return self._renderTab_on_(each,html);
  6338. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  6339. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  6340. ul=$2;
  6341. _st(_st(ul)._asJQuery())._sortable_(globals.HashedCollection._newFromPairs_(["containment","parent","start",(function(){
  6342. return smalltalk.withContext(function($ctx2) {
  6343. return self._disableSelection();
  6344. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}),"stop",(function(){
  6345. return smalltalk.withContext(function($ctx2) {
  6346. return _st((function(){
  6347. return smalltalk.withContext(function($ctx3) {
  6348. return self._enableSelection();
  6349. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,5)})}))._valueWithTimeout_((300));
  6350. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}),"update",(function(){
  6351. return smalltalk.withContext(function($ctx2) {
  6352. return self._updateTabsOrder();
  6353. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,6)})})]));
  6354. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html,ul:ul},globals.HLTabsWidget)})},
  6355. args: ["html"],
  6356. source: "renderTabsOn: html\x0a\x09| ul |\x0a\x09ul := html ul \x0a\x09\x09class: 'nav main-tabs';\x0a\x09\x09with: [ \x0a \x09self tabs do: [ :each |\x0a\x09\x09\x09\x09self renderTab: each on: html ] ].\x0a\x09\x09\x0a\x09ul asJQuery sortable: #{\x0a\x09\x09'containment' -> 'parent'.\x0a\x09\x09'start' -> [ self disableSelection ].\x0a\x09\x09'stop' -> [ [ self enableSelection] valueWithTimeout: 300 ].\x0a\x09\x09'update' -> [ self updateTabsOrder ]\x0a\x09}",
  6357. messageSends: ["class:", "ul", "with:", "do:", "tabs", "renderTab:on:", "sortable:", "asJQuery", "disableSelection", "valueWithTimeout:", "enableSelection", "updateTabsOrder"],
  6358. referencedClasses: []
  6359. }),
  6360. globals.HLTabsWidget);
  6361. smalltalk.addMethod(
  6362. smalltalk.method({
  6363. selector: "setupEvents",
  6364. protocol: 'private',
  6365. fn: function (){
  6366. var self=this;
  6367. return smalltalk.withContext(function($ctx1) {
  6368. var $2,$3,$1,$4;
  6369. _st("body"._asJQuery())._keydown_((function(event){
  6370. return smalltalk.withContext(function($ctx2) {
  6371. $2=_st(event)._ctrlKey();
  6372. $ctx2.sendIdx["ctrlKey"]=1;
  6373. $1=_st($2)._and_((function(){
  6374. return smalltalk.withContext(function($ctx3) {
  6375. $3=_st(event)._which();
  6376. $ctx3.sendIdx["which"]=1;
  6377. return _st($3).__eq((188));
  6378. $ctx3.sendIdx["="]=1;
  6379. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  6380. $ctx2.sendIdx["and:"]=1;
  6381. if(smalltalk.assert($1)){
  6382. self._activatePreviousTab();
  6383. _st(event)._preventDefault();
  6384. $ctx2.sendIdx["preventDefault"]=1;
  6385. };
  6386. $4=_st(_st(event)._ctrlKey())._and_((function(){
  6387. return smalltalk.withContext(function($ctx3) {
  6388. return _st(_st(event)._which()).__eq((190));
  6389. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,4)})}));
  6390. if(smalltalk.assert($4)){
  6391. self._activateNextTab();
  6392. return _st(event)._preventDefault();
  6393. };
  6394. }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1,1)})}));
  6395. return self}, function($ctx1) {$ctx1.fill(self,"setupEvents",{},globals.HLTabsWidget)})},
  6396. args: [],
  6397. source: "setupEvents\x0a\x09'body' asJQuery keydown: [ :event |\x0a\x09\x0a\x09\x09\x22ctrl+> and ctrl+<\x22\x0a\x09\x09(event ctrlKey and: [ event which = 188 ]) ifTrue: [\x0a\x09\x09\x09self activatePreviousTab.\x0a\x09\x09\x09event preventDefault ].\x0a\x09\x09(event ctrlKey and: [ event which = 190 ]) ifTrue: [\x0a\x09\x09\x09self activateNextTab.\x0a\x09\x09\x09event preventDefault ] ]",
  6398. messageSends: ["keydown:", "asJQuery", "ifTrue:", "and:", "ctrlKey", "=", "which", "activatePreviousTab", "preventDefault", "activateNextTab"],
  6399. referencedClasses: []
  6400. }),
  6401. globals.HLTabsWidget);
  6402. smalltalk.addMethod(
  6403. smalltalk.method({
  6404. selector: "show:",
  6405. protocol: 'rendering',
  6406. fn: function (aTab){
  6407. var self=this;
  6408. return smalltalk.withContext(function($ctx1) {
  6409. var $1;
  6410. _st(self._tabs())._do_((function(each){
  6411. return smalltalk.withContext(function($ctx2) {
  6412. return _st(each)._hide();
  6413. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  6414. _st(aTab)._show();
  6415. $1=_st(aTab)._focus();
  6416. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},globals.HLTabsWidget)})},
  6417. args: ["aTab"],
  6418. source: "show: aTab\x0a\x09self tabs do: [ :each | each hide ].\x0a\x09aTab show; focus",
  6419. messageSends: ["do:", "tabs", "hide", "show", "focus"],
  6420. referencedClasses: []
  6421. }),
  6422. globals.HLTabsWidget);
  6423. smalltalk.addMethod(
  6424. smalltalk.method({
  6425. selector: "tabWidth",
  6426. protocol: 'accessing',
  6427. fn: function (){
  6428. var self=this;
  6429. return smalltalk.withContext(function($ctx1) {
  6430. var $1;
  6431. $1=_st(_st(_st(_st(window)._asJQuery())._width()).__minus((90))).__slash(_st(self._tabs())._size());
  6432. return $1;
  6433. }, function($ctx1) {$ctx1.fill(self,"tabWidth",{},globals.HLTabsWidget)})},
  6434. args: [],
  6435. source: "tabWidth\x0a\x09^ (window asJQuery width - 90) / self tabs size",
  6436. messageSends: ["/", "-", "width", "asJQuery", "size", "tabs"],
  6437. referencedClasses: []
  6438. }),
  6439. globals.HLTabsWidget);
  6440. smalltalk.addMethod(
  6441. smalltalk.method({
  6442. selector: "tabs",
  6443. protocol: 'accessing',
  6444. fn: function (){
  6445. var self=this;
  6446. function $OrderedCollection(){return globals.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  6447. return smalltalk.withContext(function($ctx1) {
  6448. var $2,$1,$receiver;
  6449. $2=self["@tabs"];
  6450. if(($receiver = $2) == null || $receiver.isNil){
  6451. self["@tabs"]=_st($OrderedCollection())._new();
  6452. $1=self["@tabs"];
  6453. } else {
  6454. $1=$2;
  6455. };
  6456. return $1;
  6457. }, function($ctx1) {$ctx1.fill(self,"tabs",{},globals.HLTabsWidget)})},
  6458. args: [],
  6459. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
  6460. messageSends: ["ifNil:", "new"],
  6461. referencedClasses: ["OrderedCollection"]
  6462. }),
  6463. globals.HLTabsWidget);
  6464. smalltalk.addMethod(
  6465. smalltalk.method({
  6466. selector: "updateTabsOrder",
  6467. protocol: 'actions',
  6468. fn: function (){
  6469. var self=this;
  6470. return smalltalk.withContext(function($ctx1) {
  6471. self["@tabs"]=_st(_st(".main-tabs li"._asJQuery())._toArray())._collect_((function(each){
  6472. return smalltalk.withContext(function($ctx2) {
  6473. return _st(each)._at_("tab-data");
  6474. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  6475. return self}, function($ctx1) {$ctx1.fill(self,"updateTabsOrder",{},globals.HLTabsWidget)})},
  6476. args: [],
  6477. source: "updateTabsOrder\x0a\x09tabs := '.main-tabs li' asJQuery toArray \x0a\x09\x09collect: [ :each | each at: 'tab-data' ]",
  6478. messageSends: ["collect:", "toArray", "asJQuery", "at:"],
  6479. referencedClasses: []
  6480. }),
  6481. globals.HLTabsWidget);
  6482. globals.HLTabsWidget.klass.iVarNames = ['current'];
  6483. smalltalk.addClass('HLWelcomeWidget', globals.HLWidget, [], 'Helios-Core');
  6484. smalltalk.addMethod(
  6485. smalltalk.method({
  6486. selector: "cssClass",
  6487. protocol: 'accessing',
  6488. fn: function (){
  6489. var self=this;
  6490. return "welcome";
  6491. },
  6492. args: [],
  6493. source: "cssClass\x0a\x09^ 'welcome'",
  6494. messageSends: [],
  6495. referencedClasses: []
  6496. }),
  6497. globals.HLWelcomeWidget);
  6498. smalltalk.addMethod(
  6499. smalltalk.method({
  6500. selector: "openClassBrowser",
  6501. protocol: 'actions',
  6502. fn: function (){
  6503. var self=this;
  6504. function $HLBrowser(){return globals.HLBrowser||(typeof HLBrowser=="undefined"?nil:HLBrowser)}
  6505. return smalltalk.withContext(function($ctx1) {
  6506. _st($HLBrowser())._openAsTab();
  6507. return self}, function($ctx1) {$ctx1.fill(self,"openClassBrowser",{},globals.HLWelcomeWidget)})},
  6508. args: [],
  6509. source: "openClassBrowser\x0a\x09HLBrowser openAsTab",
  6510. messageSends: ["openAsTab"],
  6511. referencedClasses: ["HLBrowser"]
  6512. }),
  6513. globals.HLWelcomeWidget);
  6514. smalltalk.addMethod(
  6515. smalltalk.method({
  6516. selector: "openHelp",
  6517. protocol: 'actions',
  6518. fn: function (){
  6519. var self=this;
  6520. return self},
  6521. args: [],
  6522. source: "openHelp",
  6523. messageSends: [],
  6524. referencedClasses: []
  6525. }),
  6526. globals.HLWelcomeWidget);
  6527. smalltalk.addMethod(
  6528. smalltalk.method({
  6529. selector: "openTestRunner",
  6530. protocol: 'actions',
  6531. fn: function (){
  6532. var self=this;
  6533. function $HLSUnit(){return globals.HLSUnit||(typeof HLSUnit=="undefined"?nil:HLSUnit)}
  6534. return smalltalk.withContext(function($ctx1) {
  6535. _st($HLSUnit())._openAsTab();
  6536. return self}, function($ctx1) {$ctx1.fill(self,"openTestRunner",{},globals.HLWelcomeWidget)})},
  6537. args: [],
  6538. source: "openTestRunner\x0a\x09HLSUnit openAsTab",
  6539. messageSends: ["openAsTab"],
  6540. referencedClasses: ["HLSUnit"]
  6541. }),
  6542. globals.HLWelcomeWidget);
  6543. smalltalk.addMethod(
  6544. smalltalk.method({
  6545. selector: "openWorkspace",
  6546. protocol: 'actions',
  6547. fn: function (){
  6548. var self=this;
  6549. function $HLWorkspace(){return globals.HLWorkspace||(typeof HLWorkspace=="undefined"?nil:HLWorkspace)}
  6550. return smalltalk.withContext(function($ctx1) {
  6551. _st($HLWorkspace())._openAsTab();
  6552. return self}, function($ctx1) {$ctx1.fill(self,"openWorkspace",{},globals.HLWelcomeWidget)})},
  6553. args: [],
  6554. source: "openWorkspace\x0a\x09HLWorkspace openAsTab",
  6555. messageSends: ["openAsTab"],
  6556. referencedClasses: ["HLWorkspace"]
  6557. }),
  6558. globals.HLWelcomeWidget);
  6559. smalltalk.addMethod(
  6560. smalltalk.method({
  6561. selector: "renderButtonsOn:",
  6562. protocol: 'rendering',
  6563. fn: function (html){
  6564. var self=this;
  6565. return smalltalk.withContext(function($ctx1) {
  6566. var $1,$2,$3,$4,$5,$6;
  6567. $1=_st(html)._button();
  6568. $ctx1.sendIdx["button"]=1;
  6569. _st($1)._class_("button");
  6570. $ctx1.sendIdx["class:"]=1;
  6571. _st($1)._with_("Class Browser");
  6572. $ctx1.sendIdx["with:"]=1;
  6573. $2=_st($1)._onClick_((function(){
  6574. return smalltalk.withContext(function($ctx2) {
  6575. return self._openClassBrowser();
  6576. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  6577. $ctx1.sendIdx["onClick:"]=1;
  6578. $3=_st(html)._button();
  6579. $ctx1.sendIdx["button"]=2;
  6580. _st($3)._class_("button");
  6581. $ctx1.sendIdx["class:"]=2;
  6582. _st($3)._with_("Workspace");
  6583. $ctx1.sendIdx["with:"]=2;
  6584. $4=_st($3)._onClick_((function(){
  6585. return smalltalk.withContext(function($ctx2) {
  6586. return self._openWorkspace();
  6587. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  6588. $ctx1.sendIdx["onClick:"]=2;
  6589. $5=_st(html)._button();
  6590. _st($5)._class_("button");
  6591. _st($5)._with_("Test Runner");
  6592. $6=_st($5)._onClick_((function(){
  6593. return smalltalk.withContext(function($ctx2) {
  6594. return self._openTestRunner();
  6595. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  6596. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLWelcomeWidget)})},
  6597. args: ["html"],
  6598. source: "renderButtonsOn: html\x0a\x09html button\x0a\x09\x09class: 'button';\x0a\x09\x09with: 'Class Browser';\x0a\x09\x09onClick: [ self openClassBrowser ].\x0a\x09html button\x0a\x09\x09class: 'button';\x0a\x09\x09with: 'Workspace';\x0a\x09\x09onClick: [ self openWorkspace ].\x0a\x09html button\x0a\x09\x09class: 'button';\x0a\x09\x09with: 'Test Runner';\x0a\x09\x09onClick: [ self openTestRunner ].\x0a\x09\x22html button\x0a\x09\x09class: 'button';\x0a\x09\x09with: 'Help';\x0a\x09\x09onClick: [ self openHelp ]\x22",
  6599. messageSends: ["class:", "button", "with:", "onClick:", "openClassBrowser", "openWorkspace", "openTestRunner"],
  6600. referencedClasses: []
  6601. }),
  6602. globals.HLWelcomeWidget);
  6603. smalltalk.addMethod(
  6604. smalltalk.method({
  6605. selector: "renderContentOn:",
  6606. protocol: 'rendering',
  6607. fn: function (html){
  6608. var self=this;
  6609. return smalltalk.withContext(function($ctx1) {
  6610. var $1;
  6611. self._renderHelpOn_(html);
  6612. $1=self._renderButtonsOn_(html);
  6613. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLWelcomeWidget)})},
  6614. args: ["html"],
  6615. source: "renderContentOn: html\x0a\x09self\x0a\x09\x09renderHelpOn: html;\x0a\x09\x09renderButtonsOn: html",
  6616. messageSends: ["renderHelpOn:", "renderButtonsOn:"],
  6617. referencedClasses: []
  6618. }),
  6619. globals.HLWelcomeWidget);
  6620. smalltalk.addMethod(
  6621. smalltalk.method({
  6622. selector: "renderHelpOn:",
  6623. protocol: 'rendering',
  6624. fn: function (html){
  6625. var self=this;
  6626. return smalltalk.withContext(function($ctx1) {
  6627. var $1;
  6628. _st(_st(html)._h2())._with_("No tools are open");
  6629. $ctx1.sendIdx["with:"]=1;
  6630. _st(_st(html)._ul())._with_((function(){
  6631. return smalltalk.withContext(function($ctx2) {
  6632. $1=_st(html)._li();
  6633. $ctx2.sendIdx["li"]=1;
  6634. _st($1)._with_("Perform actions with ctrl + space");
  6635. $ctx2.sendIdx["with:"]=3;
  6636. return _st(_st(html)._li())._with_("Open one of the common tools:");
  6637. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  6638. $ctx1.sendIdx["with:"]=2;
  6639. return self}, function($ctx1) {$ctx1.fill(self,"renderHelpOn:",{html:html},globals.HLWelcomeWidget)})},
  6640. args: ["html"],
  6641. source: "renderHelpOn: html\x0a\x09html h2 with: 'No tools are open'.\x0a\x09html ul with: [\x0a\x09\x09html li with: 'Perform actions with ctrl + space'.\x0a\x09\x09html li with: 'Open one of the common tools:' ]",
  6642. messageSends: ["with:", "h2", "ul", "li"],
  6643. referencedClasses: []
  6644. }),
  6645. globals.HLWelcomeWidget);
  6646. });