Helios-Core.js 155 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254
  1. smalltalk.addPackage('Helios-Core');
  2. smalltalk.addClass('HLModel', smalltalk.Object, ['announcer', 'environment'], 'Helios-Core');
  3. smalltalk.HLModel.comment="I am the abstract superclass of all models of Helios.\x0aI am the \x22Model\x22 part of the MVC pattern implementation in Helios.\x0a\x0aI provide access to an `Environment` object and both a local (model-specific) and global (system-specific) announcer.\x0a\x0aThe `#withChangesDo:` method is handy for performing model changes ensuring that all widgets are aware of the change and can prevent it from happening.\x0a\x0aModifications of the system should be done via commands (see `HLCommand` and subclasses).\x0a\x0a"
  4. smalltalk.addMethod(
  5. smalltalk.method({
  6. selector: "announcer",
  7. category: 'accessing',
  8. fn: function (){
  9. var self=this;
  10. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  11. return smalltalk.withContext(function($ctx1) {
  12. var $2,$1;
  13. $2=self["@announcer"];
  14. if(($receiver = $2) == nil || $receiver == undefined){
  15. self["@announcer"]=_st($Announcer())._new();
  16. $1=self["@announcer"];
  17. } else {
  18. $1=$2;
  19. };
  20. return $1;
  21. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLModel)})},
  22. args: [],
  23. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  24. messageSends: ["ifNil:", "new"],
  25. referencedClasses: ["Announcer"]
  26. }),
  27. smalltalk.HLModel);
  28. smalltalk.addMethod(
  29. smalltalk.method({
  30. selector: "environment",
  31. category: 'accessing',
  32. fn: function (){
  33. var self=this;
  34. return smalltalk.withContext(function($ctx1) {
  35. var $2,$1;
  36. $2=self["@environment"];
  37. if(($receiver = $2) == nil || $receiver == undefined){
  38. $1=_st(_st(self)._manager())._environment();
  39. } else {
  40. $1=$2;
  41. };
  42. return $1;
  43. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLModel)})},
  44. args: [],
  45. source: "environment\x0a\x09^ environment ifNil: [ self manager environment ]",
  46. messageSends: ["ifNil:", "environment", "manager"],
  47. referencedClasses: []
  48. }),
  49. smalltalk.HLModel);
  50. smalltalk.addMethod(
  51. smalltalk.method({
  52. selector: "environment:",
  53. category: 'accessing',
  54. fn: function (anEnvironment){
  55. var self=this;
  56. return smalltalk.withContext(function($ctx1) {
  57. self["@environment"]=anEnvironment;
  58. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLModel)})},
  59. args: ["anEnvironment"],
  60. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  61. messageSends: [],
  62. referencedClasses: []
  63. }),
  64. smalltalk.HLModel);
  65. smalltalk.addMethod(
  66. smalltalk.method({
  67. selector: "isBrowserModel",
  68. category: 'testing',
  69. fn: function (){
  70. var self=this;
  71. return smalltalk.withContext(function($ctx1) {
  72. return false;
  73. }, function($ctx1) {$ctx1.fill(self,"isBrowserModel",{},smalltalk.HLModel)})},
  74. args: [],
  75. source: "isBrowserModel\x0a\x09^ false",
  76. messageSends: [],
  77. referencedClasses: []
  78. }),
  79. smalltalk.HLModel);
  80. smalltalk.addMethod(
  81. smalltalk.method({
  82. selector: "isReferencesModel",
  83. category: 'testing',
  84. fn: function (){
  85. var self=this;
  86. return smalltalk.withContext(function($ctx1) {
  87. return false;
  88. }, function($ctx1) {$ctx1.fill(self,"isReferencesModel",{},smalltalk.HLModel)})},
  89. args: [],
  90. source: "isReferencesModel\x0a\x09^ false",
  91. messageSends: [],
  92. referencedClasses: []
  93. }),
  94. smalltalk.HLModel);
  95. smalltalk.addMethod(
  96. smalltalk.method({
  97. selector: "isToolModel",
  98. category: 'testing',
  99. fn: function (){
  100. var self=this;
  101. return smalltalk.withContext(function($ctx1) {
  102. return false;
  103. }, function($ctx1) {$ctx1.fill(self,"isToolModel",{},smalltalk.HLModel)})},
  104. args: [],
  105. source: "isToolModel\x0a\x09^ false",
  106. messageSends: [],
  107. referencedClasses: []
  108. }),
  109. smalltalk.HLModel);
  110. smalltalk.addMethod(
  111. smalltalk.method({
  112. selector: "manager",
  113. category: 'accessing',
  114. fn: function (){
  115. var self=this;
  116. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  117. return smalltalk.withContext(function($ctx1) {
  118. var $1;
  119. $1=_st($HLManager())._current();
  120. return $1;
  121. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLModel)})},
  122. args: [],
  123. source: "manager\x0a\x09^ HLManager current",
  124. messageSends: ["current"],
  125. referencedClasses: ["HLManager"]
  126. }),
  127. smalltalk.HLModel);
  128. smalltalk.addMethod(
  129. smalltalk.method({
  130. selector: "systemAnnouncer",
  131. category: 'accessing',
  132. fn: function (){
  133. var self=this;
  134. return smalltalk.withContext(function($ctx1) {
  135. var $1;
  136. $1=_st(_st(self)._environment())._systemAnnouncer();
  137. return $1;
  138. }, function($ctx1) {$ctx1.fill(self,"systemAnnouncer",{},smalltalk.HLModel)})},
  139. args: [],
  140. source: "systemAnnouncer\x0a\x09^ self environment systemAnnouncer",
  141. messageSends: ["systemAnnouncer", "environment"],
  142. referencedClasses: []
  143. }),
  144. smalltalk.HLModel);
  145. smalltalk.addMethod(
  146. smalltalk.method({
  147. selector: "withChangesDo:",
  148. category: 'error handling',
  149. fn: function (aBlock){
  150. var self=this;
  151. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  152. function $HLAboutToChange(){return smalltalk.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  153. return smalltalk.withContext(function($ctx1) {
  154. _st((function(){
  155. return smalltalk.withContext(function($ctx2) {
  156. _st(_st(self)._announcer())._announce_(_st(_st($HLAboutToChange())._new())._actionBlock_(aBlock));
  157. return _st(aBlock)._value();
  158. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._on_do_($HLChangeForbidden(),(function(ex){
  159. return smalltalk.withContext(function($ctx2) {
  160. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  161. return self}, function($ctx1) {$ctx1.fill(self,"withChangesDo:",{aBlock:aBlock},smalltalk.HLModel)})},
  162. args: ["aBlock"],
  163. source: "withChangesDo: aBlock\x0a\x09[ \x0a\x09\x09self announcer announce: (HLAboutToChange new\x0a\x09\x09\x09actionBlock: aBlock).\x0a\x09\x09aBlock value.\x0a\x09]\x0a\x09\x09on: HLChangeForbidden \x0a\x09\x09do: [ :ex | ]",
  164. messageSends: ["on:do:", "announce:", "actionBlock:", "new", "announcer", "value"],
  165. referencedClasses: ["HLChangeForbidden", "HLAboutToChange"]
  166. }),
  167. smalltalk.HLModel);
  168. smalltalk.addClass('HLToolModel', smalltalk.HLModel, ['selectedClass', 'selectedPackage', 'selectedProtocol', 'selectedSelector'], 'Helios-Core');
  169. smalltalk.HLToolModel.comment="I am a model specific to package and class manipulation. All browsers should either use me or a subclass as their model.\x0a\x0aI provide methods for package, class, protocol and method manipulation and access, forwarding to my environment.\x0a\x0aI also handle compilation of classes and methods as well as compilation and parsing errors."
  170. smalltalk.addMethod(
  171. smalltalk.method({
  172. selector: "addInstVarNamed:",
  173. category: 'actions',
  174. fn: function (aString){
  175. var self=this;
  176. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  177. return smalltalk.withContext(function($ctx1) {
  178. var $1,$2;
  179. _st(_st(self)._environment())._addInstVarNamed_to_(aString,_st(self)._selectedClass());
  180. $1=_st($HLInstVarAdded())._new();
  181. _st($1)._theClass_(_st(self)._selectedClass());
  182. _st($1)._variableName_(aString);
  183. $2=_st($1)._yourself();
  184. _st(_st(self)._announcer())._announce_($2);
  185. return self}, function($ctx1) {$ctx1.fill(self,"addInstVarNamed:",{aString:aString},smalltalk.HLToolModel)})},
  186. args: ["aString"],
  187. 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)",
  188. messageSends: ["addInstVarNamed:to:", "selectedClass", "environment", "announce:", "theClass:", "new", "variableName:", "yourself", "announcer"],
  189. referencedClasses: ["HLInstVarAdded"]
  190. }),
  191. smalltalk.HLToolModel);
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "allProtocol",
  195. category: 'defaults',
  196. fn: function (){
  197. var self=this;
  198. return smalltalk.withContext(function($ctx1) {
  199. return "-- all --";
  200. }, function($ctx1) {$ctx1.fill(self,"allProtocol",{},smalltalk.HLToolModel)})},
  201. args: [],
  202. source: "allProtocol\x0a\x09^ '-- all --'",
  203. messageSends: [],
  204. referencedClasses: []
  205. }),
  206. smalltalk.HLToolModel);
  207. smalltalk.addMethod(
  208. smalltalk.method({
  209. selector: "allSelectors",
  210. category: 'accessing',
  211. fn: function (){
  212. var self=this;
  213. return smalltalk.withContext(function($ctx1) {
  214. var $1;
  215. $1=_st(_st(self)._environment())._allSelectors();
  216. return $1;
  217. }, function($ctx1) {$ctx1.fill(self,"allSelectors",{},smalltalk.HLToolModel)})},
  218. args: [],
  219. source: "allSelectors\x0a\x09^ self environment allSelectors",
  220. messageSends: ["allSelectors", "environment"],
  221. referencedClasses: []
  222. }),
  223. smalltalk.HLToolModel);
  224. smalltalk.addMethod(
  225. smalltalk.method({
  226. selector: "availableClassNames",
  227. category: 'accessing',
  228. fn: function (){
  229. var self=this;
  230. return smalltalk.withContext(function($ctx1) {
  231. var $1;
  232. $1=_st(_st(self)._environment())._availableClassNames();
  233. return $1;
  234. }, function($ctx1) {$ctx1.fill(self,"availableClassNames",{},smalltalk.HLToolModel)})},
  235. args: [],
  236. source: "availableClassNames\x0a\x09^ self environment availableClassNames",
  237. messageSends: ["availableClassNames", "environment"],
  238. referencedClasses: []
  239. }),
  240. smalltalk.HLToolModel);
  241. smalltalk.addMethod(
  242. smalltalk.method({
  243. selector: "availablePackageNames",
  244. category: 'accessing',
  245. fn: function (){
  246. var self=this;
  247. return smalltalk.withContext(function($ctx1) {
  248. var $1;
  249. $1=_st(_st(self)._environment())._availablePackageNames();
  250. return $1;
  251. }, function($ctx1) {$ctx1.fill(self,"availablePackageNames",{},smalltalk.HLToolModel)})},
  252. args: [],
  253. source: "availablePackageNames\x0a\x09^ self environment availablePackageNames",
  254. messageSends: ["availablePackageNames", "environment"],
  255. referencedClasses: []
  256. }),
  257. smalltalk.HLToolModel);
  258. smalltalk.addMethod(
  259. smalltalk.method({
  260. selector: "availablePackages",
  261. category: 'accessing',
  262. fn: function (){
  263. var self=this;
  264. return smalltalk.withContext(function($ctx1) {
  265. var $1;
  266. $1=_st(_st(self)._environment())._availablePackageNames();
  267. return $1;
  268. }, function($ctx1) {$ctx1.fill(self,"availablePackages",{},smalltalk.HLToolModel)})},
  269. args: [],
  270. source: "availablePackages\x0a\x09^ self environment availablePackageNames",
  271. messageSends: ["availablePackageNames", "environment"],
  272. referencedClasses: []
  273. }),
  274. smalltalk.HLToolModel);
  275. smalltalk.addMethod(
  276. smalltalk.method({
  277. selector: "availableProtocols",
  278. category: 'accessing',
  279. fn: function (){
  280. var self=this;
  281. return smalltalk.withContext(function($ctx1) {
  282. var $1;
  283. $1=_st(_st(self)._environment())._availableProtocolsFor_(_st(self)._selectedClass());
  284. return $1;
  285. }, function($ctx1) {$ctx1.fill(self,"availableProtocols",{},smalltalk.HLToolModel)})},
  286. args: [],
  287. source: "availableProtocols\x0a\x09^ self environment availableProtocolsFor: self selectedClass",
  288. messageSends: ["availableProtocolsFor:", "selectedClass", "environment"],
  289. referencedClasses: []
  290. }),
  291. smalltalk.HLToolModel);
  292. smalltalk.addMethod(
  293. smalltalk.method({
  294. selector: "commitPackage",
  295. category: 'commands actions',
  296. fn: function (){
  297. var self=this;
  298. return smalltalk.withContext(function($ctx1) {
  299. _st(self)._withHelperLabelled_do_(_st(_st("Committing package ").__comma(_st(_st(self)._selectedPackage())._name())).__comma("..."),(function(){
  300. return smalltalk.withContext(function($ctx2) {
  301. return _st(_st(self)._environment())._commitPackage_(_st(self)._selectedPackage());
  302. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  303. return self}, function($ctx1) {$ctx1.fill(self,"commitPackage",{},smalltalk.HLToolModel)})},
  304. args: [],
  305. source: "commitPackage\x0a\x09self \x0a\x09\x09withHelperLabelled: 'Committing package ', self selectedPackage name, '...'\x0a\x09\x09do: [ self environment commitPackage: self selectedPackage ]",
  306. messageSends: ["withHelperLabelled:do:", ",", "name", "selectedPackage", "commitPackage:", "environment"],
  307. referencedClasses: []
  308. }),
  309. smalltalk.HLToolModel);
  310. smalltalk.addMethod(
  311. smalltalk.method({
  312. selector: "compilationProtocol",
  313. category: 'private',
  314. fn: function (){
  315. var self=this;
  316. var currentProtocol;
  317. return smalltalk.withContext(function($ctx1) {
  318. var $1,$2,$4,$3;
  319. currentProtocol=_st(self)._selectedProtocol();
  320. $1=currentProtocol;
  321. if(($receiver = $1) == nil || $receiver == undefined){
  322. currentProtocol=_st(self)._unclassifiedProtocol();
  323. currentProtocol;
  324. } else {
  325. $1;
  326. };
  327. $2=_st(self)._selectedMethod();
  328. if(($receiver = $2) == nil || $receiver == undefined){
  329. $2;
  330. } else {
  331. currentProtocol=_st(_st(self)._selectedMethod())._protocol();
  332. currentProtocol;
  333. };
  334. $4=_st(currentProtocol).__eq(_st(self)._allProtocol());
  335. if(smalltalk.assert($4)){
  336. $3=_st(self)._unclassifiedProtocol();
  337. } else {
  338. $3=currentProtocol;
  339. };
  340. return $3;
  341. }, function($ctx1) {$ctx1.fill(self,"compilationProtocol",{currentProtocol:currentProtocol},smalltalk.HLToolModel)})},
  342. args: [],
  343. 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 ]",
  344. messageSends: ["selectedProtocol", "ifNil:", "unclassifiedProtocol", "ifNotNil:", "protocol", "selectedMethod", "ifTrue:ifFalse:", "=", "allProtocol"],
  345. referencedClasses: []
  346. }),
  347. smalltalk.HLToolModel);
  348. smalltalk.addMethod(
  349. smalltalk.method({
  350. selector: "compileClassComment:",
  351. category: 'compiling',
  352. fn: function (aString){
  353. var self=this;
  354. return smalltalk.withContext(function($ctx1) {
  355. _st(_st(self)._environment())._compileClassComment_for_(aString,_st(self)._selectedClass());
  356. return self}, function($ctx1) {$ctx1.fill(self,"compileClassComment:",{aString:aString},smalltalk.HLToolModel)})},
  357. args: ["aString"],
  358. source: "compileClassComment: aString\x0a\x09self environment \x0a\x09\x09compileClassComment: aString \x0a\x09\x09for: self selectedClass",
  359. messageSends: ["compileClassComment:for:", "selectedClass", "environment"],
  360. referencedClasses: []
  361. }),
  362. smalltalk.HLToolModel);
  363. smalltalk.addMethod(
  364. smalltalk.method({
  365. selector: "compileClassDefinition:",
  366. category: 'compiling',
  367. fn: function (aString){
  368. var self=this;
  369. return smalltalk.withContext(function($ctx1) {
  370. _st(_st(self)._environment())._compileClassDefinition_(aString);
  371. return self}, function($ctx1) {$ctx1.fill(self,"compileClassDefinition:",{aString:aString},smalltalk.HLToolModel)})},
  372. args: ["aString"],
  373. source: "compileClassDefinition: aString\x0a\x09self environment compileClassDefinition: aString",
  374. messageSends: ["compileClassDefinition:", "environment"],
  375. referencedClasses: []
  376. }),
  377. smalltalk.HLToolModel);
  378. smalltalk.addMethod(
  379. smalltalk.method({
  380. selector: "compileMethod:",
  381. category: 'compiling',
  382. fn: function (aString){
  383. var self=this;
  384. var method;
  385. return smalltalk.withContext(function($ctx1) {
  386. _st(self)._withCompileErrorHandling_((function(){
  387. return smalltalk.withContext(function($ctx2) {
  388. method=_st(_st(self)._environment())._compileMethod_for_protocol_(aString,_st(self)._selectedClass(),_st(self)._compilationProtocol());
  389. method;
  390. return _st(self)._selectedMethod_(method);
  391. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  392. return self}, function($ctx1) {$ctx1.fill(self,"compileMethod:",{aString:aString,method:method},smalltalk.HLToolModel)})},
  393. args: ["aString"],
  394. 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 ]",
  395. messageSends: ["withCompileErrorHandling:", "compileMethod:for:protocol:", "selectedClass", "compilationProtocol", "environment", "selectedMethod:"],
  396. referencedClasses: []
  397. }),
  398. smalltalk.HLToolModel);
  399. smalltalk.addMethod(
  400. smalltalk.method({
  401. selector: "copyClassTo:",
  402. category: 'commands actions',
  403. fn: function (aClassName){
  404. var self=this;
  405. return smalltalk.withContext(function($ctx1) {
  406. _st(self)._withChangesDo_((function(){
  407. return smalltalk.withContext(function($ctx2) {
  408. return _st(_st(self)._environment())._copyClass_to_(_st(_st(self)._selectedClass())._theNonMetaClass(),aClassName);
  409. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  410. return self}, function($ctx1) {$ctx1.fill(self,"copyClassTo:",{aClassName:aClassName},smalltalk.HLToolModel)})},
  411. args: ["aClassName"],
  412. source: "copyClassTo: aClassName\x0a\x09self withChangesDo: [ \x0a\x09\x09self environment \x0a\x09\x09\x09copyClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09to: aClassName ]",
  413. messageSends: ["withChangesDo:", "copyClass:to:", "theNonMetaClass", "selectedClass", "environment"],
  414. referencedClasses: []
  415. }),
  416. smalltalk.HLToolModel);
  417. smalltalk.addMethod(
  418. smalltalk.method({
  419. selector: "handleCompileError:",
  420. category: 'error handling',
  421. fn: function (anError){
  422. var self=this;
  423. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  424. return smalltalk.withContext(function($ctx1) {
  425. var $1,$2;
  426. $1=_st($HLCompileErrorRaised())._new();
  427. _st($1)._error_(anError);
  428. $2=_st($1)._yourself();
  429. _st(_st(self)._announcer())._announce_($2);
  430. return self}, function($ctx1) {$ctx1.fill(self,"handleCompileError:",{anError:anError},smalltalk.HLToolModel)})},
  431. args: ["anError"],
  432. source: "handleCompileError: anError\x0a\x09self announcer announce: (HLCompileErrorRaised new\x0a\x09\x09error: anError;\x0a\x09\x09yourself)",
  433. messageSends: ["announce:", "error:", "new", "yourself", "announcer"],
  434. referencedClasses: ["HLCompileErrorRaised"]
  435. }),
  436. smalltalk.HLToolModel);
  437. smalltalk.addMethod(
  438. smalltalk.method({
  439. selector: "handleParseError:",
  440. category: 'error handling',
  441. fn: function (anError){
  442. var self=this;
  443. var split,line,column,messageToInsert;
  444. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  445. return smalltalk.withContext(function($ctx1) {
  446. var $1,$2;
  447. split=_st(_st(anError)._messageText())._tokenize_(" : ");
  448. messageToInsert=_st(split)._second();
  449. split=_st(_st(split)._first())._copyFrom_to_((21),_st(_st(split)._first())._size());
  450. split=_st(split)._tokenize_(" column ");
  451. line=_st(split)._first();
  452. column=_st(split)._second();
  453. $1=_st($HLParseErrorRaised())._new();
  454. _st($1)._line_(_st(line)._asNumber());
  455. _st($1)._column_(_st(column)._asNumber());
  456. _st($1)._message_(messageToInsert);
  457. _st($1)._error_(anError);
  458. $2=_st($1)._yourself();
  459. _st(_st(self)._announcer())._announce_($2);
  460. return self}, function($ctx1) {$ctx1.fill(self,"handleParseError:",{anError:anError,split:split,line:line,column:column,messageToInsert:messageToInsert},smalltalk.HLToolModel)})},
  461. args: ["anError"],
  462. 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)",
  463. messageSends: ["tokenize:", "messageText", "second", "copyFrom:to:", "size", "first", "announce:", "line:", "asNumber", "new", "column:", "message:", "error:", "yourself", "announcer"],
  464. referencedClasses: ["HLParseErrorRaised"]
  465. }),
  466. smalltalk.HLToolModel);
  467. smalltalk.addMethod(
  468. smalltalk.method({
  469. selector: "handleUnkownVariableError:",
  470. category: 'error handling',
  471. fn: function (anError){
  472. var self=this;
  473. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  474. return smalltalk.withContext(function($ctx1) {
  475. var $1,$2;
  476. $1=_st($HLUnknownVariableErrorRaised())._new();
  477. _st($1)._error_(anError);
  478. $2=_st($1)._yourself();
  479. _st(_st(self)._announcer())._announce_($2);
  480. return self}, function($ctx1) {$ctx1.fill(self,"handleUnkownVariableError:",{anError:anError},smalltalk.HLToolModel)})},
  481. args: ["anError"],
  482. source: "handleUnkownVariableError: anError\x0a\x09self announcer announce: (HLUnknownVariableErrorRaised new\x0a\x09\x09error: anError;\x0a\x09\x09yourself)",
  483. messageSends: ["announce:", "error:", "new", "yourself", "announcer"],
  484. referencedClasses: ["HLUnknownVariableErrorRaised"]
  485. }),
  486. smalltalk.HLToolModel);
  487. smalltalk.addMethod(
  488. smalltalk.method({
  489. selector: "isToolModel",
  490. category: 'testing',
  491. fn: function (){
  492. var self=this;
  493. return smalltalk.withContext(function($ctx1) {
  494. return true;
  495. }, function($ctx1) {$ctx1.fill(self,"isToolModel",{},smalltalk.HLToolModel)})},
  496. args: [],
  497. source: "isToolModel\x0a\x09^ true",
  498. messageSends: [],
  499. referencedClasses: []
  500. }),
  501. smalltalk.HLToolModel);
  502. smalltalk.addMethod(
  503. smalltalk.method({
  504. selector: "moveClassToPackage:",
  505. category: 'commands actions',
  506. fn: function (aPackageName){
  507. var self=this;
  508. return smalltalk.withContext(function($ctx1) {
  509. _st(self)._withChangesDo_((function(){
  510. return smalltalk.withContext(function($ctx2) {
  511. return _st(_st(self)._environment())._moveClass_toPackage_(_st(_st(self)._selectedClass())._theNonMetaClass(),aPackageName);
  512. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  513. return self}, function($ctx1) {$ctx1.fill(self,"moveClassToPackage:",{aPackageName:aPackageName},smalltalk.HLToolModel)})},
  514. args: ["aPackageName"],
  515. source: "moveClassToPackage: aPackageName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09toPackage: aPackageName ]",
  516. messageSends: ["withChangesDo:", "moveClass:toPackage:", "theNonMetaClass", "selectedClass", "environment"],
  517. referencedClasses: []
  518. }),
  519. smalltalk.HLToolModel);
  520. smalltalk.addMethod(
  521. smalltalk.method({
  522. selector: "moveMethodToClass:",
  523. category: 'commands actions',
  524. fn: function (aClassName){
  525. var self=this;
  526. return smalltalk.withContext(function($ctx1) {
  527. _st(self)._withChangesDo_((function(){
  528. return smalltalk.withContext(function($ctx2) {
  529. return _st(_st(self)._environment())._moveMethod_toClass_(_st(self)._selectedMethod(),aClassName);
  530. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  531. return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToClass:",{aClassName:aClassName},smalltalk.HLToolModel)})},
  532. args: ["aClassName"],
  533. source: "moveMethodToClass: aClassName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveMethod: self selectedMethod \x0a\x09\x09\x09toClass: aClassName ]",
  534. messageSends: ["withChangesDo:", "moveMethod:toClass:", "selectedMethod", "environment"],
  535. referencedClasses: []
  536. }),
  537. smalltalk.HLToolModel);
  538. smalltalk.addMethod(
  539. smalltalk.method({
  540. selector: "moveMethodToProtocol:",
  541. category: 'commands actions',
  542. fn: function (aProtocol){
  543. var self=this;
  544. return smalltalk.withContext(function($ctx1) {
  545. _st(self)._withChangesDo_((function(){
  546. return smalltalk.withContext(function($ctx2) {
  547. return _st(_st(self)._environment())._moveMethod_toProtocol_(_st(self)._selectedMethod(),aProtocol);
  548. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  549. return self}, function($ctx1) {$ctx1.fill(self,"moveMethodToProtocol:",{aProtocol:aProtocol},smalltalk.HLToolModel)})},
  550. args: ["aProtocol"],
  551. source: "moveMethodToProtocol: aProtocol\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09moveMethod: self selectedMethod \x0a\x09\x09\x09toProtocol: aProtocol ]",
  552. messageSends: ["withChangesDo:", "moveMethod:toProtocol:", "selectedMethod", "environment"],
  553. referencedClasses: []
  554. }),
  555. smalltalk.HLToolModel);
  556. smalltalk.addMethod(
  557. smalltalk.method({
  558. selector: "openClassNamed:",
  559. category: 'commands actions',
  560. fn: function (aString){
  561. var self=this;
  562. var class_;
  563. return smalltalk.withContext(function($ctx1) {
  564. _st(self)._withChangesDo_((function(){
  565. return smalltalk.withContext(function($ctx2) {
  566. class_=_st(_st(self)._environment())._classNamed_(aString);
  567. class_;
  568. _st(self)._selectedPackage_(_st(class_)._package());
  569. return _st(self)._selectedClass_(class_);
  570. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  571. return self}, function($ctx1) {$ctx1.fill(self,"openClassNamed:",{aString:aString,class_:class_},smalltalk.HLToolModel)})},
  572. args: ["aString"],
  573. 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 ]",
  574. messageSends: ["withChangesDo:", "classNamed:", "environment", "selectedPackage:", "package", "selectedClass:"],
  575. referencedClasses: []
  576. }),
  577. smalltalk.HLToolModel);
  578. smalltalk.addMethod(
  579. smalltalk.method({
  580. selector: "packages",
  581. category: 'accessing',
  582. fn: function (){
  583. var self=this;
  584. return smalltalk.withContext(function($ctx1) {
  585. var $1;
  586. $1=_st(_st(self)._environment())._packages();
  587. return $1;
  588. }, function($ctx1) {$ctx1.fill(self,"packages",{},smalltalk.HLToolModel)})},
  589. args: [],
  590. source: "packages\x0a\x09^ self environment packages",
  591. messageSends: ["packages", "environment"],
  592. referencedClasses: []
  593. }),
  594. smalltalk.HLToolModel);
  595. smalltalk.addMethod(
  596. smalltalk.method({
  597. selector: "removeClass",
  598. category: 'commands actions',
  599. fn: function (){
  600. var self=this;
  601. return smalltalk.withContext(function($ctx1) {
  602. _st(self)._withChangesDo_((function(){
  603. return smalltalk.withContext(function($ctx2) {
  604. return _st(_st(self)._manager())._confirm_ifTrue_(_st("Do you REALLY want to remove class ").__comma(_st(_st(self)._selectedClass())._name()),(function(){
  605. return smalltalk.withContext(function($ctx3) {
  606. return _st(_st(self)._environment())._removeClass_(_st(self)._selectedClass());
  607. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  608. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  609. return self}, function($ctx1) {$ctx1.fill(self,"removeClass",{},smalltalk.HLToolModel)})},
  610. args: [],
  611. source: "removeClass\x0a\x09self withChangesDo: [\x0a\x09\x09self manager \x0a\x09\x09\x09confirm: 'Do you REALLY want to remove class ', self selectedClass name\x0a\x09\x09\x09ifTrue: [ self environment removeClass: self selectedClass ] ]",
  612. messageSends: ["withChangesDo:", "confirm:ifTrue:", ",", "name", "selectedClass", "removeClass:", "environment", "manager"],
  613. referencedClasses: []
  614. }),
  615. smalltalk.HLToolModel);
  616. smalltalk.addMethod(
  617. smalltalk.method({
  618. selector: "removeMethod",
  619. category: 'commands actions',
  620. fn: function (){
  621. var self=this;
  622. return smalltalk.withContext(function($ctx1) {
  623. _st(self)._withChangesDo_((function(){
  624. return smalltalk.withContext(function($ctx2) {
  625. return _st(_st(self)._manager())._confirm_ifTrue_(_st(_st(_st("Do you REALLY want to remove method ").__comma(_st(_st(_st(self)._selectedMethod())._methodClass())._name())).__comma(" >> #")).__comma(_st(_st(self)._selectedMethod())._selector()),(function(){
  626. return smalltalk.withContext(function($ctx3) {
  627. return _st(_st(self)._environment())._removeMethod_(_st(self)._selectedMethod());
  628. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  629. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  630. return self}, function($ctx1) {$ctx1.fill(self,"removeMethod",{},smalltalk.HLToolModel)})},
  631. args: [],
  632. 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 ] ]",
  633. messageSends: ["withChangesDo:", "confirm:ifTrue:", ",", "selector", "selectedMethod", "name", "methodClass", "removeMethod:", "environment", "manager"],
  634. referencedClasses: []
  635. }),
  636. smalltalk.HLToolModel);
  637. smalltalk.addMethod(
  638. smalltalk.method({
  639. selector: "removeProtocol",
  640. category: 'commands actions',
  641. fn: function (){
  642. var self=this;
  643. return smalltalk.withContext(function($ctx1) {
  644. _st(self)._withChangesDo_((function(){
  645. return smalltalk.withContext(function($ctx2) {
  646. return _st(_st(self)._manager())._confirm_ifTrue_(_st("Do you REALLY want to remove protocol ").__comma(_st(self)._selectedProtocol()),(function(){
  647. return smalltalk.withContext(function($ctx3) {
  648. return _st(_st(self)._environment())._removeProtocol_from_(_st(self)._selectedProtocol(),_st(self)._selectedClass());
  649. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  650. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  651. return self}, function($ctx1) {$ctx1.fill(self,"removeProtocol",{},smalltalk.HLToolModel)})},
  652. args: [],
  653. 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 ] ]",
  654. messageSends: ["withChangesDo:", "confirm:ifTrue:", ",", "selectedProtocol", "removeProtocol:from:", "selectedClass", "environment", "manager"],
  655. referencedClasses: []
  656. }),
  657. smalltalk.HLToolModel);
  658. smalltalk.addMethod(
  659. smalltalk.method({
  660. selector: "renameClassTo:",
  661. category: 'commands actions',
  662. fn: function (aClassName){
  663. var self=this;
  664. return smalltalk.withContext(function($ctx1) {
  665. _st(self)._withChangesDo_((function(){
  666. return smalltalk.withContext(function($ctx2) {
  667. return _st(_st(self)._environment())._renameClass_to_(_st(_st(self)._selectedClass())._theNonMetaClass(),aClassName);
  668. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  669. return self}, function($ctx1) {$ctx1.fill(self,"renameClassTo:",{aClassName:aClassName},smalltalk.HLToolModel)})},
  670. args: ["aClassName"],
  671. source: "renameClassTo: aClassName\x0a\x09self withChangesDo: [\x0a\x09\x09self environment \x0a\x09\x09\x09renameClass: self selectedClass theNonMetaClass\x0a\x09\x09\x09to: aClassName ]",
  672. messageSends: ["withChangesDo:", "renameClass:to:", "theNonMetaClass", "selectedClass", "environment"],
  673. referencedClasses: []
  674. }),
  675. smalltalk.HLToolModel);
  676. smalltalk.addMethod(
  677. smalltalk.method({
  678. selector: "renameProtocolTo:",
  679. category: 'commands actions',
  680. fn: function (aString){
  681. var self=this;
  682. return smalltalk.withContext(function($ctx1) {
  683. _st(self)._withChangesDo_((function(){
  684. return smalltalk.withContext(function($ctx2) {
  685. return _st(_st(self)._environment())._renameProtocol_to_in_(_st(self)._selectedProtocol(),aString,_st(self)._selectedClass());
  686. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  687. return self}, function($ctx1) {$ctx1.fill(self,"renameProtocolTo:",{aString:aString},smalltalk.HLToolModel)})},
  688. args: ["aString"],
  689. 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 ]",
  690. messageSends: ["withChangesDo:", "renameProtocol:to:in:", "selectedProtocol", "selectedClass", "environment"],
  691. referencedClasses: []
  692. }),
  693. smalltalk.HLToolModel);
  694. smalltalk.addMethod(
  695. smalltalk.method({
  696. selector: "save:",
  697. category: 'actions',
  698. fn: function (aString){
  699. var self=this;
  700. function $HLSourceCodeSaved(){return smalltalk.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  701. return smalltalk.withContext(function($ctx1) {
  702. var $1;
  703. _st(_st(self)._announcer())._announce_(_st($HLSourceCodeSaved())._new());
  704. $1=_st(self)._shouldCompileClassDefinition_(aString);
  705. if(smalltalk.assert($1)){
  706. _st(self)._compileClassDefinition_(aString);
  707. } else {
  708. _st(self)._compileMethod_(aString);
  709. };
  710. return self}, function($ctx1) {$ctx1.fill(self,"save:",{aString:aString},smalltalk.HLToolModel)})},
  711. args: ["aString"],
  712. 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 ]",
  713. messageSends: ["announce:", "new", "announcer", "ifTrue:ifFalse:", "compileClassDefinition:", "compileMethod:", "shouldCompileClassDefinition:"],
  714. referencedClasses: ["HLSourceCodeSaved"]
  715. }),
  716. smalltalk.HLToolModel);
  717. smalltalk.addMethod(
  718. smalltalk.method({
  719. selector: "saveSourceCode",
  720. category: 'actions',
  721. fn: function (){
  722. var self=this;
  723. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  724. return smalltalk.withContext(function($ctx1) {
  725. _st(_st(self)._announcer())._announce_(_st($HLSaveSourceCode())._new());
  726. return self}, function($ctx1) {$ctx1.fill(self,"saveSourceCode",{},smalltalk.HLToolModel)})},
  727. args: [],
  728. source: "saveSourceCode\x0a\x09self announcer announce: HLSaveSourceCode new",
  729. messageSends: ["announce:", "new", "announcer"],
  730. referencedClasses: ["HLSaveSourceCode"]
  731. }),
  732. smalltalk.HLToolModel);
  733. smalltalk.addMethod(
  734. smalltalk.method({
  735. selector: "selectedClass",
  736. category: 'accessing',
  737. fn: function (){
  738. var self=this;
  739. return smalltalk.withContext(function($ctx1) {
  740. var $1;
  741. $1=self["@selectedClass"];
  742. return $1;
  743. }, function($ctx1) {$ctx1.fill(self,"selectedClass",{},smalltalk.HLToolModel)})},
  744. args: [],
  745. source: "selectedClass\x0a\x09^ selectedClass",
  746. messageSends: [],
  747. referencedClasses: []
  748. }),
  749. smalltalk.HLToolModel);
  750. smalltalk.addMethod(
  751. smalltalk.method({
  752. selector: "selectedClass:",
  753. category: 'accessing',
  754. fn: function (aClass){
  755. var self=this;
  756. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  757. return smalltalk.withContext(function($ctx1) {
  758. var $1,$2,$3,$4,$5;
  759. $1=_st(_st(_st(self)._selectedClass()).__eq(aClass))._and_((function(){
  760. return smalltalk.withContext(function($ctx2) {
  761. return _st(aClass)._isNil();
  762. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  763. if(smalltalk.assert($1)){
  764. $2=self;
  765. return $2;
  766. };
  767. _st(self)._withChangesDo_((function(){
  768. return smalltalk.withContext(function($ctx2) {
  769. $3=_st(self["@selectedClass"]).__eq(aClass);
  770. if(smalltalk.assert($3)){
  771. _st(self)._selectedProtocol_(nil);
  772. };
  773. $4=aClass;
  774. if(($receiver = $4) == nil || $receiver == undefined){
  775. self["@selectedClass"]=nil;
  776. self["@selectedClass"];
  777. } else {
  778. self["@selectedPackage"]=_st(_st(aClass)._theNonMetaClass())._package();
  779. self["@selectedPackage"];
  780. $5=_st(self)._showInstance();
  781. if(smalltalk.assert($5)){
  782. self["@selectedClass"]=_st(aClass)._theNonMetaClass();
  783. self["@selectedClass"];
  784. } else {
  785. self["@selectedClass"]=_st(aClass)._theMetaClass();
  786. self["@selectedClass"];
  787. };
  788. };
  789. _st(self)._selectedProtocol_(nil);
  790. return _st(_st(self)._announcer())._announce_(_st($HLClassSelected())._on_(_st(self)._selectedClass()));
  791. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  792. return self}, function($ctx1) {$ctx1.fill(self,"selectedClass:",{aClass:aClass},smalltalk.HLToolModel)})},
  793. args: ["aClass"],
  794. 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\x09selectedPackage := 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) ]",
  795. messageSends: ["ifTrue:", "and:", "isNil", "=", "selectedClass", "withChangesDo:", "selectedProtocol:", "ifNil:ifNotNil:", "package", "theNonMetaClass", "ifTrue:ifFalse:", "theMetaClass", "showInstance", "announce:", "on:", "announcer"],
  796. referencedClasses: ["HLClassSelected"]
  797. }),
  798. smalltalk.HLToolModel);
  799. smalltalk.addMethod(
  800. smalltalk.method({
  801. selector: "selectedMethod",
  802. category: 'accessing',
  803. fn: function (){
  804. var self=this;
  805. return smalltalk.withContext(function($ctx1) {
  806. var $2,$1;
  807. $2=_st(self)._selectedClass();
  808. if(($receiver = $2) == nil || $receiver == undefined){
  809. $1=$2;
  810. } else {
  811. $1=_st(_st(_st(self)._selectedClass())._methodDictionary())._at_ifAbsent_(self["@selectedSelector"],(function(){
  812. return smalltalk.withContext(function($ctx2) {
  813. return nil;
  814. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  815. };
  816. return $1;
  817. }, function($ctx1) {$ctx1.fill(self,"selectedMethod",{},smalltalk.HLToolModel)})},
  818. args: [],
  819. source: "selectedMethod\x0a\x09^ self selectedClass ifNotNil: [ \x0a\x09\x09self selectedClass methodDictionary \x0a\x09\x09\x09at: selectedSelector \x0a\x09\x09\x09ifAbsent: [ nil ] ]",
  820. messageSends: ["ifNotNil:", "at:ifAbsent:", "methodDictionary", "selectedClass"],
  821. referencedClasses: []
  822. }),
  823. smalltalk.HLToolModel);
  824. smalltalk.addMethod(
  825. smalltalk.method({
  826. selector: "selectedMethod:",
  827. category: 'accessing',
  828. fn: function (aCompiledMethod){
  829. var self=this;
  830. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  831. return smalltalk.withContext(function($ctx1) {
  832. var $1,$2,$3;
  833. $1=_st(self["@selectedSelector"]).__eq(aCompiledMethod);
  834. if(smalltalk.assert($1)){
  835. $2=self;
  836. return $2;
  837. };
  838. _st(self)._withChangesDo_((function(){
  839. return smalltalk.withContext(function($ctx2) {
  840. $3=aCompiledMethod;
  841. if(($receiver = $3) == nil || $receiver == undefined){
  842. self["@selectedSelector"]=nil;
  843. self["@selectedSelector"];
  844. } else {
  845. self["@selectedClass"]=_st(aCompiledMethod)._methodClass();
  846. self["@selectedClass"];
  847. self["@selectedPackage"]=_st(_st(self["@selectedClass"])._theNonMetaClass())._package();
  848. self["@selectedPackage"];
  849. self["@selectedSelector"]=_st(aCompiledMethod)._selector();
  850. self["@selectedSelector"];
  851. };
  852. return _st(_st(self)._announcer())._announce_(_st($HLMethodSelected())._on_(aCompiledMethod));
  853. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  854. return self}, function($ctx1) {$ctx1.fill(self,"selectedMethod:",{aCompiledMethod:aCompiledMethod},smalltalk.HLToolModel)})},
  855. args: ["aCompiledMethod"],
  856. 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) ]",
  857. messageSends: ["ifTrue:", "=", "withChangesDo:", "ifNil:ifNotNil:", "methodClass", "package", "theNonMetaClass", "selector", "announce:", "on:", "announcer"],
  858. referencedClasses: ["HLMethodSelected"]
  859. }),
  860. smalltalk.HLToolModel);
  861. smalltalk.addMethod(
  862. smalltalk.method({
  863. selector: "selectedPackage",
  864. category: 'accessing',
  865. fn: function (){
  866. var self=this;
  867. return smalltalk.withContext(function($ctx1) {
  868. var $1;
  869. $1=self["@selectedPackage"];
  870. return $1;
  871. }, function($ctx1) {$ctx1.fill(self,"selectedPackage",{},smalltalk.HLToolModel)})},
  872. args: [],
  873. source: "selectedPackage\x0a\x09^ selectedPackage",
  874. messageSends: [],
  875. referencedClasses: []
  876. }),
  877. smalltalk.HLToolModel);
  878. smalltalk.addMethod(
  879. smalltalk.method({
  880. selector: "selectedPackage:",
  881. category: 'accessing',
  882. fn: function (aPackage){
  883. var self=this;
  884. function $HLPackageSelected(){return smalltalk.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  885. return smalltalk.withContext(function($ctx1) {
  886. var $1,$2;
  887. $1=_st(self["@selectedPackage"]).__eq(aPackage);
  888. if(smalltalk.assert($1)){
  889. $2=self;
  890. return $2;
  891. };
  892. _st(self)._withChangesDo_((function(){
  893. return smalltalk.withContext(function($ctx2) {
  894. self["@selectedPackage"]=aPackage;
  895. self["@selectedPackage"];
  896. _st(self)._selectedClass_(nil);
  897. return _st(_st(self)._announcer())._announce_(_st($HLPackageSelected())._on_(aPackage));
  898. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  899. return self}, function($ctx1) {$ctx1.fill(self,"selectedPackage:",{aPackage:aPackage},smalltalk.HLToolModel)})},
  900. args: ["aPackage"],
  901. 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) ]",
  902. messageSends: ["ifTrue:", "=", "withChangesDo:", "selectedClass:", "announce:", "on:", "announcer"],
  903. referencedClasses: ["HLPackageSelected"]
  904. }),
  905. smalltalk.HLToolModel);
  906. smalltalk.addMethod(
  907. smalltalk.method({
  908. selector: "selectedProtocol",
  909. category: 'accessing',
  910. fn: function (){
  911. var self=this;
  912. return smalltalk.withContext(function($ctx1) {
  913. var $1;
  914. $1=self["@selectedProtocol"];
  915. return $1;
  916. }, function($ctx1) {$ctx1.fill(self,"selectedProtocol",{},smalltalk.HLToolModel)})},
  917. args: [],
  918. source: "selectedProtocol\x0a\x09^ selectedProtocol",
  919. messageSends: [],
  920. referencedClasses: []
  921. }),
  922. smalltalk.HLToolModel);
  923. smalltalk.addMethod(
  924. smalltalk.method({
  925. selector: "selectedProtocol:",
  926. category: 'accessing',
  927. fn: function (aString){
  928. var self=this;
  929. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  930. return smalltalk.withContext(function($ctx1) {
  931. var $1,$2;
  932. $1=_st(self["@selectedProtocol"]).__eq(aString);
  933. if(smalltalk.assert($1)){
  934. $2=self;
  935. return $2;
  936. };
  937. _st(self)._withChangesDo_((function(){
  938. return smalltalk.withContext(function($ctx2) {
  939. self["@selectedProtocol"]=aString;
  940. self["@selectedProtocol"];
  941. _st(self)._selectedMethod_(nil);
  942. return _st(_st(self)._announcer())._announce_(_st($HLProtocolSelected())._on_(aString));
  943. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  944. return self}, function($ctx1) {$ctx1.fill(self,"selectedProtocol:",{aString:aString},smalltalk.HLToolModel)})},
  945. args: ["aString"],
  946. 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) ]",
  947. messageSends: ["ifTrue:", "=", "withChangesDo:", "selectedMethod:", "announce:", "on:", "announcer"],
  948. referencedClasses: ["HLProtocolSelected"]
  949. }),
  950. smalltalk.HLToolModel);
  951. smalltalk.addMethod(
  952. smalltalk.method({
  953. selector: "shouldCompileClassDefinition:",
  954. category: 'testing',
  955. fn: function (aString){
  956. var self=this;
  957. return smalltalk.withContext(function($ctx1) {
  958. var $1;
  959. $1=_st(_st(_st(self)._selectedClass())._isNil())._or_((function(){
  960. return smalltalk.withContext(function($ctx2) {
  961. return _st(_st(_st(aString)._first())._asUppercase()).__eq(_st(aString)._first());
  962. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  963. return $1;
  964. }, function($ctx1) {$ctx1.fill(self,"shouldCompileClassDefinition:",{aString:aString},smalltalk.HLToolModel)})},
  965. args: ["aString"],
  966. source: "shouldCompileClassDefinition: aString\x0a\x09^ self selectedClass isNil or: [\x0a\x09\x09aString first asUppercase = aString first ]",
  967. messageSends: ["or:", "=", "first", "asUppercase", "isNil", "selectedClass"],
  968. referencedClasses: []
  969. }),
  970. smalltalk.HLToolModel);
  971. smalltalk.addMethod(
  972. smalltalk.method({
  973. selector: "unclassifiedProtocol",
  974. category: 'defaults',
  975. fn: function (){
  976. var self=this;
  977. return smalltalk.withContext(function($ctx1) {
  978. return "as yet unclassified";
  979. }, function($ctx1) {$ctx1.fill(self,"unclassifiedProtocol",{},smalltalk.HLToolModel)})},
  980. args: [],
  981. source: "unclassifiedProtocol\x0a\x09^ 'as yet unclassified'",
  982. messageSends: [],
  983. referencedClasses: []
  984. }),
  985. smalltalk.HLToolModel);
  986. smalltalk.addMethod(
  987. smalltalk.method({
  988. selector: "withCompileErrorHandling:",
  989. category: 'error handling',
  990. fn: function (aBlock){
  991. var self=this;
  992. function $ParseError(){return smalltalk.ParseError||(typeof ParseError=="undefined"?nil:ParseError)}
  993. function $UnknownVariableError(){return smalltalk.UnknownVariableError||(typeof UnknownVariableError=="undefined"?nil:UnknownVariableError)}
  994. function $CompilerError(){return smalltalk.CompilerError||(typeof CompilerError=="undefined"?nil:CompilerError)}
  995. return smalltalk.withContext(function($ctx1) {
  996. _st(_st(self)._environment())._evaluate_on_do_((function(){
  997. return smalltalk.withContext(function($ctx2) {
  998. return _st(_st(self)._environment())._evaluate_on_do_((function(){
  999. return smalltalk.withContext(function($ctx3) {
  1000. return _st(_st(self)._environment())._evaluate_on_do_(aBlock,$ParseError(),(function(ex){
  1001. return smalltalk.withContext(function($ctx4) {
  1002. return _st(self)._handleParseError_(ex);
  1003. }, function($ctx4) {$ctx4.fillBlock({ex:ex},$ctx3)})}));
  1004. }, function($ctx3) {$ctx3.fillBlock({},$ctx2)})}),$UnknownVariableError(),(function(ex){
  1005. return smalltalk.withContext(function($ctx3) {
  1006. return _st(self)._handleUnkownVariableError_(ex);
  1007. }, function($ctx3) {$ctx3.fillBlock({ex:ex},$ctx2)})}));
  1008. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),$CompilerError(),(function(ex){
  1009. return smalltalk.withContext(function($ctx2) {
  1010. return _st(self)._handleCompileError_(ex);
  1011. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1)})}));
  1012. return self}, function($ctx1) {$ctx1.fill(self,"withCompileErrorHandling:",{aBlock:aBlock},smalltalk.HLToolModel)})},
  1013. args: ["aBlock"],
  1014. source: "withCompileErrorHandling: aBlock\x0a\x09self environment\x0a\x09\x09evaluate: [\x0a\x09\x09\x09self environment\x0a\x09\x09\x09\x09evaluate: [\x0a\x09\x09\x09\x09\x09self environment\x0a\x09\x09\x09\x09\x09\x09evaluate: aBlock \x0a\x09\x09\x09\x09\x09\x09on: ParseError\x0a\x09\x09\x09\x09\x09\x09do: [:ex | self handleParseError: ex ] ]\x0a\x09\x09\x09\x09on: UnknownVariableError\x0a\x09\x09\x09\x09do: [ :ex | self handleUnkownVariableError: ex ] ]\x0a\x09\x09on: CompilerError\x0a\x09\x09do: [ :ex | self handleCompileError: ex ]",
  1015. messageSends: ["evaluate:on:do:", "handleParseError:", "environment", "handleUnkownVariableError:", "handleCompileError:"],
  1016. referencedClasses: ["ParseError", "UnknownVariableError", "CompilerError"]
  1017. }),
  1018. smalltalk.HLToolModel);
  1019. smalltalk.addMethod(
  1020. smalltalk.method({
  1021. selector: "withHelperLabelled:do:",
  1022. category: 'private',
  1023. fn: function (aString,aBlock){
  1024. var self=this;
  1025. return smalltalk.withContext(function($ctx1) {
  1026. var $1,$2;
  1027. _st(_st(window)._jQuery_("#helper"))._remove();
  1028. _st((function(html){
  1029. return smalltalk.withContext(function($ctx2) {
  1030. $1=_st(html)._div();
  1031. _st($1)._id_("helper");
  1032. $2=_st($1)._with_(aString);
  1033. return $2;
  1034. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st("body")._asJQuery());
  1035. _st((function(){
  1036. return smalltalk.withContext(function($ctx2) {
  1037. _st(aBlock)._value();
  1038. return _st(_st(window)._jQuery_("#helper"))._remove();
  1039. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((10));
  1040. return self}, function($ctx1) {$ctx1.fill(self,"withHelperLabelled:do:",{aString:aString,aBlock:aBlock},smalltalk.HLToolModel)})},
  1041. args: ["aString", "aBlock"],
  1042. source: "withHelperLabelled: aString do: aBlock\x0a\x09\x22TODO: doesn't belong here\x22\x0a\x0a\x09(window jQuery: '#helper') 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(window jQuery: '#helper') remove\x0a\x09] \x0a\x09\x09valueWithTimeout: 10",
  1043. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery", "id:", "div", "with:", "valueWithTimeout:", "value"],
  1044. referencedClasses: []
  1045. }),
  1046. smalltalk.HLToolModel);
  1047. smalltalk.addMethod(
  1048. smalltalk.method({
  1049. selector: "on:",
  1050. category: 'actions',
  1051. fn: function (anEnvironment){
  1052. var self=this;
  1053. return smalltalk.withContext(function($ctx1) {
  1054. var $2,$3,$1;
  1055. $2=_st(self)._new();
  1056. _st($2)._environment_(anEnvironment);
  1057. $3=_st($2)._yourself();
  1058. $1=$3;
  1059. return $1;
  1060. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLToolModel.klass)})},
  1061. args: ["anEnvironment"],
  1062. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  1063. messageSends: ["environment:", "new", "yourself"],
  1064. referencedClasses: []
  1065. }),
  1066. smalltalk.HLToolModel.klass);
  1067. smalltalk.addClass('HLTab', smalltalk.Widget, ['widget', 'label', 'root'], 'Helios-Core');
  1068. smalltalk.HLTab.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"
  1069. smalltalk.addMethod(
  1070. smalltalk.method({
  1071. selector: "activate",
  1072. category: 'accessing',
  1073. fn: function (){
  1074. var self=this;
  1075. return smalltalk.withContext(function($ctx1) {
  1076. _st(_st(self)._manager())._activate_(self);
  1077. return self}, function($ctx1) {$ctx1.fill(self,"activate",{},smalltalk.HLTab)})},
  1078. args: [],
  1079. source: "activate\x0a\x09self manager activate: self",
  1080. messageSends: ["activate:", "manager"],
  1081. referencedClasses: []
  1082. }),
  1083. smalltalk.HLTab);
  1084. smalltalk.addMethod(
  1085. smalltalk.method({
  1086. selector: "add",
  1087. category: 'accessing',
  1088. fn: function (){
  1089. var self=this;
  1090. return smalltalk.withContext(function($ctx1) {
  1091. _st(_st(self)._manager())._addTab_(self);
  1092. return self}, function($ctx1) {$ctx1.fill(self,"add",{},smalltalk.HLTab)})},
  1093. args: [],
  1094. source: "add\x0a\x09self manager addTab: self",
  1095. messageSends: ["addTab:", "manager"],
  1096. referencedClasses: []
  1097. }),
  1098. smalltalk.HLTab);
  1099. smalltalk.addMethod(
  1100. smalltalk.method({
  1101. selector: "cssClass",
  1102. category: 'accessing',
  1103. fn: function (){
  1104. var self=this;
  1105. return smalltalk.withContext(function($ctx1) {
  1106. var $1;
  1107. $1=_st(_st(self)._widget())._tabClass();
  1108. return $1;
  1109. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLTab)})},
  1110. args: [],
  1111. source: "cssClass\x0a\x09^ self widget tabClass",
  1112. messageSends: ["tabClass", "widget"],
  1113. referencedClasses: []
  1114. }),
  1115. smalltalk.HLTab);
  1116. smalltalk.addMethod(
  1117. smalltalk.method({
  1118. selector: "displayLabel",
  1119. category: 'accessing',
  1120. fn: function (){
  1121. var self=this;
  1122. return smalltalk.withContext(function($ctx1) {
  1123. var $2,$1;
  1124. $2=_st(_st(_st(self)._label())._size()).__gt((20));
  1125. if(smalltalk.assert($2)){
  1126. $1=_st(_st(_st(self)._label())._first_((20))).__comma("...");
  1127. } else {
  1128. $1=_st(self)._label();
  1129. };
  1130. return $1;
  1131. }, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLTab)})},
  1132. args: [],
  1133. source: "displayLabel\x0a\x09^ self label size > 20 \x0a\x09\x09ifTrue: [ (self label first: 20), '...' ]\x0a\x09\x09ifFalse: [ self label ]",
  1134. messageSends: ["ifTrue:ifFalse:", ",", "first:", "label", ">", "size"],
  1135. referencedClasses: []
  1136. }),
  1137. smalltalk.HLTab);
  1138. smalltalk.addMethod(
  1139. smalltalk.method({
  1140. selector: "focus",
  1141. category: 'accessing',
  1142. fn: function (){
  1143. var self=this;
  1144. return smalltalk.withContext(function($ctx1) {
  1145. var $1;
  1146. $1=_st(_st(self)._widget())._canHaveFocus();
  1147. if(smalltalk.assert($1)){
  1148. _st(_st(self)._widget())._focus();
  1149. };
  1150. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLTab)})},
  1151. args: [],
  1152. source: "focus\x0a\x09self widget canHaveFocus ifTrue: [\x0a\x09\x09self widget focus ]",
  1153. messageSends: ["ifTrue:", "focus", "widget", "canHaveFocus"],
  1154. referencedClasses: []
  1155. }),
  1156. smalltalk.HLTab);
  1157. smalltalk.addMethod(
  1158. smalltalk.method({
  1159. selector: "hide",
  1160. category: 'actions',
  1161. fn: function (){
  1162. var self=this;
  1163. return smalltalk.withContext(function($ctx1) {
  1164. var $1;
  1165. $1=self["@root"];
  1166. if(($receiver = $1) == nil || $receiver == undefined){
  1167. $1;
  1168. } else {
  1169. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","hidden");
  1170. };
  1171. return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.HLTab)})},
  1172. args: [],
  1173. source: "hide\x0a\x09root ifNotNil: [ root asJQuery css: 'visibility' put: 'hidden' ]",
  1174. messageSends: ["ifNotNil:", "css:put:", "asJQuery"],
  1175. referencedClasses: []
  1176. }),
  1177. smalltalk.HLTab);
  1178. smalltalk.addMethod(
  1179. smalltalk.method({
  1180. selector: "isActive",
  1181. category: 'testing',
  1182. fn: function (){
  1183. var self=this;
  1184. return smalltalk.withContext(function($ctx1) {
  1185. var $1;
  1186. $1=_st(_st(_st(self)._manager())._activeTab()).__eq(self);
  1187. return $1;
  1188. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLTab)})},
  1189. args: [],
  1190. source: "isActive\x0a\x09^ self manager activeTab = self",
  1191. messageSends: ["=", "activeTab", "manager"],
  1192. referencedClasses: []
  1193. }),
  1194. smalltalk.HLTab);
  1195. smalltalk.addMethod(
  1196. smalltalk.method({
  1197. selector: "label",
  1198. category: 'accessing',
  1199. fn: function (){
  1200. var self=this;
  1201. return smalltalk.withContext(function($ctx1) {
  1202. var $2,$1;
  1203. $2=self["@label"];
  1204. if(($receiver = $2) == nil || $receiver == undefined){
  1205. $1="";
  1206. } else {
  1207. $1=$2;
  1208. };
  1209. return $1;
  1210. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLTab)})},
  1211. args: [],
  1212. source: "label\x0a\x09^ label ifNil: [ '' ]",
  1213. messageSends: ["ifNil:"],
  1214. referencedClasses: []
  1215. }),
  1216. smalltalk.HLTab);
  1217. smalltalk.addMethod(
  1218. smalltalk.method({
  1219. selector: "label:",
  1220. category: 'accessing',
  1221. fn: function (aString){
  1222. var self=this;
  1223. return smalltalk.withContext(function($ctx1) {
  1224. self["@label"]=aString;
  1225. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.HLTab)})},
  1226. args: ["aString"],
  1227. source: "label: aString\x0a\x09label := aString",
  1228. messageSends: [],
  1229. referencedClasses: []
  1230. }),
  1231. smalltalk.HLTab);
  1232. smalltalk.addMethod(
  1233. smalltalk.method({
  1234. selector: "manager",
  1235. category: 'accessing',
  1236. fn: function (){
  1237. var self=this;
  1238. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1239. return smalltalk.withContext(function($ctx1) {
  1240. var $1;
  1241. $1=_st($HLManager())._current();
  1242. return $1;
  1243. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLTab)})},
  1244. args: [],
  1245. source: "manager\x0a\x09^ HLManager current",
  1246. messageSends: ["current"],
  1247. referencedClasses: ["HLManager"]
  1248. }),
  1249. smalltalk.HLTab);
  1250. smalltalk.addMethod(
  1251. smalltalk.method({
  1252. selector: "registerBindings",
  1253. category: 'actions',
  1254. fn: function (){
  1255. var self=this;
  1256. return smalltalk.withContext(function($ctx1) {
  1257. _st(_st(self)._widget())._registerBindings();
  1258. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLTab)})},
  1259. args: [],
  1260. source: "registerBindings\x0a\x09self widget registerBindings",
  1261. messageSends: ["registerBindings", "widget"],
  1262. referencedClasses: []
  1263. }),
  1264. smalltalk.HLTab);
  1265. smalltalk.addMethod(
  1266. smalltalk.method({
  1267. selector: "remove",
  1268. category: 'actions',
  1269. fn: function (){
  1270. var self=this;
  1271. return smalltalk.withContext(function($ctx1) {
  1272. var $1;
  1273. _st(_st(self)._widget())._unregister();
  1274. $1=self["@root"];
  1275. if(($receiver = $1) == nil || $receiver == undefined){
  1276. $1;
  1277. } else {
  1278. _st(_st(self["@root"])._asJQuery())._remove();
  1279. };
  1280. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLTab)})},
  1281. args: [],
  1282. source: "remove\x0a\x09self widget unregister.\x0a\x09root ifNotNil: [ root asJQuery remove ]",
  1283. messageSends: ["unregister", "widget", "ifNotNil:", "remove", "asJQuery"],
  1284. referencedClasses: []
  1285. }),
  1286. smalltalk.HLTab);
  1287. smalltalk.addMethod(
  1288. smalltalk.method({
  1289. selector: "renderOn:",
  1290. category: 'rendering',
  1291. fn: function (html){
  1292. var self=this;
  1293. return smalltalk.withContext(function($ctx1) {
  1294. var $1,$2;
  1295. $1=_st(html)._div();
  1296. _st($1)._class_("tab");
  1297. $2=_st($1)._yourself();
  1298. self["@root"]=$2;
  1299. _st(self)._renderTab();
  1300. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLTab)})},
  1301. args: ["html"],
  1302. source: "renderOn: html\x0a\x09root := html div\x0a\x09\x09class: 'tab';\x0a\x09\x09yourself.\x0a\x09self renderTab",
  1303. messageSends: ["class:", "div", "yourself", "renderTab"],
  1304. referencedClasses: []
  1305. }),
  1306. smalltalk.HLTab);
  1307. smalltalk.addMethod(
  1308. smalltalk.method({
  1309. selector: "renderTab",
  1310. category: 'rendering',
  1311. fn: function (){
  1312. var self=this;
  1313. return smalltalk.withContext(function($ctx1) {
  1314. var $1,$2;
  1315. _st(self["@root"])._contents_((function(html){
  1316. return smalltalk.withContext(function($ctx2) {
  1317. $1=_st(html)._div();
  1318. _st($1)._class_("amber_box");
  1319. $2=_st($1)._with_((function(){
  1320. return smalltalk.withContext(function($ctx3) {
  1321. return _st(_st(self)._widget())._renderOn_(html);
  1322. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1323. return $2;
  1324. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}));
  1325. return self}, function($ctx1) {$ctx1.fill(self,"renderTab",{},smalltalk.HLTab)})},
  1326. args: [],
  1327. source: "renderTab\x0a\x09root contents: [ :html |\x0a\x09\x09html div\x0a\x09\x09\x09class: 'amber_box';\x0a\x09\x09\x09with: [ self widget renderOn: html ] ]",
  1328. messageSends: ["contents:", "class:", "div", "with:", "renderOn:", "widget"],
  1329. referencedClasses: []
  1330. }),
  1331. smalltalk.HLTab);
  1332. smalltalk.addMethod(
  1333. smalltalk.method({
  1334. selector: "show",
  1335. category: 'actions',
  1336. fn: function (){
  1337. var self=this;
  1338. return smalltalk.withContext(function($ctx1) {
  1339. var $1;
  1340. $1=self["@root"];
  1341. if(($receiver = $1) == nil || $receiver == undefined){
  1342. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  1343. } else {
  1344. _st(_st(self["@root"])._asJQuery())._css_put_("visibility","visible");
  1345. };
  1346. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLTab)})},
  1347. args: [],
  1348. source: "show\x0a\x09root\x0a\x09\x09ifNil: [ self appendToJQuery: 'body' asJQuery ]\x0a\x09\x09ifNotNil: [ root asJQuery css: 'visibility' put: 'visible' ]",
  1349. messageSends: ["ifNil:ifNotNil:", "appendToJQuery:", "asJQuery", "css:put:"],
  1350. referencedClasses: []
  1351. }),
  1352. smalltalk.HLTab);
  1353. smalltalk.addMethod(
  1354. smalltalk.method({
  1355. selector: "widget",
  1356. category: 'accessing',
  1357. fn: function (){
  1358. var self=this;
  1359. return smalltalk.withContext(function($ctx1) {
  1360. var $1;
  1361. $1=self["@widget"];
  1362. return $1;
  1363. }, function($ctx1) {$ctx1.fill(self,"widget",{},smalltalk.HLTab)})},
  1364. args: [],
  1365. source: "widget\x0a\x09^ widget",
  1366. messageSends: [],
  1367. referencedClasses: []
  1368. }),
  1369. smalltalk.HLTab);
  1370. smalltalk.addMethod(
  1371. smalltalk.method({
  1372. selector: "widget:",
  1373. category: 'accessing',
  1374. fn: function (aWidget){
  1375. var self=this;
  1376. return smalltalk.withContext(function($ctx1) {
  1377. self["@widget"]=aWidget;
  1378. return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget},smalltalk.HLTab)})},
  1379. args: ["aWidget"],
  1380. source: "widget: aWidget\x0a\x09widget := aWidget",
  1381. messageSends: [],
  1382. referencedClasses: []
  1383. }),
  1384. smalltalk.HLTab);
  1385. smalltalk.addMethod(
  1386. smalltalk.method({
  1387. selector: "on:labelled:",
  1388. category: 'instance creation',
  1389. fn: function (aWidget,aString){
  1390. var self=this;
  1391. return smalltalk.withContext(function($ctx1) {
  1392. var $2,$3,$1;
  1393. $2=_st(self)._new();
  1394. _st($2)._widget_(aWidget);
  1395. _st($2)._label_(aString);
  1396. $3=_st($2)._yourself();
  1397. $1=$3;
  1398. return $1;
  1399. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{aWidget:aWidget,aString:aString},smalltalk.HLTab.klass)})},
  1400. args: ["aWidget", "aString"],
  1401. source: "on: aWidget labelled: aString\x0a\x09^ self new\x0a\x09\x09widget: aWidget;\x0a\x09\x09label: aString;\x0a\x09\x09yourself",
  1402. messageSends: ["widget:", "new", "label:", "yourself"],
  1403. referencedClasses: []
  1404. }),
  1405. smalltalk.HLTab.klass);
  1406. smalltalk.addClass('HLWidget', smalltalk.Widget, ['wrapper'], 'Helios-Core');
  1407. smalltalk.HLWidget.comment="I am the abstract superclass of all Helios widgets.\x0a\x0aI provide common methods, additional behavior to widgets useful for Helios, like dialog creation, command execution and tab creation."
  1408. smalltalk.addMethod(
  1409. smalltalk.method({
  1410. selector: "alert:",
  1411. category: 'actions',
  1412. fn: function (aString){
  1413. var self=this;
  1414. return smalltalk.withContext(function($ctx1) {
  1415. _st(window)._alert_(aString);
  1416. return self}, function($ctx1) {$ctx1.fill(self,"alert:",{aString:aString},smalltalk.HLWidget)})},
  1417. args: ["aString"],
  1418. source: "alert: aString\x0a\x09window alert: aString",
  1419. messageSends: ["alert:"],
  1420. referencedClasses: []
  1421. }),
  1422. smalltalk.HLWidget);
  1423. smalltalk.addMethod(
  1424. smalltalk.method({
  1425. selector: "canHaveFocus",
  1426. category: 'testing',
  1427. fn: function (){
  1428. var self=this;
  1429. return smalltalk.withContext(function($ctx1) {
  1430. return false;
  1431. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWidget)})},
  1432. args: [],
  1433. source: "canHaveFocus\x0a\x09^ false",
  1434. messageSends: [],
  1435. referencedClasses: []
  1436. }),
  1437. smalltalk.HLWidget);
  1438. smalltalk.addMethod(
  1439. smalltalk.method({
  1440. selector: "confirm:ifTrue:",
  1441. category: 'actions',
  1442. fn: function (aString,aBlock){
  1443. var self=this;
  1444. return smalltalk.withContext(function($ctx1) {
  1445. _st(_st(self)._manager())._confirm_ifTrue_(aString,aBlock);
  1446. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLWidget)})},
  1447. args: ["aString", "aBlock"],
  1448. source: "confirm: aString ifTrue: aBlock\x0a\x09self manager confirm: aString ifTrue: aBlock",
  1449. messageSends: ["confirm:ifTrue:", "manager"],
  1450. referencedClasses: []
  1451. }),
  1452. smalltalk.HLWidget);
  1453. smalltalk.addMethod(
  1454. smalltalk.method({
  1455. selector: "execute:",
  1456. category: 'actions',
  1457. fn: function (aCommand){
  1458. var self=this;
  1459. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1460. return smalltalk.withContext(function($ctx1) {
  1461. var $1,$2;
  1462. $1=_st(_st($HLManager())._current())._keyBinder();
  1463. _st($1)._activate();
  1464. $2=_st($1)._applyBinding_(_st(aCommand)._asBinding());
  1465. return self}, function($ctx1) {$ctx1.fill(self,"execute:",{aCommand:aCommand},smalltalk.HLWidget)})},
  1466. args: ["aCommand"],
  1467. source: "execute: aCommand\x0a\x09HLManager current keyBinder\x0a\x09\x09activate;\x0a\x09\x09applyBinding: aCommand asBinding",
  1468. messageSends: ["activate", "keyBinder", "current", "applyBinding:", "asBinding"],
  1469. referencedClasses: ["HLManager"]
  1470. }),
  1471. smalltalk.HLWidget);
  1472. smalltalk.addMethod(
  1473. smalltalk.method({
  1474. selector: "manager",
  1475. category: 'accessing',
  1476. fn: function (){
  1477. var self=this;
  1478. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1479. return smalltalk.withContext(function($ctx1) {
  1480. var $1;
  1481. $1=_st($HLManager())._current();
  1482. return $1;
  1483. }, function($ctx1) {$ctx1.fill(self,"manager",{},smalltalk.HLWidget)})},
  1484. args: [],
  1485. source: "manager\x0a\x09^ HLManager current",
  1486. messageSends: ["current"],
  1487. referencedClasses: ["HLManager"]
  1488. }),
  1489. smalltalk.HLWidget);
  1490. smalltalk.addMethod(
  1491. smalltalk.method({
  1492. selector: "refresh",
  1493. category: 'updating',
  1494. fn: function (){
  1495. var self=this;
  1496. return smalltalk.withContext(function($ctx1) {
  1497. var $1,$2;
  1498. $1=_st(self)._wrapper();
  1499. if(($receiver = $1) == nil || $receiver == undefined){
  1500. $2=self;
  1501. return $2;
  1502. } else {
  1503. $1;
  1504. };
  1505. _st(_st(_st(self)._wrapper())._asJQuery())._empty();
  1506. _st((function(html){
  1507. return smalltalk.withContext(function($ctx2) {
  1508. return _st(self)._renderContentOn_(html);
  1509. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st(_st(self)._wrapper())._asJQuery());
  1510. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLWidget)})},
  1511. args: [],
  1512. source: "refresh\x0a\x09self wrapper ifNil: [ ^ self ].\x0a \x0a\x09self wrapper asJQuery empty.\x0a [ :html | self renderContentOn: html ] appendToJQuery: self wrapper asJQuery",
  1513. messageSends: ["ifNil:", "wrapper", "empty", "asJQuery", "appendToJQuery:", "renderContentOn:"],
  1514. referencedClasses: []
  1515. }),
  1516. smalltalk.HLWidget);
  1517. smalltalk.addMethod(
  1518. smalltalk.method({
  1519. selector: "registerBindings",
  1520. category: 'keybindings',
  1521. fn: function (){
  1522. var self=this;
  1523. return smalltalk.withContext(function($ctx1) {
  1524. _st(self)._registerBindingsOn_(_st(_st(_st(self)._manager())._keyBinder())._bindings());
  1525. return self}, function($ctx1) {$ctx1.fill(self,"registerBindings",{},smalltalk.HLWidget)})},
  1526. args: [],
  1527. source: "registerBindings\x0a\x09self registerBindingsOn: self manager keyBinder bindings",
  1528. messageSends: ["registerBindingsOn:", "bindings", "keyBinder", "manager"],
  1529. referencedClasses: []
  1530. }),
  1531. smalltalk.HLWidget);
  1532. smalltalk.addMethod(
  1533. smalltalk.method({
  1534. selector: "registerBindingsOn:",
  1535. category: 'keybindings',
  1536. fn: function (aBindingGroup){
  1537. var self=this;
  1538. return smalltalk.withContext(function($ctx1) {
  1539. return self}, function($ctx1) {$ctx1.fill(self,"registerBindingsOn:",{aBindingGroup:aBindingGroup},smalltalk.HLWidget)})},
  1540. args: ["aBindingGroup"],
  1541. source: "registerBindingsOn: aBindingGroup",
  1542. messageSends: [],
  1543. referencedClasses: []
  1544. }),
  1545. smalltalk.HLWidget);
  1546. smalltalk.addMethod(
  1547. smalltalk.method({
  1548. selector: "renderContentOn:",
  1549. category: 'rendering',
  1550. fn: function (html){
  1551. var self=this;
  1552. return smalltalk.withContext(function($ctx1) {
  1553. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWidget)})},
  1554. args: ["html"],
  1555. source: "renderContentOn: html",
  1556. messageSends: [],
  1557. referencedClasses: []
  1558. }),
  1559. smalltalk.HLWidget);
  1560. smalltalk.addMethod(
  1561. smalltalk.method({
  1562. selector: "renderOn:",
  1563. category: 'rendering',
  1564. fn: function (html){
  1565. var self=this;
  1566. return smalltalk.withContext(function($ctx1) {
  1567. self["@wrapper"]=_st(html)._div();
  1568. _st((function(renderer){
  1569. return smalltalk.withContext(function($ctx2) {
  1570. return _st(self)._renderContentOn_(renderer);
  1571. }, function($ctx2) {$ctx2.fillBlock({renderer:renderer},$ctx1)})}))._appendToJQuery_(_st(self["@wrapper"])._asJQuery());
  1572. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLWidget)})},
  1573. args: ["html"],
  1574. source: "renderOn: html\x0a\x09wrapper := html div.\x0a [ :renderer | self renderContentOn: renderer ] appendToJQuery: wrapper asJQuery",
  1575. messageSends: ["div", "appendToJQuery:", "asJQuery", "renderContentOn:"],
  1576. referencedClasses: []
  1577. }),
  1578. smalltalk.HLWidget);
  1579. smalltalk.addMethod(
  1580. smalltalk.method({
  1581. selector: "request:do:",
  1582. category: 'actions',
  1583. fn: function (aString,aBlock){
  1584. var self=this;
  1585. return smalltalk.withContext(function($ctx1) {
  1586. _st(_st(self)._manager())._request_do_(aString,aBlock);
  1587. return self}, function($ctx1) {$ctx1.fill(self,"request:do:",{aString:aString,aBlock:aBlock},smalltalk.HLWidget)})},
  1588. args: ["aString", "aBlock"],
  1589. source: "request: aString do: aBlock\x0a\x09self manager request: aString do: aBlock",
  1590. messageSends: ["request:do:", "manager"],
  1591. referencedClasses: []
  1592. }),
  1593. smalltalk.HLWidget);
  1594. smalltalk.addMethod(
  1595. smalltalk.method({
  1596. selector: "request:value:do:",
  1597. category: 'actions',
  1598. fn: function (aString,valueString,aBlock){
  1599. var self=this;
  1600. return smalltalk.withContext(function($ctx1) {
  1601. _st(_st(self)._manager())._request_value_do_(aString,valueString,aBlock);
  1602. return self}, function($ctx1) {$ctx1.fill(self,"request:value:do:",{aString:aString,valueString:valueString,aBlock:aBlock},smalltalk.HLWidget)})},
  1603. args: ["aString", "valueString", "aBlock"],
  1604. source: "request: aString value: valueString do: aBlock\x0a\x09self manager \x0a\x09\x09request: aString \x0a\x09\x09value: valueString\x0a\x09\x09do: aBlock",
  1605. messageSends: ["request:value:do:", "manager"],
  1606. referencedClasses: []
  1607. }),
  1608. smalltalk.HLWidget);
  1609. smalltalk.addMethod(
  1610. smalltalk.method({
  1611. selector: "tabClass",
  1612. category: 'accessing',
  1613. fn: function (){
  1614. var self=this;
  1615. return smalltalk.withContext(function($ctx1) {
  1616. var $1;
  1617. $1=_st(_st(self)._class())._tabClass();
  1618. return $1;
  1619. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLWidget)})},
  1620. args: [],
  1621. source: "tabClass\x0a\x09^ self class tabClass",
  1622. messageSends: ["tabClass", "class"],
  1623. referencedClasses: []
  1624. }),
  1625. smalltalk.HLWidget);
  1626. smalltalk.addMethod(
  1627. smalltalk.method({
  1628. selector: "unregister",
  1629. category: 'actions',
  1630. fn: function (){
  1631. var self=this;
  1632. return smalltalk.withContext(function($ctx1) {
  1633. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLWidget)})},
  1634. args: [],
  1635. 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",
  1636. messageSends: [],
  1637. referencedClasses: []
  1638. }),
  1639. smalltalk.HLWidget);
  1640. smalltalk.addMethod(
  1641. smalltalk.method({
  1642. selector: "wrapper",
  1643. category: 'accessing',
  1644. fn: function (){
  1645. var self=this;
  1646. return smalltalk.withContext(function($ctx1) {
  1647. var $1;
  1648. $1=self["@wrapper"];
  1649. return $1;
  1650. }, function($ctx1) {$ctx1.fill(self,"wrapper",{},smalltalk.HLWidget)})},
  1651. args: [],
  1652. source: "wrapper\x0a\x09^ wrapper",
  1653. messageSends: [],
  1654. referencedClasses: []
  1655. }),
  1656. smalltalk.HLWidget);
  1657. smalltalk.addMethod(
  1658. smalltalk.method({
  1659. selector: "canBeOpenAsTab",
  1660. category: 'testing',
  1661. fn: function (){
  1662. var self=this;
  1663. return smalltalk.withContext(function($ctx1) {
  1664. return false;
  1665. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWidget.klass)})},
  1666. args: [],
  1667. source: "canBeOpenAsTab\x0a\x09^ false",
  1668. messageSends: [],
  1669. referencedClasses: []
  1670. }),
  1671. smalltalk.HLWidget.klass);
  1672. smalltalk.addMethod(
  1673. smalltalk.method({
  1674. selector: "openAsTab",
  1675. category: 'accessing',
  1676. fn: function (){
  1677. var self=this;
  1678. function $HLTab(){return smalltalk.HLTab||(typeof HLTab=="undefined"?nil:HLTab)}
  1679. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1680. return smalltalk.withContext(function($ctx1) {
  1681. var $1,$2;
  1682. $1=_st(self)._canBeOpenAsTab();
  1683. if(! smalltalk.assert($1)){
  1684. $2=self;
  1685. return $2;
  1686. };
  1687. _st(_st($HLManager())._current())._addTab_(_st($HLTab())._on_labelled_(_st(self)._new(),_st(self)._tabLabel()));
  1688. return self}, function($ctx1) {$ctx1.fill(self,"openAsTab",{},smalltalk.HLWidget.klass)})},
  1689. args: [],
  1690. source: "openAsTab\x0a\x09self canBeOpenAsTab ifFalse: [ ^ self ].\x0a\x09HLManager current addTab: (HLTab on: self new labelled: self tabLabel)",
  1691. messageSends: ["ifFalse:", "canBeOpenAsTab", "addTab:", "on:labelled:", "new", "tabLabel", "current"],
  1692. referencedClasses: ["HLTab", "HLManager"]
  1693. }),
  1694. smalltalk.HLWidget.klass);
  1695. smalltalk.addMethod(
  1696. smalltalk.method({
  1697. selector: "tabClass",
  1698. category: 'accessing',
  1699. fn: function (){
  1700. var self=this;
  1701. return smalltalk.withContext(function($ctx1) {
  1702. return "";
  1703. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLWidget.klass)})},
  1704. args: [],
  1705. source: "tabClass\x0a\x09^ ''",
  1706. messageSends: [],
  1707. referencedClasses: []
  1708. }),
  1709. smalltalk.HLWidget.klass);
  1710. smalltalk.addMethod(
  1711. smalltalk.method({
  1712. selector: "tabLabel",
  1713. category: 'accessing',
  1714. fn: function (){
  1715. var self=this;
  1716. return smalltalk.withContext(function($ctx1) {
  1717. return "Tab";
  1718. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWidget.klass)})},
  1719. args: [],
  1720. source: "tabLabel\x0a\x09^ 'Tab'",
  1721. messageSends: [],
  1722. referencedClasses: []
  1723. }),
  1724. smalltalk.HLWidget.klass);
  1725. smalltalk.addMethod(
  1726. smalltalk.method({
  1727. selector: "tabPriority",
  1728. category: 'accessing',
  1729. fn: function (){
  1730. var self=this;
  1731. return smalltalk.withContext(function($ctx1) {
  1732. var $1;
  1733. $1=(500);
  1734. return $1;
  1735. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWidget.klass)})},
  1736. args: [],
  1737. source: "tabPriority\x0a\x09^ 500",
  1738. messageSends: [],
  1739. referencedClasses: []
  1740. }),
  1741. smalltalk.HLWidget.klass);
  1742. smalltalk.addClass('HLConfirmation', smalltalk.HLWidget, ['confirmationString', 'actionBlock', 'cancelBlock'], 'Helios-Core');
  1743. smalltalk.addMethod(
  1744. smalltalk.method({
  1745. selector: "actionBlock",
  1746. category: 'accessing',
  1747. fn: function (){
  1748. var self=this;
  1749. return smalltalk.withContext(function($ctx1) {
  1750. var $2,$1;
  1751. $2=self["@actionBlock"];
  1752. if(($receiver = $2) == nil || $receiver == undefined){
  1753. $1=(function(){
  1754. return smalltalk.withContext(function($ctx2) {
  1755. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1756. } else {
  1757. $1=$2;
  1758. };
  1759. return $1;
  1760. }, function($ctx1) {$ctx1.fill(self,"actionBlock",{},smalltalk.HLConfirmation)})},
  1761. args: [],
  1762. source: "actionBlock\x0a\x09^ actionBlock ifNil: [ [] ]",
  1763. messageSends: ["ifNil:"],
  1764. referencedClasses: []
  1765. }),
  1766. smalltalk.HLConfirmation);
  1767. smalltalk.addMethod(
  1768. smalltalk.method({
  1769. selector: "actionBlock:",
  1770. category: 'accessing',
  1771. fn: function (aBlock){
  1772. var self=this;
  1773. return smalltalk.withContext(function($ctx1) {
  1774. self["@actionBlock"]=aBlock;
  1775. return self}, function($ctx1) {$ctx1.fill(self,"actionBlock:",{aBlock:aBlock},smalltalk.HLConfirmation)})},
  1776. args: ["aBlock"],
  1777. source: "actionBlock: aBlock\x0a\x09actionBlock := aBlock",
  1778. messageSends: [],
  1779. referencedClasses: []
  1780. }),
  1781. smalltalk.HLConfirmation);
  1782. smalltalk.addMethod(
  1783. smalltalk.method({
  1784. selector: "cancel",
  1785. category: 'actions',
  1786. fn: function (){
  1787. var self=this;
  1788. return smalltalk.withContext(function($ctx1) {
  1789. _st(_st(self)._cancelBlock())._value();
  1790. _st(self)._remove();
  1791. return self}, function($ctx1) {$ctx1.fill(self,"cancel",{},smalltalk.HLConfirmation)})},
  1792. args: [],
  1793. source: "cancel\x0a\x09self cancelBlock value.\x0a\x09self remove",
  1794. messageSends: ["value", "cancelBlock", "remove"],
  1795. referencedClasses: []
  1796. }),
  1797. smalltalk.HLConfirmation);
  1798. smalltalk.addMethod(
  1799. smalltalk.method({
  1800. selector: "cancelBlock",
  1801. category: 'accessing',
  1802. fn: function (){
  1803. var self=this;
  1804. return smalltalk.withContext(function($ctx1) {
  1805. var $2,$1;
  1806. $2=self["@cancelBlock"];
  1807. if(($receiver = $2) == nil || $receiver == undefined){
  1808. $1=(function(){
  1809. return smalltalk.withContext(function($ctx2) {
  1810. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})});
  1811. } else {
  1812. $1=$2;
  1813. };
  1814. return $1;
  1815. }, function($ctx1) {$ctx1.fill(self,"cancelBlock",{},smalltalk.HLConfirmation)})},
  1816. args: [],
  1817. source: "cancelBlock\x0a\x09^ cancelBlock ifNil: [ [] ]",
  1818. messageSends: ["ifNil:"],
  1819. referencedClasses: []
  1820. }),
  1821. smalltalk.HLConfirmation);
  1822. smalltalk.addMethod(
  1823. smalltalk.method({
  1824. selector: "cancelBlock:",
  1825. category: 'accessing',
  1826. fn: function (aBlock){
  1827. var self=this;
  1828. return smalltalk.withContext(function($ctx1) {
  1829. self["@cancelBlock"]=aBlock;
  1830. return self}, function($ctx1) {$ctx1.fill(self,"cancelBlock:",{aBlock:aBlock},smalltalk.HLConfirmation)})},
  1831. args: ["aBlock"],
  1832. source: "cancelBlock: aBlock\x0a\x09cancelBlock := aBlock",
  1833. messageSends: [],
  1834. referencedClasses: []
  1835. }),
  1836. smalltalk.HLConfirmation);
  1837. smalltalk.addMethod(
  1838. smalltalk.method({
  1839. selector: "confirm",
  1840. category: 'actions',
  1841. fn: function (){
  1842. var self=this;
  1843. return smalltalk.withContext(function($ctx1) {
  1844. _st(_st(self)._actionBlock())._value();
  1845. _st(self)._remove();
  1846. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},smalltalk.HLConfirmation)})},
  1847. args: [],
  1848. source: "confirm\x0a\x09self actionBlock value.\x0a\x09self remove",
  1849. messageSends: ["value", "actionBlock", "remove"],
  1850. referencedClasses: []
  1851. }),
  1852. smalltalk.HLConfirmation);
  1853. smalltalk.addMethod(
  1854. smalltalk.method({
  1855. selector: "confirmationString",
  1856. category: 'accessing',
  1857. fn: function (){
  1858. var self=this;
  1859. return smalltalk.withContext(function($ctx1) {
  1860. var $2,$1;
  1861. $2=self["@confirmationString"];
  1862. if(($receiver = $2) == nil || $receiver == undefined){
  1863. $1="Confirm";
  1864. } else {
  1865. $1=$2;
  1866. };
  1867. return $1;
  1868. }, function($ctx1) {$ctx1.fill(self,"confirmationString",{},smalltalk.HLConfirmation)})},
  1869. args: [],
  1870. source: "confirmationString\x0a\x09^ confirmationString ifNil: [ 'Confirm' ]",
  1871. messageSends: ["ifNil:"],
  1872. referencedClasses: []
  1873. }),
  1874. smalltalk.HLConfirmation);
  1875. smalltalk.addMethod(
  1876. smalltalk.method({
  1877. selector: "confirmationString:",
  1878. category: 'accessing',
  1879. fn: function (aString){
  1880. var self=this;
  1881. return smalltalk.withContext(function($ctx1) {
  1882. self["@confirmationString"]=aString;
  1883. return self}, function($ctx1) {$ctx1.fill(self,"confirmationString:",{aString:aString},smalltalk.HLConfirmation)})},
  1884. args: ["aString"],
  1885. source: "confirmationString: aString\x0a\x09confirmationString := aString",
  1886. messageSends: [],
  1887. referencedClasses: []
  1888. }),
  1889. smalltalk.HLConfirmation);
  1890. smalltalk.addMethod(
  1891. smalltalk.method({
  1892. selector: "cssClass",
  1893. category: 'accessing',
  1894. fn: function (){
  1895. var self=this;
  1896. return smalltalk.withContext(function($ctx1) {
  1897. return "";
  1898. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLConfirmation)})},
  1899. args: [],
  1900. source: "cssClass\x0a\x09^ ''",
  1901. messageSends: [],
  1902. referencedClasses: []
  1903. }),
  1904. smalltalk.HLConfirmation);
  1905. smalltalk.addMethod(
  1906. smalltalk.method({
  1907. selector: "remove",
  1908. category: 'actions',
  1909. fn: function (){
  1910. var self=this;
  1911. return smalltalk.withContext(function($ctx1) {
  1912. _st(_st(window)._jQuery_(".dialog"))._removeClass_("active");
  1913. _st((function(){
  1914. return smalltalk.withContext(function($ctx2) {
  1915. _st(_st(window)._jQuery_("#overlay"))._remove();
  1916. return _st(_st(window)._jQuery_(".dialog"))._remove();
  1917. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  1918. return self}, function($ctx1) {$ctx1.fill(self,"remove",{},smalltalk.HLConfirmation)})},
  1919. args: [],
  1920. source: "remove\x0a\x09(window jQuery: '.dialog') removeClass: 'active'.\x0a\x09[ \x0a\x09\x09(window jQuery: '#overlay') remove.\x0a\x09\x09(window jQuery: '.dialog') remove\x0a\x09] valueWithTimeout: 300",
  1921. messageSends: ["removeClass:", "jQuery:", "valueWithTimeout:", "remove"],
  1922. referencedClasses: []
  1923. }),
  1924. smalltalk.HLConfirmation);
  1925. smalltalk.addMethod(
  1926. smalltalk.method({
  1927. selector: "renderButtonsOn:",
  1928. category: 'rendering',
  1929. fn: function (html){
  1930. var self=this;
  1931. var confirmButton;
  1932. return smalltalk.withContext(function($ctx1) {
  1933. var $1,$3,$4,$5,$6,$2;
  1934. $1=_st(html)._div();
  1935. _st($1)._class_("buttons");
  1936. $2=_st($1)._with_((function(){
  1937. return smalltalk.withContext(function($ctx2) {
  1938. $3=_st(html)._button();
  1939. _st($3)._class_("button");
  1940. _st($3)._with_("Cancel");
  1941. $4=_st($3)._onClick_((function(){
  1942. return smalltalk.withContext(function($ctx3) {
  1943. return _st(self)._cancel();
  1944. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1945. $4;
  1946. $5=_st(html)._button();
  1947. _st($5)._class_("button default");
  1948. _st($5)._with_("Confirm");
  1949. $6=_st($5)._onClick_((function(){
  1950. return smalltalk.withContext(function($ctx3) {
  1951. return _st(self)._confirm();
  1952. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  1953. confirmButton=$6;
  1954. return confirmButton;
  1955. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1956. _st(_st(confirmButton)._asJQuery())._focus();
  1957. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html,confirmButton:confirmButton},smalltalk.HLConfirmation)})},
  1958. args: ["html"],
  1959. source: "renderButtonsOn: html\x0a\x09| confirmButton |\x0a\x09\x0a\x09html div \x0a\x09\x09class: 'buttons';\x0a\x09\x09with: [\x0a\x09\x09\x09html button\x0a\x09\x09\x09\x09class: 'button';\x0a\x09\x09\x09\x09with: 'Cancel';\x0a\x09\x09\x09\x09onClick: [ self cancel ].\x0a\x09\x09\x09confirmButton := html button\x0a\x09\x09\x09\x09class: 'button default';\x0a\x09\x09\x09\x09with: 'Confirm';\x0a\x09\x09\x09\x09onClick: [ self confirm ] ].\x0a\x0a\x09confirmButton asJQuery focus",
  1960. messageSends: ["class:", "div", "with:", "button", "onClick:", "cancel", "confirm", "focus", "asJQuery"],
  1961. referencedClasses: []
  1962. }),
  1963. smalltalk.HLConfirmation);
  1964. smalltalk.addMethod(
  1965. smalltalk.method({
  1966. selector: "renderContentOn:",
  1967. category: 'rendering',
  1968. fn: function (html){
  1969. var self=this;
  1970. var confirmButton;
  1971. return smalltalk.withContext(function($ctx1) {
  1972. var $1,$3,$4,$2;
  1973. _st(_st(html)._div())._id_("overlay");
  1974. $1=_st(html)._div();
  1975. _st($1)._class_(_st("dialog ").__comma(_st(self)._cssClass()));
  1976. $2=_st($1)._with_((function(){
  1977. return smalltalk.withContext(function($ctx2) {
  1978. $3=self;
  1979. _st($3)._renderMainOn_(html);
  1980. $4=_st($3)._renderButtonsOn_(html);
  1981. return $4;
  1982. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1983. _st(_st(window)._jQuery_(".dialog"))._addClass_("active");
  1984. _st(self)._setupKeyBindings();
  1985. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html,confirmButton:confirmButton},smalltalk.HLConfirmation)})},
  1986. args: ["html"],
  1987. source: "renderContentOn: html\x0a\x09| confirmButton |\x0a\x09\x0a\x09html div id: 'overlay'.\x0a\x09html div \x0a\x09\x09class: 'dialog ', self cssClass;\x0a\x09\x09with: [\x0a\x09\x09\x09self\x0a\x09\x09\x09\x09renderMainOn: html;\x0a\x09\x09\x09\x09renderButtonsOn: html ].\x0a\x0a\x09(window jQuery: '.dialog') addClass: 'active'.\x0a\x09self setupKeyBindings",
  1988. messageSends: ["id:", "div", "class:", ",", "cssClass", "with:", "renderMainOn:", "renderButtonsOn:", "addClass:", "jQuery:", "setupKeyBindings"],
  1989. referencedClasses: []
  1990. }),
  1991. smalltalk.HLConfirmation);
  1992. smalltalk.addMethod(
  1993. smalltalk.method({
  1994. selector: "renderMainOn:",
  1995. category: 'rendering',
  1996. fn: function (html){
  1997. var self=this;
  1998. return smalltalk.withContext(function($ctx1) {
  1999. _st(_st(html)._span())._with_(_st(self)._confirmationString());
  2000. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLConfirmation)})},
  2001. args: ["html"],
  2002. source: "renderMainOn: html\x0a\x09html span with: self confirmationString",
  2003. messageSends: ["with:", "confirmationString", "span"],
  2004. referencedClasses: []
  2005. }),
  2006. smalltalk.HLConfirmation);
  2007. smalltalk.addMethod(
  2008. smalltalk.method({
  2009. selector: "setupKeyBindings",
  2010. category: 'rendering',
  2011. fn: function (){
  2012. var self=this;
  2013. return smalltalk.withContext(function($ctx1) {
  2014. var $1;
  2015. _st(_st(window)._jQuery_(".dialog"))._keyup_((function(e){
  2016. return smalltalk.withContext(function($ctx2) {
  2017. $1=_st(_st(e)._keyCode()).__eq((27));
  2018. if(smalltalk.assert($1)){
  2019. return _st(self)._cancel();
  2020. };
  2021. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  2022. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLConfirmation)})},
  2023. args: [],
  2024. source: "setupKeyBindings\x0a\x09(window jQuery: '.dialog') keyup: [ :e |\x0a\x09\x09e keyCode = 27 ifTrue: [ self cancel ] ]",
  2025. messageSends: ["keyup:", "ifTrue:", "cancel", "=", "keyCode", "jQuery:"],
  2026. referencedClasses: []
  2027. }),
  2028. smalltalk.HLConfirmation);
  2029. smalltalk.addClass('HLRequest', smalltalk.HLConfirmation, ['input', 'value'], 'Helios-Core');
  2030. smalltalk.addMethod(
  2031. smalltalk.method({
  2032. selector: "confirm",
  2033. category: 'actions',
  2034. fn: function (){
  2035. var self=this;
  2036. return smalltalk.withContext(function($ctx1) {
  2037. _st(_st(self)._actionBlock())._value_(_st(_st(self["@input"])._asJQuery())._val());
  2038. _st(self)._remove();
  2039. return self}, function($ctx1) {$ctx1.fill(self,"confirm",{},smalltalk.HLRequest)})},
  2040. args: [],
  2041. source: "confirm\x0a\x09self actionBlock value: input asJQuery val.\x0a\x09self remove",
  2042. messageSends: ["value:", "val", "asJQuery", "actionBlock", "remove"],
  2043. referencedClasses: []
  2044. }),
  2045. smalltalk.HLRequest);
  2046. smalltalk.addMethod(
  2047. smalltalk.method({
  2048. selector: "cssClass",
  2049. category: 'accessing',
  2050. fn: function (){
  2051. var self=this;
  2052. return smalltalk.withContext(function($ctx1) {
  2053. return "large";
  2054. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLRequest)})},
  2055. args: [],
  2056. source: "cssClass\x0a\x09^ 'large'",
  2057. messageSends: [],
  2058. referencedClasses: []
  2059. }),
  2060. smalltalk.HLRequest);
  2061. smalltalk.addMethod(
  2062. smalltalk.method({
  2063. selector: "renderMainOn:",
  2064. category: 'rendering',
  2065. fn: function (html){
  2066. var self=this;
  2067. return smalltalk.withContext(function($ctx1) {
  2068. smalltalk.HLConfirmation.fn.prototype._renderMainOn_.apply(_st(self), [html]);
  2069. self["@input"]=_st(html)._textarea();
  2070. _st(_st(self["@input"])._asJQuery())._val_(_st(self)._value());
  2071. return self}, function($ctx1) {$ctx1.fill(self,"renderMainOn:",{html:html},smalltalk.HLRequest)})},
  2072. args: ["html"],
  2073. source: "renderMainOn: html\x0a\x09super renderMainOn: html.\x0a\x09input := html textarea.\x0a\x09input asJQuery val: self value",
  2074. messageSends: ["renderMainOn:", "textarea", "val:", "value", "asJQuery"],
  2075. referencedClasses: []
  2076. }),
  2077. smalltalk.HLRequest);
  2078. smalltalk.addMethod(
  2079. smalltalk.method({
  2080. selector: "value",
  2081. category: 'accessing',
  2082. fn: function (){
  2083. var self=this;
  2084. return smalltalk.withContext(function($ctx1) {
  2085. var $2,$1;
  2086. $2=self["@value"];
  2087. if(($receiver = $2) == nil || $receiver == undefined){
  2088. $1="";
  2089. } else {
  2090. $1=$2;
  2091. };
  2092. return $1;
  2093. }, function($ctx1) {$ctx1.fill(self,"value",{},smalltalk.HLRequest)})},
  2094. args: [],
  2095. source: "value\x0a\x09^ value ifNil: [ '' ]",
  2096. messageSends: ["ifNil:"],
  2097. referencedClasses: []
  2098. }),
  2099. smalltalk.HLRequest);
  2100. smalltalk.addMethod(
  2101. smalltalk.method({
  2102. selector: "value:",
  2103. category: 'accessing',
  2104. fn: function (aString){
  2105. var self=this;
  2106. return smalltalk.withContext(function($ctx1) {
  2107. self["@value"]=aString;
  2108. return self}, function($ctx1) {$ctx1.fill(self,"value:",{aString:aString},smalltalk.HLRequest)})},
  2109. args: ["aString"],
  2110. source: "value: aString\x0a\x09value := aString",
  2111. messageSends: [],
  2112. referencedClasses: []
  2113. }),
  2114. smalltalk.HLRequest);
  2115. smalltalk.addClass('HLFocusableWidget', smalltalk.HLWidget, [], 'Helios-Core');
  2116. smalltalk.addMethod(
  2117. smalltalk.method({
  2118. selector: "blur",
  2119. category: 'events',
  2120. fn: function (){
  2121. var self=this;
  2122. return smalltalk.withContext(function($ctx1) {
  2123. _st(_st(_st(self)._wrapper())._asJQuery())._blur();
  2124. return self}, function($ctx1) {$ctx1.fill(self,"blur",{},smalltalk.HLFocusableWidget)})},
  2125. args: [],
  2126. source: "blur\x0a\x09self wrapper asJQuery blur",
  2127. messageSends: ["blur", "asJQuery", "wrapper"],
  2128. referencedClasses: []
  2129. }),
  2130. smalltalk.HLFocusableWidget);
  2131. smalltalk.addMethod(
  2132. smalltalk.method({
  2133. selector: "canHaveFocus",
  2134. category: 'testing',
  2135. fn: function (){
  2136. var self=this;
  2137. return smalltalk.withContext(function($ctx1) {
  2138. return true;
  2139. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLFocusableWidget)})},
  2140. args: [],
  2141. source: "canHaveFocus\x0a\x09^ true",
  2142. messageSends: [],
  2143. referencedClasses: []
  2144. }),
  2145. smalltalk.HLFocusableWidget);
  2146. smalltalk.addMethod(
  2147. smalltalk.method({
  2148. selector: "focus",
  2149. category: 'events',
  2150. fn: function (){
  2151. var self=this;
  2152. return smalltalk.withContext(function($ctx1) {
  2153. _st(_st(_st(self)._wrapper())._asJQuery())._focus();
  2154. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLFocusableWidget)})},
  2155. args: [],
  2156. source: "focus\x0a\x09self wrapper asJQuery focus",
  2157. messageSends: ["focus", "asJQuery", "wrapper"],
  2158. referencedClasses: []
  2159. }),
  2160. smalltalk.HLFocusableWidget);
  2161. smalltalk.addMethod(
  2162. smalltalk.method({
  2163. selector: "focusClass",
  2164. category: 'accessing',
  2165. fn: function (){
  2166. var self=this;
  2167. return smalltalk.withContext(function($ctx1) {
  2168. return "focused";
  2169. }, function($ctx1) {$ctx1.fill(self,"focusClass",{},smalltalk.HLFocusableWidget)})},
  2170. args: [],
  2171. source: "focusClass\x0a\x09^ 'focused'",
  2172. messageSends: [],
  2173. referencedClasses: []
  2174. }),
  2175. smalltalk.HLFocusableWidget);
  2176. smalltalk.addMethod(
  2177. smalltalk.method({
  2178. selector: "hasFocus",
  2179. category: 'events',
  2180. fn: function (){
  2181. var self=this;
  2182. return smalltalk.withContext(function($ctx1) {
  2183. var $1;
  2184. $1=_st(_st(_st(self)._wrapper())._notNil())._and_((function(){
  2185. return smalltalk.withContext(function($ctx2) {
  2186. return _st(_st(_st(self)._wrapper())._asJQuery())._is_(":focus");
  2187. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2188. return $1;
  2189. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLFocusableWidget)})},
  2190. args: [],
  2191. source: "hasFocus\x0a\x09^ self wrapper notNil and: [ self wrapper asJQuery is: ':focus' ]",
  2192. messageSends: ["and:", "is:", "asJQuery", "wrapper", "notNil"],
  2193. referencedClasses: []
  2194. }),
  2195. smalltalk.HLFocusableWidget);
  2196. smalltalk.addMethod(
  2197. smalltalk.method({
  2198. selector: "renderContentOn:",
  2199. category: 'rendering',
  2200. fn: function (html){
  2201. var self=this;
  2202. return smalltalk.withContext(function($ctx1) {
  2203. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLFocusableWidget)})},
  2204. args: ["html"],
  2205. source: "renderContentOn: html",
  2206. messageSends: [],
  2207. referencedClasses: []
  2208. }),
  2209. smalltalk.HLFocusableWidget);
  2210. smalltalk.addMethod(
  2211. smalltalk.method({
  2212. selector: "renderOn:",
  2213. category: 'rendering',
  2214. fn: function (html){
  2215. var self=this;
  2216. return smalltalk.withContext(function($ctx1) {
  2217. var $1,$2,$3,$4;
  2218. $1=_st(html)._div();
  2219. _st($1)._class_("hl_widget");
  2220. $2=_st($1)._yourself();
  2221. self["@wrapper"]=$2;
  2222. _st(self["@wrapper"])._with_((function(){
  2223. return smalltalk.withContext(function($ctx2) {
  2224. return _st(self)._renderContentOn_(html);
  2225. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2226. $3=self["@wrapper"];
  2227. _st($3)._at_put_("tabindex","0");
  2228. _st($3)._onBlur_((function(){
  2229. return smalltalk.withContext(function($ctx2) {
  2230. return _st(_st(_st(self)._wrapper())._asJQuery())._removeClass_(_st(self)._focusClass());
  2231. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2232. $4=_st($3)._onFocus_((function(){
  2233. return smalltalk.withContext(function($ctx2) {
  2234. return _st(_st(_st(self)._wrapper())._asJQuery())._addClass_(_st(self)._focusClass());
  2235. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2236. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLFocusableWidget)})},
  2237. args: ["html"],
  2238. source: "renderOn: html\x0a wrapper := html div \x0a \x09class: 'hl_widget';\x0a\x09\x09yourself.\x0a\x09\x09\x0a wrapper with: [ self renderContentOn: html ].\x0a\x09\x0a\x09wrapper\x0a\x09\x09at: 'tabindex' put: '0';\x0a\x09\x09onBlur: [ self wrapper asJQuery removeClass: self focusClass ];\x0a onFocus: [ self wrapper asJQuery addClass: self focusClass ]",
  2239. messageSends: ["class:", "div", "yourself", "with:", "renderContentOn:", "at:put:", "onBlur:", "removeClass:", "focusClass", "asJQuery", "wrapper", "onFocus:", "addClass:"],
  2240. referencedClasses: []
  2241. }),
  2242. smalltalk.HLFocusableWidget);
  2243. smalltalk.addClass('HLListWidget', smalltalk.HLFocusableWidget, ['items', 'selectedItem', 'mapping'], 'Helios-Core');
  2244. smalltalk.addMethod(
  2245. smalltalk.method({
  2246. selector: "activateFirstListItem",
  2247. category: 'actions',
  2248. fn: function (){
  2249. var self=this;
  2250. return smalltalk.withContext(function($ctx1) {
  2251. _st(self)._activateListItem_(_st(window)._jQuery_(_st(_st(_st(self["@wrapper"])._asJQuery())._find_("li.inactive"))._get_((0))));
  2252. return self}, function($ctx1) {$ctx1.fill(self,"activateFirstListItem",{},smalltalk.HLListWidget)})},
  2253. args: [],
  2254. source: "activateFirstListItem\x0a\x09self activateListItem: (window jQuery: ((wrapper asJQuery find: 'li.inactive') get: 0))",
  2255. messageSends: ["activateListItem:", "jQuery:", "get:", "find:", "asJQuery"],
  2256. referencedClasses: []
  2257. }),
  2258. smalltalk.HLListWidget);
  2259. smalltalk.addMethod(
  2260. smalltalk.method({
  2261. selector: "activateItem:",
  2262. category: 'actions',
  2263. fn: function (anObject){
  2264. var self=this;
  2265. return smalltalk.withContext(function($ctx1) {
  2266. var $1;
  2267. var $early={};
  2268. try {
  2269. _st(self)._activateListItem_(_st(_st(self["@mapping"])._at_ifAbsent_(anObject,(function(){
  2270. return smalltalk.withContext(function($ctx2) {
  2271. $1=self;
  2272. throw $early=[$1];
  2273. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  2274. return self}
  2275. catch(e) {if(e===$early)return e[0]; throw e}
  2276. }, function($ctx1) {$ctx1.fill(self,"activateItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2277. args: ["anObject"],
  2278. source: "activateItem: anObject\x0a\x09self activateListItem: (mapping \x0a\x09\x09at: anObject\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  2279. messageSends: ["activateListItem:", "asJQuery", "at:ifAbsent:"],
  2280. referencedClasses: []
  2281. }),
  2282. smalltalk.HLListWidget);
  2283. smalltalk.addMethod(
  2284. smalltalk.method({
  2285. selector: "activateListItem:",
  2286. category: 'actions',
  2287. fn: function (aListItem){
  2288. var self=this;
  2289. var item;
  2290. return smalltalk.withContext(function($ctx1) {
  2291. var $1,$2,$3;
  2292. $1=_st(aListItem)._get_((0));
  2293. if(($receiver = $1) == nil || $receiver == undefined){
  2294. $2=self;
  2295. return $2;
  2296. } else {
  2297. $1;
  2298. };
  2299. _st(_st(_st(aListItem)._parent())._children())._removeClass_("active");
  2300. _st(aListItem)._addClass_("active");
  2301. _st(self)._ensureVisible_(aListItem);
  2302. item=_st(_st(self)._items())._at_(_st(_st(aListItem)._attr_("list-data"))._asNumber());
  2303. $3=_st(_st(self)._selectedItem()).__eq_eq(item);
  2304. if(! smalltalk.assert($3)){
  2305. _st(self)._selectItem_(item);
  2306. };
  2307. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{aListItem:aListItem,item:item},smalltalk.HLListWidget)})},
  2308. args: ["aListItem"],
  2309. source: "activateListItem: aListItem\x0a\x09| item |\x0a\x09\x0a\x09(aListItem get: 0) ifNil: [ ^self ].\x0a\x09aListItem parent children removeClass: 'active'.\x0a\x09aListItem addClass: 'active'.\x0a \x0a\x09self ensureVisible: aListItem.\x0a \x0a \x22Activate the corresponding item\x22\x0a item := (self items at: (aListItem attr: 'list-data') asNumber).\x0a self selectedItem == item ifFalse: [\x0a\x09 self selectItem: item ]",
  2310. messageSends: ["ifNil:", "get:", "removeClass:", "children", "parent", "addClass:", "ensureVisible:", "at:", "asNumber", "attr:", "items", "ifFalse:", "selectItem:", "==", "selectedItem"],
  2311. referencedClasses: []
  2312. }),
  2313. smalltalk.HLListWidget);
  2314. smalltalk.addMethod(
  2315. smalltalk.method({
  2316. selector: "activateNextListItem",
  2317. category: 'actions',
  2318. fn: function (){
  2319. var self=this;
  2320. return smalltalk.withContext(function($ctx1) {
  2321. _st(self)._activateListItem_(_st(_st(_st(_st(self)._wrapper())._asJQuery())._find_(" .active"))._next());
  2322. _st(_st(_st(_st(_st(self)._wrapper())._asJQuery())._find_(" .active"))._get())._ifEmpty_((function(){
  2323. return smalltalk.withContext(function($ctx2) {
  2324. return _st(self)._activateFirstListItem();
  2325. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2326. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLListWidget)})},
  2327. args: [],
  2328. source: "activateNextListItem\x0a\x09self activateListItem: (self wrapper asJQuery find: ' .active') next.\x0a\x09\x0a\x09\x22select the first item if none is selected\x22\x0a\x09(self wrapper asJQuery find: ' .active') get ifEmpty: [\x0a\x09\x09self activateFirstListItem ]",
  2329. messageSends: ["activateListItem:", "next", "find:", "asJQuery", "wrapper", "ifEmpty:", "activateFirstListItem", "get"],
  2330. referencedClasses: []
  2331. }),
  2332. smalltalk.HLListWidget);
  2333. smalltalk.addMethod(
  2334. smalltalk.method({
  2335. selector: "activatePreviousListItem",
  2336. category: 'actions',
  2337. fn: function (){
  2338. var self=this;
  2339. return smalltalk.withContext(function($ctx1) {
  2340. _st(self)._activateListItem_(_st(_st(_st(_st(self)._wrapper())._asJQuery())._find_(" .active"))._prev());
  2341. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLListWidget)})},
  2342. args: [],
  2343. source: "activatePreviousListItem\x0a\x09self activateListItem: (self wrapper asJQuery find: ' .active') prev",
  2344. messageSends: ["activateListItem:", "prev", "find:", "asJQuery", "wrapper"],
  2345. referencedClasses: []
  2346. }),
  2347. smalltalk.HLListWidget);
  2348. smalltalk.addMethod(
  2349. smalltalk.method({
  2350. selector: "cssClassForItem:",
  2351. category: 'accessing',
  2352. fn: function (anObject){
  2353. var self=this;
  2354. return smalltalk.withContext(function($ctx1) {
  2355. return "";
  2356. }, function($ctx1) {$ctx1.fill(self,"cssClassForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2357. args: ["anObject"],
  2358. source: "cssClassForItem: anObject\x0a\x09^ ''",
  2359. messageSends: [],
  2360. referencedClasses: []
  2361. }),
  2362. smalltalk.HLListWidget);
  2363. smalltalk.addMethod(
  2364. smalltalk.method({
  2365. selector: "defaultItems",
  2366. category: 'defaults',
  2367. fn: function (){
  2368. var self=this;
  2369. return smalltalk.withContext(function($ctx1) {
  2370. var $1;
  2371. $1=[];
  2372. return $1;
  2373. }, function($ctx1) {$ctx1.fill(self,"defaultItems",{},smalltalk.HLListWidget)})},
  2374. args: [],
  2375. source: "defaultItems\x0a\x09^ #()",
  2376. messageSends: [],
  2377. referencedClasses: []
  2378. }),
  2379. smalltalk.HLListWidget);
  2380. smalltalk.addMethod(
  2381. smalltalk.method({
  2382. selector: "ensureVisible:",
  2383. category: 'actions',
  2384. fn: function (aListItem){
  2385. var self=this;
  2386. var perent,position;
  2387. return smalltalk.withContext(function($ctx1) {
  2388. var $1,$2;
  2389. position=_st(self)._positionOf_(aListItem);
  2390. parent=_st(aListItem)._parent();
  2391. $1=_st(_st(_st(aListItem)._position())._top()).__lt((0));
  2392. if(smalltalk.assert($1)){
  2393. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(_st(aListItem)._position())._top())).__minus((10)));
  2394. };
  2395. $2=_st(_st(_st(_st(aListItem)._position())._top()).__plus(_st(aListItem)._height())).__gt(_st(parent)._height());
  2396. if(smalltalk.assert($2)){
  2397. _st(_st(parent)._get_((0)))._scrollTop_(_st(_st(_st(_st(_st(parent)._get_((0)))._scrollTop()).__plus(_st(aListItem)._height())).__minus(_st(_st(parent)._height()).__minus(_st(_st(aListItem)._position())._top()))).__plus((10)));
  2398. };
  2399. return self}, function($ctx1) {$ctx1.fill(self,"ensureVisible:",{aListItem:aListItem,perent:perent,position:position},smalltalk.HLListWidget)})},
  2400. args: ["aListItem"],
  2401. source: "ensureVisible: aListItem\x09\x0a\x09\x22Move the scrollbar to show the active element\x22\x0a\x09\x0a\x09| perent position |\x0a\x09\x0a\x09position := self positionOf: aListItem.\x0a\x09parent := aListItem parent.\x0a\x09\x0a aListItem position top < 0 ifTrue: [\x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem position top - 10) ].\x0a aListItem position top + aListItem height > parent height ifTrue: [ \x0a\x09\x09(parent get: 0) scrollTop: ((parent get: 0) scrollTop + aListItem height - (parent height - aListItem position top)) +10 ]",
  2402. messageSends: ["positionOf:", "parent", "ifTrue:", "scrollTop:", "-", "+", "top", "position", "scrollTop", "get:", "<", "height", ">"],
  2403. referencedClasses: []
  2404. }),
  2405. smalltalk.HLListWidget);
  2406. smalltalk.addMethod(
  2407. smalltalk.method({
  2408. selector: "focus",
  2409. category: 'actions',
  2410. fn: function (){
  2411. var self=this;
  2412. return smalltalk.withContext(function($ctx1) {
  2413. var $1,$2;
  2414. smalltalk.HLFocusableWidget.fn.prototype._focus.apply(_st(self), []);
  2415. $1=_st(_st(self)._items())._isEmpty();
  2416. if(! smalltalk.assert($1)){
  2417. $2=_st(self)._selectedItem();
  2418. if(($receiver = $2) == nil || $receiver == undefined){
  2419. _st(self)._activateFirstListItem();
  2420. } else {
  2421. $2;
  2422. };
  2423. };
  2424. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLListWidget)})},
  2425. args: [],
  2426. source: "focus\x0a\x09super focus.\x0a self items isEmpty ifFalse: [ \x0a\x09\x09self selectedItem ifNil: [ self activateFirstListItem ] ]",
  2427. messageSends: ["focus", "ifFalse:", "ifNil:", "activateFirstListItem", "selectedItem", "isEmpty", "items"],
  2428. referencedClasses: []
  2429. }),
  2430. smalltalk.HLListWidget);
  2431. smalltalk.addMethod(
  2432. smalltalk.method({
  2433. selector: "initialize",
  2434. category: 'initialization',
  2435. fn: function (){
  2436. var self=this;
  2437. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  2438. return smalltalk.withContext(function($ctx1) {
  2439. smalltalk.HLFocusableWidget.fn.prototype._initialize.apply(_st(self), []);
  2440. self["@mapping"]=_st($Dictionary())._new();
  2441. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLListWidget)})},
  2442. args: [],
  2443. source: "initialize\x0a\x09super initialize.\x0a\x09\x0a\x09mapping := Dictionary new.",
  2444. messageSends: ["initialize", "new"],
  2445. referencedClasses: ["Dictionary"]
  2446. }),
  2447. smalltalk.HLListWidget);
  2448. smalltalk.addMethod(
  2449. smalltalk.method({
  2450. selector: "items",
  2451. category: 'accessing',
  2452. fn: function (){
  2453. var self=this;
  2454. return smalltalk.withContext(function($ctx1) {
  2455. var $2,$1;
  2456. $2=self["@items"];
  2457. if(($receiver = $2) == nil || $receiver == undefined){
  2458. self["@items"]=_st(self)._defaultItems();
  2459. $1=self["@items"];
  2460. } else {
  2461. $1=$2;
  2462. };
  2463. return $1;
  2464. }, function($ctx1) {$ctx1.fill(self,"items",{},smalltalk.HLListWidget)})},
  2465. args: [],
  2466. source: "items\x0a\x09^ items ifNil: [ items := self defaultItems ]",
  2467. messageSends: ["ifNil:", "defaultItems"],
  2468. referencedClasses: []
  2469. }),
  2470. smalltalk.HLListWidget);
  2471. smalltalk.addMethod(
  2472. smalltalk.method({
  2473. selector: "items:",
  2474. category: 'accessing',
  2475. fn: function (aCollection){
  2476. var self=this;
  2477. return smalltalk.withContext(function($ctx1) {
  2478. self["@items"]=aCollection;
  2479. return self}, function($ctx1) {$ctx1.fill(self,"items:",{aCollection:aCollection},smalltalk.HLListWidget)})},
  2480. args: ["aCollection"],
  2481. source: "items: aCollection\x0a\x09items := aCollection",
  2482. messageSends: [],
  2483. referencedClasses: []
  2484. }),
  2485. smalltalk.HLListWidget);
  2486. smalltalk.addMethod(
  2487. smalltalk.method({
  2488. selector: "listCssClassForItem:",
  2489. category: 'accessing',
  2490. fn: function (anObject){
  2491. var self=this;
  2492. return smalltalk.withContext(function($ctx1) {
  2493. var $2,$1;
  2494. $2=_st(_st(self)._selectedItem()).__eq(anObject);
  2495. if(smalltalk.assert($2)){
  2496. $1="active";
  2497. } else {
  2498. $1="inactive";
  2499. };
  2500. return $1;
  2501. }, function($ctx1) {$ctx1.fill(self,"listCssClassForItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2502. args: ["anObject"],
  2503. source: "listCssClassForItem: anObject\x0a\x09^ self selectedItem = anObject\x0a\x09\x09ifTrue: [ 'active' ]\x0a\x09\x09ifFalse: [ 'inactive' ]",
  2504. messageSends: ["ifTrue:ifFalse:", "=", "selectedItem"],
  2505. referencedClasses: []
  2506. }),
  2507. smalltalk.HLListWidget);
  2508. smalltalk.addMethod(
  2509. smalltalk.method({
  2510. selector: "positionOf:",
  2511. category: 'accessing',
  2512. fn: function (aListItem){
  2513. var self=this;
  2514. return smalltalk.withContext(function($ctx1) {
  2515. return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1
  2516. ;
  2517. return self}, function($ctx1) {$ctx1.fill(self,"positionOf:",{aListItem:aListItem},smalltalk.HLListWidget)})},
  2518. args: ["aListItem"],
  2519. source: "positionOf: aListItem\x0a\x09<\x0a \x09return aListItem.parent().children().get().indexOf(aListItem.get(0)) + 1\x0a\x09>",
  2520. messageSends: [],
  2521. referencedClasses: []
  2522. }),
  2523. smalltalk.HLListWidget);
  2524. smalltalk.addMethod(
  2525. smalltalk.method({
  2526. selector: "refresh",
  2527. category: 'actions',
  2528. fn: function (){
  2529. var self=this;
  2530. return smalltalk.withContext(function($ctx1) {
  2531. var $1;
  2532. var $early={};
  2533. try {
  2534. smalltalk.HLFocusableWidget.fn.prototype._refresh.apply(_st(self), []);
  2535. _st(self)._ensureVisible_(_st(_st(self["@mapping"])._at_ifAbsent_(_st(self)._selectedItem(),(function(){
  2536. return smalltalk.withContext(function($ctx2) {
  2537. $1=self;
  2538. throw $early=[$1];
  2539. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})})))._asJQuery());
  2540. return self}
  2541. catch(e) {if(e===$early)return e[0]; throw e}
  2542. }, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLListWidget)})},
  2543. args: [],
  2544. source: "refresh\x0a\x09super refresh.\x0a\x09\x0a\x09self ensureVisible: (mapping \x0a\x09\x09at: self selectedItem\x0a\x09\x09ifAbsent: [ ^ self ]) asJQuery",
  2545. messageSends: ["refresh", "ensureVisible:", "asJQuery", "at:ifAbsent:", "selectedItem"],
  2546. referencedClasses: []
  2547. }),
  2548. smalltalk.HLListWidget);
  2549. smalltalk.addMethod(
  2550. smalltalk.method({
  2551. selector: "registerMappingFrom:to:",
  2552. category: 'private',
  2553. fn: function (anObject,aTag){
  2554. var self=this;
  2555. return smalltalk.withContext(function($ctx1) {
  2556. _st(self["@mapping"])._at_put_(anObject,aTag);
  2557. return self}, function($ctx1) {$ctx1.fill(self,"registerMappingFrom:to:",{anObject:anObject,aTag:aTag},smalltalk.HLListWidget)})},
  2558. args: ["anObject", "aTag"],
  2559. source: "registerMappingFrom: anObject to: aTag\x0a\x09mapping at: anObject put: aTag",
  2560. messageSends: ["at:put:"],
  2561. referencedClasses: []
  2562. }),
  2563. smalltalk.HLListWidget);
  2564. smalltalk.addMethod(
  2565. smalltalk.method({
  2566. selector: "renderButtonsOn:",
  2567. category: 'rendering',
  2568. fn: function (html){
  2569. var self=this;
  2570. return smalltalk.withContext(function($ctx1) {
  2571. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLListWidget)})},
  2572. args: ["html"],
  2573. source: "renderButtonsOn: html",
  2574. messageSends: [],
  2575. referencedClasses: []
  2576. }),
  2577. smalltalk.HLListWidget);
  2578. smalltalk.addMethod(
  2579. smalltalk.method({
  2580. selector: "renderContentOn:",
  2581. category: 'rendering',
  2582. fn: function (html){
  2583. var self=this;
  2584. return smalltalk.withContext(function($ctx1) {
  2585. var $1,$2,$3,$4;
  2586. $1=_st(html)._ul();
  2587. _st($1)._class_("nav nav-pills nav-stacked");
  2588. $2=_st($1)._with_((function(){
  2589. return smalltalk.withContext(function($ctx2) {
  2590. return _st(self)._renderListOn_(html);
  2591. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2592. $3=_st(html)._div();
  2593. _st($3)._class_("pane_actions form-actions");
  2594. $4=_st($3)._with_((function(){
  2595. return smalltalk.withContext(function($ctx2) {
  2596. return _st(self)._renderButtonsOn_(html);
  2597. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2598. _st(self)._setupKeyBindings();
  2599. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLListWidget)})},
  2600. args: ["html"],
  2601. source: "renderContentOn: html\x0a\x09html ul \x0a \x09class: 'nav nav-pills nav-stacked';\x0a with: [ self renderListOn: html ].\x0a html div class: 'pane_actions form-actions'; with: [\x0a \x09self renderButtonsOn: html ].\x0a \x0a self setupKeyBindings",
  2602. messageSends: ["class:", "ul", "with:", "renderListOn:", "div", "renderButtonsOn:", "setupKeyBindings"],
  2603. referencedClasses: []
  2604. }),
  2605. smalltalk.HLListWidget);
  2606. smalltalk.addMethod(
  2607. smalltalk.method({
  2608. selector: "renderItem:on:",
  2609. category: 'rendering',
  2610. fn: function (anObject,html){
  2611. var self=this;
  2612. var li;
  2613. return smalltalk.withContext(function($ctx1) {
  2614. var $1,$3,$4,$2;
  2615. li=_st(html)._li();
  2616. _st(self)._registerMappingFrom_to_(anObject,li);
  2617. $1=li;
  2618. _st($1)._at_put_("list-data",_st(_st(_st(self)._items())._indexOf_(anObject))._asString());
  2619. _st($1)._class_(_st(self)._listCssClassForItem_(anObject));
  2620. $2=_st($1)._with_((function(){
  2621. return smalltalk.withContext(function($ctx2) {
  2622. $3=_st(html)._a();
  2623. _st($3)._with_((function(){
  2624. return smalltalk.withContext(function($ctx3) {
  2625. _st(_st(html)._tag_("i"))._class_(_st(self)._cssClassForItem_(anObject));
  2626. return _st(self)._renderItemLabel_on_(anObject,html);
  2627. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2628. $4=_st($3)._onClick_((function(){
  2629. return smalltalk.withContext(function($ctx3) {
  2630. return _st(self)._activateListItem_(_st(li)._asJQuery());
  2631. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2632. return $4;
  2633. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2634. return self}, function($ctx1) {$ctx1.fill(self,"renderItem:on:",{anObject:anObject,html:html,li:li},smalltalk.HLListWidget)})},
  2635. args: ["anObject", "html"],
  2636. source: "renderItem: anObject on: html\x0a\x09| li |\x0a \x0a\x09li := html li.\x0a\x09self registerMappingFrom: anObject to: li.\x0a\x09\x0a li\x0a at: 'list-data' put: (self items indexOf: anObject) asString;\x0a\x09\x09class: (self listCssClassForItem: anObject);\x0a with: [ \x0a \x09html a\x0a \x09with: [ \x0a \x09\x09(html tag: 'i') class: (self cssClassForItem: anObject).\x0a \x09\x09\x09\x09\x09self renderItemLabel: anObject on: html ];\x0a\x09\x09\x09\x09onClick: [\x0a \x09self activateListItem: li asJQuery ] ]",
  2637. messageSends: ["li", "registerMappingFrom:to:", "at:put:", "asString", "indexOf:", "items", "class:", "listCssClassForItem:", "with:", "cssClassForItem:", "tag:", "renderItemLabel:on:", "a", "onClick:", "activateListItem:", "asJQuery"],
  2638. referencedClasses: []
  2639. }),
  2640. smalltalk.HLListWidget);
  2641. smalltalk.addMethod(
  2642. smalltalk.method({
  2643. selector: "renderItemLabel:on:",
  2644. category: 'rendering',
  2645. fn: function (anObject,html){
  2646. var self=this;
  2647. return smalltalk.withContext(function($ctx1) {
  2648. _st(html)._with_(_st(anObject)._asString());
  2649. return self}, function($ctx1) {$ctx1.fill(self,"renderItemLabel:on:",{anObject:anObject,html:html},smalltalk.HLListWidget)})},
  2650. args: ["anObject", "html"],
  2651. source: "renderItemLabel: anObject on: html\x0a\x09html with: anObject asString",
  2652. messageSends: ["with:", "asString"],
  2653. referencedClasses: []
  2654. }),
  2655. smalltalk.HLListWidget);
  2656. smalltalk.addMethod(
  2657. smalltalk.method({
  2658. selector: "renderListOn:",
  2659. category: 'rendering',
  2660. fn: function (html){
  2661. var self=this;
  2662. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  2663. return smalltalk.withContext(function($ctx1) {
  2664. self["@mapping"]=_st($Dictionary())._new();
  2665. _st(_st(self)._items())._do_((function(each){
  2666. return smalltalk.withContext(function($ctx2) {
  2667. return _st(self)._renderItem_on_(each,html);
  2668. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  2669. return self}, function($ctx1) {$ctx1.fill(self,"renderListOn:",{html:html},smalltalk.HLListWidget)})},
  2670. args: ["html"],
  2671. source: "renderListOn: html\x0a\x09mapping := Dictionary new.\x0a\x09\x0a\x09self items do: [ :each | \x0a \x09self renderItem: each on: html ]",
  2672. messageSends: ["new", "do:", "renderItem:on:", "items"],
  2673. referencedClasses: ["Dictionary"]
  2674. }),
  2675. smalltalk.HLListWidget);
  2676. smalltalk.addMethod(
  2677. smalltalk.method({
  2678. selector: "selectItem:",
  2679. category: 'actions',
  2680. fn: function (anObject){
  2681. var self=this;
  2682. return smalltalk.withContext(function($ctx1) {
  2683. _st(self)._selectedItem_(anObject);
  2684. return self}, function($ctx1) {$ctx1.fill(self,"selectItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2685. args: ["anObject"],
  2686. source: "selectItem: anObject\x0a\x09self selectedItem: anObject",
  2687. messageSends: ["selectedItem:"],
  2688. referencedClasses: []
  2689. }),
  2690. smalltalk.HLListWidget);
  2691. smalltalk.addMethod(
  2692. smalltalk.method({
  2693. selector: "selectedItem",
  2694. category: 'accessing',
  2695. fn: function (){
  2696. var self=this;
  2697. return smalltalk.withContext(function($ctx1) {
  2698. var $1;
  2699. $1=self["@selectedItem"];
  2700. return $1;
  2701. }, function($ctx1) {$ctx1.fill(self,"selectedItem",{},smalltalk.HLListWidget)})},
  2702. args: [],
  2703. source: "selectedItem\x0a\x09^ selectedItem",
  2704. messageSends: [],
  2705. referencedClasses: []
  2706. }),
  2707. smalltalk.HLListWidget);
  2708. smalltalk.addMethod(
  2709. smalltalk.method({
  2710. selector: "selectedItem:",
  2711. category: 'accessing',
  2712. fn: function (anObject){
  2713. var self=this;
  2714. return smalltalk.withContext(function($ctx1) {
  2715. self["@selectedItem"]=anObject;
  2716. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anObject:anObject},smalltalk.HLListWidget)})},
  2717. args: ["anObject"],
  2718. source: "selectedItem: anObject\x0a\x09selectedItem := anObject",
  2719. messageSends: [],
  2720. referencedClasses: []
  2721. }),
  2722. smalltalk.HLListWidget);
  2723. smalltalk.addMethod(
  2724. smalltalk.method({
  2725. selector: "setupKeyBindings",
  2726. category: 'events',
  2727. fn: function (){
  2728. var self=this;
  2729. var active,interval,delay,repeatInterval;
  2730. return smalltalk.withContext(function($ctx1) {
  2731. var $1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11;
  2732. active=false;
  2733. repeatInterval=(70);
  2734. _st(_st(_st(self)._wrapper())._asJQuery())._unbind_("keydown");
  2735. _st(_st(_st(self)._wrapper())._asJQuery())._keydown_((function(e){
  2736. return smalltalk.withContext(function($ctx2) {
  2737. $1=_st(_st(_st(e)._which()).__eq((38)))._and_((function(){
  2738. return smalltalk.withContext(function($ctx3) {
  2739. return _st(active).__eq(false);
  2740. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2741. if(smalltalk.assert($1)){
  2742. active=true;
  2743. active;
  2744. _st(self)._activatePreviousListItem();
  2745. delay=_st((function(){
  2746. return smalltalk.withContext(function($ctx3) {
  2747. interval=_st((function(){
  2748. return smalltalk.withContext(function($ctx4) {
  2749. $2=_st(_st(_st(self)._wrapper())._asJQuery())._hasClass_(_st(self)._focusClass());
  2750. if(smalltalk.assert($2)){
  2751. return _st(self)._activatePreviousListItem();
  2752. } else {
  2753. active=false;
  2754. active;
  2755. $3=interval;
  2756. if(($receiver = $3) == nil || $receiver == undefined){
  2757. $3;
  2758. } else {
  2759. _st(interval)._clearInterval();
  2760. };
  2761. $4=delay;
  2762. if(($receiver = $4) == nil || $receiver == undefined){
  2763. return $4;
  2764. } else {
  2765. return _st(delay)._clearTimeout();
  2766. };
  2767. };
  2768. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  2769. return interval;
  2770. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  2771. delay;
  2772. };
  2773. $5=_st(_st(_st(e)._which()).__eq((40)))._and_((function(){
  2774. return smalltalk.withContext(function($ctx3) {
  2775. return _st(active).__eq(false);
  2776. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  2777. if(smalltalk.assert($5)){
  2778. active=true;
  2779. active;
  2780. _st(self)._activateNextListItem();
  2781. delay=_st((function(){
  2782. return smalltalk.withContext(function($ctx3) {
  2783. interval=_st((function(){
  2784. return smalltalk.withContext(function($ctx4) {
  2785. $6=_st(_st(_st(self)._wrapper())._asJQuery())._hasClass_(_st(self)._focusClass());
  2786. if(smalltalk.assert($6)){
  2787. return _st(self)._activateNextListItem();
  2788. } else {
  2789. active=false;
  2790. active;
  2791. $7=interval;
  2792. if(($receiver = $7) == nil || $receiver == undefined){
  2793. $7;
  2794. } else {
  2795. _st(interval)._clearInterval();
  2796. };
  2797. $8=delay;
  2798. if(($receiver = $8) == nil || $receiver == undefined){
  2799. return $8;
  2800. } else {
  2801. return _st(delay)._clearTimeout();
  2802. };
  2803. };
  2804. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}))._valueWithInterval_(repeatInterval);
  2805. return interval;
  2806. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}))._valueWithTimeout_((300));
  2807. return delay;
  2808. };
  2809. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  2810. _st(_st(_st(self)._wrapper())._asJQuery())._keyup_((function(e){
  2811. return smalltalk.withContext(function($ctx2) {
  2812. $9=active;
  2813. if(smalltalk.assert($9)){
  2814. active=false;
  2815. active;
  2816. $10=interval;
  2817. if(($receiver = $10) == nil || $receiver == undefined){
  2818. $10;
  2819. } else {
  2820. _st(interval)._clearInterval();
  2821. };
  2822. $11=delay;
  2823. if(($receiver = $11) == nil || $receiver == undefined){
  2824. return $11;
  2825. } else {
  2826. return _st(delay)._clearTimeout();
  2827. };
  2828. };
  2829. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  2830. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{active:active,interval:interval,delay:delay,repeatInterval:repeatInterval},smalltalk.HLListWidget)})},
  2831. args: [],
  2832. source: "setupKeyBindings\x0a\x09\x22TODO: refactor this!\x22\x0a\x09\x0a\x09| active interval delay repeatInterval |\x0a\x09\x0a\x09active := false.\x0a\x09repeatInterval := 70.\x0a\x09self wrapper asJQuery unbind: 'keydown'.\x0a\x0a\x09self wrapper asJQuery keydown: [ :e |\x0a\x09\x09\x0a (e which = 38 and: [ active = false ]) ifTrue: [ \x0a\x09\x09\x09active := true.\x0a\x09\x09\x09self activatePreviousListItem.\x0a \x09delay := [\x0a\x09\x09\x09\x09interval := [\x0a\x09\x09\x09\x09\x09(self wrapper asJQuery hasClass: self focusClass)\x0a\x09\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09\x09self activatePreviousListItem ]\x0a\x09\x09\x09\x09\x09\x09ifFalse: [\x0a\x09\x09\x09\x09\x09\x09\x09active := false.\x0a\x09\x09\x09\x09\x09\x09\x09interval ifNotNil: [ interval clearInterval ].\x0a\x09\x09\x09\x09\x09\x09\x09delay ifNotNil: [ delay clearTimeout] ] ]\x0a\x09\x09\x09\x09\x09valueWithInterval: repeatInterval ]\x0a\x09\x09\x09\x09\x09\x09valueWithTimeout: 300 ].\x0a\x09\x09\x09\x0a \x09(e which = 40 and: [ active = false ]) ifTrue: [\x0a active := true.\x0a\x09\x09\x09self activateNextListItem.\x0a \x09delay := [\x0a\x09\x09\x09\x09interval := [ \x0a\x09\x09\x09\x09\x09(self wrapper asJQuery hasClass: self focusClass)\x0a\x09\x09\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x09\x09self activateNextListItem ]\x0a\x09\x09\x09\x09\x09\x09ifFalse: [\x0a\x09\x09\x09\x09\x09\x09\x09active := false.\x0a\x09\x09\x09\x09\x09\x09\x09interval ifNotNil: [ interval clearInterval ].\x0a\x09\x09\x09\x09\x09\x09\x09delay ifNotNil: [ delay clearTimeout] ] ]\x0a\x09\x09\x09\x09\x09valueWithInterval: repeatInterval ]\x0a\x09\x09\x09\x09\x09\x09valueWithTimeout: 300 ] ].\x0a\x09\x0a\x09self wrapper asJQuery keyup: [ :e |\x0a\x09\x09active ifTrue: [\x0a\x09\x09\x09active := false.\x0a\x09\x09\x09interval ifNotNil: [ interval clearInterval ].\x0a\x09\x09\x09delay ifNotNil: [ delay clearTimeout] ] ]",
  2833. messageSends: ["unbind:", "asJQuery", "wrapper", "keydown:", "ifTrue:", "activatePreviousListItem", "valueWithTimeout:", "valueWithInterval:", "ifTrue:ifFalse:", "ifNotNil:", "clearInterval", "clearTimeout", "hasClass:", "focusClass", "and:", "=", "which", "activateNextListItem", "keyup:"],
  2834. referencedClasses: []
  2835. }),
  2836. smalltalk.HLListWidget);
  2837. smalltalk.addClass('HLNavigationListWidget', smalltalk.HLListWidget, ['previous', 'next'], 'Helios-Core');
  2838. smalltalk.addMethod(
  2839. smalltalk.method({
  2840. selector: "next",
  2841. category: 'accessing',
  2842. fn: function (){
  2843. var self=this;
  2844. return smalltalk.withContext(function($ctx1) {
  2845. var $1;
  2846. $1=self["@next"];
  2847. return $1;
  2848. }, function($ctx1) {$ctx1.fill(self,"next",{},smalltalk.HLNavigationListWidget)})},
  2849. args: [],
  2850. source: "next\x0a\x09^ next",
  2851. messageSends: [],
  2852. referencedClasses: []
  2853. }),
  2854. smalltalk.HLNavigationListWidget);
  2855. smalltalk.addMethod(
  2856. smalltalk.method({
  2857. selector: "next:",
  2858. category: 'accessing',
  2859. fn: function (aWidget){
  2860. var self=this;
  2861. return smalltalk.withContext(function($ctx1) {
  2862. var $1;
  2863. self["@next"]=aWidget;
  2864. $1=_st(_st(aWidget)._previous()).__eq(self);
  2865. if(! smalltalk.assert($1)){
  2866. _st(aWidget)._previous_(self);
  2867. };
  2868. return self}, function($ctx1) {$ctx1.fill(self,"next:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  2869. args: ["aWidget"],
  2870. source: "next: aWidget\x0a\x09next := aWidget.\x0a aWidget previous = self ifFalse: [ aWidget previous: self ]",
  2871. messageSends: ["ifFalse:", "previous:", "=", "previous"],
  2872. referencedClasses: []
  2873. }),
  2874. smalltalk.HLNavigationListWidget);
  2875. smalltalk.addMethod(
  2876. smalltalk.method({
  2877. selector: "nextFocus",
  2878. category: 'actions',
  2879. fn: function (){
  2880. var self=this;
  2881. return smalltalk.withContext(function($ctx1) {
  2882. var $1;
  2883. $1=_st(self)._next();
  2884. if(($receiver = $1) == nil || $receiver == undefined){
  2885. $1;
  2886. } else {
  2887. _st(_st(self)._next())._focus();
  2888. };
  2889. return self}, function($ctx1) {$ctx1.fill(self,"nextFocus",{},smalltalk.HLNavigationListWidget)})},
  2890. args: [],
  2891. source: "nextFocus\x0a\x09self next ifNotNil: [ self next focus ]",
  2892. messageSends: ["ifNotNil:", "focus", "next"],
  2893. referencedClasses: []
  2894. }),
  2895. smalltalk.HLNavigationListWidget);
  2896. smalltalk.addMethod(
  2897. smalltalk.method({
  2898. selector: "previous",
  2899. category: 'accessing',
  2900. fn: function (){
  2901. var self=this;
  2902. return smalltalk.withContext(function($ctx1) {
  2903. var $1;
  2904. $1=self["@previous"];
  2905. return $1;
  2906. }, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationListWidget)})},
  2907. args: [],
  2908. source: "previous\x0a\x09^ previous",
  2909. messageSends: [],
  2910. referencedClasses: []
  2911. }),
  2912. smalltalk.HLNavigationListWidget);
  2913. smalltalk.addMethod(
  2914. smalltalk.method({
  2915. selector: "previous:",
  2916. category: 'accessing',
  2917. fn: function (aWidget){
  2918. var self=this;
  2919. return smalltalk.withContext(function($ctx1) {
  2920. var $1;
  2921. self["@previous"]=aWidget;
  2922. $1=_st(_st(aWidget)._next()).__eq(self);
  2923. if(! smalltalk.assert($1)){
  2924. _st(aWidget)._next_(self);
  2925. };
  2926. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationListWidget)})},
  2927. args: ["aWidget"],
  2928. source: "previous: aWidget\x0a\x09previous := aWidget.\x0a aWidget next = self ifFalse: [ aWidget next: self ]",
  2929. messageSends: ["ifFalse:", "next:", "=", "next"],
  2930. referencedClasses: []
  2931. }),
  2932. smalltalk.HLNavigationListWidget);
  2933. smalltalk.addMethod(
  2934. smalltalk.method({
  2935. selector: "previousFocus",
  2936. category: 'actions',
  2937. fn: function (){
  2938. var self=this;
  2939. return smalltalk.withContext(function($ctx1) {
  2940. var $1;
  2941. $1=_st(self)._previous();
  2942. if(($receiver = $1) == nil || $receiver == undefined){
  2943. $1;
  2944. } else {
  2945. _st(_st(self)._previous())._focus();
  2946. };
  2947. return self}, function($ctx1) {$ctx1.fill(self,"previousFocus",{},smalltalk.HLNavigationListWidget)})},
  2948. args: [],
  2949. source: "previousFocus\x0a\x09self previous ifNotNil: [ self previous focus ]",
  2950. messageSends: ["ifNotNil:", "focus", "previous"],
  2951. referencedClasses: []
  2952. }),
  2953. smalltalk.HLNavigationListWidget);
  2954. smalltalk.addMethod(
  2955. smalltalk.method({
  2956. selector: "setupKeyBindings",
  2957. category: 'events',
  2958. fn: function (){
  2959. var self=this;
  2960. return smalltalk.withContext(function($ctx1) {
  2961. var $1,$2;
  2962. smalltalk.HLListWidget.fn.prototype._setupKeyBindings.apply(_st(self), []);
  2963. _st(_st(_st(self)._wrapper())._asJQuery())._keydown_((function(e){
  2964. return smalltalk.withContext(function($ctx2) {
  2965. $1=_st(_st(e)._which()).__eq((39));
  2966. if(smalltalk.assert($1)){
  2967. _st(self)._nextFocus();
  2968. };
  2969. $2=_st(_st(e)._which()).__eq((37));
  2970. if(smalltalk.assert($2)){
  2971. return _st(self)._previousFocus();
  2972. };
  2973. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  2974. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyBindings",{},smalltalk.HLNavigationListWidget)})},
  2975. args: [],
  2976. 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 ] ]",
  2977. messageSends: ["setupKeyBindings", "keydown:", "ifTrue:", "nextFocus", "=", "which", "previousFocus", "asJQuery", "wrapper"],
  2978. referencedClasses: []
  2979. }),
  2980. smalltalk.HLNavigationListWidget);
  2981. smalltalk.addClass('HLToolListWidget', smalltalk.HLNavigationListWidget, ['model'], 'Helios-Core');
  2982. smalltalk.addMethod(
  2983. smalltalk.method({
  2984. selector: "activateListItem:",
  2985. category: 'actions',
  2986. fn: function (anItem){
  2987. var self=this;
  2988. return smalltalk.withContext(function($ctx1) {
  2989. _st(_st(self)._model())._withChangesDo_((function(){
  2990. return smalltalk.withContext(function($ctx2) {
  2991. return smalltalk.HLNavigationListWidget.fn.prototype._activateListItem_.apply(_st(self), [anItem]);
  2992. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  2993. return self}, function($ctx1) {$ctx1.fill(self,"activateListItem:",{anItem:anItem},smalltalk.HLToolListWidget)})},
  2994. args: ["anItem"],
  2995. source: "activateListItem: anItem\x0a\x09self model withChangesDo: [ super activateListItem: anItem ]",
  2996. messageSends: ["withChangesDo:", "activateListItem:", "model"],
  2997. referencedClasses: []
  2998. }),
  2999. smalltalk.HLToolListWidget);
  3000. smalltalk.addMethod(
  3001. smalltalk.method({
  3002. selector: "activateNextListItem",
  3003. category: 'actions',
  3004. fn: function (){
  3005. var self=this;
  3006. return smalltalk.withContext(function($ctx1) {
  3007. _st(_st(self)._model())._withChangesDo_((function(){
  3008. return smalltalk.withContext(function($ctx2) {
  3009. return smalltalk.HLNavigationListWidget.fn.prototype._activateNextListItem.apply(_st(self), []);
  3010. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3011. return self}, function($ctx1) {$ctx1.fill(self,"activateNextListItem",{},smalltalk.HLToolListWidget)})},
  3012. args: [],
  3013. source: "activateNextListItem\x0a\x09self model withChangesDo: [ super activateNextListItem ]",
  3014. messageSends: ["withChangesDo:", "activateNextListItem", "model"],
  3015. referencedClasses: []
  3016. }),
  3017. smalltalk.HLToolListWidget);
  3018. smalltalk.addMethod(
  3019. smalltalk.method({
  3020. selector: "activatePreviousListItem",
  3021. category: 'actions',
  3022. fn: function (){
  3023. var self=this;
  3024. return smalltalk.withContext(function($ctx1) {
  3025. _st(_st(self)._model())._withChangesDo_((function(){
  3026. return smalltalk.withContext(function($ctx2) {
  3027. return smalltalk.HLNavigationListWidget.fn.prototype._activatePreviousListItem.apply(_st(self), []);
  3028. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3029. return self}, function($ctx1) {$ctx1.fill(self,"activatePreviousListItem",{},smalltalk.HLToolListWidget)})},
  3030. args: [],
  3031. source: "activatePreviousListItem\x0a\x09self model withChangesDo: [ super activatePreviousListItem ]",
  3032. messageSends: ["withChangesDo:", "activatePreviousListItem", "model"],
  3033. referencedClasses: []
  3034. }),
  3035. smalltalk.HLToolListWidget);
  3036. smalltalk.addMethod(
  3037. smalltalk.method({
  3038. selector: "commandCategory",
  3039. category: 'accessing',
  3040. fn: function (){
  3041. var self=this;
  3042. return smalltalk.withContext(function($ctx1) {
  3043. var $1;
  3044. $1=_st(self)._label();
  3045. return $1;
  3046. }, function($ctx1) {$ctx1.fill(self,"commandCategory",{},smalltalk.HLToolListWidget)})},
  3047. args: [],
  3048. source: "commandCategory\x0a\x09^ self label",
  3049. messageSends: ["label"],
  3050. referencedClasses: []
  3051. }),
  3052. smalltalk.HLToolListWidget);
  3053. smalltalk.addMethod(
  3054. smalltalk.method({
  3055. selector: "label",
  3056. category: 'accessing',
  3057. fn: function (){
  3058. var self=this;
  3059. return smalltalk.withContext(function($ctx1) {
  3060. return "List";
  3061. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLToolListWidget)})},
  3062. args: [],
  3063. source: "label\x0a\x09^ 'List'",
  3064. messageSends: [],
  3065. referencedClasses: []
  3066. }),
  3067. smalltalk.HLToolListWidget);
  3068. smalltalk.addMethod(
  3069. smalltalk.method({
  3070. selector: "menuCommands",
  3071. category: 'accessing',
  3072. fn: function (){
  3073. var self=this;
  3074. function $HLToolCommand(){return smalltalk.HLToolCommand||(typeof HLToolCommand=="undefined"?nil:HLToolCommand)}
  3075. return smalltalk.withContext(function($ctx1) {
  3076. var $1;
  3077. $1=_st(_st(_st(_st($HLToolCommand())._concreteClasses())._select_((function(each){
  3078. return smalltalk.withContext(function($ctx2) {
  3079. return _st(each)._isValidFor_(_st(self)._model());
  3080. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._collect_((function(each){
  3081. return smalltalk.withContext(function($ctx2) {
  3082. return _st(each)._for_(_st(self)._model());
  3083. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._select_((function(each){
  3084. return smalltalk.withContext(function($ctx2) {
  3085. return _st(_st(_st(each)._category()).__eq(_st(self)._commandCategory()))._and_((function(){
  3086. return smalltalk.withContext(function($ctx3) {
  3087. return _st(_st(each)._isAction())._and_((function(){
  3088. return smalltalk.withContext(function($ctx4) {
  3089. return _st(each)._isActive();
  3090. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  3091. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  3092. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3093. return $1;
  3094. }, function($ctx1) {$ctx1.fill(self,"menuCommands",{},smalltalk.HLToolListWidget)})},
  3095. args: [],
  3096. 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 ] ] ]",
  3097. messageSends: ["select:", "and:", "isActive", "isAction", "=", "commandCategory", "category", "collect:", "for:", "model", "isValidFor:", "concreteClasses"],
  3098. referencedClasses: ["HLToolCommand"]
  3099. }),
  3100. smalltalk.HLToolListWidget);
  3101. smalltalk.addMethod(
  3102. smalltalk.method({
  3103. selector: "model",
  3104. category: 'accessing',
  3105. fn: function (){
  3106. var self=this;
  3107. return smalltalk.withContext(function($ctx1) {
  3108. var $1;
  3109. $1=self["@model"];
  3110. return $1;
  3111. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLToolListWidget)})},
  3112. args: [],
  3113. source: "model\x0a\x09^ model",
  3114. messageSends: [],
  3115. referencedClasses: []
  3116. }),
  3117. smalltalk.HLToolListWidget);
  3118. smalltalk.addMethod(
  3119. smalltalk.method({
  3120. selector: "model:",
  3121. category: 'accessing',
  3122. fn: function (aBrowserModel){
  3123. var self=this;
  3124. return smalltalk.withContext(function($ctx1) {
  3125. var $1,$2;
  3126. self["@model"]=aBrowserModel;
  3127. $1=self;
  3128. _st($1)._observeSystem();
  3129. $2=_st($1)._observeModel();
  3130. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aBrowserModel:aBrowserModel},smalltalk.HLToolListWidget)})},
  3131. args: ["aBrowserModel"],
  3132. source: "model: aBrowserModel\x0a\x09model := aBrowserModel.\x0a \x0a self \x0a\x09\x09observeSystem;\x0a\x09\x09observeModel",
  3133. messageSends: ["observeSystem", "observeModel"],
  3134. referencedClasses: []
  3135. }),
  3136. smalltalk.HLToolListWidget);
  3137. smalltalk.addMethod(
  3138. smalltalk.method({
  3139. selector: "observeModel",
  3140. category: 'actions',
  3141. fn: function (){
  3142. var self=this;
  3143. return smalltalk.withContext(function($ctx1) {
  3144. return self}, function($ctx1) {$ctx1.fill(self,"observeModel",{},smalltalk.HLToolListWidget)})},
  3145. args: [],
  3146. source: "observeModel",
  3147. messageSends: [],
  3148. referencedClasses: []
  3149. }),
  3150. smalltalk.HLToolListWidget);
  3151. smalltalk.addMethod(
  3152. smalltalk.method({
  3153. selector: "observeSystem",
  3154. category: 'actions',
  3155. fn: function (){
  3156. var self=this;
  3157. return smalltalk.withContext(function($ctx1) {
  3158. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLToolListWidget)})},
  3159. args: [],
  3160. source: "observeSystem",
  3161. messageSends: [],
  3162. referencedClasses: []
  3163. }),
  3164. smalltalk.HLToolListWidget);
  3165. smalltalk.addMethod(
  3166. smalltalk.method({
  3167. selector: "renderContentOn:",
  3168. category: 'rendering',
  3169. fn: function (html){
  3170. var self=this;
  3171. return smalltalk.withContext(function($ctx1) {
  3172. _st(self)._renderHeadOn_(html);
  3173. smalltalk.HLNavigationListWidget.fn.prototype._renderContentOn_.apply(_st(self), [html]);
  3174. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLToolListWidget)})},
  3175. args: ["html"],
  3176. source: "renderContentOn: html\x0a\x09self renderHeadOn: html.\x09\x0a\x09super renderContentOn: html",
  3177. messageSends: ["renderHeadOn:", "renderContentOn:"],
  3178. referencedClasses: []
  3179. }),
  3180. smalltalk.HLToolListWidget);
  3181. smalltalk.addMethod(
  3182. smalltalk.method({
  3183. selector: "renderHeadOn:",
  3184. category: 'rendering',
  3185. fn: function (html){
  3186. var self=this;
  3187. return smalltalk.withContext(function($ctx1) {
  3188. var $1,$2;
  3189. $1=_st(html)._div();
  3190. _st($1)._class_("list-label");
  3191. $2=_st($1)._with_((function(){
  3192. return smalltalk.withContext(function($ctx2) {
  3193. _st(html)._with_(_st(self)._label());
  3194. return _st(self)._renderMenuOn_(html);
  3195. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3196. return self}, function($ctx1) {$ctx1.fill(self,"renderHeadOn:",{html:html},smalltalk.HLToolListWidget)})},
  3197. args: ["html"],
  3198. 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 ]",
  3199. messageSends: ["class:", "div", "with:", "label", "renderMenuOn:"],
  3200. referencedClasses: []
  3201. }),
  3202. smalltalk.HLToolListWidget);
  3203. smalltalk.addMethod(
  3204. smalltalk.method({
  3205. selector: "renderMenuOn:",
  3206. category: 'rendering',
  3207. fn: function (html){
  3208. var self=this;
  3209. var commands;
  3210. return smalltalk.withContext(function($ctx1) {
  3211. var $1,$2,$3,$5,$6,$7,$9,$10,$8,$4;
  3212. commands=_st(self)._menuCommands();
  3213. $1=_st(commands)._isEmpty();
  3214. if(smalltalk.assert($1)){
  3215. $2=self;
  3216. return $2;
  3217. };
  3218. $3=_st(html)._div();
  3219. _st($3)._class_("btn-group cog");
  3220. $4=_st($3)._with_((function(){
  3221. return smalltalk.withContext(function($ctx2) {
  3222. $5=_st(html)._a();
  3223. _st($5)._class_("btn dropdown-toggle");
  3224. _st($5)._at_put_("data-toggle","dropdown");
  3225. $6=_st($5)._with_((function(){
  3226. return smalltalk.withContext(function($ctx3) {
  3227. return _st(_st(html)._tag_("i"))._class_("icon-cog");
  3228. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  3229. $6;
  3230. $7=_st(html)._ul();
  3231. _st($7)._class_("dropdown-menu pull-right");
  3232. $8=_st($7)._with_((function(){
  3233. return smalltalk.withContext(function($ctx3) {
  3234. return _st(_st(self)._menuCommands())._do_((function(each){
  3235. return smalltalk.withContext(function($ctx4) {
  3236. return _st(_st(html)._li())._with_((function(){
  3237. return smalltalk.withContext(function($ctx5) {
  3238. $9=_st(html)._a();
  3239. _st($9)._with_(_st(each)._menuLabel());
  3240. $10=_st($9)._onClick_((function(){
  3241. return smalltalk.withContext(function($ctx6) {
  3242. return _st(self)._execute_(each);
  3243. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  3244. return $10;
  3245. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  3246. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  3247. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  3248. return $8;
  3249. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3250. return self}, function($ctx1) {$ctx1.fill(self,"renderMenuOn:",{html:html,commands:commands},smalltalk.HLToolListWidget)})},
  3251. args: ["html"],
  3252. source: "renderMenuOn: html\x0a\x09| commands |\x0a\x09\x0a\x09commands := self menuCommands.\x0a\x09commands isEmpty ifTrue: [ ^ self ].\x0a\x09\x0a\x09html div \x0a\x09\x09class: 'btn-group cog';\x0a\x09\x09with: [\x0a\x09\x09\x09html a\x0a\x09\x09\x09\x09class: 'btn dropdown-toggle';\x0a\x09\x09\x09\x09at: 'data-toggle' put: 'dropdown';\x0a\x09\x09\x09\x09with: [ (html tag: 'i') class: 'icon-cog' ].\x0a\x09\x09html ul \x0a\x09\x09\x09class: 'dropdown-menu pull-right';\x0a\x09\x09\x09with: [ \x0a\x09\x09\x09\x09self menuCommands do: [ :each | \x0a\x09\x09\x09\x09\x09html li with: [ html a \x0a\x09\x09\x09\x09\x09\x09with: each menuLabel;\x0a\x09\x09\x09\x09\x09\x09onClick: [ self execute: each ] ] ] ] ]",
  3253. messageSends: ["menuCommands", "ifTrue:", "isEmpty", "class:", "div", "with:", "a", "at:put:", "tag:", "ul", "do:", "menuLabel", "onClick:", "execute:", "li"],
  3254. referencedClasses: []
  3255. }),
  3256. smalltalk.HLToolListWidget);
  3257. smalltalk.addMethod(
  3258. smalltalk.method({
  3259. selector: "selectedItem:",
  3260. category: 'accessing',
  3261. fn: function (anItem){
  3262. var self=this;
  3263. return smalltalk.withContext(function($ctx1) {
  3264. smalltalk.HLNavigationListWidget.fn.prototype._selectedItem_.apply(_st(self), [anItem]);
  3265. _st(self)._updateMenu();
  3266. return self}, function($ctx1) {$ctx1.fill(self,"selectedItem:",{anItem:anItem},smalltalk.HLToolListWidget)})},
  3267. args: ["anItem"],
  3268. source: "selectedItem: anItem\x0a\x09\x22Selection changed, update the cog menu\x22\x0a\x09\x0a\x09super selectedItem: anItem.\x0a\x09self updateMenu",
  3269. messageSends: ["selectedItem:", "updateMenu"],
  3270. referencedClasses: []
  3271. }),
  3272. smalltalk.HLToolListWidget);
  3273. smalltalk.addMethod(
  3274. smalltalk.method({
  3275. selector: "unregister",
  3276. category: 'actions',
  3277. fn: function (){
  3278. var self=this;
  3279. return smalltalk.withContext(function($ctx1) {
  3280. smalltalk.HLNavigationListWidget.fn.prototype._unregister.apply(_st(self), []);
  3281. _st(_st(_st(self)._model())._announcer())._unsubscribe_(self);
  3282. _st(_st(_st(self)._model())._systemAnnouncer())._unsubscribe_(self);
  3283. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLToolListWidget)})},
  3284. args: [],
  3285. source: "unregister\x0a\x09super unregister.\x0a\x09\x0a\x09self model announcer unsubscribe: self.\x0a\x09self model systemAnnouncer unsubscribe: self",
  3286. messageSends: ["unregister", "unsubscribe:", "announcer", "model", "systemAnnouncer"],
  3287. referencedClasses: []
  3288. }),
  3289. smalltalk.HLToolListWidget);
  3290. smalltalk.addMethod(
  3291. smalltalk.method({
  3292. selector: "updateMenu",
  3293. category: 'updating',
  3294. fn: function (){
  3295. var self=this;
  3296. return smalltalk.withContext(function($ctx1) {
  3297. _st(_st(_st(_st(self)._wrapper())._asJQuery())._find_(".cog"))._remove();
  3298. _st((function(html){
  3299. return smalltalk.withContext(function($ctx2) {
  3300. return _st(self)._renderMenuOn_(html);
  3301. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1)})}))._appendToJQuery_(_st(_st(_st(self)._wrapper())._asJQuery())._find_(".list-label"));
  3302. return self}, function($ctx1) {$ctx1.fill(self,"updateMenu",{},smalltalk.HLToolListWidget)})},
  3303. args: [],
  3304. 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')",
  3305. messageSends: ["remove", "find:", "asJQuery", "wrapper", "appendToJQuery:", "renderMenuOn:"],
  3306. referencedClasses: []
  3307. }),
  3308. smalltalk.HLToolListWidget);
  3309. smalltalk.addMethod(
  3310. smalltalk.method({
  3311. selector: "on:",
  3312. category: 'instance creation',
  3313. fn: function (aModel){
  3314. var self=this;
  3315. return smalltalk.withContext(function($ctx1) {
  3316. var $2,$3,$1;
  3317. $2=_st(self)._new();
  3318. _st($2)._model_(aModel);
  3319. $3=_st($2)._yourself();
  3320. $1=$3;
  3321. return $1;
  3322. }, function($ctx1) {$ctx1.fill(self,"on:",{aModel:aModel},smalltalk.HLToolListWidget.klass)})},
  3323. args: ["aModel"],
  3324. source: "on: aModel\x0a\x09^ self new \x0a \x09model: aModel;\x0a yourself",
  3325. messageSends: ["model:", "new", "yourself"],
  3326. referencedClasses: []
  3327. }),
  3328. smalltalk.HLToolListWidget.klass);
  3329. smalltalk.addClass('HLManager', smalltalk.HLWidget, ['tabs', 'activeTab', 'keyBinder', 'environment', 'history'], 'Helios-Core');
  3330. smalltalk.addMethod(
  3331. smalltalk.method({
  3332. selector: "activate:",
  3333. category: 'actions',
  3334. fn: function (aTab){
  3335. var self=this;
  3336. return smalltalk.withContext(function($ctx1) {
  3337. var $1,$2;
  3338. _st(_st(self)._keyBinder())._flushBindings();
  3339. _st(aTab)._registerBindings();
  3340. self["@activeTab"]=aTab;
  3341. $1=self;
  3342. _st($1)._refresh();
  3343. _st($1)._addToHistory_(aTab);
  3344. $2=_st($1)._show_(aTab);
  3345. return self}, function($ctx1) {$ctx1.fill(self,"activate:",{aTab:aTab},smalltalk.HLManager)})},
  3346. args: ["aTab"],
  3347. source: "activate: aTab\x0a\x09self keyBinder flushBindings.\x0a\x09aTab registerBindings.\x0a\x09activeTab := aTab.\x0a\x09\x0a\x09self \x0a\x09\x09refresh;\x0a\x09\x09addToHistory: aTab;\x0a\x09\x09show: aTab",
  3348. messageSends: ["flushBindings", "keyBinder", "registerBindings", "refresh", "addToHistory:", "show:"],
  3349. referencedClasses: []
  3350. }),
  3351. smalltalk.HLManager);
  3352. smalltalk.addMethod(
  3353. smalltalk.method({
  3354. selector: "activeTab",
  3355. category: 'accessing',
  3356. fn: function (){
  3357. var self=this;
  3358. return smalltalk.withContext(function($ctx1) {
  3359. var $1;
  3360. $1=self["@activeTab"];
  3361. return $1;
  3362. }, function($ctx1) {$ctx1.fill(self,"activeTab",{},smalltalk.HLManager)})},
  3363. args: [],
  3364. source: "activeTab\x0a\x09^ activeTab",
  3365. messageSends: [],
  3366. referencedClasses: []
  3367. }),
  3368. smalltalk.HLManager);
  3369. smalltalk.addMethod(
  3370. smalltalk.method({
  3371. selector: "addTab:",
  3372. category: 'actions',
  3373. fn: function (aTab){
  3374. var self=this;
  3375. return smalltalk.withContext(function($ctx1) {
  3376. _st(_st(self)._tabs())._add_(aTab);
  3377. _st(self)._activate_(aTab);
  3378. return self}, function($ctx1) {$ctx1.fill(self,"addTab:",{aTab:aTab},smalltalk.HLManager)})},
  3379. args: ["aTab"],
  3380. source: "addTab: aTab\x0a\x09self tabs add: aTab.\x0a self activate: aTab",
  3381. messageSends: ["add:", "tabs", "activate:"],
  3382. referencedClasses: []
  3383. }),
  3384. smalltalk.HLManager);
  3385. smalltalk.addMethod(
  3386. smalltalk.method({
  3387. selector: "addToHistory:",
  3388. category: 'actions',
  3389. fn: function (aTab){
  3390. var self=this;
  3391. return smalltalk.withContext(function($ctx1) {
  3392. _st(self)._removeFromHistory_(aTab);
  3393. _st(_st(self)._history())._add_(aTab);
  3394. return self}, function($ctx1) {$ctx1.fill(self,"addToHistory:",{aTab:aTab},smalltalk.HLManager)})},
  3395. args: ["aTab"],
  3396. source: "addToHistory: aTab\x0a\x09self removeFromHistory: aTab.\x0a\x09self history add: aTab",
  3397. messageSends: ["removeFromHistory:", "add:", "history"],
  3398. referencedClasses: []
  3399. }),
  3400. smalltalk.HLManager);
  3401. smalltalk.addMethod(
  3402. smalltalk.method({
  3403. selector: "confirm:ifFalse:",
  3404. category: 'actions',
  3405. fn: function (aString,aBlock){
  3406. var self=this;
  3407. function $HLConfirmation(){return smalltalk.HLConfirmation||(typeof HLConfirmation=="undefined"?nil:HLConfirmation)}
  3408. return smalltalk.withContext(function($ctx1) {
  3409. var $1,$2;
  3410. $1=_st($HLConfirmation())._new();
  3411. _st($1)._confirmationString_(aString);
  3412. _st($1)._cancelBlock_(aBlock);
  3413. $2=_st($1)._yourself();
  3414. _st($2)._appendToJQuery_(_st("body")._asJQuery());
  3415. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifFalse:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  3416. args: ["aString", "aBlock"],
  3417. source: "confirm: aString ifFalse: aBlock\x0a\x09(HLConfirmation new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09cancelBlock: aBlock;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
  3418. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "cancelBlock:", "yourself"],
  3419. referencedClasses: ["HLConfirmation"]
  3420. }),
  3421. smalltalk.HLManager);
  3422. smalltalk.addMethod(
  3423. smalltalk.method({
  3424. selector: "confirm:ifTrue:",
  3425. category: 'actions',
  3426. fn: function (aString,aBlock){
  3427. var self=this;
  3428. function $HLConfirmation(){return smalltalk.HLConfirmation||(typeof HLConfirmation=="undefined"?nil:HLConfirmation)}
  3429. return smalltalk.withContext(function($ctx1) {
  3430. var $1,$2;
  3431. $1=_st($HLConfirmation())._new();
  3432. _st($1)._confirmationString_(aString);
  3433. _st($1)._actionBlock_(aBlock);
  3434. $2=_st($1)._yourself();
  3435. _st($2)._appendToJQuery_(_st("body")._asJQuery());
  3436. return self}, function($ctx1) {$ctx1.fill(self,"confirm:ifTrue:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  3437. args: ["aString", "aBlock"],
  3438. source: "confirm: aString ifTrue: aBlock\x0a\x09(HLConfirmation new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
  3439. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "actionBlock:", "yourself"],
  3440. referencedClasses: ["HLConfirmation"]
  3441. }),
  3442. smalltalk.HLManager);
  3443. smalltalk.addMethod(
  3444. smalltalk.method({
  3445. selector: "defaultEnvironment",
  3446. category: 'defaults',
  3447. fn: function (){
  3448. var self=this;
  3449. function $Environment(){return smalltalk.Environment||(typeof Environment=="undefined"?nil:Environment)}
  3450. return smalltalk.withContext(function($ctx1) {
  3451. var $1,$2,$3;
  3452. $1=_st(window)._parent();
  3453. if(($receiver = $1) == nil || $receiver == undefined){
  3454. $2=_st($Environment())._new();
  3455. return $2;
  3456. } else {
  3457. $1;
  3458. };
  3459. $3=_st(_st(_st(_st(window)._parent())._at_("smalltalk"))._at_("Environment"))._new();
  3460. return $3;
  3461. }, function($ctx1) {$ctx1.fill(self,"defaultEnvironment",{},smalltalk.HLManager)})},
  3462. args: [],
  3463. source: "defaultEnvironment\x0a\x09\x22If helios is loaded from within a frame, answer the parent window environment\x22\x0a\x09\x0a\x09window parent ifNil: [ ^ Environment new ].\x0a\x09\x0a\x09^ ((window parent at: 'smalltalk')\x0a\x09\x09at: 'Environment') new",
  3464. messageSends: ["ifNil:", "new", "parent", "at:"],
  3465. referencedClasses: ["Environment"]
  3466. }),
  3467. smalltalk.HLManager);
  3468. smalltalk.addMethod(
  3469. smalltalk.method({
  3470. selector: "environment",
  3471. category: 'accessing',
  3472. fn: function (){
  3473. var self=this;
  3474. return smalltalk.withContext(function($ctx1) {
  3475. var $2,$1;
  3476. $2=self["@environment"];
  3477. if(($receiver = $2) == nil || $receiver == undefined){
  3478. self["@environment"]=_st(self)._defaultEnvironment();
  3479. $1=self["@environment"];
  3480. } else {
  3481. $1=$2;
  3482. };
  3483. return $1;
  3484. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLManager)})},
  3485. args: [],
  3486. source: "environment\x0a\x09\x22The default environment used by all Helios objects\x22\x0a \x0a\x09^ environment ifNil: [ environment := self defaultEnvironment ]",
  3487. messageSends: ["ifNil:", "defaultEnvironment"],
  3488. referencedClasses: []
  3489. }),
  3490. smalltalk.HLManager);
  3491. smalltalk.addMethod(
  3492. smalltalk.method({
  3493. selector: "environment:",
  3494. category: 'accessing',
  3495. fn: function (anEnvironment){
  3496. var self=this;
  3497. return smalltalk.withContext(function($ctx1) {
  3498. self["@environment"]=anEnvironment;
  3499. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLManager)})},
  3500. args: ["anEnvironment"],
  3501. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  3502. messageSends: [],
  3503. referencedClasses: []
  3504. }),
  3505. smalltalk.HLManager);
  3506. smalltalk.addMethod(
  3507. smalltalk.method({
  3508. selector: "history",
  3509. category: 'accessing',
  3510. fn: function (){
  3511. var self=this;
  3512. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3513. return smalltalk.withContext(function($ctx1) {
  3514. var $2,$1;
  3515. $2=self["@history"];
  3516. if(($receiver = $2) == nil || $receiver == undefined){
  3517. self["@history"]=_st($OrderedCollection())._new();
  3518. $1=self["@history"];
  3519. } else {
  3520. $1=$2;
  3521. };
  3522. return $1;
  3523. }, function($ctx1) {$ctx1.fill(self,"history",{},smalltalk.HLManager)})},
  3524. args: [],
  3525. source: "history\x0a\x09^ history ifNil: [ history := OrderedCollection new ]",
  3526. messageSends: ["ifNil:", "new"],
  3527. referencedClasses: ["OrderedCollection"]
  3528. }),
  3529. smalltalk.HLManager);
  3530. smalltalk.addMethod(
  3531. smalltalk.method({
  3532. selector: "history:",
  3533. category: 'accessing',
  3534. fn: function (aCollection){
  3535. var self=this;
  3536. return smalltalk.withContext(function($ctx1) {
  3537. self["@history"]=aCollection;
  3538. return self}, function($ctx1) {$ctx1.fill(self,"history:",{aCollection:aCollection},smalltalk.HLManager)})},
  3539. args: ["aCollection"],
  3540. source: "history: aCollection\x0a\x09history := aCollection",
  3541. messageSends: [],
  3542. referencedClasses: []
  3543. }),
  3544. smalltalk.HLManager);
  3545. smalltalk.addMethod(
  3546. smalltalk.method({
  3547. selector: "initialize",
  3548. category: 'initialization',
  3549. fn: function (){
  3550. var self=this;
  3551. function $HLInspector(){return smalltalk.HLInspector||(typeof HLInspector=="undefined"?nil:HLInspector)}
  3552. function $HLErrorHandler(){return smalltalk.HLErrorHandler||(typeof HLErrorHandler=="undefined"?nil:HLErrorHandler)}
  3553. return smalltalk.withContext(function($ctx1) {
  3554. smalltalk.HLWidget.fn.prototype._initialize.apply(_st(self), []);
  3555. _st(self)._registerInspector_($HLInspector());
  3556. _st(self)._registerErrorHandler_($HLErrorHandler());
  3557. _st(_st(self)._keyBinder())._setupEvents();
  3558. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager)})},
  3559. args: [],
  3560. source: "initialize\x0a\x09super initialize.\x0a\x09self registerInspector: HLInspector.\x0a\x09self registerErrorHandler: HLErrorHandler.\x0a self keyBinder setupEvents",
  3561. messageSends: ["initialize", "registerInspector:", "registerErrorHandler:", "setupEvents", "keyBinder"],
  3562. referencedClasses: ["HLInspector", "HLErrorHandler"]
  3563. }),
  3564. smalltalk.HLManager);
  3565. smalltalk.addMethod(
  3566. smalltalk.method({
  3567. selector: "keyBinder",
  3568. category: 'accessing',
  3569. fn: function (){
  3570. var self=this;
  3571. function $HLKeyBinder(){return smalltalk.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
  3572. return smalltalk.withContext(function($ctx1) {
  3573. var $2,$1;
  3574. $2=self["@keyBinder"];
  3575. if(($receiver = $2) == nil || $receiver == undefined){
  3576. self["@keyBinder"]=_st($HLKeyBinder())._new();
  3577. $1=self["@keyBinder"];
  3578. } else {
  3579. $1=$2;
  3580. };
  3581. return $1;
  3582. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{},smalltalk.HLManager)})},
  3583. args: [],
  3584. source: "keyBinder\x0a\x09^ keyBinder ifNil: [ keyBinder := HLKeyBinder new ]",
  3585. messageSends: ["ifNil:", "new"],
  3586. referencedClasses: ["HLKeyBinder"]
  3587. }),
  3588. smalltalk.HLManager);
  3589. smalltalk.addMethod(
  3590. smalltalk.method({
  3591. selector: "refresh",
  3592. category: 'rendering',
  3593. fn: function (){
  3594. var self=this;
  3595. return smalltalk.withContext(function($ctx1) {
  3596. _st(_st(window)._jQuery_(".navbar"))._remove();
  3597. _st(self)._appendToJQuery_(_st("body")._asJQuery());
  3598. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLManager)})},
  3599. args: [],
  3600. source: "refresh\x0a\x09(window jQuery: '.navbar') remove.\x0a\x09self appendToJQuery: 'body' asJQuery",
  3601. messageSends: ["remove", "jQuery:", "appendToJQuery:", "asJQuery"],
  3602. referencedClasses: []
  3603. }),
  3604. smalltalk.HLManager);
  3605. smalltalk.addMethod(
  3606. smalltalk.method({
  3607. selector: "registerErrorHandler:",
  3608. category: 'actions',
  3609. fn: function (anErrorHandler){
  3610. var self=this;
  3611. return smalltalk.withContext(function($ctx1) {
  3612. _st(_st(self)._environment())._registerErrorHandler_(anErrorHandler);
  3613. return self}, function($ctx1) {$ctx1.fill(self,"registerErrorHandler:",{anErrorHandler:anErrorHandler},smalltalk.HLManager)})},
  3614. args: ["anErrorHandler"],
  3615. source: "registerErrorHandler: anErrorHandler\x0a\x09self environment registerErrorHandler: anErrorHandler",
  3616. messageSends: ["registerErrorHandler:", "environment"],
  3617. referencedClasses: []
  3618. }),
  3619. smalltalk.HLManager);
  3620. smalltalk.addMethod(
  3621. smalltalk.method({
  3622. selector: "registerInspector:",
  3623. category: 'actions',
  3624. fn: function (anInspector){
  3625. var self=this;
  3626. return smalltalk.withContext(function($ctx1) {
  3627. _st(_st(self)._environment())._registerInspector_(anInspector);
  3628. return self}, function($ctx1) {$ctx1.fill(self,"registerInspector:",{anInspector:anInspector},smalltalk.HLManager)})},
  3629. args: ["anInspector"],
  3630. source: "registerInspector: anInspector\x0a\x09self environment registerInspector: anInspector",
  3631. messageSends: ["registerInspector:", "environment"],
  3632. referencedClasses: []
  3633. }),
  3634. smalltalk.HLManager);
  3635. smalltalk.addMethod(
  3636. smalltalk.method({
  3637. selector: "removeActiveTab",
  3638. category: 'actions',
  3639. fn: function (){
  3640. var self=this;
  3641. return smalltalk.withContext(function($ctx1) {
  3642. _st(self)._removeTab_(_st(self)._activeTab());
  3643. return self}, function($ctx1) {$ctx1.fill(self,"removeActiveTab",{},smalltalk.HLManager)})},
  3644. args: [],
  3645. source: "removeActiveTab\x0a\x09self removeTab: self activeTab",
  3646. messageSends: ["removeTab:", "activeTab"],
  3647. referencedClasses: []
  3648. }),
  3649. smalltalk.HLManager);
  3650. smalltalk.addMethod(
  3651. smalltalk.method({
  3652. selector: "removeFromHistory:",
  3653. category: 'actions',
  3654. fn: function (aTab){
  3655. var self=this;
  3656. return smalltalk.withContext(function($ctx1) {
  3657. _st(self)._history_(_st(_st(self)._history())._reject_((function(each){
  3658. return smalltalk.withContext(function($ctx2) {
  3659. return _st(each).__eq_eq(aTab);
  3660. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})));
  3661. return self}, function($ctx1) {$ctx1.fill(self,"removeFromHistory:",{aTab:aTab},smalltalk.HLManager)})},
  3662. args: ["aTab"],
  3663. source: "removeFromHistory: aTab\x0a\x09self history: (self history reject: [ :each | each == aTab ])",
  3664. messageSends: ["history:", "reject:", "==", "history"],
  3665. referencedClasses: []
  3666. }),
  3667. smalltalk.HLManager);
  3668. smalltalk.addMethod(
  3669. smalltalk.method({
  3670. selector: "removeTab:",
  3671. category: 'actions',
  3672. fn: function (aTab){
  3673. var self=this;
  3674. return smalltalk.withContext(function($ctx1) {
  3675. var $1,$2;
  3676. $1=_st(_st(self)._tabs())._includes_(aTab);
  3677. if(! smalltalk.assert($1)){
  3678. $2=self;
  3679. return $2;
  3680. };
  3681. _st(self)._removeFromHistory_(aTab);
  3682. _st(_st(self)._tabs())._remove_(aTab);
  3683. _st(_st(self)._keyBinder())._flushBindings();
  3684. _st(aTab)._remove();
  3685. _st(self)._refresh();
  3686. _st(_st(self)._history())._ifNotEmpty_((function(){
  3687. return smalltalk.withContext(function($ctx2) {
  3688. return _st(_st(_st(self)._history())._last())._activate();
  3689. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3690. return self}, function($ctx1) {$ctx1.fill(self,"removeTab:",{aTab:aTab},smalltalk.HLManager)})},
  3691. args: ["aTab"],
  3692. source: "removeTab: aTab\x0a\x09(self tabs includes: aTab) ifFalse: [ ^ self ].\x0a\x0a\x09self removeFromHistory: aTab.\x0a\x09self tabs remove: aTab.\x0a\x09self keyBinder flushBindings.\x0a\x09aTab remove.\x0a\x09self refresh.\x0a\x09self history ifNotEmpty: [\x0a\x09\x09self history last activate ]",
  3693. messageSends: ["ifFalse:", "includes:", "tabs", "removeFromHistory:", "remove:", "flushBindings", "keyBinder", "remove", "refresh", "ifNotEmpty:", "activate", "last", "history"],
  3694. referencedClasses: []
  3695. }),
  3696. smalltalk.HLManager);
  3697. smalltalk.addMethod(
  3698. smalltalk.method({
  3699. selector: "renderAddOn:",
  3700. category: 'rendering',
  3701. fn: function (html){
  3702. var self=this;
  3703. function $HLWidget(){return smalltalk.HLWidget||(typeof HLWidget=="undefined"?nil:HLWidget)}
  3704. return smalltalk.withContext(function($ctx1) {
  3705. var $1,$3,$4,$5,$7,$8,$6,$2;
  3706. $1=_st(html)._li();
  3707. _st($1)._class_("dropdown");
  3708. $2=_st($1)._with_((function(){
  3709. return smalltalk.withContext(function($ctx2) {
  3710. $3=_st(html)._a();
  3711. _st($3)._class_("dropdown-toggle");
  3712. _st($3)._at_put_("data-toggle","dropdown");
  3713. $4=_st($3)._with_((function(){
  3714. return smalltalk.withContext(function($ctx3) {
  3715. _st(html)._with_("Open...");
  3716. return _st(_st(html)._tag_("b"))._class_("caret");
  3717. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  3718. $4;
  3719. $5=_st(html)._ul();
  3720. _st($5)._class_("dropdown-menu");
  3721. $6=_st($5)._with_((function(){
  3722. return smalltalk.withContext(function($ctx3) {
  3723. return _st(_st(_st(_st($HLWidget())._withAllSubclasses())._select_((function(each){
  3724. return smalltalk.withContext(function($ctx4) {
  3725. return _st(each)._canBeOpenAsTab();
  3726. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})})))._sorted_((function(a,b){
  3727. return smalltalk.withContext(function($ctx4) {
  3728. return _st(_st(a)._tabPriority()).__lt(_st(b)._tabPriority());
  3729. }, function($ctx4) {$ctx4.fillBlock({a:a,b:b},$ctx1)})})))._do_((function(each){
  3730. return smalltalk.withContext(function($ctx4) {
  3731. return _st(_st(html)._li())._with_((function(){
  3732. return smalltalk.withContext(function($ctx5) {
  3733. $7=_st(html)._a();
  3734. _st($7)._with_(_st(each)._tabLabel());
  3735. $8=_st($7)._onClick_((function(){
  3736. return smalltalk.withContext(function($ctx6) {
  3737. return _st(each)._openAsTab();
  3738. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  3739. return $8;
  3740. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  3741. }, function($ctx4) {$ctx4.fillBlock({each:each},$ctx1)})}));
  3742. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  3743. return $6;
  3744. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3745. return self}, function($ctx1) {$ctx1.fill(self,"renderAddOn:",{html:html},smalltalk.HLManager)})},
  3746. args: ["html"],
  3747. source: "renderAddOn: html\x0a html li \x0a \x09class: 'dropdown';\x0a with: [ \x0a\x09\x09\x09html a \x0a \x09\x09class: 'dropdown-toggle';\x0a \x09 \x09at: 'data-toggle' put: 'dropdown';\x0a \x09with: [ \x0a \x09\x09html with: 'Open...'.\x0a \x09\x09\x09\x09\x09(html tag: 'b') class: 'caret' ].\x0a html ul \x0a \x09\x09class: 'dropdown-menu';\x0a with: [\x0a \x09((HLWidget withAllSubclasses\x0a \x09select: [ :each | each canBeOpenAsTab ])\x0a sorted: [ :a :b | a tabPriority < b tabPriority ])\x0a do: [ :each |\x0a \x09\x09\x09\x09\x09\x09\x09html li with: [\x0a \x09\x09\x09html a \x0a \x09with: each tabLabel;\x0a \x09\x09\x09\x09\x09\x09\x09\x09onClick: [ each openAsTab ] ] ] ] ]",
  3748. messageSends: ["class:", "li", "with:", "a", "at:put:", "tag:", "ul", "do:", "tabLabel", "onClick:", "openAsTab", "sorted:", "<", "tabPriority", "select:", "canBeOpenAsTab", "withAllSubclasses"],
  3749. referencedClasses: ["HLWidget"]
  3750. }),
  3751. smalltalk.HLManager);
  3752. smalltalk.addMethod(
  3753. smalltalk.method({
  3754. selector: "renderContentOn:",
  3755. category: 'rendering',
  3756. fn: function (html){
  3757. var self=this;
  3758. return smalltalk.withContext(function($ctx1) {
  3759. var $1,$3,$4,$2;
  3760. $1=_st(html)._div();
  3761. _st($1)._class_("navbar navbar-fixed-top");
  3762. $2=_st($1)._with_((function(){
  3763. return smalltalk.withContext(function($ctx2) {
  3764. $3=_st(html)._div();
  3765. _st($3)._class_("navbar-inner");
  3766. $4=_st($3)._with_((function(){
  3767. return smalltalk.withContext(function($ctx3) {
  3768. return _st(self)._renderTabsOn_(html);
  3769. }, function($ctx3) {$ctx3.fillBlock({},$ctx1)})}));
  3770. return $4;
  3771. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3772. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLManager)})},
  3773. args: ["html"],
  3774. 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 ] ]",
  3775. messageSends: ["class:", "div", "with:", "renderTabsOn:"],
  3776. referencedClasses: []
  3777. }),
  3778. smalltalk.HLManager);
  3779. smalltalk.addMethod(
  3780. smalltalk.method({
  3781. selector: "renderTabsOn:",
  3782. category: 'rendering',
  3783. fn: function (html){
  3784. var self=this;
  3785. return smalltalk.withContext(function($ctx1) {
  3786. var $1,$3,$4,$6,$5,$8,$9,$10,$11,$7,$2;
  3787. $1=_st(html)._ul();
  3788. _st($1)._class_("nav");
  3789. $2=_st($1)._with_((function(){
  3790. return smalltalk.withContext(function($ctx2) {
  3791. _st(_st(self)._tabs())._do_((function(each){
  3792. return smalltalk.withContext(function($ctx3) {
  3793. $3=_st(html)._li();
  3794. $4=$3;
  3795. $6=_st(each)._isActive();
  3796. if(smalltalk.assert($6)){
  3797. $5="active";
  3798. } else {
  3799. $5="inactive";
  3800. };
  3801. _st($4)._class_($5);
  3802. $7=_st($3)._with_((function(){
  3803. return smalltalk.withContext(function($ctx4) {
  3804. $8=_st(html)._a();
  3805. _st($8)._with_((function(){
  3806. return smalltalk.withContext(function($ctx5) {
  3807. _st(_st(_st(html)._tag_("i"))._class_("close"))._onClick_((function(){
  3808. return smalltalk.withContext(function($ctx6) {
  3809. return _st(self)._removeTab_(each);
  3810. }, function($ctx6) {$ctx6.fillBlock({},$ctx1)})}));
  3811. $9=_st(html)._span();
  3812. _st($9)._class_(_st(each)._cssClass());
  3813. $10=_st($9)._with_(_st(each)._displayLabel());
  3814. return $10;
  3815. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  3816. $11=_st($8)._onClick_((function(){
  3817. return smalltalk.withContext(function($ctx5) {
  3818. return _st(each)._activate();
  3819. }, function($ctx5) {$ctx5.fillBlock({},$ctx1)})}));
  3820. return $11;
  3821. }, function($ctx4) {$ctx4.fillBlock({},$ctx1)})}));
  3822. return $7;
  3823. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  3824. return _st(self)._renderAddOn_(html);
  3825. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  3826. return self}, function($ctx1) {$ctx1.fill(self,"renderTabsOn:",{html:html},smalltalk.HLManager)})},
  3827. args: ["html"],
  3828. source: "renderTabsOn: html\x0a\x09html ul \x0a\x09\x09class: 'nav';\x0a\x09\x09with: [ \x0a \x09self tabs do: [ :each |\x0a\x09\x09\x09\x09html li \x0a\x09\x09\x09\x09\x09class: (each isActive ifTrue: [ 'active' ] ifFalse: [ 'inactive' ]);\x0a\x09\x09\x09\x09\x09with: [\x0a\x09\x09\x09\x09\x09\x09html a\x0a\x09\x09\x09\x09\x09\x09\x09with: [\x0a \x09\x09\x09\x09\x09\x09\x09((html tag: 'i') class: 'close')\x0a \x09\x09\x09\x09\x09\x09\x09\x09\x09onClick: [ self removeTab: each ].\x0a \x09html span \x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09class: each cssClass;\x0a\x09\x09\x09\x09\x09\x09\x09\x09\x09with: each displayLabel ];\x0a\x09\x09\x09\x09\x09\x09\x09onClick: [ each activate ] ] ].\x0a\x09\x09\x09self renderAddOn: html ]",
  3829. messageSends: ["class:", "ul", "with:", "do:", "ifTrue:ifFalse:", "isActive", "li", "onClick:", "removeTab:", "tag:", "cssClass", "span", "displayLabel", "a", "activate", "tabs", "renderAddOn:"],
  3830. referencedClasses: []
  3831. }),
  3832. smalltalk.HLManager);
  3833. smalltalk.addMethod(
  3834. smalltalk.method({
  3835. selector: "request:do:",
  3836. category: 'actions',
  3837. fn: function (aString,aBlock){
  3838. var self=this;
  3839. return smalltalk.withContext(function($ctx1) {
  3840. _st(self)._request_value_do_(aString,"",aBlock);
  3841. return self}, function($ctx1) {$ctx1.fill(self,"request:do:",{aString:aString,aBlock:aBlock},smalltalk.HLManager)})},
  3842. args: ["aString", "aBlock"],
  3843. source: "request: aString do: aBlock\x0a\x09self \x0a\x09\x09request: aString\x0a\x09\x09value: ''\x0a\x09\x09do: aBlock",
  3844. messageSends: ["request:value:do:"],
  3845. referencedClasses: []
  3846. }),
  3847. smalltalk.HLManager);
  3848. smalltalk.addMethod(
  3849. smalltalk.method({
  3850. selector: "request:value:do:",
  3851. category: 'actions',
  3852. fn: function (aString,valueString,aBlock){
  3853. var self=this;
  3854. function $HLRequest(){return smalltalk.HLRequest||(typeof HLRequest=="undefined"?nil:HLRequest)}
  3855. return smalltalk.withContext(function($ctx1) {
  3856. var $1,$2;
  3857. $1=_st($HLRequest())._new();
  3858. _st($1)._confirmationString_(aString);
  3859. _st($1)._actionBlock_(aBlock);
  3860. _st($1)._value_(valueString);
  3861. $2=_st($1)._yourself();
  3862. _st($2)._appendToJQuery_(_st("body")._asJQuery());
  3863. return self}, function($ctx1) {$ctx1.fill(self,"request:value:do:",{aString:aString,valueString:valueString,aBlock:aBlock},smalltalk.HLManager)})},
  3864. args: ["aString", "valueString", "aBlock"],
  3865. source: "request: aString value: valueString do: aBlock\x0a\x09(HLRequest new\x0a\x09\x09confirmationString: aString;\x0a\x09\x09actionBlock: aBlock;\x0a\x09\x09value: valueString;\x0a\x09\x09yourself)\x0a\x09\x09\x09appendToJQuery: 'body' asJQuery",
  3866. messageSends: ["appendToJQuery:", "asJQuery", "confirmationString:", "new", "actionBlock:", "value:", "yourself"],
  3867. referencedClasses: ["HLRequest"]
  3868. }),
  3869. smalltalk.HLManager);
  3870. smalltalk.addMethod(
  3871. smalltalk.method({
  3872. selector: "show:",
  3873. category: 'rendering',
  3874. fn: function (aTab){
  3875. var self=this;
  3876. return smalltalk.withContext(function($ctx1) {
  3877. var $1,$2;
  3878. _st(_st(self)._tabs())._do_((function(each){
  3879. return smalltalk.withContext(function($ctx2) {
  3880. return _st(each)._hide();
  3881. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  3882. $1=aTab;
  3883. _st($1)._show();
  3884. $2=_st($1)._focus();
  3885. return self}, function($ctx1) {$ctx1.fill(self,"show:",{aTab:aTab},smalltalk.HLManager)})},
  3886. args: ["aTab"],
  3887. source: "show: aTab\x0a\x09self tabs do: [ :each | each hide ].\x0a\x09aTab show; focus",
  3888. messageSends: ["do:", "hide", "tabs", "show", "focus"],
  3889. referencedClasses: []
  3890. }),
  3891. smalltalk.HLManager);
  3892. smalltalk.addMethod(
  3893. smalltalk.method({
  3894. selector: "tabs",
  3895. category: 'accessing',
  3896. fn: function (){
  3897. var self=this;
  3898. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  3899. return smalltalk.withContext(function($ctx1) {
  3900. var $2,$1;
  3901. $2=self["@tabs"];
  3902. if(($receiver = $2) == nil || $receiver == undefined){
  3903. self["@tabs"]=_st($OrderedCollection())._new();
  3904. $1=self["@tabs"];
  3905. } else {
  3906. $1=$2;
  3907. };
  3908. return $1;
  3909. }, function($ctx1) {$ctx1.fill(self,"tabs",{},smalltalk.HLManager)})},
  3910. args: [],
  3911. source: "tabs\x0a\x09^ tabs ifNil: [ tabs := OrderedCollection new ]",
  3912. messageSends: ["ifNil:", "new"],
  3913. referencedClasses: ["OrderedCollection"]
  3914. }),
  3915. smalltalk.HLManager);
  3916. smalltalk.HLManager.klass.iVarNames = ['current'];
  3917. smalltalk.addMethod(
  3918. smalltalk.method({
  3919. selector: "current",
  3920. category: 'accessing',
  3921. fn: function (){
  3922. var self=this;
  3923. return smalltalk.withContext(function($ctx1) {
  3924. var $2,$1;
  3925. $2=self["@current"];
  3926. if(($receiver = $2) == nil || $receiver == undefined){
  3927. self["@current"]=_st(_st(self)._basicNew())._initialize();
  3928. $1=self["@current"];
  3929. } else {
  3930. $1=$2;
  3931. };
  3932. return $1;
  3933. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.HLManager.klass)})},
  3934. args: [],
  3935. source: "current\x0a\x09^ current ifNil: [ current := self basicNew initialize ]",
  3936. messageSends: ["ifNil:", "initialize", "basicNew"],
  3937. referencedClasses: []
  3938. }),
  3939. smalltalk.HLManager.klass);
  3940. smalltalk.addMethod(
  3941. smalltalk.method({
  3942. selector: "initialize",
  3943. category: 'initialization',
  3944. fn: function (){
  3945. var self=this;
  3946. return smalltalk.withContext(function($ctx1) {
  3947. _st(_st(self)._current())._appendToJQuery_(_st("body")._asJQuery());
  3948. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLManager.klass)})},
  3949. args: [],
  3950. source: "initialize\x0a\x09self current appendToJQuery: 'body' asJQuery",
  3951. messageSends: ["appendToJQuery:", "asJQuery", "current"],
  3952. referencedClasses: []
  3953. }),
  3954. smalltalk.HLManager.klass);
  3955. smalltalk.addMethod(
  3956. smalltalk.method({
  3957. selector: "new",
  3958. category: 'instance creation',
  3959. fn: function (){
  3960. var self=this;
  3961. return smalltalk.withContext(function($ctx1) {
  3962. _st(self)._shouldNotImplement();
  3963. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.HLManager.klass)})},
  3964. args: [],
  3965. source: "new\x0a\x09\x22Use current instead\x22\x0a\x0a\x09self shouldNotImplement",
  3966. messageSends: ["shouldNotImplement"],
  3967. referencedClasses: []
  3968. }),
  3969. smalltalk.HLManager.klass);
  3970. smalltalk.addClass('HLSUnit', smalltalk.HLWidget, [], 'Helios-Core');
  3971. smalltalk.addMethod(
  3972. smalltalk.method({
  3973. selector: "canBeOpenAsTab",
  3974. category: 'testing',
  3975. fn: function (){
  3976. var self=this;
  3977. return smalltalk.withContext(function($ctx1) {
  3978. return true;
  3979. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSUnit.klass)})},
  3980. args: [],
  3981. source: "canBeOpenAsTab\x0a\x09^ true",
  3982. messageSends: [],
  3983. referencedClasses: []
  3984. }),
  3985. smalltalk.HLSUnit.klass);
  3986. smalltalk.addMethod(
  3987. smalltalk.method({
  3988. selector: "tabClass",
  3989. category: 'accessing',
  3990. fn: function (){
  3991. var self=this;
  3992. return smalltalk.withContext(function($ctx1) {
  3993. return "sunit";
  3994. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLSUnit.klass)})},
  3995. args: [],
  3996. source: "tabClass\x0a\x09^ 'sunit'",
  3997. messageSends: [],
  3998. referencedClasses: []
  3999. }),
  4000. smalltalk.HLSUnit.klass);
  4001. smalltalk.addMethod(
  4002. smalltalk.method({
  4003. selector: "tabLabel",
  4004. category: 'accessing',
  4005. fn: function (){
  4006. var self=this;
  4007. return smalltalk.withContext(function($ctx1) {
  4008. return "SUnit";
  4009. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLSUnit.klass)})},
  4010. args: [],
  4011. source: "tabLabel\x0a\x09^ 'SUnit'",
  4012. messageSends: [],
  4013. referencedClasses: []
  4014. }),
  4015. smalltalk.HLSUnit.klass);
  4016. smalltalk.addMethod(
  4017. smalltalk.method({
  4018. selector: "tabPriority",
  4019. category: 'accessing',
  4020. fn: function (){
  4021. var self=this;
  4022. return smalltalk.withContext(function($ctx1) {
  4023. var $1;
  4024. $1=(1000);
  4025. return $1;
  4026. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLSUnit.klass)})},
  4027. args: [],
  4028. source: "tabPriority\x0a\x09^ 1000",
  4029. messageSends: [],
  4030. referencedClasses: []
  4031. }),
  4032. smalltalk.HLSUnit.klass);