1
0

Helios-Workspace.js 33 KB

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