Helios-KeyBindings.js 79 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359
  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 $2,$3,$1;
  1268. $2=_st(_st(event)._which()).__eq(self._activationKey());
  1269. if(smalltalk.assert($2)){
  1270. $3=_st(event)._ctrlKey();
  1271. if(smalltalk.assert($3)){
  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,$4,$7,$6,$5;
  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. $4=aWidget;
  1868. $7=self._mainId();
  1869. $6="#".__comma($7);
  1870. $5=_st($6)._asJQuery();
  1871. _st($4)._appendToJQuery_($5);
  1872. return self}, function($ctx1) {$ctx1.fill(self,"showWidget:",{aWidget:aWidget},smalltalk.HLKeyBinderHelperWidget)})},
  1873. args: ["aWidget"],
  1874. 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",
  1875. messageSends: ["empty", "asJQuery", ",", "mainId", "appendToJQuery:"],
  1876. referencedClasses: []
  1877. }),
  1878. smalltalk.HLKeyBinderHelperWidget);
  1879. smalltalk.addMethod(
  1880. smalltalk.method({
  1881. selector: "on:",
  1882. category: 'instance creation',
  1883. fn: function (aKeyBinder){
  1884. var self=this;
  1885. return smalltalk.withContext(function($ctx1) {
  1886. var $2,$3,$1;
  1887. $2=self._new();
  1888. _st($2)._keyBinder_(aKeyBinder);
  1889. $3=_st($2)._yourself();
  1890. $1=$3;
  1891. return $1;
  1892. }, function($ctx1) {$ctx1.fill(self,"on:",{aKeyBinder:aKeyBinder},smalltalk.HLKeyBinderHelperWidget.klass)})},
  1893. args: ["aKeyBinder"],
  1894. source: "on: aKeyBinder\x0a\x09^ self new\x0a \x09keyBinder: aKeyBinder;\x0a yourself",
  1895. messageSends: ["keyBinder:", "new", "yourself"],
  1896. referencedClasses: []
  1897. }),
  1898. smalltalk.HLKeyBinderHelperWidget.klass);
  1899. smalltalk.addClass('HLRepeatedKeyDownHandler', smalltalk.Object, ['repeatInterval', 'delay', 'interval', 'keyBindings', 'widget', 'keyDown'], 'Helios-KeyBindings');
  1900. 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.";
  1901. smalltalk.addMethod(
  1902. smalltalk.method({
  1903. selector: "bindKeys",
  1904. category: 'binding',
  1905. fn: function (){
  1906. var self=this;
  1907. return smalltalk.withContext(function($ctx1) {
  1908. _st(self._widget())._bindKeyDown_keyUp_((function(e){
  1909. return smalltalk.withContext(function($ctx2) {
  1910. return self._handleKeyDown_(e);
  1911. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,1)})}),(function(e){
  1912. return smalltalk.withContext(function($ctx2) {
  1913. return self._handleKeyUp();
  1914. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,2)})}));
  1915. return self}, function($ctx1) {$ctx1.fill(self,"bindKeys",{},smalltalk.HLRepeatedKeyDownHandler)})},
  1916. args: [],
  1917. source: "bindKeys\x0a\x09self widget \x0a\x09\x09bindKeyDown: [ :e | self handleKeyDown: e ] \x0a\x09\x09keyUp: [ :e | self handleKeyUp ]",
  1918. messageSends: ["bindKeyDown:keyUp:", "widget", "handleKeyDown:", "handleKeyUp"],
  1919. referencedClasses: []
  1920. }),
  1921. smalltalk.HLRepeatedKeyDownHandler);
  1922. smalltalk.addMethod(
  1923. smalltalk.method({
  1924. selector: "defaultRepeatInterval",
  1925. category: 'defaults',
  1926. fn: function (){
  1927. var self=this;
  1928. return smalltalk.withContext(function($ctx1) {
  1929. return (70);
  1930. }, function($ctx1) {$ctx1.fill(self,"defaultRepeatInterval",{},smalltalk.HLRepeatedKeyDownHandler)})},
  1931. args: [],
  1932. source: "defaultRepeatInterval\x0a\x09^ 70",
  1933. messageSends: [],
  1934. referencedClasses: []
  1935. }),
  1936. smalltalk.HLRepeatedKeyDownHandler);
  1937. smalltalk.addMethod(
  1938. smalltalk.method({
  1939. selector: "handleEvent:forKey:action:",
  1940. category: 'events handling',
  1941. fn: function (anEvent,anInteger,aBlock){
  1942. var self=this;
  1943. return smalltalk.withContext(function($ctx1) {
  1944. var $1;
  1945. $1=_st(_st(_st(anEvent)._which()).__eq(anInteger))._and_((function(){
  1946. return smalltalk.withContext(function($ctx2) {
  1947. return _st(self._isKeyDown())._not();
  1948. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1949. if(smalltalk.assert($1)){
  1950. self._whileKeyDownDo_(aBlock);
  1951. };
  1952. return self}, function($ctx1) {$ctx1.fill(self,"handleEvent:forKey:action:",{anEvent:anEvent,anInteger:anInteger,aBlock:aBlock},smalltalk.HLRepeatedKeyDownHandler)})},
  1953. args: ["anEvent", "anInteger", "aBlock"],
  1954. source: "handleEvent: anEvent forKey: anInteger action: aBlock\x0a\x09(anEvent which = anInteger and: [ self isKeyDown not ])\x0a\x09\x09ifTrue: [ self whileKeyDownDo: aBlock ]",
  1955. messageSends: ["ifTrue:", "and:", "=", "which", "not", "isKeyDown", "whileKeyDownDo:"],
  1956. referencedClasses: []
  1957. }),
  1958. smalltalk.HLRepeatedKeyDownHandler);
  1959. smalltalk.addMethod(
  1960. smalltalk.method({
  1961. selector: "handleKeyDown:",
  1962. category: 'events handling',
  1963. fn: function (anEvent){
  1964. var self=this;
  1965. return smalltalk.withContext(function($ctx1) {
  1966. _st(self._keyBindings())._keysAndValuesDo_((function(key,action){
  1967. return smalltalk.withContext(function($ctx2) {
  1968. return self._handleEvent_forKey_action_(anEvent,key,action);
  1969. }, function($ctx2) {$ctx2.fillBlock({key:key,action:action},$ctx1,1)})}));
  1970. return self}, function($ctx1) {$ctx1.fill(self,"handleKeyDown:",{anEvent:anEvent},smalltalk.HLRepeatedKeyDownHandler)})},
  1971. args: ["anEvent"],
  1972. source: "handleKeyDown: anEvent\x0a\x09self keyBindings keysAndValuesDo: [ :key :action | \x0a\x09\x09self handleEvent: anEvent forKey: key action: action ]",
  1973. messageSends: ["keysAndValuesDo:", "keyBindings", "handleEvent:forKey:action:"],
  1974. referencedClasses: []
  1975. }),
  1976. smalltalk.HLRepeatedKeyDownHandler);
  1977. smalltalk.addMethod(
  1978. smalltalk.method({
  1979. selector: "handleKeyUp",
  1980. category: 'events handling',
  1981. fn: function (){
  1982. var self=this;
  1983. return smalltalk.withContext(function($ctx1) {
  1984. var $1,$2,$3;
  1985. $1=self._isKeyDown();
  1986. if(smalltalk.assert($1)){
  1987. self["@keyDown"]=false;
  1988. self["@keyDown"];
  1989. $2=self["@interval"];
  1990. if(($receiver = $2) == nil || $receiver == null){
  1991. $2;
  1992. } else {
  1993. _st(self["@interval"])._clearInterval();
  1994. };
  1995. $3=self["@delay"];
  1996. if(($receiver = $3) == nil || $receiver == null){
  1997. $3;
  1998. } else {
  1999. _st(self["@delay"])._clearTimeout();
  2000. };
  2001. };
  2002. return self}, function($ctx1) {$ctx1.fill(self,"handleKeyUp",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2003. args: [],
  2004. source: "handleKeyUp\x0a\x09self isKeyDown ifTrue: [\x0a\x09\x09keyDown := false.\x0a\x09\x09interval ifNotNil: [ interval clearInterval ].\x0a\x09\x09delay ifNotNil: [ delay clearTimeout ] ]",
  2005. messageSends: ["ifTrue:", "isKeyDown", "ifNotNil:", "clearInterval", "clearTimeout"],
  2006. referencedClasses: []
  2007. }),
  2008. smalltalk.HLRepeatedKeyDownHandler);
  2009. smalltalk.addMethod(
  2010. smalltalk.method({
  2011. selector: "isKeyDown",
  2012. category: 'testing',
  2013. fn: function (){
  2014. var self=this;
  2015. return smalltalk.withContext(function($ctx1) {
  2016. var $2,$1;
  2017. $2=self["@keyDown"];
  2018. if(($receiver = $2) == nil || $receiver == null){
  2019. $1=false;
  2020. } else {
  2021. $1=$2;
  2022. };
  2023. return $1;
  2024. }, function($ctx1) {$ctx1.fill(self,"isKeyDown",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2025. args: [],
  2026. source: "isKeyDown\x0a\x09^ keyDown ifNil: [ false ]",
  2027. messageSends: ["ifNil:"],
  2028. referencedClasses: []
  2029. }),
  2030. smalltalk.HLRepeatedKeyDownHandler);
  2031. smalltalk.addMethod(
  2032. smalltalk.method({
  2033. selector: "keyBindings",
  2034. category: 'accessing',
  2035. fn: function (){
  2036. var self=this;
  2037. function $Dictionary(){return smalltalk.Dictionary||(typeof Dictionary=="undefined"?nil:Dictionary)}
  2038. return smalltalk.withContext(function($ctx1) {
  2039. var $2,$1;
  2040. $2=self["@keyBindings"];
  2041. if(($receiver = $2) == nil || $receiver == null){
  2042. self["@keyBindings"]=_st($Dictionary())._new();
  2043. $1=self["@keyBindings"];
  2044. } else {
  2045. $1=$2;
  2046. };
  2047. return $1;
  2048. }, function($ctx1) {$ctx1.fill(self,"keyBindings",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2049. args: [],
  2050. source: "keyBindings\x0a\x09^ keyBindings ifNil: [ keyBindings := Dictionary new ]",
  2051. messageSends: ["ifNil:", "new"],
  2052. referencedClasses: ["Dictionary"]
  2053. }),
  2054. smalltalk.HLRepeatedKeyDownHandler);
  2055. smalltalk.addMethod(
  2056. smalltalk.method({
  2057. selector: "rebindKeys",
  2058. category: 'binding',
  2059. fn: function (){
  2060. var self=this;
  2061. return smalltalk.withContext(function($ctx1) {
  2062. var $1;
  2063. self._unbindKeys();
  2064. $1=self._bindKeys();
  2065. return self}, function($ctx1) {$ctx1.fill(self,"rebindKeys",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2066. args: [],
  2067. source: "rebindKeys\x0a\x09self \x0a\x09\x09unbindKeys;\x0a\x09\x09bindKeys",
  2068. messageSends: ["unbindKeys", "bindKeys"],
  2069. referencedClasses: []
  2070. }),
  2071. smalltalk.HLRepeatedKeyDownHandler);
  2072. smalltalk.addMethod(
  2073. smalltalk.method({
  2074. selector: "repeatInterval",
  2075. category: 'accessing',
  2076. fn: function (){
  2077. var self=this;
  2078. return smalltalk.withContext(function($ctx1) {
  2079. var $2,$1;
  2080. $2=self["@repeatInterval"];
  2081. if(($receiver = $2) == nil || $receiver == null){
  2082. $1=self._defaultRepeatInterval();
  2083. } else {
  2084. $1=$2;
  2085. };
  2086. return $1;
  2087. }, function($ctx1) {$ctx1.fill(self,"repeatInterval",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2088. args: [],
  2089. source: "repeatInterval\x0a\x09^ repeatInterval ifNil: [ self defaultRepeatInterval ]",
  2090. messageSends: ["ifNil:", "defaultRepeatInterval"],
  2091. referencedClasses: []
  2092. }),
  2093. smalltalk.HLRepeatedKeyDownHandler);
  2094. smalltalk.addMethod(
  2095. smalltalk.method({
  2096. selector: "repeatInterval:",
  2097. category: 'accessing',
  2098. fn: function (anInteger){
  2099. var self=this;
  2100. return smalltalk.withContext(function($ctx1) {
  2101. self["@repeatInterval"]=anInteger;
  2102. return self}, function($ctx1) {$ctx1.fill(self,"repeatInterval:",{anInteger:anInteger},smalltalk.HLRepeatedKeyDownHandler)})},
  2103. args: ["anInteger"],
  2104. source: "repeatInterval: anInteger\x0a\x09repeatInterval := anInteger",
  2105. messageSends: [],
  2106. referencedClasses: []
  2107. }),
  2108. smalltalk.HLRepeatedKeyDownHandler);
  2109. smalltalk.addMethod(
  2110. smalltalk.method({
  2111. selector: "startRepeatingAction:",
  2112. category: 'actions',
  2113. fn: function (aBlock){
  2114. var self=this;
  2115. return smalltalk.withContext(function($ctx1) {
  2116. var $2,$1;
  2117. $1=_st((function(){
  2118. return smalltalk.withContext(function($ctx2) {
  2119. $2=_st(self._widget())._hasFocus();
  2120. if(smalltalk.assert($2)){
  2121. return _st(aBlock)._value();
  2122. } else {
  2123. return self._handleKeyUp();
  2124. };
  2125. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._valueWithInterval_(self._repeatInterval());
  2126. return $1;
  2127. }, function($ctx1) {$ctx1.fill(self,"startRepeatingAction:",{aBlock:aBlock},smalltalk.HLRepeatedKeyDownHandler)})},
  2128. args: ["aBlock"],
  2129. source: "startRepeatingAction: aBlock\x0a\x09^ [ (self widget hasFocus)\x0a\x09\x09ifTrue: [ aBlock value ]\x0a\x09\x09ifFalse: [ self handleKeyUp ] ] valueWithInterval: self repeatInterval",
  2130. messageSends: ["valueWithInterval:", "ifTrue:ifFalse:", "hasFocus", "widget", "value", "handleKeyUp", "repeatInterval"],
  2131. referencedClasses: []
  2132. }),
  2133. smalltalk.HLRepeatedKeyDownHandler);
  2134. smalltalk.addMethod(
  2135. smalltalk.method({
  2136. selector: "unbindKeys",
  2137. category: 'binding',
  2138. fn: function (){
  2139. var self=this;
  2140. return smalltalk.withContext(function($ctx1) {
  2141. _st(self._widget())._unbindKeyDownKeyUp();
  2142. return self}, function($ctx1) {$ctx1.fill(self,"unbindKeys",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2143. args: [],
  2144. source: "unbindKeys\x0a\x09self widget unbindKeyDownKeyUp",
  2145. messageSends: ["unbindKeyDownKeyUp", "widget"],
  2146. referencedClasses: []
  2147. }),
  2148. smalltalk.HLRepeatedKeyDownHandler);
  2149. smalltalk.addMethod(
  2150. smalltalk.method({
  2151. selector: "whileKeyDown:do:",
  2152. category: 'actions',
  2153. fn: function (aKey,aBlock){
  2154. var self=this;
  2155. return smalltalk.withContext(function($ctx1) {
  2156. _st(self._keyBindings())._at_put_(aKey,aBlock);
  2157. return self}, function($ctx1) {$ctx1.fill(self,"whileKeyDown:do:",{aKey:aKey,aBlock:aBlock},smalltalk.HLRepeatedKeyDownHandler)})},
  2158. args: ["aKey", "aBlock"],
  2159. source: "whileKeyDown: aKey do: aBlock\x0a\x09self keyBindings at: aKey put: aBlock",
  2160. messageSends: ["at:put:", "keyBindings"],
  2161. referencedClasses: []
  2162. }),
  2163. smalltalk.HLRepeatedKeyDownHandler);
  2164. smalltalk.addMethod(
  2165. smalltalk.method({
  2166. selector: "whileKeyDownDo:",
  2167. category: 'events handling',
  2168. fn: function (aBlock){
  2169. var self=this;
  2170. return smalltalk.withContext(function($ctx1) {
  2171. self["@keyDown"]=true;
  2172. _st(aBlock)._value();
  2173. self["@delay"]=_st((function(){
  2174. return smalltalk.withContext(function($ctx2) {
  2175. self["@interval"]=self._startRepeatingAction_(aBlock);
  2176. return self["@interval"];
  2177. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._valueWithTimeout_((300));
  2178. return self}, function($ctx1) {$ctx1.fill(self,"whileKeyDownDo:",{aBlock:aBlock},smalltalk.HLRepeatedKeyDownHandler)})},
  2179. args: ["aBlock"],
  2180. source: "whileKeyDownDo: aBlock\x0a\x09keyDown := true.\x0a\x09aBlock value.\x0a\x09delay := [ interval := self startRepeatingAction: aBlock ] \x0a\x09\x09valueWithTimeout: 300",
  2181. messageSends: ["value", "valueWithTimeout:", "startRepeatingAction:"],
  2182. referencedClasses: []
  2183. }),
  2184. smalltalk.HLRepeatedKeyDownHandler);
  2185. smalltalk.addMethod(
  2186. smalltalk.method({
  2187. selector: "widget",
  2188. category: 'accessing',
  2189. fn: function (){
  2190. var self=this;
  2191. return smalltalk.withContext(function($ctx1) {
  2192. var $1;
  2193. $1=self["@widget"];
  2194. return $1;
  2195. }, function($ctx1) {$ctx1.fill(self,"widget",{},smalltalk.HLRepeatedKeyDownHandler)})},
  2196. args: [],
  2197. source: "widget\x0a\x09^ widget",
  2198. messageSends: [],
  2199. referencedClasses: []
  2200. }),
  2201. smalltalk.HLRepeatedKeyDownHandler);
  2202. smalltalk.addMethod(
  2203. smalltalk.method({
  2204. selector: "widget:",
  2205. category: 'accessing',
  2206. fn: function (aWidget){
  2207. var self=this;
  2208. return smalltalk.withContext(function($ctx1) {
  2209. self["@widget"]=aWidget;
  2210. return self}, function($ctx1) {$ctx1.fill(self,"widget:",{aWidget:aWidget},smalltalk.HLRepeatedKeyDownHandler)})},
  2211. args: ["aWidget"],
  2212. source: "widget: aWidget\x0a\x09widget := aWidget",
  2213. messageSends: [],
  2214. referencedClasses: []
  2215. }),
  2216. smalltalk.HLRepeatedKeyDownHandler);
  2217. smalltalk.addMethod(
  2218. smalltalk.method({
  2219. selector: "on:",
  2220. category: 'instance creation',
  2221. fn: function (aWidget){
  2222. var self=this;
  2223. return smalltalk.withContext(function($ctx1) {
  2224. var $2,$3,$1;
  2225. $2=self._new();
  2226. _st($2)._widget_(aWidget);
  2227. $3=_st($2)._yourself();
  2228. $1=$3;
  2229. return $1;
  2230. }, function($ctx1) {$ctx1.fill(self,"on:",{aWidget:aWidget},smalltalk.HLRepeatedKeyDownHandler.klass)})},
  2231. args: ["aWidget"],
  2232. source: "on: aWidget\x0a\x09^ self new\x0a\x09\x09widget: aWidget;\x0a\x09\x09yourself",
  2233. messageSends: ["widget:", "new", "yourself"],
  2234. referencedClasses: []
  2235. }),
  2236. smalltalk.HLRepeatedKeyDownHandler.klass);
  2237. });