1
0

Helios-Workspace.js 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069
  1. smalltalk.addPackage('Helios-Workspace');
  2. smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
  3. smalltalk.addMethod(
  4. "_announcer",
  5. smalltalk.method({
  6. selector: "announcer",
  7. category: 'accessing',
  8. fn: function (){
  9. var self=this;
  10. return smalltalk.withContext(function($ctx1) { var $2,$1;
  11. $2=self["@announcer"];
  12. if(($receiver = $2) == nil || $receiver == undefined){
  13. self["@announcer"]=_st((smalltalk.Announcer || Announcer))._new();
  14. $1=self["@announcer"];
  15. } else {
  16. $1=$2;
  17. };
  18. return $1;
  19. }, function($ctx1) {$ctx1.fill(self,"announcer",{}, smalltalk.HLCodeModel)})},
  20. args: [],
  21. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  22. messageSends: ["ifNil:", "new"],
  23. referencedClasses: ["Announcer"]
  24. }),
  25. smalltalk.HLCodeModel);
  26. smalltalk.addMethod(
  27. "_defaultReceiver",
  28. smalltalk.method({
  29. selector: "defaultReceiver",
  30. category: 'defaults',
  31. fn: function (){
  32. var self=this;
  33. return smalltalk.withContext(function($ctx1) { var $1;
  34. $1=_st((smalltalk.DoIt || DoIt))._new();
  35. return $1;
  36. }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{}, smalltalk.HLCodeModel)})},
  37. args: [],
  38. source: "defaultReceiver\x0a\x09^ DoIt new",
  39. messageSends: ["new"],
  40. referencedClasses: ["DoIt"]
  41. }),
  42. smalltalk.HLCodeModel);
  43. smalltalk.addMethod(
  44. "_doIt_",
  45. smalltalk.method({
  46. selector: "doIt:",
  47. category: 'actions',
  48. fn: function (someCode){
  49. var self=this;
  50. return smalltalk.withContext(function($ctx1) { var $1;
  51. $1=_st(_st(self)._environment())._eval_on_(someCode,_st(self)._receiver());
  52. return $1;
  53. }, function($ctx1) {$ctx1.fill(self,"doIt:",{someCode:someCode}, smalltalk.HLCodeModel)})},
  54. args: ["someCode"],
  55. source: "doIt: someCode\x0a\x0a\x09^ self environment eval: someCode on: self receiver",
  56. messageSends: ["eval:on:", "receiver", "environment"],
  57. referencedClasses: []
  58. }),
  59. smalltalk.HLCodeModel);
  60. smalltalk.addMethod(
  61. "_environment",
  62. smalltalk.method({
  63. selector: "environment",
  64. category: 'accessing',
  65. fn: function (){
  66. var self=this;
  67. return smalltalk.withContext(function($ctx1) { var $2,$1;
  68. $2=self["@environment"];
  69. if(($receiver = $2) == nil || $receiver == undefined){
  70. $1=_st(_st((smalltalk.HLManager || HLManager))._current())._environment();
  71. } else {
  72. $1=$2;
  73. };
  74. return $1;
  75. }, function($ctx1) {$ctx1.fill(self,"environment",{}, smalltalk.HLCodeModel)})},
  76. args: [],
  77. source: "environment\x0a\x09^ environment ifNil: [ HLManager current environment ]",
  78. messageSends: ["ifNil:", "environment", "current"],
  79. referencedClasses: ["HLManager"]
  80. }),
  81. smalltalk.HLCodeModel);
  82. smalltalk.addMethod(
  83. "_environment_",
  84. smalltalk.method({
  85. selector: "environment:",
  86. category: 'accessing',
  87. fn: function (anEnvironment){
  88. var self=this;
  89. return smalltalk.withContext(function($ctx1) { self["@environment"]=anEnvironment;
  90. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment}, smalltalk.HLCodeModel)})},
  91. args: ["anEnvironment"],
  92. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  93. messageSends: [],
  94. referencedClasses: []
  95. }),
  96. smalltalk.HLCodeModel);
  97. smalltalk.addMethod(
  98. "_receiver",
  99. smalltalk.method({
  100. selector: "receiver",
  101. category: 'accessing',
  102. fn: function (){
  103. var self=this;
  104. return smalltalk.withContext(function($ctx1) { var $2,$1;
  105. $2=self["@receiver"];
  106. if(($receiver = $2) == nil || $receiver == undefined){
  107. self["@receiver"]=_st(self)._defaultReceiver();
  108. $1=self["@receiver"];
  109. } else {
  110. $1=$2;
  111. };
  112. return $1;
  113. }, function($ctx1) {$ctx1.fill(self,"receiver",{}, smalltalk.HLCodeModel)})},
  114. args: [],
  115. source: "receiver\x0a\x09^ receiver ifNil: [ receiver := self defaultReceiver ]",
  116. messageSends: ["ifNil:", "defaultReceiver"],
  117. referencedClasses: []
  118. }),
  119. smalltalk.HLCodeModel);
  120. smalltalk.addMethod(
  121. "_receiver_",
  122. smalltalk.method({
  123. selector: "receiver:",
  124. category: 'accessing',
  125. fn: function (anObject){
  126. var self=this;
  127. return smalltalk.withContext(function($ctx1) { self["@receiver"]=anObject;
  128. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject}, smalltalk.HLCodeModel)})},
  129. args: ["anObject"],
  130. source: "receiver: anObject\x0a\x09receiver := anObject",
  131. messageSends: [],
  132. referencedClasses: []
  133. }),
  134. smalltalk.HLCodeModel);
  135. smalltalk.addMethod(
  136. "_subscribe_",
  137. smalltalk.method({
  138. selector: "subscribe:",
  139. category: 'actions',
  140. fn: function (aWidget){
  141. var self=this;
  142. return smalltalk.withContext(function($ctx1) { _st(aWidget)._subscribeTo_(_st(self)._announcer());
  143. return self}, function($ctx1) {$ctx1.fill(self,"subscribe:",{aWidget:aWidget}, smalltalk.HLCodeModel)})},
  144. args: ["aWidget"],
  145. source: "subscribe: aWidget\x0a\x09aWidget subscribeTo: self announcer",
  146. messageSends: ["subscribeTo:", "announcer"],
  147. referencedClasses: []
  148. }),
  149. smalltalk.HLCodeModel);
  150. smalltalk.addMethod(
  151. "_on_",
  152. smalltalk.method({
  153. selector: "on:",
  154. category: 'actions',
  155. fn: function (anEnvironment){
  156. var self=this;
  157. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  158. $2=_st(self)._new();
  159. _st($2)._environment_(anEnvironment);
  160. $3=_st($2)._yourself();
  161. $1=$3;
  162. return $1;
  163. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment}, smalltalk.HLCodeModel.klass)})},
  164. args: ["anEnvironment"],
  165. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  166. messageSends: ["environment:", "new", "yourself"],
  167. referencedClasses: []
  168. }),
  169. smalltalk.HLCodeModel.klass);
  170. smalltalk.addClass('HLCodeWidget', smalltalk.HLWidget, ['model', 'wrapper', 'code', 'editor'], 'Helios-Workspace');
  171. smalltalk.addMethod(
  172. "_announcer",
  173. smalltalk.method({
  174. selector: "announcer",
  175. category: 'accessing',
  176. fn: function (){
  177. var self=this;
  178. return smalltalk.withContext(function($ctx1) { var $1;
  179. $1=_st(_st(self)._model())._announcer();
  180. return $1;
  181. }, function($ctx1) {$ctx1.fill(self,"announcer",{}, smalltalk.HLCodeWidget)})},
  182. args: [],
  183. source: "announcer\x0a\x09^ self model announcer",
  184. messageSends: ["announcer", "model"],
  185. referencedClasses: []
  186. }),
  187. smalltalk.HLCodeWidget);
  188. smalltalk.addMethod(
  189. "_clear",
  190. smalltalk.method({
  191. selector: "clear",
  192. category: 'actions',
  193. fn: function (){
  194. var self=this;
  195. return smalltalk.withContext(function($ctx1) { _st(self)._contents_("");
  196. return self}, function($ctx1) {$ctx1.fill(self,"clear",{}, smalltalk.HLCodeWidget)})},
  197. args: [],
  198. source: "clear\x0a self contents: ''",
  199. messageSends: ["contents:"],
  200. referencedClasses: []
  201. }),
  202. smalltalk.HLCodeWidget);
  203. smalltalk.addMethod(
  204. "_contents",
  205. smalltalk.method({
  206. selector: "contents",
  207. category: 'accessing',
  208. fn: function (){
  209. var self=this;
  210. return smalltalk.withContext(function($ctx1) { var $1;
  211. $1=_st(self["@editor"])._getValue();
  212. return $1;
  213. }, function($ctx1) {$ctx1.fill(self,"contents",{}, smalltalk.HLCodeWidget)})},
  214. args: [],
  215. source: "contents\x0a\x09^ editor getValue",
  216. messageSends: ["getValue"],
  217. referencedClasses: []
  218. }),
  219. smalltalk.HLCodeWidget);
  220. smalltalk.addMethod(
  221. "_contents_",
  222. smalltalk.method({
  223. selector: "contents:",
  224. category: 'accessing',
  225. fn: function (aString){
  226. var self=this;
  227. return smalltalk.withContext(function($ctx1) { _st(self["@editor"])._setValue_(aString);
  228. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString}, smalltalk.HLCodeWidget)})},
  229. args: ["aString"],
  230. source: "contents: aString\x0a\x09editor setValue: aString",
  231. messageSends: ["setValue:"],
  232. referencedClasses: []
  233. }),
  234. smalltalk.HLCodeWidget);
  235. smalltalk.addMethod(
  236. "_currentLine",
  237. smalltalk.method({
  238. selector: "currentLine",
  239. category: 'accessing',
  240. fn: function (){
  241. var self=this;
  242. return smalltalk.withContext(function($ctx1) { var $1;
  243. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  244. return $1;
  245. }, function($ctx1) {$ctx1.fill(self,"currentLine",{}, smalltalk.HLCodeWidget)})},
  246. args: [],
  247. source: "currentLine\x0a ^editor getLine: (editor getCursor line)",
  248. messageSends: ["getLine:", "line", "getCursor"],
  249. referencedClasses: []
  250. }),
  251. smalltalk.HLCodeWidget);
  252. smalltalk.addMethod(
  253. "_currentLineOrSelection",
  254. smalltalk.method({
  255. selector: "currentLineOrSelection",
  256. category: 'accessing',
  257. fn: function (){
  258. var self=this;
  259. return smalltalk.withContext(function($ctx1) { var $2,$1;
  260. $2=_st(self["@editor"])._somethingSelected();
  261. if(smalltalk.assert($2)){
  262. $1=_st(self)._selection();
  263. } else {
  264. $1=_st(self)._currentLine();
  265. };
  266. return $1;
  267. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{}, smalltalk.HLCodeWidget)})},
  268. args: [],
  269. source: "currentLineOrSelection\x0a ^editor somethingSelected\x0a\x09\x09ifFalse: [self currentLine]\x0a\x09\x09ifTrue: [self selection]",
  270. messageSends: ["ifFalse:ifTrue:", "currentLine", "selection", "somethingSelected"],
  271. referencedClasses: []
  272. }),
  273. smalltalk.HLCodeWidget);
  274. smalltalk.addMethod(
  275. "_doIt",
  276. smalltalk.method({
  277. selector: "doIt",
  278. category: 'actions',
  279. fn: function (){
  280. var self=this;
  281. var result;
  282. return smalltalk.withContext(function($ctx1) { var $1;
  283. _st(_st(self)._announcer())._announce_(_st((smalltalk.HLDoItRequested || HLDoItRequested))._on_(self["@model"]));
  284. result=_st(self["@model"])._doIt_(_st(self)._currentLineOrSelection());
  285. _st(_st(self)._announcer())._announce_(_st((smalltalk.HLDoItExecuted || HLDoItExecuted))._on_(self["@model"]));
  286. $1=result;
  287. return $1;
  288. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result}, smalltalk.HLCodeWidget)})},
  289. args: [],
  290. source: "doIt\x0a\x09| result |\x0a\x0a\x09self announcer announce: (HLDoItRequested on: model).\x0a\x0a\x09result:= model doIt: self currentLineOrSelection.\x0a\x0a\x09self announcer announce: (HLDoItExecuted on: model).\x0a\x0a\x09^ result ",
  291. messageSends: ["announce:", "on:", "announcer", "doIt:", "currentLineOrSelection"],
  292. referencedClasses: ["HLDoItRequested", "HLDoItExecuted"]
  293. }),
  294. smalltalk.HLCodeWidget);
  295. smalltalk.addMethod(
  296. "_editor",
  297. smalltalk.method({
  298. selector: "editor",
  299. category: 'actions',
  300. fn: function (){
  301. var self=this;
  302. return smalltalk.withContext(function($ctx1) { var $1;
  303. $1=self["@editor"];
  304. return $1;
  305. }, function($ctx1) {$ctx1.fill(self,"editor",{}, smalltalk.HLCodeWidget)})},
  306. args: [],
  307. source: "editor\x0a\x09^editor",
  308. messageSends: [],
  309. referencedClasses: []
  310. }),
  311. smalltalk.HLCodeWidget);
  312. smalltalk.addMethod(
  313. "_focus",
  314. smalltalk.method({
  315. selector: "focus",
  316. category: 'actions',
  317. fn: function (){
  318. var self=this;
  319. return smalltalk.withContext(function($ctx1) { _st(_st(self)._editor())._focus();
  320. return self}, function($ctx1) {$ctx1.fill(self,"focus",{}, smalltalk.HLCodeWidget)})},
  321. args: [],
  322. source: "focus\x0a self editor focus",
  323. messageSends: ["focus", "editor"],
  324. referencedClasses: []
  325. }),
  326. smalltalk.HLCodeWidget);
  327. smalltalk.addMethod(
  328. "_inspectIt",
  329. smalltalk.method({
  330. selector: "inspectIt",
  331. category: 'actions',
  332. fn: function (){
  333. var self=this;
  334. var newInspector;
  335. return smalltalk.withContext(function($ctx1) { _st(_st(self)._announcer())._announce_(_st((smalltalk.HLInspectItRequested || HLInspectItRequested))._on_(self["@model"]));
  336. newInspector=_st(self)._makeInspectorOn_(_st(self)._doIt());
  337. _st(newInspector)._open();
  338. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector}, smalltalk.HLCodeWidget)})},
  339. args: [],
  340. source: "inspectIt\x0a\x09| newInspector |\x0a \x0a\x09self announcer announce: (HLInspectItRequested on: model).\x0a\x09newInspector := self makeInspectorOn: self doIt.\x0a\x09newInspector open",
  341. messageSends: ["announce:", "on:", "announcer", "makeInspectorOn:", "doIt", "open"],
  342. referencedClasses: ["HLInspectItRequested"]
  343. }),
  344. smalltalk.HLCodeWidget);
  345. smalltalk.addMethod(
  346. "_makeInspectorOn_",
  347. smalltalk.method({
  348. selector: "makeInspectorOn:",
  349. category: 'actions',
  350. fn: function (anObject){
  351. var self=this;
  352. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  353. $2=_st((smalltalk.HLInspector || HLInspector))._new();
  354. _st($2)._inspect_(anObject);
  355. $3=_st($2)._yourself();
  356. $1=$3;
  357. return $1;
  358. }, function($ctx1) {$ctx1.fill(self,"makeInspectorOn:",{anObject:anObject}, smalltalk.HLCodeWidget)})},
  359. args: ["anObject"],
  360. source: "makeInspectorOn: anObject\x0a\x0a\x09^ HLInspector new \x0a\x09\x09inspect: anObject;\x0a\x09\x09yourself",
  361. messageSends: ["inspect:", "new", "yourself"],
  362. referencedClasses: ["HLInspector"]
  363. }),
  364. smalltalk.HLCodeWidget);
  365. smalltalk.addMethod(
  366. "_model",
  367. smalltalk.method({
  368. selector: "model",
  369. category: 'accessing',
  370. fn: function (){
  371. var self=this;
  372. return smalltalk.withContext(function($ctx1) { var $2,$1;
  373. $2=self["@model"];
  374. if(($receiver = $2) == nil || $receiver == undefined){
  375. _st(self)._model_(_st((smalltalk.HLCodeModel || HLCodeModel))._new());
  376. $1=self["@model"];
  377. } else {
  378. $1=$2;
  379. };
  380. return $1;
  381. }, function($ctx1) {$ctx1.fill(self,"model",{}, smalltalk.HLCodeWidget)})},
  382. args: [],
  383. source: "model\x0a\x09^ model ifNil: [ \x0a \x09self model: HLCodeModel new.\x0a\x09\x09model ]",
  384. messageSends: ["ifNil:", "model:", "new"],
  385. referencedClasses: ["HLCodeModel"]
  386. }),
  387. smalltalk.HLCodeWidget);
  388. smalltalk.addMethod(
  389. "_model_",
  390. smalltalk.method({
  391. selector: "model:",
  392. category: 'accessing',
  393. fn: function (aModel){
  394. var self=this;
  395. return smalltalk.withContext(function($ctx1) { self["@model"]=aModel;
  396. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel}, smalltalk.HLCodeWidget)})},
  397. args: ["aModel"],
  398. source: "model: aModel\x0a\x09model := aModel",
  399. messageSends: [],
  400. referencedClasses: []
  401. }),
  402. smalltalk.HLCodeWidget);
  403. smalltalk.addMethod(
  404. "_observeWrapper",
  405. smalltalk.method({
  406. selector: "observeWrapper",
  407. category: 'actions',
  408. fn: function (){
  409. var self=this;
  410. return smalltalk.withContext(function($ctx1) { _st(self["@wrapper"])._onKeyDown_((function(e){
  411. return smalltalk.withContext(function($ctx2) { return _st(self)._onKeyDown_(e);
  412. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1)})}));
  413. return self}, function($ctx1) {$ctx1.fill(self,"observeWrapper",{}, smalltalk.HLCodeWidget)})},
  414. args: [],
  415. source: "observeWrapper\x0a\x0a wrapper onKeyDown: [ :e | self onKeyDown: e ]\x0a",
  416. messageSends: ["onKeyDown:"],
  417. referencedClasses: []
  418. }),
  419. smalltalk.HLCodeWidget);
  420. smalltalk.addMethod(
  421. "_onDoIt",
  422. smalltalk.method({
  423. selector: "onDoIt",
  424. category: 'reactions',
  425. fn: function (){
  426. var self=this;
  427. return smalltalk.withContext(function($ctx1) { _st(self)._doIt();
  428. return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{}, smalltalk.HLCodeWidget)})},
  429. args: [],
  430. source: "onDoIt\x0a\x09\x0a self doIt",
  431. messageSends: ["doIt"],
  432. referencedClasses: []
  433. }),
  434. smalltalk.HLCodeWidget);
  435. smalltalk.addMethod(
  436. "_onInspectIt",
  437. smalltalk.method({
  438. selector: "onInspectIt",
  439. category: 'reactions',
  440. fn: function (){
  441. var self=this;
  442. return smalltalk.withContext(function($ctx1) { _st(self)._inspectIt();
  443. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{}, smalltalk.HLCodeWidget)})},
  444. args: [],
  445. source: "onInspectIt\x0a\x0a\x09self inspectIt",
  446. messageSends: ["inspectIt"],
  447. referencedClasses: []
  448. }),
  449. smalltalk.HLCodeWidget);
  450. smalltalk.addMethod(
  451. "_onKeyDown_",
  452. smalltalk.method({
  453. selector: "onKeyDown:",
  454. category: 'reactions',
  455. fn: function (anEvent){
  456. var self=this;
  457. return smalltalk.withContext(function($ctx1) { if(anEvent.ctrlKey) {
  458. if(anEvent.keyCode === 80) { //ctrl+p
  459. self._onPrintIt();
  460. anEvent.preventDefault();
  461. return false;
  462. }
  463. if(anEvent.keyCode === 68) { //ctrl+d
  464. self._onDoIt();
  465. anEvent.preventDefault();
  466. return false;
  467. }
  468. if(anEvent.keyCode === 73) { //ctrl+i
  469. self._onInspectIt();
  470. anEvent.preventDefault();
  471. return false;
  472. }
  473. };
  474. return self}, function($ctx1) {$ctx1.fill(self,"onKeyDown:",{anEvent:anEvent}, smalltalk.HLCodeWidget)})},
  475. args: ["anEvent"],
  476. source: "onKeyDown: anEvent\x0a\x0a <if(anEvent.ctrlKey) {\x0a\x09\x09if(anEvent.keyCode === 80) { //ctrl+p\x0a\x09\x09\x09self._onPrintIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09\x09if(anEvent.keyCode === 68) { //ctrl+d\x0a\x09\x09\x09self._onDoIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09\x09if(anEvent.keyCode === 73) { //ctrl+i\x0a\x09\x09\x09self._onInspectIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09}>\x09",
  477. messageSends: [],
  478. referencedClasses: []
  479. }),
  480. smalltalk.HLCodeWidget);
  481. smalltalk.addMethod(
  482. "_onPrintIt",
  483. smalltalk.method({
  484. selector: "onPrintIt",
  485. category: 'reactions',
  486. fn: function (){
  487. var self=this;
  488. return smalltalk.withContext(function($ctx1) { _st(self)._printIt();
  489. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{}, smalltalk.HLCodeWidget)})},
  490. args: [],
  491. source: "onPrintIt\x0a\x0a\x09self printIt",
  492. messageSends: ["printIt"],
  493. referencedClasses: []
  494. }),
  495. smalltalk.HLCodeWidget);
  496. smalltalk.addMethod(
  497. "_print_",
  498. smalltalk.method({
  499. selector: "print:",
  500. category: 'actions',
  501. fn: function (aString){
  502. var self=this;
  503. var start,stop;
  504. return smalltalk.withContext(function($ctx1) { start=_st((smalltalk.HashedCollection || HashedCollection))._new();
  505. stop=_st((smalltalk.HashedCollection || HashedCollection))._new();
  506. _st(start)._at_put_("line",_st(_st(self["@editor"])._getCursor_(false))._line());
  507. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getCursor_(false))._ch());
  508. _st(stop)._at_put_("line",_st(start)._at_("line"));
  509. _st(stop)._at_put_("ch",_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2)));
  510. _st(self["@editor"])._replaceSelection_(_st(_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString)).__comma(" "));
  511. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  512. _st(self["@editor"])._setSelection_end_(stop,start);
  513. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop}, smalltalk.HLCodeWidget)})},
  514. args: ["aString"],
  515. source: "print: aString\x0a\x09| start stop |\x0a\x09start := HashedCollection new.\x0a\x09stop := HashedCollection new.\x0a\x09start at: 'line' put: (editor getCursor: false) line.\x0a\x09start at: 'ch' put: (editor getCursor: false) ch.\x0a\x09stop at: 'line' put: (start at: 'line').\x0a\x09stop at: 'ch' put: ((start at: 'ch') + aString size + 2).\x0a\x09editor replaceSelection: (editor getSelection, ' ', aString, ' ').\x0a\x09editor setCursor: (editor getCursor: true).\x0a\x09editor setSelection: stop end: start",
  516. messageSends: ["new", "at:put:", "line", "getCursor:", "ch", "at:", "+", "size", "replaceSelection:", ",", "getSelection", "setCursor:", "setSelection:end:"],
  517. referencedClasses: ["HashedCollection"]
  518. }),
  519. smalltalk.HLCodeWidget);
  520. smalltalk.addMethod(
  521. "_printIt",
  522. smalltalk.method({
  523. selector: "printIt",
  524. category: 'actions',
  525. fn: function (){
  526. var self=this;
  527. var result;
  528. return smalltalk.withContext(function($ctx1) { result=_st(self)._doIt();
  529. _st(_st(self)._announcer())._announce_(_st((smalltalk.HLPrintItRequested || HLPrintItRequested))._on_(self["@model"]));
  530. _st(self)._print_(_st(result)._printString());
  531. _st(self)._focus();
  532. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{result:result}, smalltalk.HLCodeWidget)})},
  533. args: [],
  534. source: "printIt\x0a\x09| result |\x0a\x0a\x09result:= self doIt.\x0a \x0a\x09self announcer announce: (HLPrintItRequested on: model).\x0a\x0a self print: result printString.\x0a\x09self focus.",
  535. messageSends: ["doIt", "announce:", "on:", "announcer", "print:", "printString", "focus"],
  536. referencedClasses: ["HLPrintItRequested"]
  537. }),
  538. smalltalk.HLCodeWidget);
  539. smalltalk.addMethod(
  540. "_receiver",
  541. smalltalk.method({
  542. selector: "receiver",
  543. category: 'accessing',
  544. fn: function (){
  545. var self=this;
  546. return smalltalk.withContext(function($ctx1) { var $1;
  547. $1=_st(_st(self)._model())._receiver();
  548. return $1;
  549. }, function($ctx1) {$ctx1.fill(self,"receiver",{}, smalltalk.HLCodeWidget)})},
  550. args: [],
  551. source: "receiver\x0a\x09^ self model receiver",
  552. messageSends: ["receiver", "model"],
  553. referencedClasses: []
  554. }),
  555. smalltalk.HLCodeWidget);
  556. smalltalk.addMethod(
  557. "_receiver_",
  558. smalltalk.method({
  559. selector: "receiver:",
  560. category: 'accessing',
  561. fn: function (anObject){
  562. var self=this;
  563. return smalltalk.withContext(function($ctx1) { _st(_st(self)._model())._receiver_(anObject);
  564. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject}, smalltalk.HLCodeWidget)})},
  565. args: ["anObject"],
  566. source: "receiver: anObject\x0a\x09self model receiver: anObject",
  567. messageSends: ["receiver:", "model"],
  568. referencedClasses: []
  569. }),
  570. smalltalk.HLCodeWidget);
  571. smalltalk.addMethod(
  572. "_renderContentOn_",
  573. smalltalk.method({
  574. selector: "renderContentOn:",
  575. category: 'rendering',
  576. fn: function (html){
  577. var self=this;
  578. return smalltalk.withContext(function($ctx1) { self["@code"]=_st(html)._textarea();
  579. _st(self)._setEditorOn_(_st(self["@code"])._element());
  580. _st(self)._observeWrapper();
  581. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLCodeWidget)})},
  582. args: ["html"],
  583. source: "renderContentOn: html\x0a code := html textarea.\x0a self setEditorOn: code element.\x0a \x0a self observeWrapper",
  584. messageSends: ["textarea", "setEditorOn:", "element", "observeWrapper"],
  585. referencedClasses: []
  586. }),
  587. smalltalk.HLCodeWidget);
  588. smalltalk.addMethod(
  589. "_selection",
  590. smalltalk.method({
  591. selector: "selection",
  592. category: 'accessing',
  593. fn: function (){
  594. var self=this;
  595. return smalltalk.withContext(function($ctx1) { var $1;
  596. $1=_st(self["@editor"])._getSelection();
  597. return $1;
  598. }, function($ctx1) {$ctx1.fill(self,"selection",{}, smalltalk.HLCodeWidget)})},
  599. args: [],
  600. source: "selection\x0a\x09^editor getSelection",
  601. messageSends: ["getSelection"],
  602. referencedClasses: []
  603. }),
  604. smalltalk.HLCodeWidget);
  605. smalltalk.addMethod(
  606. "_selectionEnd",
  607. smalltalk.method({
  608. selector: "selectionEnd",
  609. category: 'accessing',
  610. fn: function (){
  611. var self=this;
  612. return smalltalk.withContext(function($ctx1) { var $1;
  613. $1=_st(_st(self["@code"])._element())._selectionEnd();
  614. return $1;
  615. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{}, smalltalk.HLCodeWidget)})},
  616. args: [],
  617. source: "selectionEnd\x0a ^code element selectionEnd",
  618. messageSends: ["selectionEnd", "element"],
  619. referencedClasses: []
  620. }),
  621. smalltalk.HLCodeWidget);
  622. smalltalk.addMethod(
  623. "_selectionEnd_",
  624. smalltalk.method({
  625. selector: "selectionEnd:",
  626. category: 'accessing',
  627. fn: function (anInteger){
  628. var self=this;
  629. return smalltalk.withContext(function($ctx1) { _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  630. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger}, smalltalk.HLCodeWidget)})},
  631. args: ["anInteger"],
  632. source: "selectionEnd: anInteger\x0a code element selectionEnd: anInteger",
  633. messageSends: ["selectionEnd:", "element"],
  634. referencedClasses: []
  635. }),
  636. smalltalk.HLCodeWidget);
  637. smalltalk.addMethod(
  638. "_selectionStart",
  639. smalltalk.method({
  640. selector: "selectionStart",
  641. category: 'accessing',
  642. fn: function (){
  643. var self=this;
  644. return smalltalk.withContext(function($ctx1) { var $1;
  645. $1=_st(_st(self["@code"])._element())._selectionStart();
  646. return $1;
  647. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{}, smalltalk.HLCodeWidget)})},
  648. args: [],
  649. source: "selectionStart\x0a ^code element selectionStart",
  650. messageSends: ["selectionStart", "element"],
  651. referencedClasses: []
  652. }),
  653. smalltalk.HLCodeWidget);
  654. smalltalk.addMethod(
  655. "_selectionStart_",
  656. smalltalk.method({
  657. selector: "selectionStart:",
  658. category: 'accessing',
  659. fn: function (anInteger){
  660. var self=this;
  661. return smalltalk.withContext(function($ctx1) { _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  662. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger}, smalltalk.HLCodeWidget)})},
  663. args: ["anInteger"],
  664. source: "selectionStart: anInteger\x0a code element selectionStart: anInteger",
  665. messageSends: ["selectionStart:", "element"],
  666. referencedClasses: []
  667. }),
  668. smalltalk.HLCodeWidget);
  669. smalltalk.addMethod(
  670. "_setEditorOn_",
  671. smalltalk.method({
  672. selector: "setEditorOn:",
  673. category: 'actions',
  674. fn: function (aTextarea){
  675. var self=this;
  676. return smalltalk.withContext(function($ctx1) { self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
  677. theme: 'amber',
  678. lineNumbers: true,
  679. enterMode: 'flat',
  680. matchBrackets: true,
  681. electricChars: false
  682. });
  683. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea}, smalltalk.HLCodeWidget)})},
  684. args: ["aTextarea"],
  685. source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {\x0a\x09\x09theme: 'amber',\x0a lineNumbers: true,\x0a enterMode: 'flat',\x0a matchBrackets: true,\x0a electricChars: false\x0a\x09})>",
  686. messageSends: [],
  687. referencedClasses: []
  688. }),
  689. smalltalk.HLCodeWidget);
  690. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['model', 'codeWidget'], 'Helios-Workspace');
  691. smalltalk.addMethod(
  692. "_codeWidget",
  693. smalltalk.method({
  694. selector: "codeWidget",
  695. category: 'accessing',
  696. fn: function (){
  697. var self=this;
  698. return smalltalk.withContext(function($ctx1) { var $2,$3,$4,$1;
  699. $2=self["@codeWidget"];
  700. if(($receiver = $2) == nil || $receiver == undefined){
  701. $3=_st((smalltalk.HLCodeWidget || HLCodeWidget))._new();
  702. _st($3)._model_(_st(_st(self)._model())._code());
  703. $4=_st($3)._yourself();
  704. self["@codeWidget"]=$4;
  705. $1=self["@codeWidget"];
  706. } else {
  707. $1=$2;
  708. };
  709. return $1;
  710. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{}, smalltalk.HLWorkspace)})},
  711. args: [],
  712. source: "codeWidget\x0a\x09^ codeWidget ifNil: [\x0a\x09\x09codeWidget := HLCodeWidget new\x0a \x09\x09model: self model code;\x0a \x09yourself ]",
  713. messageSends: ["ifNil:", "model:", "code", "model", "new", "yourself"],
  714. referencedClasses: ["HLCodeWidget"]
  715. }),
  716. smalltalk.HLWorkspace);
  717. smalltalk.addMethod(
  718. "_model",
  719. smalltalk.method({
  720. selector: "model",
  721. category: 'accessing',
  722. fn: function (){
  723. var self=this;
  724. return smalltalk.withContext(function($ctx1) { var $2,$1;
  725. $2=self["@model"];
  726. if(($receiver = $2) == nil || $receiver == undefined){
  727. _st(self)._model_(_st((smalltalk.HLWorkspaceModel || HLWorkspaceModel))._new());
  728. $1=self["@model"];
  729. } else {
  730. $1=$2;
  731. };
  732. return $1;
  733. }, function($ctx1) {$ctx1.fill(self,"model",{}, smalltalk.HLWorkspace)})},
  734. args: [],
  735. source: "model\x0a\x09^ model ifNil: [ \x0a \x09self model: HLWorkspaceModel new.\x0a\x09\x09model ]",
  736. messageSends: ["ifNil:", "model:", "new"],
  737. referencedClasses: ["HLWorkspaceModel"]
  738. }),
  739. smalltalk.HLWorkspace);
  740. smalltalk.addMethod(
  741. "_model_",
  742. smalltalk.method({
  743. selector: "model:",
  744. category: 'accessing',
  745. fn: function (aModel){
  746. var self=this;
  747. return smalltalk.withContext(function($ctx1) { self["@model"]=aModel;
  748. _st(_st(self)._codeWidget())._model_(_st(aModel)._code());
  749. _st(self)._observeCodeWidget();
  750. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel}, smalltalk.HLWorkspace)})},
  751. args: ["aModel"],
  752. source: "model: aModel\x0a\x09model := aModel.\x0a \x0a self codeWidget model: aModel code.\x0a self observeCodeWidget.\x0a ",
  753. messageSends: ["model:", "code", "codeWidget", "observeCodeWidget"],
  754. referencedClasses: []
  755. }),
  756. smalltalk.HLWorkspace);
  757. smalltalk.addMethod(
  758. "_observeCodeWidget",
  759. smalltalk.method({
  760. selector: "observeCodeWidget",
  761. category: 'actions',
  762. fn: function (){
  763. var self=this;
  764. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"observeCodeWidget",{}, smalltalk.HLWorkspace)})},
  765. args: [],
  766. source: "observeCodeWidget\x0a\x0a",
  767. messageSends: [],
  768. referencedClasses: []
  769. }),
  770. smalltalk.HLWorkspace);
  771. smalltalk.addMethod(
  772. "_onDoIt",
  773. smalltalk.method({
  774. selector: "onDoIt",
  775. category: 'reactions',
  776. fn: function (){
  777. var self=this;
  778. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{}, smalltalk.HLWorkspace)})},
  779. args: [],
  780. source: "onDoIt",
  781. messageSends: [],
  782. referencedClasses: []
  783. }),
  784. smalltalk.HLWorkspace);
  785. smalltalk.addMethod(
  786. "_onInspectIt",
  787. smalltalk.method({
  788. selector: "onInspectIt",
  789. category: 'reactions',
  790. fn: function (){
  791. var self=this;
  792. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{}, smalltalk.HLWorkspace)})},
  793. args: [],
  794. source: "onInspectIt",
  795. messageSends: [],
  796. referencedClasses: []
  797. }),
  798. smalltalk.HLWorkspace);
  799. smalltalk.addMethod(
  800. "_onPrintIt",
  801. smalltalk.method({
  802. selector: "onPrintIt",
  803. category: 'reactions',
  804. fn: function (){
  805. var self=this;
  806. return smalltalk.withContext(function($ctx1) { return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{}, smalltalk.HLWorkspace)})},
  807. args: [],
  808. source: "onPrintIt",
  809. messageSends: [],
  810. referencedClasses: []
  811. }),
  812. smalltalk.HLWorkspace);
  813. smalltalk.addMethod(
  814. "_renderContentOn_",
  815. smalltalk.method({
  816. selector: "renderContentOn:",
  817. category: 'rendering',
  818. fn: function (html){
  819. var self=this;
  820. return smalltalk.withContext(function($ctx1) { _st(html)._with_(_st(self)._codeWidget());
  821. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html}, smalltalk.HLWorkspace)})},
  822. args: ["html"],
  823. source: "renderContentOn: html\x0a\x09html with: self codeWidget\x0a ",
  824. messageSends: ["with:", "codeWidget"],
  825. referencedClasses: []
  826. }),
  827. smalltalk.HLWorkspace);
  828. smalltalk.addMethod(
  829. "_canBeOpenAsTab",
  830. smalltalk.method({
  831. selector: "canBeOpenAsTab",
  832. category: 'testing',
  833. fn: function (){
  834. var self=this;
  835. return smalltalk.withContext(function($ctx1) { return true;
  836. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{}, smalltalk.HLWorkspace.klass)})},
  837. args: [],
  838. source: "canBeOpenAsTab\x0a\x09^ true",
  839. messageSends: [],
  840. referencedClasses: []
  841. }),
  842. smalltalk.HLWorkspace.klass);
  843. smalltalk.addMethod(
  844. "_tabLabel",
  845. smalltalk.method({
  846. selector: "tabLabel",
  847. category: 'accessing',
  848. fn: function (){
  849. var self=this;
  850. return smalltalk.withContext(function($ctx1) { return "Workspace";
  851. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{}, smalltalk.HLWorkspace.klass)})},
  852. args: [],
  853. source: "tabLabel\x0a\x09^ 'Workspace'",
  854. messageSends: [],
  855. referencedClasses: []
  856. }),
  857. smalltalk.HLWorkspace.klass);
  858. smalltalk.addMethod(
  859. "_tabPriority",
  860. smalltalk.method({
  861. selector: "tabPriority",
  862. category: 'accessing',
  863. fn: function (){
  864. var self=this;
  865. return smalltalk.withContext(function($ctx1) { return (10);
  866. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{}, smalltalk.HLWorkspace.klass)})},
  867. args: [],
  868. source: "tabPriority\x0a\x09^ 10",
  869. messageSends: [],
  870. referencedClasses: []
  871. }),
  872. smalltalk.HLWorkspace.klass);
  873. smalltalk.addClass('HLWorkspaceModel', smalltalk.Object, ['announcer', 'environment', 'code'], 'Helios-Workspace');
  874. smalltalk.addMethod(
  875. "_announcer",
  876. smalltalk.method({
  877. selector: "announcer",
  878. category: 'accessing',
  879. fn: function (){
  880. var self=this;
  881. return smalltalk.withContext(function($ctx1) { var $2,$1;
  882. $2=self["@announcer"];
  883. if(($receiver = $2) == nil || $receiver == undefined){
  884. self["@announcer"]=_st((smalltalk.Announcer || Announcer))._new();
  885. $1=self["@announcer"];
  886. } else {
  887. $1=$2;
  888. };
  889. return $1;
  890. }, function($ctx1) {$ctx1.fill(self,"announcer",{}, smalltalk.HLWorkspaceModel)})},
  891. args: [],
  892. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  893. messageSends: ["ifNil:", "new"],
  894. referencedClasses: ["Announcer"]
  895. }),
  896. smalltalk.HLWorkspaceModel);
  897. smalltalk.addMethod(
  898. "_code",
  899. smalltalk.method({
  900. selector: "code",
  901. category: 'accessing',
  902. fn: function (){
  903. var self=this;
  904. return smalltalk.withContext(function($ctx1) { var $2,$1;
  905. $2=self["@code"];
  906. if(($receiver = $2) == nil || $receiver == undefined){
  907. $1=_st((smalltalk.HLCodeModel || HLCodeModel))._on_(_st(self)._environment());
  908. } else {
  909. $1=$2;
  910. };
  911. return $1;
  912. }, function($ctx1) {$ctx1.fill(self,"code",{}, smalltalk.HLWorkspaceModel)})},
  913. args: [],
  914. source: "code\x0a\x09\x22Answers the code model working for this workspace model\x22\x0a\x09^ code ifNil:[ HLCodeModel on: self environment ]",
  915. messageSends: ["ifNil:", "on:", "environment"],
  916. referencedClasses: ["HLCodeModel"]
  917. }),
  918. smalltalk.HLWorkspaceModel);
  919. smalltalk.addMethod(
  920. "_environment",
  921. smalltalk.method({
  922. selector: "environment",
  923. category: 'accessing',
  924. fn: function (){
  925. var self=this;
  926. return smalltalk.withContext(function($ctx1) { var $2,$1;
  927. $2=self["@environment"];
  928. if(($receiver = $2) == nil || $receiver == undefined){
  929. $1=_st(_st((smalltalk.HLManager || HLManager))._current())._environment();
  930. } else {
  931. $1=$2;
  932. };
  933. return $1;
  934. }, function($ctx1) {$ctx1.fill(self,"environment",{}, smalltalk.HLWorkspaceModel)})},
  935. args: [],
  936. source: "environment\x0a\x09^ environment ifNil: [ HLManager current environment ]",
  937. messageSends: ["ifNil:", "environment", "current"],
  938. referencedClasses: ["HLManager"]
  939. }),
  940. smalltalk.HLWorkspaceModel);
  941. smalltalk.addMethod(
  942. "_environment_",
  943. smalltalk.method({
  944. selector: "environment:",
  945. category: 'accessing',
  946. fn: function (anEnvironment){
  947. var self=this;
  948. return smalltalk.withContext(function($ctx1) { self["@environment"]=anEnvironment;
  949. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment}, smalltalk.HLWorkspaceModel)})},
  950. args: ["anEnvironment"],
  951. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  952. messageSends: [],
  953. referencedClasses: []
  954. }),
  955. smalltalk.HLWorkspaceModel);
  956. smalltalk.addMethod(
  957. "_onKeyDown_",
  958. smalltalk.method({
  959. selector: "onKeyDown:",
  960. category: 'reactions',
  961. fn: function (anEvent){
  962. var self=this;
  963. return smalltalk.withContext(function($ctx1) { if(anEvent.ctrlKey) {
  964. if(anEvent.keyCode === 80) { //ctrl+p
  965. self._printIt();
  966. anEvent.preventDefault();
  967. return false;
  968. }
  969. if(anEvent.keyCode === 68) { //ctrl+d
  970. self._doIt();
  971. anEvent.preventDefault();
  972. return false;
  973. }
  974. if(anEvent.keyCode === 73) { //ctrl+i
  975. self._inspectIt();
  976. anEvent.preventDefault();
  977. return false;
  978. }
  979. };
  980. return self}, function($ctx1) {$ctx1.fill(self,"onKeyDown:",{anEvent:anEvent}, smalltalk.HLWorkspaceModel)})},
  981. args: ["anEvent"],
  982. source: "onKeyDown: anEvent\x0a\x0a\x09<if(anEvent.ctrlKey) {\x0a\x09\x09if(anEvent.keyCode === 80) { //ctrl+p\x0a\x09\x09\x09self._printIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09\x09if(anEvent.keyCode === 68) { //ctrl+d\x0a\x09\x09\x09self._doIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09\x09if(anEvent.keyCode === 73) { //ctrl+i\x0a\x09\x09\x09self._inspectIt();\x0a\x09\x09\x09anEvent.preventDefault();\x0a\x09\x09\x09return false;\x0a\x09\x09}\x0a\x09}>",
  983. messageSends: [],
  984. referencedClasses: []
  985. }),
  986. smalltalk.HLWorkspaceModel);
  987. smalltalk.addMethod(
  988. "_on_",
  989. smalltalk.method({
  990. selector: "on:",
  991. category: 'actions',
  992. fn: function (anEnvironment){
  993. var self=this;
  994. return smalltalk.withContext(function($ctx1) { var $2,$3,$1;
  995. $2=_st(self)._new();
  996. _st($2)._environment_(anEnvironment);
  997. $3=_st($2)._yourself();
  998. $1=$3;
  999. return $1;
  1000. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment}, smalltalk.HLWorkspaceModel.klass)})},
  1001. args: ["anEnvironment"],
  1002. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  1003. messageSends: ["environment:", "new", "yourself"],
  1004. referencedClasses: []
  1005. }),
  1006. smalltalk.HLWorkspaceModel.klass);