Helios-KeyBindings.js 79 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358
  1. define("amber_core/Helios-KeyBindings", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects", "amber_core/Helios-Core"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Helios-KeyBindings');
  3. smalltalk.packages["Helios-KeyBindings"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('HLBinding', smalltalk.Object, ['key', 'label'], 'Helios-KeyBindings');
  5. smalltalk.HLBinding.comment="I am the abstract representation of a keybinding in Helios. My instances hold a key (integer value) and a label. \x0a\x0aBindings are built into a tree of keys, so pressing a key may result in more key choices (for example, to open a workspace, 'o' is pressed first then 'w' is pressed).\x0a\x0aBinding action handling and selection is handled by the `current` instance of `HLKeyBinder`.\x0a\x0aSubclasses implement specific behavior like evaluating actions or (sub-)grouping other bindings.";
  6. smalltalk.addMethod(
  7. smalltalk.method({
  8. selector: "apply",
  9. category: 'actions',
  10. fn: function (){
  11. var self=this;
  12. return smalltalk.withContext(function($ctx1) {
  13. return self}, function($ctx1) {$ctx1.fill(self,"apply",{},smalltalk.HLBinding)})},
  14. args: [],
  15. source: "apply",
  16. messageSends: [],
  17. referencedClasses: []
  18. }),
  19. smalltalk.HLBinding);
  20. smalltalk.addMethod(
  21. smalltalk.method({
  22. selector: "atKey:",
  23. category: 'accessing',
  24. fn: function (aKey){
  25. var self=this;
  26. return smalltalk.withContext(function($ctx1) {
  27. return nil;
  28. }, function($ctx1) {$ctx1.fill(self,"atKey:",{aKey:aKey},smalltalk.HLBinding)})},
  29. args: ["aKey"],
  30. source: "atKey: aKey\x0a\x09\x22Answer the sub-binding at key aKey.\x0a\x09Always answer nil here. See HLBindingGroup for more.\x22\x0a\x09\x0a\x09^ nil",
  31. messageSends: [],
  32. referencedClasses: []
  33. }),
  34. smalltalk.HLBinding);
  35. smalltalk.addMethod(
  36. smalltalk.method({
  37. selector: "displayLabel",
  38. category: 'accessing',
  39. fn: function (){
  40. var self=this;
  41. return smalltalk.withContext(function($ctx1) {
  42. var $1;
  43. $1=self._label();
  44. return $1;
  45. }, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLBinding)})},
  46. args: [],
  47. source: "displayLabel\x0a\x09^ self label",
  48. messageSends: ["label"],
  49. referencedClasses: []
  50. }),
  51. smalltalk.HLBinding);
  52. smalltalk.addMethod(
  53. smalltalk.method({
  54. selector: "isActive",
  55. category: 'testing',
  56. fn: function (){
  57. var self=this;
  58. return smalltalk.withContext(function($ctx1) {
  59. var $1;
  60. $1=self._subclassResponsibility();
  61. return $1;
  62. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBinding)})},
  63. args: [],
  64. source: "isActive\x0a\x09^ self subclassResponsibility",
  65. messageSends: ["subclassResponsibility"],
  66. referencedClasses: []
  67. }),
  68. smalltalk.HLBinding);
  69. smalltalk.addMethod(
  70. smalltalk.method({
  71. selector: "key",
  72. category: 'accessing',
  73. fn: function (){
  74. var self=this;
  75. return smalltalk.withContext(function($ctx1) {
  76. var $1;
  77. $1=self["@key"];
  78. return $1;
  79. }, function($ctx1) {$ctx1.fill(self,"key",{},smalltalk.HLBinding)})},
  80. args: [],
  81. source: "key\x0a\x09^ key",
  82. messageSends: [],
  83. referencedClasses: []
  84. }),
  85. smalltalk.HLBinding);
  86. smalltalk.addMethod(
  87. smalltalk.method({
  88. selector: "key:",
  89. category: 'accessing',
  90. fn: function (anInteger){
  91. var self=this;
  92. return smalltalk.withContext(function($ctx1) {
  93. self["@key"]=anInteger;
  94. return self}, function($ctx1) {$ctx1.fill(self,"key:",{anInteger:anInteger},smalltalk.HLBinding)})},
  95. args: ["anInteger"],
  96. source: "key: anInteger\x0a\x09key := anInteger",
  97. messageSends: [],
  98. referencedClasses: []
  99. }),
  100. smalltalk.HLBinding);
  101. smalltalk.addMethod(
  102. smalltalk.method({
  103. selector: "label",
  104. category: 'accessing',
  105. fn: function (){
  106. var self=this;
  107. return smalltalk.withContext(function($ctx1) {
  108. var $1;
  109. $1=self["@label"];
  110. return $1;
  111. }, function($ctx1) {$ctx1.fill(self,"label",{},smalltalk.HLBinding)})},
  112. args: [],
  113. source: "label\x0a\x09^ label",
  114. messageSends: [],
  115. referencedClasses: []
  116. }),
  117. smalltalk.HLBinding);
  118. smalltalk.addMethod(
  119. smalltalk.method({
  120. selector: "label:",
  121. category: 'accessing',
  122. fn: function (aString){
  123. var self=this;
  124. return smalltalk.withContext(function($ctx1) {
  125. self["@label"]=aString;
  126. return self}, function($ctx1) {$ctx1.fill(self,"label:",{aString:aString},smalltalk.HLBinding)})},
  127. args: ["aString"],
  128. source: "label: aString\x0a\x09label := aString",
  129. messageSends: [],
  130. referencedClasses: []
  131. }),
  132. smalltalk.HLBinding);
  133. smalltalk.addMethod(
  134. smalltalk.method({
  135. selector: "release",
  136. category: 'actions',
  137. fn: function (){
  138. var self=this;
  139. return smalltalk.withContext(function($ctx1) {
  140. return self}, function($ctx1) {$ctx1.fill(self,"release",{},smalltalk.HLBinding)})},
  141. args: [],
  142. source: "release",
  143. messageSends: [],
  144. referencedClasses: []
  145. }),
  146. smalltalk.HLBinding);
  147. smalltalk.addMethod(
  148. smalltalk.method({
  149. selector: "renderOn:html:",
  150. category: 'rendering',
  151. fn: function (aBindingHelper,html){
  152. var self=this;
  153. return smalltalk.withContext(function($ctx1) {
  154. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:html:",{aBindingHelper:aBindingHelper,html:html},smalltalk.HLBinding)})},
  155. args: ["aBindingHelper", "html"],
  156. source: "renderOn: aBindingHelper html: html",
  157. messageSends: [],
  158. referencedClasses: []
  159. }),
  160. smalltalk.HLBinding);
  161. smalltalk.addMethod(
  162. smalltalk.method({
  163. selector: "shortcut",
  164. category: 'accessing',
  165. fn: function (){
  166. var self=this;
  167. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  168. return smalltalk.withContext(function($ctx1) {
  169. var $1;
  170. $1=_st($String())._fromCharCode_(self._key());
  171. return $1;
  172. }, function($ctx1) {$ctx1.fill(self,"shortcut",{},smalltalk.HLBinding)})},
  173. args: [],
  174. source: "shortcut\x0a\x09^ String fromCharCode: self key",
  175. messageSends: ["fromCharCode:", "key"],
  176. referencedClasses: ["String"]
  177. }),
  178. smalltalk.HLBinding);
  179. smalltalk.addMethod(
  180. smalltalk.method({
  181. selector: "on:labelled:",
  182. category: 'instance creation',
  183. fn: function (anInteger,aString){
  184. var self=this;
  185. return smalltalk.withContext(function($ctx1) {
  186. var $2,$3,$1;
  187. $2=self._new();
  188. _st($2)._key_(anInteger);
  189. _st($2)._label_(aString);
  190. $3=_st($2)._yourself();
  191. $1=$3;
  192. return $1;
  193. }, function($ctx1) {$ctx1.fill(self,"on:labelled:",{anInteger:anInteger,aString:aString},smalltalk.HLBinding.klass)})},
  194. args: ["anInteger", "aString"],
  195. source: "on: anInteger labelled: aString\x0a\x09^ self new\x0a \x09key: anInteger;\x0a label: aString;\x0a yourself",
  196. messageSends: ["key:", "new", "label:", "yourself"],
  197. referencedClasses: []
  198. }),
  199. smalltalk.HLBinding.klass);
  200. smalltalk.addClass('HLBindingAction', smalltalk.HLBinding, ['command'], 'Helios-KeyBindings');
  201. smalltalk.HLBindingAction.comment="My instances are the leafs of the binding tree. They evaluate actions through commands, instances of concrete subclasses of `HLCommand`.\x0a\x0aThe `#apply` methods is used to evaluate the `command`. If the command requires user input, an `inputWidget` will be displayed to the user.";
  202. smalltalk.addMethod(
  203. smalltalk.method({
  204. selector: "apply",
  205. category: 'actions',
  206. fn: function (){
  207. var self=this;
  208. function $HLKeyBinder(){return smalltalk.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
  209. return smalltalk.withContext(function($ctx1) {
  210. var $1;
  211. $1=_st(self._command())._isInputRequired();
  212. if(smalltalk.assert($1)){
  213. _st(_st(_st($HLKeyBinder())._current())._helper())._showWidget_(self._inputWidget());
  214. } else {
  215. self._executeCommand();
  216. };
  217. return self}, function($ctx1) {$ctx1.fill(self,"apply",{},smalltalk.HLBindingAction)})},
  218. args: [],
  219. source: "apply\x0a\x09self command isInputRequired\x0a\x09\x09ifTrue: [ HLKeyBinder current helper showWidget: self inputWidget ]\x0a\x09\x09ifFalse: [ self executeCommand ]",
  220. messageSends: ["ifTrue:ifFalse:", "isInputRequired", "command", "showWidget:", "helper", "current", "inputWidget", "executeCommand"],
  221. referencedClasses: ["HLKeyBinder"]
  222. }),
  223. smalltalk.HLBindingAction);
  224. smalltalk.addMethod(
  225. smalltalk.method({
  226. selector: "command",
  227. category: 'accessing',
  228. fn: function (){
  229. var self=this;
  230. return smalltalk.withContext(function($ctx1) {
  231. var $1;
  232. $1=self["@command"];
  233. return $1;
  234. }, function($ctx1) {$ctx1.fill(self,"command",{},smalltalk.HLBindingAction)})},
  235. args: [],
  236. source: "command\x0a\x09^ command",
  237. messageSends: [],
  238. referencedClasses: []
  239. }),
  240. smalltalk.HLBindingAction);
  241. smalltalk.addMethod(
  242. smalltalk.method({
  243. selector: "command:",
  244. category: 'accessing',
  245. fn: function (aCommand){
  246. var self=this;
  247. return smalltalk.withContext(function($ctx1) {
  248. self["@command"]=aCommand;
  249. return self}, function($ctx1) {$ctx1.fill(self,"command:",{aCommand:aCommand},smalltalk.HLBindingAction)})},
  250. args: ["aCommand"],
  251. source: "command: aCommand\x0a\x09command := aCommand",
  252. messageSends: [],
  253. referencedClasses: []
  254. }),
  255. smalltalk.HLBindingAction);
  256. smalltalk.addMethod(
  257. smalltalk.method({
  258. selector: "executeCommand",
  259. category: 'actions',
  260. fn: function (){
  261. var self=this;
  262. function $HLKeyBinder(){return smalltalk.HLKeyBinder||(typeof HLKeyBinder=="undefined"?nil:HLKeyBinder)}
  263. return smalltalk.withContext(function($ctx1) {
  264. _st(self._command())._execute();
  265. _st(_st($HLKeyBinder())._current())._deactivate();
  266. return self}, function($ctx1) {$ctx1.fill(self,"executeCommand",{},smalltalk.HLBindingAction)})},
  267. args: [],
  268. source: "executeCommand\x0a\x09self command execute.\x0a\x09HLKeyBinder current deactivate",
  269. messageSends: ["execute", "command", "deactivate", "current"],
  270. referencedClasses: ["HLKeyBinder"]
  271. }),
  272. smalltalk.HLBindingAction);
  273. smalltalk.addMethod(
  274. smalltalk.method({
  275. selector: "input:",
  276. category: 'accessing',
  277. fn: function (aString){
  278. var self=this;
  279. return smalltalk.withContext(function($ctx1) {
  280. _st(self._command())._input_(aString);
  281. return self}, function($ctx1) {$ctx1.fill(self,"input:",{aString:aString},smalltalk.HLBindingAction)})},
  282. args: ["aString"],
  283. source: "input: aString\x0a\x09self command input: aString",
  284. messageSends: ["input:", "command"],
  285. referencedClasses: []
  286. }),
  287. smalltalk.HLBindingAction);
  288. smalltalk.addMethod(
  289. smalltalk.method({
  290. selector: "inputBinding",
  291. category: 'accessing',
  292. fn: function (){
  293. var self=this;
  294. function $HLBindingInput(){return smalltalk.HLBindingInput||(typeof HLBindingInput=="undefined"?nil:HLBindingInput)}
  295. return smalltalk.withContext(function($ctx1) {
  296. var $2,$3,$5,$4,$6,$8,$7,$9,$11,$10,$12,$14,$13,$15,$16,$17,$1;
  297. $2=_st($HLBindingInput())._new();
  298. $3=$2;
  299. $5=self._command();
  300. $ctx1.sendIdx["command"]=1;
  301. $4=_st($5)._inputLabel();
  302. _st($3)._label_($4);
  303. $6=$2;
  304. $8=self._command();
  305. $ctx1.sendIdx["command"]=2;
  306. $7=_st($8)._displayLabel();
  307. _st($6)._ghostText_($7);
  308. $9=$2;
  309. $11=self._command();
  310. $ctx1.sendIdx["command"]=3;
  311. $10=_st($11)._defaultInput();
  312. _st($9)._defaultValue_($10);
  313. $12=$2;
  314. $14=self._command();
  315. $ctx1.sendIdx["command"]=4;
  316. $13=_st($14)._inputCompletion();
  317. _st($12)._inputCompletion_($13);
  318. _st($2)._callback_((function(val){
  319. return smalltalk.withContext(function($ctx2) {
  320. $15=self._command();
  321. _st($15)._input_(val);
  322. $16=_st($15)._execute();
  323. return $16;
  324. }, function($ctx2) {$ctx2.fillBlock({val:val},$ctx1,1)})}));
  325. $17=_st($2)._yourself();
  326. $1=$17;
  327. return $1;
  328. }, function($ctx1) {$ctx1.fill(self,"inputBinding",{},smalltalk.HLBindingAction)})},
  329. args: [],
  330. source: "inputBinding\x0a\x09^ HLBindingInput new\x0a\x09\x09label: self command inputLabel;\x0a\x09\x09ghostText: self command displayLabel;\x0a\x09\x09defaultValue: self command defaultInput;\x0a\x09\x09inputCompletion: self command inputCompletion;\x0a\x09\x09callback: [ :val | \x0a\x09\x09\x09self command \x0a\x09\x09\x09\x09input: val;\x0a\x09\x09\x09\x09execute ];\x0a\x09\x09yourself",
  331. messageSends: ["label:", "new", "inputLabel", "command", "ghostText:", "displayLabel", "defaultValue:", "defaultInput", "inputCompletion:", "inputCompletion", "callback:", "input:", "execute", "yourself"],
  332. referencedClasses: ["HLBindingInput"]
  333. }),
  334. smalltalk.HLBindingAction);
  335. smalltalk.addMethod(
  336. smalltalk.method({
  337. selector: "inputWidget",
  338. category: 'accessing',
  339. fn: function (){
  340. var self=this;
  341. function $HLBindingActionInputWidget(){return smalltalk.HLBindingActionInputWidget||(typeof HLBindingActionInputWidget=="undefined"?nil:HLBindingActionInputWidget)}
  342. return smalltalk.withContext(function($ctx1) {
  343. var $2,$3,$5,$4,$6,$8,$7,$9,$11,$10,$12,$13,$1;
  344. $2=_st($HLBindingActionInputWidget())._new();
  345. $3=$2;
  346. $5=self._command();
  347. $ctx1.sendIdx["command"]=1;
  348. $4=_st($5)._displayLabel();
  349. _st($3)._ghostText_($4);
  350. $6=$2;
  351. $8=self._command();
  352. $ctx1.sendIdx["command"]=2;
  353. $7=_st($8)._defaultInput();
  354. _st($6)._defaultValue_($7);
  355. $9=$2;
  356. $11=self._command();
  357. $10=_st($11)._inputCompletion();
  358. _st($9)._inputCompletion_($10);
  359. _st($2)._callback_((function(value){
  360. return smalltalk.withContext(function($ctx2) {
  361. self._input_(value);
  362. $12=self._executeCommand();
  363. return $12;
  364. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1,1)})}));
  365. $13=_st($2)._yourself();
  366. $1=$13;
  367. return $1;
  368. }, function($ctx1) {$ctx1.fill(self,"inputWidget",{},smalltalk.HLBindingAction)})},
  369. args: [],
  370. source: "inputWidget\x0a\x09^ HLBindingActionInputWidget new\x0a\x09\x09ghostText: self command displayLabel;\x0a\x09\x09defaultValue: self command defaultInput;\x0a\x09\x09inputCompletion: self command inputCompletion;\x0a\x09\x09callback: [ :value | \x0a\x09\x09\x09self \x0a\x09\x09\x09\x09input: value;\x0a\x09\x09\x09\x09executeCommand ];\x0a\x09\x09yourself",
  371. messageSends: ["ghostText:", "new", "displayLabel", "command", "defaultValue:", "defaultInput", "inputCompletion:", "inputCompletion", "callback:", "input:", "executeCommand", "yourself"],
  372. referencedClasses: ["HLBindingActionInputWidget"]
  373. }),
  374. smalltalk.HLBindingAction);
  375. smalltalk.addMethod(
  376. smalltalk.method({
  377. selector: "isActive",
  378. category: 'testing',
  379. fn: function (){
  380. var self=this;
  381. return smalltalk.withContext(function($ctx1) {
  382. var $1;
  383. $1=_st(self._command())._isActive();
  384. return $1;
  385. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBindingAction)})},
  386. args: [],
  387. source: "isActive\x0a\x09^ self command isActive",
  388. messageSends: ["isActive", "command"],
  389. referencedClasses: []
  390. }),
  391. smalltalk.HLBindingAction);
  392. smalltalk.addClass('HLBindingGroup', smalltalk.HLBinding, ['bindings'], 'Helios-KeyBindings');
  393. smalltalk.HLBindingGroup.comment="My instances hold other bindings, either actions or groups, and do not have actions by themselves.\x0a\x0aChildren are accessed with `atKey:` and added with the `add*` methods.";
  394. smalltalk.addMethod(
  395. smalltalk.method({
  396. selector: "activeBindings",
  397. category: 'accessing',
  398. fn: function (){
  399. var self=this;
  400. return smalltalk.withContext(function($ctx1) {
  401. var $1;
  402. $1=_st(self._bindings())._select_((function(each){
  403. return smalltalk.withContext(function($ctx2) {
  404. return _st(each)._isActive();
  405. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  406. return $1;
  407. }, function($ctx1) {$ctx1.fill(self,"activeBindings",{},smalltalk.HLBindingGroup)})},
  408. args: [],
  409. source: "activeBindings\x0a\x09^ self bindings select: [ :each | each isActive ]",
  410. messageSends: ["select:", "bindings", "isActive"],
  411. referencedClasses: []
  412. }),
  413. smalltalk.HLBindingGroup);
  414. smalltalk.addMethod(
  415. smalltalk.method({
  416. selector: "add:",
  417. category: 'adding',
  418. fn: function (aBinding){
  419. var self=this;
  420. return smalltalk.withContext(function($ctx1) {
  421. var $1;
  422. $1=_st(self._bindings())._add_(aBinding);
  423. return $1;
  424. }, function($ctx1) {$ctx1.fill(self,"add:",{aBinding:aBinding},smalltalk.HLBindingGroup)})},
  425. args: ["aBinding"],
  426. source: "add: aBinding\x0a\x09^ self bindings add: aBinding",
  427. messageSends: ["add:", "bindings"],
  428. referencedClasses: []
  429. }),
  430. smalltalk.HLBindingGroup);
  431. smalltalk.addMethod(
  432. smalltalk.method({
  433. selector: "addActionKey:labelled:callback:",
  434. category: 'adding',
  435. fn: function (anInteger,aString,aBlock){
  436. var self=this;
  437. function $HLBindingAction(){return smalltalk.HLBindingAction||(typeof HLBindingAction=="undefined"?nil:HLBindingAction)}
  438. return smalltalk.withContext(function($ctx1) {
  439. var $1,$2;
  440. $1=_st($HLBindingAction())._on_labelled_(anInteger,aString);
  441. _st($1)._callback_(aBlock);
  442. $2=_st($1)._yourself();
  443. self._add_($2);
  444. return self}, function($ctx1) {$ctx1.fill(self,"addActionKey:labelled:callback:",{anInteger:anInteger,aString:aString,aBlock:aBlock},smalltalk.HLBindingGroup)})},
  445. args: ["anInteger", "aString", "aBlock"],
  446. source: "addActionKey: anInteger labelled: aString callback: aBlock\x0a\x09self add: ((HLBindingAction on: anInteger labelled: aString)\x0a \x09callback: aBlock;\x0a yourself)",
  447. messageSends: ["add:", "callback:", "on:labelled:", "yourself"],
  448. referencedClasses: ["HLBindingAction"]
  449. }),
  450. smalltalk.HLBindingGroup);
  451. smalltalk.addMethod(
  452. smalltalk.method({
  453. selector: "addGroupKey:labelled:",
  454. category: 'add',
  455. fn: function (anInteger,aString){
  456. var self=this;
  457. function $HLBindingGroup(){return smalltalk.HLBindingGroup||(typeof HLBindingGroup=="undefined"?nil:HLBindingGroup)}
  458. return smalltalk.withContext(function($ctx1) {
  459. self._add_(_st($HLBindingGroup())._on_labelled_(anInteger,aString));
  460. return self}, function($ctx1) {$ctx1.fill(self,"addGroupKey:labelled:",{anInteger:anInteger,aString:aString},smalltalk.HLBindingGroup)})},
  461. args: ["anInteger", "aString"],
  462. source: "addGroupKey: anInteger labelled: aString\x0a\x09self add: (HLBindingGroup on: anInteger labelled: aString)",
  463. messageSends: ["add:", "on:labelled:"],
  464. referencedClasses: ["HLBindingGroup"]
  465. }),
  466. smalltalk.HLBindingGroup);
  467. smalltalk.addMethod(
  468. smalltalk.method({
  469. selector: "at:",
  470. category: 'accessing',
  471. fn: function (aString){
  472. var self=this;
  473. return smalltalk.withContext(function($ctx1) {
  474. var $1;
  475. $1=_st(self._bindings())._detect_ifNone_((function(each){
  476. return smalltalk.withContext(function($ctx2) {
  477. return _st(_st(each)._label()).__eq(aString);
  478. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
  479. return smalltalk.withContext(function($ctx2) {
  480. return nil;
  481. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  482. return $1;
  483. }, function($ctx1) {$ctx1.fill(self,"at:",{aString:aString},smalltalk.HLBindingGroup)})},
  484. args: ["aString"],
  485. source: "at: aString\x0a\x09^ self bindings \x0a \x09detect: [ :each | each label = aString ]\x0a \x09ifNone: [ nil ]",
  486. messageSends: ["detect:ifNone:", "bindings", "=", "label"],
  487. referencedClasses: []
  488. }),
  489. smalltalk.HLBindingGroup);
  490. smalltalk.addMethod(
  491. smalltalk.method({
  492. selector: "at:add:",
  493. category: 'accessing',
  494. fn: function (aString,aBinding){
  495. var self=this;
  496. var binding;
  497. return smalltalk.withContext(function($ctx1) {
  498. var $1;
  499. binding=self._at_(aString);
  500. $1=binding;
  501. if(($receiver = $1) == nil || $receiver == null){
  502. return self;
  503. } else {
  504. $1;
  505. };
  506. _st(binding)._add_(aBinding);
  507. return self}, function($ctx1) {$ctx1.fill(self,"at:add:",{aString:aString,aBinding:aBinding,binding:binding},smalltalk.HLBindingGroup)})},
  508. args: ["aString", "aBinding"],
  509. source: "at: aString add: aBinding\x0a\x09| binding |\x0a\x09\x0a\x09binding := self at: aString.\x0a\x09binding ifNil: [ ^ self ].\x0a\x09\x09\x0a\x09binding add: aBinding",
  510. messageSends: ["at:", "ifNil:", "add:"],
  511. referencedClasses: []
  512. }),
  513. smalltalk.HLBindingGroup);
  514. smalltalk.addMethod(
  515. smalltalk.method({
  516. selector: "atKey:",
  517. category: 'accessing',
  518. fn: function (anInteger){
  519. var self=this;
  520. return smalltalk.withContext(function($ctx1) {
  521. var $1;
  522. $1=_st(self._bindings())._detect_ifNone_((function(each){
  523. return smalltalk.withContext(function($ctx2) {
  524. return _st(_st(each)._key()).__eq(anInteger);
  525. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}),(function(){
  526. return smalltalk.withContext(function($ctx2) {
  527. return nil;
  528. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  529. return $1;
  530. }, function($ctx1) {$ctx1.fill(self,"atKey:",{anInteger:anInteger},smalltalk.HLBindingGroup)})},
  531. args: ["anInteger"],
  532. source: "atKey: anInteger\x0a\x09^ self bindings \x0a \x09detect: [ :each | each key = anInteger ]\x0a \x09ifNone: [ nil ]",
  533. messageSends: ["detect:ifNone:", "bindings", "=", "key"],
  534. referencedClasses: []
  535. }),
  536. smalltalk.HLBindingGroup);
  537. smalltalk.addMethod(
  538. smalltalk.method({
  539. selector: "bindings",
  540. category: 'accessing',
  541. fn: function (){
  542. var self=this;
  543. function $OrderedCollection(){return smalltalk.OrderedCollection||(typeof OrderedCollection=="undefined"?nil:OrderedCollection)}
  544. return smalltalk.withContext(function($ctx1) {
  545. var $2,$1;
  546. $2=self["@bindings"];
  547. if(($receiver = $2) == nil || $receiver == null){
  548. self["@bindings"]=_st($OrderedCollection())._new();
  549. $1=self["@bindings"];
  550. } else {
  551. $1=$2;
  552. };
  553. return $1;
  554. }, function($ctx1) {$ctx1.fill(self,"bindings",{},smalltalk.HLBindingGroup)})},
  555. args: [],
  556. source: "bindings\x0a\x09^ bindings ifNil: [ bindings := OrderedCollection new ]",
  557. messageSends: ["ifNil:", "new"],
  558. referencedClasses: ["OrderedCollection"]
  559. }),
  560. smalltalk.HLBindingGroup);
  561. smalltalk.addMethod(
  562. smalltalk.method({
  563. selector: "displayLabel",
  564. category: 'accessing',
  565. fn: function (){
  566. var self=this;
  567. return smalltalk.withContext(function($ctx1) {
  568. var $1;
  569. $1=_st(smalltalk.HLBindingGroup.superclass.fn.prototype._displayLabel.apply(_st(self), [])).__comma("...");
  570. return $1;
  571. }, function($ctx1) {$ctx1.fill(self,"displayLabel",{},smalltalk.HLBindingGroup)})},
  572. args: [],
  573. source: "displayLabel\x0a\x09^ super displayLabel, '...'",
  574. messageSends: [",", "displayLabel"],
  575. referencedClasses: []
  576. }),
  577. smalltalk.HLBindingGroup);
  578. smalltalk.addMethod(
  579. smalltalk.method({
  580. selector: "isActive",
  581. category: 'testing',
  582. fn: function (){
  583. var self=this;
  584. return smalltalk.withContext(function($ctx1) {
  585. var $1;
  586. $1=_st(self._activeBindings())._notEmpty();
  587. return $1;
  588. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLBindingGroup)})},
  589. args: [],
  590. source: "isActive\x0a\x09^ self activeBindings notEmpty",
  591. messageSends: ["notEmpty", "activeBindings"],
  592. referencedClasses: []
  593. }),
  594. smalltalk.HLBindingGroup);
  595. smalltalk.addMethod(
  596. smalltalk.method({
  597. selector: "release",
  598. category: 'actions',
  599. fn: function (){
  600. var self=this;
  601. return smalltalk.withContext(function($ctx1) {
  602. _st(self._bindings())._do_((function(each){
  603. return smalltalk.withContext(function($ctx2) {
  604. return _st(each)._release();
  605. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  606. return self}, function($ctx1) {$ctx1.fill(self,"release",{},smalltalk.HLBindingGroup)})},
  607. args: [],
  608. source: "release\x0a\x09self bindings do: [ :each | each release ]",
  609. messageSends: ["do:", "bindings", "release"],
  610. referencedClasses: []
  611. }),
  612. smalltalk.HLBindingGroup);
  613. smalltalk.addMethod(
  614. smalltalk.method({
  615. selector: "renderOn:html:",
  616. category: 'rendering',
  617. fn: function (aBindingHelper,html){
  618. var self=this;
  619. return smalltalk.withContext(function($ctx1) {
  620. var $1;
  621. $1=self._isActive();
  622. if(smalltalk.assert($1)){
  623. _st(aBindingHelper)._renderBindingGroup_on_(self,html);
  624. };
  625. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:html:",{aBindingHelper:aBindingHelper,html:html},smalltalk.HLBindingGroup)})},
  626. args: ["aBindingHelper", "html"],
  627. source: "renderOn: aBindingHelper html: html\x0a\x09self isActive ifTrue: [\x0a\x09\x09aBindingHelper renderBindingGroup: self on: html ]",
  628. messageSends: ["ifTrue:", "isActive", "renderBindingGroup:on:"],
  629. referencedClasses: []
  630. }),
  631. smalltalk.HLBindingGroup);
  632. smalltalk.addClass('HLBindingActionInputWidget', smalltalk.HLWidget, ['input', 'callback', 'status', 'wrapper', 'ghostText', 'message', 'inputCompletion', 'defaultValue', 'messageTag'], 'Helios-KeyBindings');
  633. smalltalk.HLBindingActionInputWidget.comment="My instances are built when a `HLBindingAction` that requires user input is applied.";
  634. smalltalk.addMethod(
  635. smalltalk.method({
  636. selector: "callback",
  637. category: 'accessing',
  638. fn: function (){
  639. var self=this;
  640. return smalltalk.withContext(function($ctx1) {
  641. var $2,$1;
  642. $2=self["@callback"];
  643. if(($receiver = $2) == nil || $receiver == null){
  644. self["@callback"]=(function(value){
  645. return smalltalk.withContext(function($ctx2) {
  646. }, function($ctx2) {$ctx2.fillBlock({value:value},$ctx1,2)})});
  647. $1=self["@callback"];
  648. } else {
  649. $1=$2;
  650. };
  651. return $1;
  652. }, function($ctx1) {$ctx1.fill(self,"callback",{},smalltalk.HLBindingActionInputWidget)})},
  653. args: [],
  654. source: "callback\x0a\x09^ callback ifNil: [ callback := [ :value | ] ]",
  655. messageSends: ["ifNil:"],
  656. referencedClasses: []
  657. }),
  658. smalltalk.HLBindingActionInputWidget);
  659. smalltalk.addMethod(
  660. smalltalk.method({
  661. selector: "callback:",
  662. category: 'accessing',
  663. fn: function (aBlock){
  664. var self=this;
  665. return smalltalk.withContext(function($ctx1) {
  666. self["@callback"]=aBlock;
  667. return self}, function($ctx1) {$ctx1.fill(self,"callback:",{aBlock:aBlock},smalltalk.HLBindingActionInputWidget)})},
  668. args: ["aBlock"],
  669. source: "callback: aBlock\x0a\x09callback := aBlock",
  670. messageSends: [],
  671. referencedClasses: []
  672. }),
  673. smalltalk.HLBindingActionInputWidget);
  674. smalltalk.addMethod(
  675. smalltalk.method({
  676. selector: "clearStatus",
  677. category: 'actions',
  678. fn: function (){
  679. var self=this;
  680. return smalltalk.withContext(function($ctx1) {
  681. self._status_("info");
  682. self._message_("");
  683. self._refresh();
  684. return self}, function($ctx1) {$ctx1.fill(self,"clearStatus",{},smalltalk.HLBindingActionInputWidget)})},
  685. args: [],
  686. source: "clearStatus\x0a\x09self status: 'info'.\x0a\x09self message: ''.\x0a\x09self refresh",
  687. messageSends: ["status:", "message:", "refresh"],
  688. referencedClasses: []
  689. }),
  690. smalltalk.HLBindingActionInputWidget);
  691. smalltalk.addMethod(
  692. smalltalk.method({
  693. selector: "defaultValue",
  694. category: 'accessing',
  695. fn: function (){
  696. var self=this;
  697. return smalltalk.withContext(function($ctx1) {
  698. var $2,$1;
  699. $2=self["@defaultValue"];
  700. if(($receiver = $2) == nil || $receiver == null){
  701. $1="";
  702. } else {
  703. $1=$2;
  704. };
  705. return $1;
  706. }, function($ctx1) {$ctx1.fill(self,"defaultValue",{},smalltalk.HLBindingActionInputWidget)})},
  707. args: [],
  708. source: "defaultValue\x0a\x09^ defaultValue ifNil: [ '' ]",
  709. messageSends: ["ifNil:"],
  710. referencedClasses: []
  711. }),
  712. smalltalk.HLBindingActionInputWidget);
  713. smalltalk.addMethod(
  714. smalltalk.method({
  715. selector: "defaultValue:",
  716. category: 'accessing',
  717. fn: function (aString){
  718. var self=this;
  719. return smalltalk.withContext(function($ctx1) {
  720. self["@defaultValue"]=aString;
  721. return self}, function($ctx1) {$ctx1.fill(self,"defaultValue:",{aString:aString},smalltalk.HLBindingActionInputWidget)})},
  722. args: ["aString"],
  723. source: "defaultValue: aString\x0a\x09defaultValue := aString",
  724. messageSends: [],
  725. referencedClasses: []
  726. }),
  727. smalltalk.HLBindingActionInputWidget);
  728. smalltalk.addMethod(
  729. smalltalk.method({
  730. selector: "errorStatus",
  731. category: 'actions',
  732. fn: function (){
  733. var self=this;
  734. return smalltalk.withContext(function($ctx1) {
  735. self._status_("error");
  736. self._refresh();
  737. return self}, function($ctx1) {$ctx1.fill(self,"errorStatus",{},smalltalk.HLBindingActionInputWidget)})},
  738. args: [],
  739. source: "errorStatus\x0a\x09self status: 'error'.\x0a\x09self refresh",
  740. messageSends: ["status:", "refresh"],
  741. referencedClasses: []
  742. }),
  743. smalltalk.HLBindingActionInputWidget);
  744. smalltalk.addMethod(
  745. smalltalk.method({
  746. selector: "evaluate:",
  747. category: 'actions',
  748. fn: function (aString){
  749. var self=this;
  750. function $Error(){return smalltalk.Error||(typeof Error=="undefined"?nil:Error)}
  751. return smalltalk.withContext(function($ctx1) {
  752. _st((function(){
  753. return smalltalk.withContext(function($ctx2) {
  754. return _st(self._callback())._value_(aString);
  755. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(ex){
  756. return smalltalk.withContext(function($ctx2) {
  757. _st(_st(self._input())._asJQuery())._one_do_("keydown",(function(){
  758. return smalltalk.withContext(function($ctx3) {
  759. return self._clearStatus();
  760. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,3)})}));
  761. self._message_(_st(ex)._messageText());
  762. return self._errorStatus();
  763. }, function($ctx2) {$ctx2.fillBlock({ex:ex},$ctx1,2)})}));
  764. return self}, function($ctx1) {$ctx1.fill(self,"evaluate:",{aString:aString},smalltalk.HLBindingActionInputWidget)})},
  765. args: ["aString"],
  766. source: "evaluate: aString\x09\x0a\x09[ self callback value: aString ]\x0a\x09\x09on: Error\x0a\x09\x09do: [:ex |\x0a\x09\x09\x09self input asJQuery \x0a\x09\x09\x09\x09one: 'keydown' \x0a\x09\x09\x09\x09do: [ self clearStatus ].\x0a\x09\x09\x09self message: ex messageText.\x0a\x09\x09\x09self errorStatus ]",
  767. messageSends: ["on:do:", "value:", "callback", "one:do:", "asJQuery", "input", "clearStatus", "message:", "messageText", "errorStatus"],
  768. referencedClasses: ["Error"]
  769. }),
  770. smalltalk.HLBindingActionInputWidget);
  771. smalltalk.addMethod(
  772. smalltalk.method({
  773. selector: "ghostText",
  774. category: 'accessing',
  775. fn: function (){
  776. var self=this;
  777. return smalltalk.withContext(function($ctx1) {
  778. var $1;
  779. $1=self["@ghostText"];
  780. return $1;
  781. }, function($ctx1) {$ctx1.fill(self,"ghostText",{},smalltalk.HLBindingActionInputWidget)})},
  782. args: [],
  783. source: "ghostText\x0a\x09^ ghostText",
  784. messageSends: [],
  785. referencedClasses: []
  786. }),
  787. smalltalk.HLBindingActionInputWidget);
  788. smalltalk.addMethod(
  789. smalltalk.method({
  790. selector: "ghostText:",
  791. category: 'accessing',
  792. fn: function (aText){
  793. var self=this;
  794. return smalltalk.withContext(function($ctx1) {
  795. self["@ghostText"]=aText;
  796. return self}, function($ctx1) {$ctx1.fill(self,"ghostText:",{aText:aText},smalltalk.HLBindingActionInputWidget)})},
  797. args: ["aText"],
  798. source: "ghostText: aText\x0a\x09ghostText := aText",
  799. messageSends: [],
  800. referencedClasses: []
  801. }),
  802. smalltalk.HLBindingActionInputWidget);
  803. smalltalk.addMethod(
  804. smalltalk.method({
  805. selector: "input",
  806. category: 'accessing',
  807. fn: function (){
  808. var self=this;
  809. return smalltalk.withContext(function($ctx1) {
  810. var $1;
  811. $1=self["@input"];
  812. return $1;
  813. }, function($ctx1) {$ctx1.fill(self,"input",{},smalltalk.HLBindingActionInputWidget)})},
  814. args: [],
  815. source: "input\x0a\x09^ input",
  816. messageSends: [],
  817. referencedClasses: []
  818. }),
  819. smalltalk.HLBindingActionInputWidget);
  820. smalltalk.addMethod(
  821. smalltalk.method({
  822. selector: "inputCompletion",
  823. category: 'accessing',
  824. fn: function (){
  825. var self=this;
  826. return smalltalk.withContext(function($ctx1) {
  827. var $2,$1;
  828. $2=self["@inputCompletion"];
  829. if(($receiver = $2) == nil || $receiver == null){
  830. $1=[];
  831. } else {
  832. $1=$2;
  833. };
  834. return $1;
  835. }, function($ctx1) {$ctx1.fill(self,"inputCompletion",{},smalltalk.HLBindingActionInputWidget)})},
  836. args: [],
  837. source: "inputCompletion\x0a\x09^ inputCompletion ifNil: [ #() ]",
  838. messageSends: ["ifNil:"],
  839. referencedClasses: []
  840. }),
  841. smalltalk.HLBindingActionInputWidget);
  842. smalltalk.addMethod(
  843. smalltalk.method({
  844. selector: "inputCompletion:",
  845. category: 'accessing',
  846. fn: function (aCollection){
  847. var self=this;
  848. return smalltalk.withContext(function($ctx1) {
  849. self["@inputCompletion"]=aCollection;
  850. return self}, function($ctx1) {$ctx1.fill(self,"inputCompletion:",{aCollection:aCollection},smalltalk.HLBindingActionInputWidget)})},
  851. args: ["aCollection"],
  852. source: "inputCompletion: aCollection\x0a\x09inputCompletion := aCollection",
  853. messageSends: [],
  854. referencedClasses: []
  855. }),
  856. smalltalk.HLBindingActionInputWidget);
  857. smalltalk.addMethod(
  858. smalltalk.method({
  859. selector: "message",
  860. category: 'accessing',
  861. fn: function (){
  862. var self=this;
  863. return smalltalk.withContext(function($ctx1) {
  864. var $2,$1;
  865. $2=self["@message"];
  866. if(($receiver = $2) == nil || $receiver == null){
  867. self["@message"]="";
  868. $1=self["@message"];
  869. } else {
  870. $1=$2;
  871. };
  872. return $1;
  873. }, function($ctx1) {$ctx1.fill(self,"message",{},smalltalk.HLBindingActionInputWidget)})},
  874. args: [],
  875. source: "message\x0a\x09^ message ifNil: [ message := '' ]",
  876. messageSends: ["ifNil:"],
  877. referencedClasses: []
  878. }),
  879. smalltalk.HLBindingActionInputWidget);
  880. smalltalk.addMethod(
  881. smalltalk.method({
  882. selector: "message:",
  883. category: 'accessing',
  884. fn: function (aString){
  885. var self=this;
  886. return smalltalk.withContext(function($ctx1) {
  887. self["@message"]=aString;
  888. return self}, function($ctx1) {$ctx1.fill(self,"message:",{aString:aString},smalltalk.HLBindingActionInputWidget)})},
  889. args: ["aString"],
  890. source: "message: aString\x0a\x09message := aString",
  891. messageSends: [],
  892. referencedClasses: []
  893. }),
  894. smalltalk.HLBindingActionInputWidget);
  895. smalltalk.addMethod(
  896. smalltalk.method({
  897. selector: "refresh",
  898. category: 'actions',
  899. fn: function (){
  900. var self=this;
  901. return smalltalk.withContext(function($ctx1) {
  902. var $1;
  903. $1=self["@wrapper"];
  904. if(($receiver = $1) == nil || $receiver == null){
  905. return self;
  906. } else {
  907. $1;
  908. };
  909. _st(self["@wrapper"])._class_(self._status());
  910. _st(self["@messageTag"])._contents_(self._message());
  911. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLBindingActionInputWidget)})},
  912. args: [],
  913. source: "refresh\x0a\x09wrapper ifNil: [ ^ self ].\x0a \x0a\x09wrapper class: self status.\x0a\x09messageTag contents: self message",
  914. messageSends: ["ifNil:", "class:", "status", "contents:", "message"],
  915. referencedClasses: []
  916. }),
  917. smalltalk.HLBindingActionInputWidget);
  918. smalltalk.addMethod(
  919. smalltalk.method({
  920. selector: "renderOn:",
  921. category: 'rendering',
  922. fn: function (html){
  923. var self=this;
  924. return smalltalk.withContext(function($ctx1) {
  925. var $1,$2,$4,$6,$8,$10,$9,$7,$5,$11,$12,$13,$3,$14;
  926. $1=self["@wrapper"];
  927. if(($receiver = $1) == nil || $receiver == null){
  928. self["@wrapper"]=_st(html)._span();
  929. $ctx1.sendIdx["span"]=1;
  930. self["@wrapper"];
  931. } else {
  932. $1;
  933. };
  934. $2=self["@wrapper"];
  935. _st($2)._class_(self._status());
  936. $ctx1.sendIdx["class:"]=1;
  937. $3=_st($2)._with_((function(){
  938. return smalltalk.withContext(function($ctx2) {
  939. $4=_st(html)._input();
  940. _st($4)._placeholder_(self._ghostText());
  941. _st($4)._value_(self._defaultValue());
  942. $6=$4;
  943. $7=_st((function(event){
  944. return smalltalk.withContext(function($ctx3) {
  945. $8=_st(_st(event)._which()).__eq((13));
  946. if(smalltalk.assert($8)){
  947. $10=_st(self["@input"])._asJQuery();
  948. $ctx3.sendIdx["asJQuery"]=1;
  949. $9=_st($10)._val();
  950. return self._evaluate_($9);
  951. };
  952. }, function($ctx3) {$ctx3.fillBlock({event:event},$ctx2,3)})}))._yourself();
  953. $ctx2.sendIdx["yourself"]=1;
  954. $5=_st($6)._onKeyDown_($7);
  955. self["@input"]=$5;
  956. self["@input"];
  957. $11=_st(self["@input"])._asJQuery();
  958. $ctx2.sendIdx["asJQuery"]=2;
  959. _st($11)._typeahead_(smalltalk.HashedCollection._from_(["source".__minus_gt(self._inputCompletion())]));
  960. $12=_st(html)._span();
  961. _st($12)._class_("help-inline");
  962. _st($12)._with_(self._message());
  963. $13=_st($12)._yourself();
  964. self["@messageTag"]=$13;
  965. return self["@messageTag"];
  966. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  967. $ctx1.sendIdx["with:"]=1;
  968. _st((function(){
  969. return smalltalk.withContext(function($ctx2) {
  970. $14=_st(self["@input"])._asJQuery();
  971. return _st($14)._focus();
  972. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,5)})}))._valueWithTimeout_((10));
  973. return self}, function($ctx1) {$ctx1.fill(self,"renderOn:",{html:html},smalltalk.HLBindingActionInputWidget)})},
  974. args: ["html"],
  975. source: "renderOn: html\x0a\x09wrapper ifNil: [ wrapper := html span ].\x0a\x0a\x09wrapper \x0a\x09\x09class: self status;\x0a\x09\x09with: [\x0a\x09\x09\x09input := html input\x0a\x09\x09\x09\x09placeholder: self ghostText;\x0a\x09\x09\x09\x09value: self defaultValue;\x0a\x09\x09\x09\x09onKeyDown: [ :event | \x0a\x09\x09\x09\x09\x09event which = 13 ifTrue: [\x0a\x09\x09\x09\x09\x09\x09self evaluate: input asJQuery val ] ]\x0a\x09\x09\x09\x09yourself.\x0a\x09\x09\x09input asJQuery \x0a\x09\x09\x09\x09typeahead: #{ 'source' -> self inputCompletion }.\x0a\x09\x09\x09messageTag := (html span\x0a\x09\x09\x09\x09class: 'help-inline';\x0a\x09\x09\x09\x09with: self message;\x0a\x09\x09\x09\x09yourself) ].\x0a\x09\x0a\x09\x22Evaluate with a timeout to ensure focus.\x0a\x09Commands can be executed from a menu, clicking on the menu to\x0a\x09evaluate the command would give it the focus otherwise\x22\x0a\x09\x0a\x09[ input asJQuery focus ] valueWithTimeout: 10",
  976. messageSends: ["ifNil:", "span", "class:", "status", "with:", "placeholder:", "input", "ghostText", "value:", "defaultValue", "onKeyDown:", "yourself", "ifTrue:", "=", "which", "evaluate:", "val", "asJQuery", "typeahead:", "->", "inputCompletion", "message", "valueWithTimeout:", "focus"],
  977. referencedClasses: []
  978. }),
  979. smalltalk.HLBindingActionInputWidget);
  980. smalltalk.addMethod(
  981. smalltalk.method({
  982. selector: "status",
  983. category: 'accessing',
  984. fn: function (){
  985. var self=this;
  986. return smalltalk.withContext(function($ctx1) {
  987. var $2,$1;
  988. $2=self["@status"];
  989. if(($receiver = $2) == nil || $receiver == null){
  990. self["@status"]="info";
  991. $1=self["@status"];
  992. } else {
  993. $1=$2;
  994. };
  995. return $1;
  996. }, function($ctx1) {$ctx1.fill(self,"status",{},smalltalk.HLBindingActionInputWidget)})},
  997. args: [],
  998. source: "status\x0a\x09^ status ifNil: [ status := 'info' ]",
  999. messageSends: ["ifNil:"],
  1000. referencedClasses: []
  1001. }),
  1002. smalltalk.HLBindingActionInputWidget);
  1003. smalltalk.addMethod(
  1004. smalltalk.method({
  1005. selector: "status:",
  1006. category: 'accessing',
  1007. fn: function (aStatus){
  1008. var self=this;
  1009. return smalltalk.withContext(function($ctx1) {
  1010. self["@status"]=aStatus;
  1011. return self}, function($ctx1) {$ctx1.fill(self,"status:",{aStatus:aStatus},smalltalk.HLBindingActionInputWidget)})},
  1012. args: ["aStatus"],
  1013. source: "status: aStatus\x0a\x09status := aStatus",
  1014. messageSends: [],
  1015. referencedClasses: []
  1016. }),
  1017. smalltalk.HLBindingActionInputWidget);
  1018. smalltalk.addClass('HLKeyBinder', smalltalk.Object, ['modifierKey', 'helper', 'bindings', 'selectedBinding'], 'Helios-KeyBindings');
  1019. smalltalk.HLKeyBinder.comment="My `current` instance holds keybindings for Helios actions and evaluate them.\x0a\x0aBindings can be nested by groups. The `bindings` instance variable holds the root of the key bindings tree.\x0a\x0aBindings are instances of a concrete subclass of `HLBinding`.\x0a\x0aI am always either in 'active' or 'inactive' state. In active state I capture key down events and my `helper` widget is displayed at the bottom of the window. My `selectedBinding`, if any, is displayed by the helper.\x0a\x0aBindings are evaluated through `applyBinding:`. If a binding is final (not a group of other bindings), evaluating it will result in deactivating the binder, and hiding the `helper` widget.";
  1020. smalltalk.addMethod(
  1021. smalltalk.method({
  1022. selector: "activate",
  1023. category: 'actions',
  1024. fn: function (){
  1025. var self=this;
  1026. return smalltalk.withContext(function($ctx1) {
  1027. _st(self._helper())._show();
  1028. return self}, function($ctx1) {$ctx1.fill(self,"activate",{},smalltalk.HLKeyBinder)})},
  1029. args: [],
  1030. source: "activate\x0a\x09self helper show",
  1031. messageSends: ["show", "helper"],
  1032. referencedClasses: []
  1033. }),
  1034. smalltalk.HLKeyBinder);
  1035. smalltalk.addMethod(
  1036. smalltalk.method({
  1037. selector: "activationKey",
  1038. category: 'accessing',
  1039. fn: function (){
  1040. var self=this;
  1041. return smalltalk.withContext(function($ctx1) {
  1042. return (32);
  1043. }, function($ctx1) {$ctx1.fill(self,"activationKey",{},smalltalk.HLKeyBinder)})},
  1044. args: [],
  1045. source: "activationKey\x0a\x09\x22SPACE\x22\x0a\x09^ 32",
  1046. messageSends: [],
  1047. referencedClasses: []
  1048. }),
  1049. smalltalk.HLKeyBinder);
  1050. smalltalk.addMethod(
  1051. smalltalk.method({
  1052. selector: "activationKeyLabel",
  1053. category: 'accessing',
  1054. fn: function (){
  1055. var self=this;
  1056. return smalltalk.withContext(function($ctx1) {
  1057. return "ctrl + space";
  1058. }, function($ctx1) {$ctx1.fill(self,"activationKeyLabel",{},smalltalk.HLKeyBinder)})},
  1059. args: [],
  1060. source: "activationKeyLabel\x0a\x09^ 'ctrl + space'",
  1061. messageSends: [],
  1062. referencedClasses: []
  1063. }),
  1064. smalltalk.HLKeyBinder);
  1065. smalltalk.addMethod(
  1066. smalltalk.method({
  1067. selector: "applyBinding:",
  1068. category: 'actions',
  1069. fn: function (aBinding){
  1070. var self=this;
  1071. return smalltalk.withContext(function($ctx1) {
  1072. var $1;
  1073. $1=_st(aBinding)._isActive();
  1074. if(! smalltalk.assert($1)){
  1075. return self;
  1076. };
  1077. self._selectBinding_(aBinding);
  1078. _st(aBinding)._apply();
  1079. return self}, function($ctx1) {$ctx1.fill(self,"applyBinding:",{aBinding:aBinding},smalltalk.HLKeyBinder)})},
  1080. args: ["aBinding"],
  1081. source: "applyBinding: aBinding\x0a\x09aBinding isActive ifFalse: [ ^ self ].\x0a\x09\x0a\x09self selectBinding: aBinding.\x0a aBinding apply",
  1082. messageSends: ["ifFalse:", "isActive", "selectBinding:", "apply"],
  1083. referencedClasses: []
  1084. }),
  1085. smalltalk.HLKeyBinder);
  1086. smalltalk.addMethod(
  1087. smalltalk.method({
  1088. selector: "bindings",
  1089. category: 'accessing',
  1090. fn: function (){
  1091. var self=this;
  1092. return smalltalk.withContext(function($ctx1) {
  1093. var $2,$1;
  1094. $2=self["@bindings"];
  1095. if(($receiver = $2) == nil || $receiver == null){
  1096. self["@bindings"]=self._defaultBindings();
  1097. $1=self["@bindings"];
  1098. } else {
  1099. $1=$2;
  1100. };
  1101. return $1;
  1102. }, function($ctx1) {$ctx1.fill(self,"bindings",{},smalltalk.HLKeyBinder)})},
  1103. args: [],
  1104. source: "bindings\x0a\x09^ bindings ifNil: [ bindings := self defaultBindings ]",
  1105. messageSends: ["ifNil:", "defaultBindings"],
  1106. referencedClasses: []
  1107. }),
  1108. smalltalk.HLKeyBinder);
  1109. smalltalk.addMethod(
  1110. smalltalk.method({
  1111. selector: "deactivate",
  1112. category: 'actions',
  1113. fn: function (){
  1114. var self=this;
  1115. return smalltalk.withContext(function($ctx1) {
  1116. var $1;
  1117. $1=self["@selectedBinding"];
  1118. if(($receiver = $1) == nil || $receiver == null){
  1119. $1;
  1120. } else {
  1121. _st(self["@selectedBinding"])._release();
  1122. };
  1123. self["@selectedBinding"]=nil;
  1124. _st(self._helper())._hide();
  1125. return self}, function($ctx1) {$ctx1.fill(self,"deactivate",{},smalltalk.HLKeyBinder)})},
  1126. args: [],
  1127. source: "deactivate\x0a\x09selectedBinding ifNotNil: [ selectedBinding release ].\x0a selectedBinding := nil.\x0a\x09self helper hide",
  1128. messageSends: ["ifNotNil:", "release", "hide", "helper"],
  1129. referencedClasses: []
  1130. }),
  1131. smalltalk.HLKeyBinder);
  1132. smalltalk.addMethod(
  1133. smalltalk.method({
  1134. selector: "defaultBindings",
  1135. category: 'defaults',
  1136. fn: function (){
  1137. var self=this;
  1138. var group;
  1139. function $HLBindingGroup(){return smalltalk.HLBindingGroup||(typeof HLBindingGroup=="undefined"?nil:HLBindingGroup)}
  1140. function $HLCloseTabCommand(){return smalltalk.HLCloseTabCommand||(typeof HLCloseTabCommand=="undefined"?nil:HLCloseTabCommand)}
  1141. function $HLSwitchTabCommand(){return smalltalk.HLSwitchTabCommand||(typeof HLSwitchTabCommand=="undefined"?nil:HLSwitchTabCommand)}
  1142. function $HLOpenCommand(){return smalltalk.HLOpenCommand||(typeof HLOpenCommand=="undefined"?nil:HLOpenCommand)}
  1143. return smalltalk.withContext(function($ctx1) {
  1144. var $1,$2,$4,$3,$5,$7,$6,$8,$9;
  1145. $1=_st($HLBindingGroup())._new();
  1146. $ctx1.sendIdx["new"]=1;
  1147. $2=$1;
  1148. $4=_st($HLCloseTabCommand())._new();
  1149. $ctx1.sendIdx["new"]=2;
  1150. $3=_st($4)._asBinding();
  1151. $ctx1.sendIdx["asBinding"]=1;
  1152. _st($2)._add_($3);
  1153. $ctx1.sendIdx["add:"]=1;
  1154. $5=$1;
  1155. $7=_st($HLSwitchTabCommand())._new();
  1156. $6=_st($7)._asBinding();
  1157. _st($5)._add_($6);
  1158. $8=_st($1)._yourself();
  1159. group=$8;
  1160. _st($HLOpenCommand())._registerConcreteClassesOn_(group);
  1161. $9=group;
  1162. return $9;
  1163. }, function($ctx1) {$ctx1.fill(self,"defaultBindings",{group:group},smalltalk.HLKeyBinder)})},
  1164. args: [],
  1165. source: "defaultBindings\x0a\x09| group |\x0a\x09\x0a\x09group := HLBindingGroup new\x0a\x09\x09add: HLCloseTabCommand new asBinding;\x0a\x09\x09add: HLSwitchTabCommand new asBinding;\x0a\x09\x09yourself.\x0a\x09\x09\x0a\x09HLOpenCommand registerConcreteClassesOn: group.\x0a\x09\x09\x09\x09\x0a\x09^ group",
  1166. messageSends: ["add:", "new", "asBinding", "yourself", "registerConcreteClassesOn:"],
  1167. referencedClasses: ["HLBindingGroup", "HLCloseTabCommand", "HLSwitchTabCommand", "HLOpenCommand"]
  1168. }),
  1169. smalltalk.HLKeyBinder);
  1170. smalltalk.addMethod(
  1171. smalltalk.method({
  1172. selector: "escapeKey",
  1173. category: 'accessing',
  1174. fn: function (){
  1175. var self=this;
  1176. return smalltalk.withContext(function($ctx1) {
  1177. return (27);
  1178. }, function($ctx1) {$ctx1.fill(self,"escapeKey",{},smalltalk.HLKeyBinder)})},
  1179. args: [],
  1180. source: "escapeKey\x0a\x09\x22ESC\x22\x0a\x09^ 27",
  1181. messageSends: [],
  1182. referencedClasses: []
  1183. }),
  1184. smalltalk.HLKeyBinder);
  1185. smalltalk.addMethod(
  1186. smalltalk.method({
  1187. selector: "flushBindings",
  1188. category: 'actions',
  1189. fn: function (){
  1190. var self=this;
  1191. return smalltalk.withContext(function($ctx1) {
  1192. self["@bindings"]=nil;
  1193. return self}, function($ctx1) {$ctx1.fill(self,"flushBindings",{},smalltalk.HLKeyBinder)})},
  1194. args: [],
  1195. source: "flushBindings\x0a\x09bindings := nil",
  1196. messageSends: [],
  1197. referencedClasses: []
  1198. }),
  1199. smalltalk.HLKeyBinder);
  1200. smalltalk.addMethod(
  1201. smalltalk.method({
  1202. selector: "handleActiveKeyDown:",
  1203. category: 'events',
  1204. fn: function (event){
  1205. var self=this;
  1206. return smalltalk.withContext(function($ctx1) {
  1207. var $3,$2,$5,$4,$1,$6;
  1208. $3=_st(event)._which();
  1209. $ctx1.sendIdx["which"]=1;
  1210. $2=_st($3).__eq(self._escapeKey());
  1211. $ctx1.sendIdx["="]=1;
  1212. $1=_st($2)._or_((function(){
  1213. return smalltalk.withContext(function($ctx2) {
  1214. $5=_st(event)._which();
  1215. $4=_st($5).__eq((71));
  1216. return _st($4)._and_((function(){
  1217. return smalltalk.withContext(function($ctx3) {
  1218. return _st(event)._ctrlKey();
  1219. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  1220. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1221. if(smalltalk.assert($1)){
  1222. self._deactivate();
  1223. _st(event)._preventDefault();
  1224. return false;
  1225. };
  1226. $6=self._handleBindingFor_(event);
  1227. return $6;
  1228. }, function($ctx1) {$ctx1.fill(self,"handleActiveKeyDown:",{event:event},smalltalk.HLKeyBinder)})},
  1229. args: ["event"],
  1230. source: "handleActiveKeyDown: event\x0a\x0a\x09\x22ESC or ctrl+g deactivate the keyBinder\x22\x0a\x09(event which = self escapeKey or: [\x0a\x09\x09event which = 71 and: [ event ctrlKey ] ])\x0a \x09ifTrue: [ \x0a \x09self deactivate.\x0a\x09\x09\x09\x09event preventDefault.\x0a\x09\x09\x09\x09^ false ].\x0a \x0a \x22Handle the keybinding\x22\x0a ^ self handleBindingFor: event",
  1231. messageSends: ["ifTrue:", "or:", "=", "which", "escapeKey", "and:", "ctrlKey", "deactivate", "preventDefault", "handleBindingFor:"],
  1232. referencedClasses: []
  1233. }),
  1234. smalltalk.HLKeyBinder);
  1235. smalltalk.addMethod(
  1236. smalltalk.method({
  1237. selector: "handleBindingFor:",
  1238. category: 'events',
  1239. fn: function (anEvent){
  1240. var self=this;
  1241. var binding;
  1242. return smalltalk.withContext(function($ctx1) {
  1243. var $1;
  1244. binding=_st(self._selectedBinding())._atKey_(_st(anEvent)._which());
  1245. $1=binding;
  1246. if(($receiver = $1) == nil || $receiver == null){
  1247. $1;
  1248. } else {
  1249. self._applyBinding_(binding);
  1250. _st(anEvent)._preventDefault();
  1251. return false;
  1252. };
  1253. return self}, function($ctx1) {$ctx1.fill(self,"handleBindingFor:",{anEvent:anEvent,binding:binding},smalltalk.HLKeyBinder)})},
  1254. args: ["anEvent"],
  1255. source: "handleBindingFor: anEvent\x0a\x09| binding |\x0a binding := self selectedBinding atKey: anEvent which.\x0a \x0a binding ifNotNil: [ \x0a \x09self applyBinding: binding.\x0a\x09\x09anEvent preventDefault.\x0a\x09\x09^ false ]",
  1256. messageSends: ["atKey:", "selectedBinding", "which", "ifNotNil:", "applyBinding:", "preventDefault"],
  1257. referencedClasses: []
  1258. }),
  1259. smalltalk.HLKeyBinder);
  1260. smalltalk.addMethod(
  1261. smalltalk.method({
  1262. selector: "handleInactiveKeyDown:",
  1263. category: 'events',
  1264. fn: function (event){
  1265. var self=this;
  1266. return smalltalk.withContext(function($ctx1) {
  1267. var $1,$2;
  1268. $1=_st(_st(event)._which()).__eq(self._activationKey());
  1269. if(smalltalk.assert($1)){
  1270. $2=_st(event)._ctrlKey();
  1271. if(smalltalk.assert($2)){
  1272. self._activate();
  1273. _st(event)._preventDefault();
  1274. return false;
  1275. };
  1276. };
  1277. return self}, function($ctx1) {$ctx1.fill(self,"handleInactiveKeyDown:",{event:event},smalltalk.HLKeyBinder)})},
  1278. args: ["event"],
  1279. source: "handleInactiveKeyDown: event\x0a\x09event which = self activationKey ifTrue: [\x0a \x09event ctrlKey ifTrue: [\x0a\x09\x09\x09self activate. \x0a event preventDefault. \x0a ^ false ] ]",
  1280. messageSends: ["ifTrue:", "=", "which", "activationKey", "ctrlKey", "activate", "preventDefault"],
  1281. referencedClasses: []
  1282. }),
  1283. smalltalk.HLKeyBinder);
  1284. smalltalk.addMethod(
  1285. smalltalk.method({
  1286. selector: "handleKeyDown:",
  1287. category: 'events',
  1288. fn: function (event){
  1289. var self=this;
  1290. return smalltalk.withContext(function($ctx1) {
  1291. var $2,$1;
  1292. $2=self._isActive();
  1293. if(smalltalk.assert($2)){
  1294. $1=self._handleActiveKeyDown_(event);
  1295. } else {
  1296. $1=self._handleInactiveKeyDown_(event);
  1297. };
  1298. return $1;
  1299. }, function($ctx1) {$ctx1.fill(self,"handleKeyDown:",{event:event},smalltalk.HLKeyBinder)})},
  1300. args: ["event"],
  1301. source: "handleKeyDown: event\x0a\x09^ self isActive\x0a \x09ifTrue: [ self handleActiveKeyDown: event ]\x0a \x09ifFalse: [ self handleInactiveKeyDown: event ]",
  1302. messageSends: ["ifTrue:ifFalse:", "isActive", "handleActiveKeyDown:", "handleInactiveKeyDown:"],
  1303. referencedClasses: []
  1304. }),
  1305. smalltalk.HLKeyBinder);
  1306. smalltalk.addMethod(
  1307. smalltalk.method({
  1308. selector: "helper",
  1309. category: 'accessing',
  1310. fn: function (){
  1311. var self=this;
  1312. return smalltalk.withContext(function($ctx1) {
  1313. var $1;
  1314. $1=self["@helper"];
  1315. return $1;
  1316. }, function($ctx1) {$ctx1.fill(self,"helper",{},smalltalk.HLKeyBinder)})},
  1317. args: [],
  1318. source: "helper\x0a\x09^ helper",
  1319. messageSends: [],
  1320. referencedClasses: []
  1321. }),
  1322. smalltalk.HLKeyBinder);
  1323. smalltalk.addMethod(
  1324. smalltalk.method({
  1325. selector: "initialize",
  1326. category: 'initialization',
  1327. fn: function (){
  1328. var self=this;
  1329. function $HLKeyBinderHelperWidget(){return smalltalk.HLKeyBinderHelperWidget||(typeof HLKeyBinderHelperWidget=="undefined"?nil:HLKeyBinderHelperWidget)}
  1330. return smalltalk.withContext(function($ctx1) {
  1331. var $1,$2;
  1332. smalltalk.HLKeyBinder.superclass.fn.prototype._initialize.apply(_st(self), []);
  1333. self["@helper"]=_st($HLKeyBinderHelperWidget())._on_(self);
  1334. $1=self["@helper"];
  1335. _st($1)._renderStart();
  1336. $2=_st($1)._renderCog();
  1337. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLKeyBinder)})},
  1338. args: [],
  1339. source: "initialize\x0a\x09super initialize.\x0a\x09helper := HLKeyBinderHelperWidget on: self.\x0a\x09helper \x09\x0a\x09\x09renderStart;\x0a\x09\x09renderCog",
  1340. messageSends: ["initialize", "on:", "renderStart", "renderCog"],
  1341. referencedClasses: ["HLKeyBinderHelperWidget"]
  1342. }),
  1343. smalltalk.HLKeyBinder);
  1344. smalltalk.addMethod(
  1345. smalltalk.method({
  1346. selector: "isActive",
  1347. category: 'testing',
  1348. fn: function (){
  1349. var self=this;
  1350. return smalltalk.withContext(function($ctx1) {
  1351. var $1;
  1352. $1=_st(_st(".".__comma(_st(self._helper())._cssClass()))._asJQuery())._is_(":visible");
  1353. return $1;
  1354. }, function($ctx1) {$ctx1.fill(self,"isActive",{},smalltalk.HLKeyBinder)})},
  1355. args: [],
  1356. source: "isActive\x0a\x09^ ('.', self helper cssClass) asJQuery is: ':visible'",
  1357. messageSends: ["is:", "asJQuery", ",", "cssClass", "helper"],
  1358. referencedClasses: []
  1359. }),
  1360. smalltalk.HLKeyBinder);
  1361. smalltalk.addMethod(
  1362. smalltalk.method({
  1363. selector: "selectBinding:",
  1364. category: 'actions',
  1365. fn: function (aBinding){
  1366. var self=this;
  1367. return smalltalk.withContext(function($ctx1) {
  1368. var $1;
  1369. $1=_st(aBinding).__eq(self["@selectedBinding"]);
  1370. if(smalltalk.assert($1)){
  1371. return self;
  1372. };
  1373. self["@selectedBinding"]=aBinding;
  1374. _st(self._helper())._refresh();
  1375. return self}, function($ctx1) {$ctx1.fill(self,"selectBinding:",{aBinding:aBinding},smalltalk.HLKeyBinder)})},
  1376. args: ["aBinding"],
  1377. source: "selectBinding: aBinding\x0a\x09aBinding = selectedBinding ifTrue: [ ^ self ].\x0a\x09\x0a\x09selectedBinding := aBinding.\x0a\x09self helper refresh",
  1378. messageSends: ["ifTrue:", "=", "refresh", "helper"],
  1379. referencedClasses: []
  1380. }),
  1381. smalltalk.HLKeyBinder);
  1382. smalltalk.addMethod(
  1383. smalltalk.method({
  1384. selector: "selectedBinding",
  1385. category: 'accessing',
  1386. fn: function (){
  1387. var self=this;
  1388. return smalltalk.withContext(function($ctx1) {
  1389. var $2,$1;
  1390. $2=self["@selectedBinding"];
  1391. if(($receiver = $2) == nil || $receiver == null){
  1392. $1=self._bindings();
  1393. } else {
  1394. $1=$2;
  1395. };
  1396. return $1;
  1397. }, function($ctx1) {$ctx1.fill(self,"selectedBinding",{},smalltalk.HLKeyBinder)})},
  1398. args: [],
  1399. source: "selectedBinding\x0a\x09^ selectedBinding ifNil: [ self bindings ]",
  1400. messageSends: ["ifNil:", "bindings"],
  1401. referencedClasses: []
  1402. }),
  1403. smalltalk.HLKeyBinder);
  1404. smalltalk.addMethod(
  1405. smalltalk.method({
  1406. selector: "setupEvents",
  1407. category: 'events',
  1408. fn: function (){
  1409. var self=this;
  1410. return smalltalk.withContext(function($ctx1) {
  1411. _st("body"._asJQuery())._keydown_((function(event){
  1412. return smalltalk.withContext(function($ctx2) {
  1413. return self._handleKeyDown_(event);
  1414. }, function($ctx2) {$ctx2.fillBlock({event:event},$ctx1,1)})}));
  1415. return self}, function($ctx1) {$ctx1.fill(self,"setupEvents",{},smalltalk.HLKeyBinder)})},
  1416. args: [],
  1417. source: "setupEvents\x0a\x09'body' asJQuery keydown: [ :event | self handleKeyDown: event ]",
  1418. messageSends: ["keydown:", "asJQuery", "handleKeyDown:"],
  1419. referencedClasses: []
  1420. }),
  1421. smalltalk.HLKeyBinder);
  1422. smalltalk.addMethod(
  1423. smalltalk.method({
  1424. selector: "systemIsMac",
  1425. category: 'testing',
  1426. fn: function (){
  1427. var self=this;
  1428. return smalltalk.withContext(function($ctx1) {
  1429. var $1;
  1430. $1=_st(_st(navigator)._platform())._match_("Mac");
  1431. return $1;
  1432. }, function($ctx1) {$ctx1.fill(self,"systemIsMac",{},smalltalk.HLKeyBinder)})},
  1433. args: [],
  1434. source: "systemIsMac\x0a\x09^ navigator platform match: 'Mac'",
  1435. messageSends: ["match:", "platform"],
  1436. referencedClasses: []
  1437. }),
  1438. smalltalk.HLKeyBinder);
  1439. smalltalk.HLKeyBinder.klass.iVarNames = ['current'];
  1440. smalltalk.addMethod(
  1441. smalltalk.method({
  1442. selector: "current",
  1443. category: 'instance creation',
  1444. fn: function (){
  1445. var self=this;
  1446. return smalltalk.withContext(function($ctx1) {
  1447. var $2,$1;
  1448. $2=self["@current"];
  1449. if(($receiver = $2) == nil || $receiver == null){
  1450. self["@current"]=smalltalk.HLKeyBinder.klass.superclass.fn.prototype._new.apply(_st(self), []);
  1451. $1=self["@current"];
  1452. } else {
  1453. $1=$2;
  1454. };
  1455. return $1;
  1456. }, function($ctx1) {$ctx1.fill(self,"current",{},smalltalk.HLKeyBinder.klass)})},
  1457. args: [],
  1458. source: "current\x0a\x09^ current ifNil: [ current := super new ]",
  1459. messageSends: ["ifNil:", "new"],
  1460. referencedClasses: []
  1461. }),
  1462. smalltalk.HLKeyBinder.klass);
  1463. smalltalk.addMethod(
  1464. smalltalk.method({
  1465. selector: "new",
  1466. category: 'instance creation',
  1467. fn: function (){
  1468. var self=this;
  1469. return smalltalk.withContext(function($ctx1) {
  1470. self._shouldNotImplement();
  1471. return self}, function($ctx1) {$ctx1.fill(self,"new",{},smalltalk.HLKeyBinder.klass)})},
  1472. args: [],
  1473. source: "new\x0a\x09self shouldNotImplement",
  1474. messageSends: ["shouldNotImplement"],
  1475. referencedClasses: []
  1476. }),
  1477. smalltalk.HLKeyBinder.klass);
  1478. smalltalk.addClass('HLKeyBinderHelperWidget', smalltalk.HLWidget, ['keyBinder'], 'Helios-KeyBindings');
  1479. smalltalk.HLKeyBinderHelperWidget.comment="I am the widget responsible for displaying active keybindings in a bar at the bottom of the window. Each keybinding is an instance of `HLBinding`. \x0a\x0aRendering is done through a double dispatch, see `#renderSelectedBindingOn:`.";
  1480. smalltalk.addMethod(
  1481. smalltalk.method({
  1482. selector: "cssClass",
  1483. category: 'accessing',
  1484. fn: function (){
  1485. var self=this;
  1486. return smalltalk.withContext(function($ctx1) {
  1487. return "key_helper";
  1488. }, function($ctx1) {$ctx1.fill(self,"cssClass",{},smalltalk.HLKeyBinderHelperWidget)})},
  1489. args: [],
  1490. source: "cssClass\x0a\x09^ 'key_helper'",
  1491. messageSends: [],
  1492. referencedClasses: []
  1493. }),
  1494. smalltalk.HLKeyBinderHelperWidget);
  1495. smalltalk.addMethod(
  1496. smalltalk.method({
  1497. selector: "hide",
  1498. category: 'actions',
  1499. fn: function (){
  1500. var self=this;
  1501. return smalltalk.withContext(function($ctx1) {
  1502. _st(_st(".".__comma(self._cssClass()))._asJQuery())._remove();
  1503. self._showCog();
  1504. return self}, function($ctx1) {$ctx1.fill(self,"hide",{},smalltalk.HLKeyBinderHelperWidget)})},
  1505. args: [],
  1506. source: "hide\x0a\x09('.', self cssClass) asJQuery remove.\x0a\x09self showCog",
  1507. messageSends: ["remove", "asJQuery", ",", "cssClass", "showCog"],
  1508. referencedClasses: []
  1509. }),
  1510. smalltalk.HLKeyBinderHelperWidget);
  1511. smalltalk.addMethod(
  1512. smalltalk.method({
  1513. selector: "hideCog",
  1514. category: 'actions',
  1515. fn: function (){
  1516. var self=this;
  1517. return smalltalk.withContext(function($ctx1) {
  1518. _st("#cog-helper"._asJQuery())._hide();
  1519. return self}, function($ctx1) {$ctx1.fill(self,"hideCog",{},smalltalk.HLKeyBinderHelperWidget)})},
  1520. args: [],
  1521. source: "hideCog\x0a\x09'#cog-helper' asJQuery hide",
  1522. messageSends: ["hide", "asJQuery"],
  1523. referencedClasses: []
  1524. }),
  1525. smalltalk.HLKeyBinderHelperWidget);
  1526. smalltalk.addMethod(
  1527. smalltalk.method({
  1528. selector: "keyBinder",
  1529. category: 'accessing',
  1530. fn: function (){
  1531. var self=this;
  1532. return smalltalk.withContext(function($ctx1) {
  1533. var $1;
  1534. $1=self["@keyBinder"];
  1535. return $1;
  1536. }, function($ctx1) {$ctx1.fill(self,"keyBinder",{},smalltalk.HLKeyBinderHelperWidget)})},
  1537. args: [],
  1538. source: "keyBinder\x0a\x09^ keyBinder",
  1539. messageSends: [],
  1540. referencedClasses: []
  1541. }),
  1542. smalltalk.HLKeyBinderHelperWidget);
  1543. smalltalk.addMethod(
  1544. smalltalk.method({
  1545. selector: "keyBinder:",
  1546. category: 'accessing',
  1547. fn: function (aKeyBinder){
  1548. var self=this;
  1549. return smalltalk.withContext(function($ctx1) {
  1550. self["@keyBinder"]=aKeyBinder;
  1551. return self}, function($ctx1) {$ctx1.fill(self,"keyBinder:",{aKeyBinder:aKeyBinder},smalltalk.HLKeyBinderHelperWidget)})},
  1552. args: ["aKeyBinder"],
  1553. source: "keyBinder: aKeyBinder\x0a\x09keyBinder := aKeyBinder",
  1554. messageSends: [],
  1555. referencedClasses: []
  1556. }),
  1557. smalltalk.HLKeyBinderHelperWidget);
  1558. smalltalk.addMethod(
  1559. smalltalk.method({
  1560. selector: "mainId",
  1561. category: 'accessing',
  1562. fn: function (){
  1563. var self=this;
  1564. return smalltalk.withContext(function($ctx1) {
  1565. return "binding-helper-main";
  1566. }, function($ctx1) {$ctx1.fill(self,"mainId",{},smalltalk.HLKeyBinderHelperWidget)})},
  1567. args: [],
  1568. source: "mainId\x0a\x09^ 'binding-helper-main'",
  1569. messageSends: [],
  1570. referencedClasses: []
  1571. }),
  1572. smalltalk.HLKeyBinderHelperWidget);
  1573. smalltalk.addMethod(
  1574. smalltalk.method({
  1575. selector: "renderBindingActionFor:on:",
  1576. category: 'rendering',
  1577. fn: function (aBinding,html){
  1578. var self=this;
  1579. return smalltalk.withContext(function($ctx1) {
  1580. var $1,$3,$4,$5,$6,$2;
  1581. $1=_st(html)._span();
  1582. $ctx1.sendIdx["span"]=1;
  1583. _st($1)._class_("command");
  1584. $ctx1.sendIdx["class:"]=1;
  1585. $2=_st($1)._with_((function(){
  1586. return smalltalk.withContext(function($ctx2) {
  1587. $3=_st(html)._span();
  1588. _st($3)._class_("label");
  1589. $ctx2.sendIdx["class:"]=2;
  1590. $4=_st($3)._with_(_st(_st(aBinding)._shortcut())._asLowercase());
  1591. $ctx2.sendIdx["with:"]=2;
  1592. $4;
  1593. $5=_st(html)._a();
  1594. _st($5)._class_("action");
  1595. _st($5)._with_(_st(aBinding)._displayLabel());
  1596. $6=_st($5)._onClick_((function(){
  1597. return smalltalk.withContext(function($ctx3) {
  1598. return _st(self._keyBinder())._applyBinding_(aBinding);
  1599. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  1600. return $6;
  1601. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1602. $ctx1.sendIdx["with:"]=1;
  1603. return self}, function($ctx1) {$ctx1.fill(self,"renderBindingActionFor:on:",{aBinding:aBinding,html:html},smalltalk.HLKeyBinderHelperWidget)})},
  1604. args: ["aBinding", "html"],
  1605. source: "renderBindingActionFor: aBinding on: html\x0a\x09html span class: 'command'; with: [\x0a\x09\x09html span \x0a\x09\x09\x09class: 'label'; \x0a\x09\x09\x09with: aBinding shortcut asLowercase.\x0a \x09\x09html a \x0a \x09class: 'action'; \x0a with: aBinding displayLabel;\x0a \x09\x09\x09onClick: [ self keyBinder applyBinding: aBinding ] ]",
  1606. messageSends: ["class:", "span", "with:", "asLowercase", "shortcut", "a", "displayLabel", "onClick:", "applyBinding:", "keyBinder"],
  1607. referencedClasses: []
  1608. }),
  1609. smalltalk.HLKeyBinderHelperWidget);
  1610. smalltalk.addMethod(
  1611. smalltalk.method({
  1612. selector: "renderBindingGroup:on:",
  1613. category: 'rendering',
  1614. fn: function (aBindingGroup,html){
  1615. var self=this;
  1616. return smalltalk.withContext(function($ctx1) {
  1617. var $1,$2;
  1618. _st(_st(_st(aBindingGroup)._activeBindings())._sorted_((function(a,b){
  1619. return smalltalk.withContext(function($ctx2) {
  1620. $1=_st(a)._key();
  1621. $ctx2.sendIdx["key"]=1;
  1622. $2=_st(b)._key();
  1623. return _st($1).__lt($2);
  1624. }, function($ctx2) {$ctx2.fillBlock({a:a,b:b},$ctx1,1)})})))._do_((function(each){
  1625. return smalltalk.withContext(function($ctx2) {
  1626. return self._renderBindingActionFor_on_(each,html);
  1627. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  1628. return self}, function($ctx1) {$ctx1.fill(self,"renderBindingGroup:on:",{aBindingGroup:aBindingGroup,html:html},smalltalk.HLKeyBinderHelperWidget)})},
  1629. args: ["aBindingGroup", "html"],
  1630. source: "renderBindingGroup: aBindingGroup on: html\x0a\x09(aBindingGroup activeBindings \x0a \x09sorted: [ :a :b | a key < b key ])\x0a do: [ :each | self renderBindingActionFor: each on: html ]",
  1631. messageSends: ["do:", "sorted:", "activeBindings", "<", "key", "renderBindingActionFor:on:"],
  1632. referencedClasses: []
  1633. }),
  1634. smalltalk.HLKeyBinderHelperWidget);
  1635. smalltalk.addMethod(
  1636. smalltalk.method({
  1637. selector: "renderCloseOn:",
  1638. category: 'rendering',
  1639. fn: function (html){
  1640. var self=this;
  1641. return smalltalk.withContext(function($ctx1) {
  1642. var $1,$2;
  1643. $1=_st(html)._a();
  1644. _st($1)._class_("close");
  1645. $ctx1.sendIdx["class:"]=1;
  1646. _st($1)._with_((function(){
  1647. return smalltalk.withContext(function($ctx2) {
  1648. return _st(_st(html)._tag_("i"))._class_("icon-remove");
  1649. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1650. $2=_st($1)._onClick_((function(){
  1651. return smalltalk.withContext(function($ctx2) {
  1652. return _st(self._keyBinder())._deactivate();
  1653. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1654. return self}, function($ctx1) {$ctx1.fill(self,"renderCloseOn:",{html:html},smalltalk.HLKeyBinderHelperWidget)})},
  1655. args: ["html"],
  1656. source: "renderCloseOn: html\x0a\x09html a\x0a\x09\x09class: 'close';\x0a\x09\x09with: [ (html tag: 'i') class: 'icon-remove' ];\x0a\x09\x09onClick: [ self keyBinder deactivate ]",
  1657. messageSends: ["class:", "a", "with:", "tag:", "onClick:", "deactivate", "keyBinder"],
  1658. referencedClasses: []
  1659. }),
  1660. smalltalk.HLKeyBinderHelperWidget);
  1661. smalltalk.addMethod(
  1662. smalltalk.method({
  1663. selector: "renderCog",
  1664. category: 'rendering',
  1665. fn: function (){
  1666. var self=this;
  1667. return smalltalk.withContext(function($ctx1) {
  1668. var $1,$3,$4,$2;
  1669. _st((function(html){
  1670. return smalltalk.withContext(function($ctx2) {
  1671. $1=_st(html)._div();
  1672. _st($1)._id_("cog-helper");
  1673. $2=_st($1)._with_((function(){
  1674. return smalltalk.withContext(function($ctx3) {
  1675. $3=_st(html)._a();
  1676. _st($3)._with_((function(){
  1677. return smalltalk.withContext(function($ctx4) {
  1678. return _st(_st(html)._tag_("i"))._class_("icon-cog");
  1679. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,3)})}));
  1680. $4=_st($3)._onClick_((function(){
  1681. return smalltalk.withContext(function($ctx4) {
  1682. return _st(self._keyBinder())._activate();
  1683. }, function($ctx4) {$ctx4.fillBlock({},$ctx3,4)})}));
  1684. return $4;
  1685. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  1686. $ctx2.sendIdx["with:"]=1;
  1687. return $2;
  1688. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})}))._appendToJQuery_("body"._asJQuery());
  1689. return self}, function($ctx1) {$ctx1.fill(self,"renderCog",{},smalltalk.HLKeyBinderHelperWidget)})},
  1690. args: [],
  1691. source: "renderCog\x0a\x09[ :html |\x0a\x09\x09html \x0a\x09\x09\x09div id: 'cog-helper'; \x0a\x09\x09\x09with: [\x0a\x09\x09\x09\x09html a \x0a\x09\x09\x09\x09\x09with: [ (html tag: 'i') class: 'icon-cog' ];\x0a\x09\x09\x09\x09\x09onClick: [ self keyBinder activate ] ] ]\x0a\x09\x09appendToJQuery: 'body' asJQuery",
  1692. messageSends: ["appendToJQuery:", "id:", "div", "with:", "a", "class:", "tag:", "onClick:", "activate", "keyBinder", "asJQuery"],
  1693. referencedClasses: []
  1694. }),
  1695. smalltalk.HLKeyBinderHelperWidget);
  1696. smalltalk.addMethod(
  1697. smalltalk.method({
  1698. selector: "renderContentOn:",
  1699. category: 'rendering',
  1700. fn: function (html){
  1701. var self=this;
  1702. return smalltalk.withContext(function($ctx1) {
  1703. var $1,$3,$4,$2;
  1704. $1=_st(html)._div();
  1705. $ctx1.sendIdx["div"]=1;
  1706. _st($1)._class_(self._cssClass());
  1707. $2=_st($1)._with_((function(){
  1708. return smalltalk.withContext(function($ctx2) {
  1709. self._renderLabelOn_(html);
  1710. $3=_st(html)._div();
  1711. _st($3)._id_(self._mainId());
  1712. $4=_st($3)._with_((function(){
  1713. return smalltalk.withContext(function($ctx3) {
  1714. return self._renderSelectedBindingOn_(html);
  1715. }, function($ctx3) {$ctx3.fillBlock({},$ctx2,2)})}));
  1716. $4;
  1717. return self._renderCloseOn_(html);
  1718. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1719. $ctx1.sendIdx["with:"]=1;
  1720. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLKeyBinderHelperWidget)})},
  1721. args: ["html"],
  1722. source: "renderContentOn: html\x0a\x09html div class: self cssClass; with: [\x0a \x09self renderLabelOn:html.\x0a\x09\x09html div\x0a\x09\x09\x09id: self mainId;\x0a\x09\x09\x09with: [ self renderSelectedBindingOn: html ].\x0a\x09\x09self renderCloseOn: html ]",
  1723. messageSends: ["class:", "div", "cssClass", "with:", "renderLabelOn:", "id:", "mainId", "renderSelectedBindingOn:", "renderCloseOn:"],
  1724. referencedClasses: []
  1725. }),
  1726. smalltalk.HLKeyBinderHelperWidget);
  1727. smalltalk.addMethod(
  1728. smalltalk.method({
  1729. selector: "renderLabelOn:",
  1730. category: 'rendering',
  1731. fn: function (html){
  1732. var self=this;
  1733. return smalltalk.withContext(function($ctx1) {
  1734. var $1,$3,$5,$4,$2;
  1735. $1=_st(html)._span();
  1736. _st($1)._class_("selected");
  1737. $3=$1;
  1738. $5=_st(self._selectedBinding())._label();
  1739. if(($receiver = $5) == nil || $receiver == null){
  1740. $4="Action";
  1741. } else {
  1742. $4=$5;
  1743. };
  1744. $2=_st($3)._with_($4);
  1745. return self}, function($ctx1) {$ctx1.fill(self,"renderLabelOn:",{html:html},smalltalk.HLKeyBinderHelperWidget)})},
  1746. args: ["html"],
  1747. source: "renderLabelOn: html\x0a\x09\x09html span \x0a \x09class: 'selected'; \x0a with: (self selectedBinding label ifNil: [ 'Action' ])",
  1748. messageSends: ["class:", "span", "with:", "ifNil:", "label", "selectedBinding"],
  1749. referencedClasses: []
  1750. }),
  1751. smalltalk.HLKeyBinderHelperWidget);
  1752. smalltalk.addMethod(
  1753. smalltalk.method({
  1754. selector: "renderSelectedBindingOn:",
  1755. category: 'rendering',
  1756. fn: function (html){
  1757. var self=this;
  1758. return smalltalk.withContext(function($ctx1) {
  1759. _st(self._selectedBinding())._renderOn_html_(self,html);
  1760. return self}, function($ctx1) {$ctx1.fill(self,"renderSelectedBindingOn:",{html:html},smalltalk.HLKeyBinderHelperWidget)})},
  1761. args: ["html"],
  1762. source: "renderSelectedBindingOn: html\x0a\x09self selectedBinding renderOn: self html: html",
  1763. messageSends: ["renderOn:html:", "selectedBinding"],
  1764. referencedClasses: []
  1765. }),
  1766. smalltalk.HLKeyBinderHelperWidget);
  1767. smalltalk.addMethod(
  1768. smalltalk.method({
  1769. selector: "renderStart",
  1770. category: 'rendering',
  1771. fn: function (){
  1772. var self=this;
  1773. return smalltalk.withContext(function($ctx1) {
  1774. var $1,$3,$5,$7,$6,$4,$2,$8,$9;
  1775. $1="#helper"._asJQuery();
  1776. $ctx1.sendIdx["asJQuery"]=1;
  1777. _st($1)._remove();
  1778. $2=(function(html){
  1779. return smalltalk.withContext(function($ctx2) {
  1780. $3=_st(html)._div();
  1781. _st($3)._id_("helper");
  1782. $5=$3;
  1783. $7="Press ".__comma(_st(self._keyBinder())._activationKeyLabel());
  1784. $6=_st($7).__comma(" to start");
  1785. $ctx2.sendIdx[","]=1;
  1786. $4=_st($5)._with_($6);
  1787. return $4;
  1788. }, function($ctx2) {$ctx2.fillBlock({html:html},$ctx1,1)})});
  1789. $8="body"._asJQuery();
  1790. $ctx1.sendIdx["asJQuery"]=2;
  1791. _st($2)._appendToJQuery_($8);
  1792. _st((function(){
  1793. return smalltalk.withContext(function($ctx2) {
  1794. $9="#helper"._asJQuery();
  1795. return _st($9)._fadeOut_((1000));
  1796. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}))._valueWithTimeout_((2000));
  1797. return self}, function($ctx1) {$ctx1.fill(self,"renderStart",{},smalltalk.HLKeyBinderHelperWidget)})},
  1798. args: [],
  1799. source: "renderStart\x0a\x09'#helper' asJQuery remove.\x0a\x0a\x09[ :html |\x0a\x09\x09html div \x0a\x09\x09\x09id: 'helper';\x0a\x09\x09\x09with: 'Press ', self keyBinder activationKeyLabel, ' to start' ] appendToJQuery: 'body' asJQuery.\x0a\x09\x0a\x09[ '#helper' asJQuery fadeOut: 1000 ] \x0a\x09\x09valueWithTimeout: 2000",
  1800. messageSends: ["remove", "asJQuery", "appendToJQuery:", "id:", "div", "with:", ",", "activationKeyLabel", "keyBinder", "valueWithTimeout:", "fadeOut:"],
  1801. referencedClasses: []
  1802. }),
  1803. smalltalk.HLKeyBinderHelperWidget);
  1804. smalltalk.addMethod(
  1805. smalltalk.method({
  1806. selector: "selectedBinding",
  1807. category: 'accessing',
  1808. fn: function (){
  1809. var self=this;
  1810. return smalltalk.withContext(function($ctx1) {
  1811. var $1;
  1812. $1=_st(self._keyBinder())._selectedBinding();
  1813. return $1;
  1814. }, function($ctx1) {$ctx1.fill(self,"selectedBinding",{},smalltalk.HLKeyBinderHelperWidget)})},
  1815. args: [],
  1816. source: "selectedBinding\x0a\x09^ self keyBinder selectedBinding",
  1817. messageSends: ["selectedBinding", "keyBinder"],
  1818. referencedClasses: []
  1819. }),
  1820. smalltalk.HLKeyBinderHelperWidget);
  1821. smalltalk.addMethod(
  1822. smalltalk.method({
  1823. selector: "show",
  1824. category: 'actions',
  1825. fn: function (){
  1826. var self=this;
  1827. return smalltalk.withContext(function($ctx1) {
  1828. self._hideCog();
  1829. self._appendToJQuery_("body"._asJQuery());
  1830. return self}, function($ctx1) {$ctx1.fill(self,"show",{},smalltalk.HLKeyBinderHelperWidget)})},
  1831. args: [],
  1832. source: "show\x0a\x09self hideCog.\x0a\x09self appendToJQuery: 'body' asJQuery",
  1833. messageSends: ["hideCog", "appendToJQuery:", "asJQuery"],
  1834. referencedClasses: []
  1835. }),
  1836. smalltalk.HLKeyBinderHelperWidget);
  1837. smalltalk.addMethod(
  1838. smalltalk.method({
  1839. selector: "showCog",
  1840. category: 'actions',
  1841. fn: function (){
  1842. var self=this;
  1843. return smalltalk.withContext(function($ctx1) {
  1844. _st("#cog-helper"._asJQuery())._show();
  1845. return self}, function($ctx1) {$ctx1.fill(self,"showCog",{},smalltalk.HLKeyBinderHelperWidget)})},
  1846. args: [],
  1847. source: "showCog\x0a\x09'#cog-helper' asJQuery show",
  1848. messageSends: ["show", "asJQuery"],
  1849. referencedClasses: []
  1850. }),
  1851. smalltalk.HLKeyBinderHelperWidget);
  1852. smalltalk.addMethod(
  1853. smalltalk.method({
  1854. selector: "showWidget:",
  1855. category: 'actions',
  1856. fn: function (aWidget){
  1857. var self=this;
  1858. return smalltalk.withContext(function($ctx1) {
  1859. var $3,$2,$1,$6,$5,$4;
  1860. $3=self._mainId();
  1861. $ctx1.sendIdx["mainId"]=1;
  1862. $2="#".__comma($3);
  1863. $ctx1.sendIdx[","]=1;
  1864. $1=_st($2)._asJQuery();
  1865. $ctx1.sendIdx["asJQuery"]=1;
  1866. _st($1)._empty();
  1867. $6=self._mainId();
  1868. $5="#".__comma($6);
  1869. $4=_st($5)._asJQuery();
  1870. _st(aWidget)._appendToJQuery_($4);
  1871. return self}, function($ctx1) {$ctx1.fill(self,"showWidget:",{aWidget:aWidget},smalltalk.HLKeyBinderHelperWidget)})},
  1872. args: ["aWidget"],
  1873. source: "showWidget: aWidget\x0a\x09\x22Some actions need to display more info to the user or request input.\x0a\x09This method is the right place for that\x22\x0a\x09\x0a\x09('#', self mainId) asJQuery empty.\x0a\x09aWidget appendToJQuery: ('#', self mainId) asJQuery",
  1874. messageSends: ["empty", "asJQuery", ",", "mainId", "appendToJQuery:"],
  1875. referencedClasses: []
  1876. }),
  1877. smalltalk.HLKeyBinderHelperWidget);
  1878. smalltalk.addMethod(
  1879. smalltalk.method({
  1880. selector: "on:",
  1881. category: 'instance creation',
  1882. fn: function (aKeyBinder){
  1883. var self=this;
  1884. return smalltalk.withContext(function($ctx1) {
  1885. var $2,$3,$1;
  1886. $2=self._new();
  1887. _st($2)._keyBinder_(aKeyBinder);
  1888. $3=_st($2)._yourself();
  1889. $1=$3;
  1890. return $1;
  1891. }, function($ctx1) {$ctx1.fill(self,"on:",{aKeyBinder:aKeyBinder},smalltalk.HLKeyBinderHelperWidget.klass)})},
  1892. args: ["aKeyBinder"],
  1893. source: "on: aKeyBinder\x0a\x09^ self new\x0a \x09keyBinder: aKeyBinder;\x0a yourself",
  1894. messageSends: ["keyBinder:", "new", "yourself"],
  1895. referencedClasses: []
  1896. }),
  1897. smalltalk.HLKeyBinderHelperWidget.klass);
  1898. smalltalk.addClass('HLRepeatedKeyDownHandler', smalltalk.Object, ['repeatInterval', 'delay', 'interval', 'keyBindings', 'widget', 'keyDown'], 'Helios-KeyBindings');
  1899. smalltalk.HLRepeatedKeyDownHandler.comment="I am responsible for handling repeated key down actions for widgets.\x0a\x0a##Usage\x0a\x0a (self on: aWidget)\x0a whileKeyDown: 38 do: aBlock;\x0a whileKeyDown: 40 do: anotherBlock;\x0a bindKeys\x0a\x0aI perform an action block on a key press, wait for 300 ms and then preform the same action block every `repeatInterval` milliseconds until the key is released.";
  1900. smalltalk.addMethod(
  1901. smalltalk.method({
  1902. selector: "bindKeys",
  1903. category: 'binding',
  1904. fn: function (){
  1905. var self=this;
  1906. return smalltalk.withContext(function($ctx1) {
  1907. _st(self._widget())._bindKeyDown_keyUp_((function(e){
  1908. return smalltalk.withContext(function($ctx2) {
  1909. return self._handleKeyDown_(e);
  1910. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,1)})}),(function(e){
  1911. return smalltalk.withContext(function($ctx2) {
  1912. return self._handleKeyUp();
  1913. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,2)})}));
  1914. return self}, function($ctx1) {$ctx1.fill(self,"bindKeys",{},smalltalk.HLRepeatedKeyDownHandler)})},
  1915. args: [],
  1916. source: "bindKeys\x0a\x09self widget \x0a\x09\x09bindKeyDown: [ :e | self handleKeyDown: e ] \x0a\x09\x09keyUp: [ :e | self handleKeyUp ]",
  1917. messageSends: ["bindKeyDown:keyUp:", "widget", "handleKeyDown:", "handleKeyUp"],
  1918. referencedClasses: []
  1919. }),
  1920. smalltalk.HLRepeatedKeyDownHandler);
  1921. smalltalk.addMethod(
  1922. smalltalk.method({
  1923. selector: "defaultRepeatInterval",
  1924. category: 'defaults',
  1925. fn: function (){
  1926. var self=this;
  1927. return smalltalk.withContext(function($ctx1) {
  1928. return (70);
  1929. }, function($ctx1) {$ctx1.fill(self,"defaultRepeatInterval",{},smalltalk.HLRepeatedKeyDownHandler)})},
  1930. args: [],
  1931. source: "defaultRepeatInterval\x0a\x09^ 70",
  1932. messageSends: [],
  1933. referencedClasses: []
  1934. }),
  1935. smalltalk.HLRepeatedKeyDownHandler);
  1936. smalltalk.addMethod(
  1937. smalltalk.method({
  1938. selector: "handleEvent:forKey:action:",
  1939. category: 'events handling',
  1940. fn: function (anEvent,anInteger,aBlock){
  1941. var self=this;
  1942. return smalltalk.withContext(function($ctx1) {
  1943. var $1;
  1944. $1=_st(_st(_st(anEvent)._which()).__eq(anInteger))._and_((function(){
  1945. return smalltalk.withContext(function($ctx2) {
  1946. return _st(self._isKeyDown())._not();
  1947. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1948. if(smalltalk.assert($1)){
  1949. self._whileKeyDownDo_(aBlock);
  1950. };
  1951. return self}, function($ctx1) {$ctx1.fill(self,"handleEvent:forKey:action:",{anEvent:anEvent,anInteger:anInteger,aBlock:aBlock},smalltalk.HLRepeatedKeyDownHandler)})},
  1952. args: ["anEvent", "anInteger", "aBlock"],
  1953. source: "handleEvent: anEvent forKey: anInteger action: aBlock\x0a\x09(anEvent which = anInteger and: [ self isKeyDown not ])\x0a\x09\x09ifTrue: [ self whileKeyDownDo: aBlock ]",
  1954. messageSends: ["ifTrue:", "and:", "=", "which", "not", "isKeyDown", "whileKeyDownDo:"],
  1955. referencedClasses: []
  1956. }),
  1957. smalltalk.HLRepeatedKeyDownHandler);
  1958. smalltalk.addMethod(
  1959. smalltalk.method({
  1960. selector: "handleKeyDown:",
  1961. category: 'events handling',
  1962. fn: function (anEvent){
  1963. var self=this;
  1964. return smalltalk.withContext(function($ctx1) {
  1965. _st(self._keyBindings())._keysAndValuesDo_((function(key,action){
  1966. return smalltalk.withContext(function($ctx2) {
  1967. return self._handleEvent_forKey_action_(anEvent,key,action);
  1968. }, function($ctx2) {$ctx2.fillBlock({key:key,action:action},$ctx1,1)})}));
  1969. return self}, function($ctx1) {$ctx1.fill(self,"handleKeyDown:",{anEvent:anEvent},smalltalk.HLRepeatedKeyDownHandler)})},
  1970. args: ["anEvent"],
  1971. source: "handleKeyDown: anEvent\x0a\x09self keyBindings keysAndValuesDo: [ :key :action | \x0a\x09\x09self handleEvent: anEvent forKey: key action: action ]",
  1972. messageSends: ["keysAndValuesDo:", "keyBindings", "handleEvent:forKey:action:"],
  1973. referencedClasses: []
  1974. }),
  1975. smalltalk.HLRepeatedKeyDownHandler);
  1976. smalltalk.addMethod(
  1977. smalltalk.method({
  1978. selector: "handleKeyUp",
  1979. category: 'events handling',
  1980. fn: function (){
  1981. var self=this;
  1982. return smalltalk.withContext(function($ctx1) {
  1983. var $1,$2,$3;
  1984. $1=self._isKeyDown();
  1985. if(smalltalk.assert($1)){
  1986. self["@keyDown"]=false;
  1987. self["@keyDown"];
  1988. $2=self["@interval"];
  1989. if(($receiver = $2) == nil || $receiver == null){
  1990. $2;
  1991. } else {
  1992. _st(self["@interval"])._clearInterval();
  1993. };
  1994. $3=self["@delay"];
  1995. if(($receiver = $3) == nil || $receiver == null){
  1996. $3;
  1997. } else {
  1998. _st(self["@delay"])._clearTimeout();
  1999. };
  2000. };
  2001. return self}, function($ctx1) {$ctx1.fill(self,"handleKeyUp",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2002. args: [],
  2003. source: "handleKeyUp\x0a\x09self isKeyDown ifTrue: [\x0a\x09\x09keyDown := false.\x0a\x09\x09interval ifNotNil: [ interval clearInterval ].\x0a\x09\x09delay ifNotNil: [ delay clearTimeout ] ]",
  2004. messageSends: ["ifTrue:", "isKeyDown", "ifNotNil:", "clearInterval", "clearTimeout"],
  2005. referencedClasses: []
  2006. }),
  2007. smalltalk.HLRepeatedKeyDownHandler);
  2008. smalltalk.addMethod(
  2009. smalltalk.method({
  2010. selector: "isKeyDown",
  2011. category: 'testing',
  2012. fn: function (){
  2013. var self=this;
  2014. return smalltalk.withContext(function($ctx1) {
  2015. var $2,$1;
  2016. $2=self["@keyDown"];
  2017. if(($receiver = $2) == nil || $receiver == null){
  2018. $1=false;
  2019. } else {
  2020. $1=$2;
  2021. };
  2022. return $1;
  2023. }, function($ctx1) {$ctx1.fill(self,"isKeyDown",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2024. args: [],
  2025. source: "isKeyDown\x0a\x09^ keyDown ifNil: [ false ]",
  2026. messageSends: ["ifNil:"],
  2027. referencedClasses: []
  2028. }),
  2029. smalltalk.HLRepeatedKeyDownHandler);
  2030. smalltalk.addMethod(
  2031. smalltalk.method({
  2032. selector: "keyBindings",
  2033. category: 'accessing',
  2034. fn: function (){
  2035. var self=this;
  2036. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  2037. return smalltalk.withContext(function($ctx1) {
  2038. var $2,$1;
  2039. $2=self["@keyBindings"];
  2040. if(($receiver = $2) == nil || $receiver == null){
  2041. self["@keyBindings"]=_st($Dictionary())._new();
  2042. $1=self["@keyBindings"];
  2043. } else {
  2044. $1=$2;
  2045. };
  2046. return $1;
  2047. }, function($ctx1) {$ctx1.fill(self,"keyBindings",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2048. args: [],
  2049. source: "keyBindings\x0a\x09^ keyBindings ifNil: [ keyBindings := Dictionary new ]",
  2050. messageSends: ["ifNil:", "new"],
  2051. referencedClasses: ["Dictionary"]
  2052. }),
  2053. smalltalk.HLRepeatedKeyDownHandler);
  2054. smalltalk.addMethod(
  2055. smalltalk.method({
  2056. selector: "rebindKeys",
  2057. category: 'binding',
  2058. fn: function (){
  2059. var self=this;
  2060. return smalltalk.withContext(function($ctx1) {
  2061. var $1;
  2062. self._unbindKeys();
  2063. $1=self._bindKeys();
  2064. return self}, function($ctx1) {$ctx1.fill(self,"rebindKeys",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2065. args: [],
  2066. source: "rebindKeys\x0a\x09self \x0a\x09\x09unbindKeys;\x0a\x09\x09bindKeys",
  2067. messageSends: ["unbindKeys", "bindKeys"],
  2068. referencedClasses: []
  2069. }),
  2070. smalltalk.HLRepeatedKeyDownHandler);
  2071. smalltalk.addMethod(
  2072. smalltalk.method({
  2073. selector: "repeatInterval",
  2074. category: 'accessing',
  2075. fn: function (){
  2076. var self=this;
  2077. return smalltalk.withContext(function($ctx1) {
  2078. var $2,$1;
  2079. $2=self["@repeatInterval"];
  2080. if(($receiver = $2) == nil || $receiver == null){
  2081. $1=self._defaultRepeatInterval();
  2082. } else {
  2083. $1=$2;
  2084. };
  2085. return $1;
  2086. }, function($ctx1) {$ctx1.fill(self,"repeatInterval",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2087. args: [],
  2088. source: "repeatInterval\x0a\x09^ repeatInterval ifNil: [ self defaultRepeatInterval ]",
  2089. messageSends: ["ifNil:", "defaultRepeatInterval"],
  2090. referencedClasses: []
  2091. }),
  2092. smalltalk.HLRepeatedKeyDownHandler);
  2093. smalltalk.addMethod(
  2094. smalltalk.method({
  2095. selector: "repeatInterval:",
  2096. category: 'accessing',
  2097. fn: function (anInteger){
  2098. var self=this;
  2099. return smalltalk.withContext(function($ctx1) {
  2100. self["@repeatInterval"]=anInteger;
  2101. return self}, function($ctx1) {$ctx1.fill(self,"repeatInterval:",{anInteger:anInteger},smalltalk.HLRepeatedKeyDownHandler)})},
  2102. args: ["anInteger"],
  2103. source: "repeatInterval: anInteger\x0a\x09repeatInterval := anInteger",
  2104. messageSends: [],
  2105. referencedClasses: []
  2106. }),
  2107. smalltalk.HLRepeatedKeyDownHandler);
  2108. smalltalk.addMethod(
  2109. smalltalk.method({
  2110. selector: "startRepeatingAction:",
  2111. category: 'actions',
  2112. fn: function (aBlock){
  2113. var self=this;
  2114. return smalltalk.withContext(function($ctx1) {
  2115. var $2,$1;
  2116. $1=_st((function(){
  2117. return smalltalk.withContext(function($ctx2) {
  2118. $2=_st(self._widget())._hasFocus();
  2119. if(smalltalk.assert($2)){
  2120. return _st(aBlock)._value();
  2121. } else {
  2122. return self._handleKeyUp();
  2123. };
  2124. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._valueWithInterval_(self._repeatInterval());
  2125. return $1;
  2126. }, function($ctx1) {$ctx1.fill(self,"startRepeatingAction:",{aBlock:aBlock},smalltalk.HLRepeatedKeyDownHandler)})},
  2127. args: ["aBlock"],
  2128. source: "startRepeatingAction: aBlock\x0a\x09^ [ (self widget hasFocus)\x0a\x09\x09ifTrue: [ aBlock value ]\x0a\x09\x09ifFalse: [ self handleKeyUp ] ] valueWithInterval: self repeatInterval",
  2129. messageSends: ["valueWithInterval:", "ifTrue:ifFalse:", "hasFocus", "widget", "value", "handleKeyUp", "repeatInterval"],
  2130. referencedClasses: []
  2131. }),
  2132. smalltalk.HLRepeatedKeyDownHandler);
  2133. smalltalk.addMethod(
  2134. smalltalk.method({
  2135. selector: "unbindKeys",
  2136. category: 'binding',
  2137. fn: function (){
  2138. var self=this;
  2139. return smalltalk.withContext(function($ctx1) {
  2140. _st(self._widget())._unbindKeyDownKeyUp();
  2141. return self}, function($ctx1) {$ctx1.fill(self,"unbindKeys",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2142. args: [],
  2143. source: "unbindKeys\x0a\x09self widget unbindKeyDownKeyUp",
  2144. messageSends: ["unbindKeyDownKeyUp", "widget"],
  2145. referencedClasses: []
  2146. }),
  2147. smalltalk.HLRepeatedKeyDownHandler);
  2148. smalltalk.addMethod(
  2149. smalltalk.method({
  2150. selector: "whileKeyDown:do:",
  2151. category: 'actions',
  2152. fn: function (aKey,aBlock){
  2153. var self=this;
  2154. return smalltalk.withContext(function($ctx1) {
  2155. _st(self._keyBindings())._at_put_(aKey,aBlock);
  2156. return self}, function($ctx1) {$ctx1.fill(self,"whileKeyDown:do:",{aKey:aKey,aBlock:aBlock},smalltalk.HLRepeatedKeyDownHandler)})},
  2157. args: ["aKey", "aBlock"],
  2158. source: "whileKeyDown: aKey do: aBlock\x0a\x09self keyBindings at: aKey put: aBlock",
  2159. messageSends: ["at:put:", "keyBindings"],
  2160. referencedClasses: []
  2161. }),
  2162. smalltalk.HLRepeatedKeyDownHandler);
  2163. smalltalk.addMethod(
  2164. smalltalk.method({
  2165. selector: "whileKeyDownDo:",
  2166. category: 'events handling',
  2167. fn: function (aBlock){
  2168. var self=this;
  2169. return smalltalk.withContext(function($ctx1) {
  2170. self["@keyDown"]=true;
  2171. _st(aBlock)._value();
  2172. self["@delay"]=_st((function(){
  2173. return smalltalk.withContext(function($ctx2) {
  2174. self["@interval"]=self._startRepeatingAction_(aBlock);
  2175. return self["@interval"];
  2176. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._valueWithTimeout_((300));
  2177. return self}, function($ctx1) {$ctx1.fill(self,"whileKeyDownDo:",{aBlock:aBlock},smalltalk.HLRepeatedKeyDownHandler)})},
  2178. args: ["aBlock"],
  2179. source: "whileKeyDownDo: aBlock\x0a\x09keyDown := true.\x0a\x09aBlock value.\x0a\x09delay := [ interval := self startRepeatingAction: aBlock ] \x0a\x09\x09valueWithTimeout: 300",
  2180. messageSends: ["value", "valueWithTimeout:", "startRepeatingAction:"],
  2181. referencedClasses: []
  2182. }),
  2183. smalltalk.HLRepeatedKeyDownHandler);
  2184. smalltalk.addMethod(
  2185. smalltalk.method({
  2186. selector: "widget",
  2187. category: 'accessing',
  2188. fn: function (){
  2189. var self=this;
  2190. return smalltalk.withContext(function($ctx1) {
  2191. var $1;
  2192. $1=self["@widget"];
  2193. return $1;
  2194. }, function($ctx1) {$ctx1.fill(self,"widget",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2195. args: [],
  2196. source: "widget\x0a\x09^ widget",
  2197. messageSends: [],
  2198. referencedClasses: []
  2199. }),
  2200. smalltalk.HLRepeatedKeyDownHandler);
  2201. smalltalk.addMethod(
  2202. smalltalk.method({
  2203. selector: "widget:",
  2204. category: 'accessing',
  2205. fn: function (aWidget){
  2206. var self=this;
  2207. return smalltalk.withContext(function($ctx1) {
  2208. self["@widget"]=aWidget;
  2209. return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget},smalltalk.HLRepeatedKeyDownHandler)})},
  2210. args: ["aWidget"],
  2211. source: "widget: aWidget\x0a\x09widget := aWidget",
  2212. messageSends: [],
  2213. referencedClasses: []
  2214. }),
  2215. smalltalk.HLRepeatedKeyDownHandler);
  2216. smalltalk.addMethod(
  2217. smalltalk.method({
  2218. selector: "on:",
  2219. category: 'instance creation',
  2220. fn: function (aWidget){
  2221. var self=this;
  2222. return smalltalk.withContext(function($ctx1) {
  2223. var $2,$3,$1;
  2224. $2=self._new();
  2225. _st($2)._widget_(aWidget);
  2226. $3=_st($2)._yourself();
  2227. $1=$3;
  2228. return $1;
  2229. }, function($ctx1) {$ctx1.fill(self,"on:",{aWidget:aWidget},smalltalk.HLRepeatedKeyDownHandler.klass)})},
  2230. args: ["aWidget"],
  2231. source: "on: aWidget\x0a\x09^ self new\x0a\x09\x09widget: aWidget;\x0a\x09\x09yourself",
  2232. messageSends: ["widget:", "new", "yourself"],
  2233. referencedClasses: []
  2234. }),
  2235. smalltalk.HLRepeatedKeyDownHandler.klass);
  2236. });