Helios-Core.js 142 KB

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