Helios-Workspace.js 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780
  1. smalltalk.addPackage('Helios-Workspace');
  2. smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "announcer",
  6. category: 'accessing',
  7. fn: function (){
  8. var self=this;
  9. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  10. return smalltalk.withContext(function($ctx1) {
  11. var $2,$1;
  12. $2=self["@announcer"];
  13. if(($receiver = $2) == nil || $receiver == undefined){
  14. self["@announcer"]=_st($Announcer())._new();
  15. $1=self["@announcer"];
  16. } else {
  17. $1=$2;
  18. };
  19. return $1;
  20. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeModel)})},
  21. args: [],
  22. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  23. messageSends: ["ifNil:", "new"],
  24. referencedClasses: ["Announcer"]
  25. }),
  26. smalltalk.HLCodeModel);
  27. smalltalk.addMethod(
  28. smalltalk.method({
  29. selector: "defaultReceiver",
  30. category: 'defaults',
  31. fn: function (){
  32. var self=this;
  33. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  34. return smalltalk.withContext(function($ctx1) {
  35. var $1;
  36. $1=_st($DoIt())._new();
  37. return $1;
  38. }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{},smalltalk.HLCodeModel)})},
  39. args: [],
  40. source: "defaultReceiver\x0a\x09^ DoIt new",
  41. messageSends: ["new"],
  42. referencedClasses: ["DoIt"]
  43. }),
  44. smalltalk.HLCodeModel);
  45. smalltalk.addMethod(
  46. smalltalk.method({
  47. selector: "doIt:",
  48. category: 'actions',
  49. fn: function (someCode){
  50. var self=this;
  51. return smalltalk.withContext(function($ctx1) {
  52. var $1;
  53. $1=_st(_st(self)._environment())._eval_on_(someCode,_st(self)._receiver());
  54. return $1;
  55. }, function($ctx1) {$ctx1.fill(self,"doIt:",{someCode:someCode},smalltalk.HLCodeModel)})},
  56. args: ["someCode"],
  57. source: "doIt: someCode\x0a\x0a\x09^ self environment eval: someCode on: self receiver",
  58. messageSends: ["eval:on:", "receiver", "environment"],
  59. referencedClasses: []
  60. }),
  61. smalltalk.HLCodeModel);
  62. smalltalk.addMethod(
  63. smalltalk.method({
  64. selector: "environment",
  65. category: 'accessing',
  66. fn: function (){
  67. var self=this;
  68. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  69. return smalltalk.withContext(function($ctx1) {
  70. var $2,$1;
  71. $2=self["@environment"];
  72. if(($receiver = $2) == nil || $receiver == undefined){
  73. $1=_st(_st($HLManager())._current())._environment();
  74. } else {
  75. $1=$2;
  76. };
  77. return $1;
  78. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLCodeModel)})},
  79. args: [],
  80. source: "environment\x0a\x09^ environment ifNil: [ HLManager current environment ]",
  81. messageSends: ["ifNil:", "environment", "current"],
  82. referencedClasses: ["HLManager"]
  83. }),
  84. smalltalk.HLCodeModel);
  85. smalltalk.addMethod(
  86. smalltalk.method({
  87. selector: "environment:",
  88. category: 'accessing',
  89. fn: function (anEnvironment){
  90. var self=this;
  91. return smalltalk.withContext(function($ctx1) {
  92. self["@environment"]=anEnvironment;
  93. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel)})},
  94. args: ["anEnvironment"],
  95. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  96. messageSends: [],
  97. referencedClasses: []
  98. }),
  99. smalltalk.HLCodeModel);
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "receiver",
  103. category: 'accessing',
  104. fn: function (){
  105. var self=this;
  106. return smalltalk.withContext(function($ctx1) {
  107. var $2,$1;
  108. $2=self["@receiver"];
  109. if(($receiver = $2) == nil || $receiver == undefined){
  110. self["@receiver"]=_st(self)._defaultReceiver();
  111. $1=self["@receiver"];
  112. } else {
  113. $1=$2;
  114. };
  115. return $1;
  116. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeModel)})},
  117. args: [],
  118. source: "receiver\x0a\x09^ receiver ifNil: [ receiver := self defaultReceiver ]",
  119. messageSends: ["ifNil:", "defaultReceiver"],
  120. referencedClasses: []
  121. }),
  122. smalltalk.HLCodeModel);
  123. smalltalk.addMethod(
  124. smalltalk.method({
  125. selector: "receiver:",
  126. category: 'accessing',
  127. fn: function (anObject){
  128. var self=this;
  129. return smalltalk.withContext(function($ctx1) {
  130. self["@receiver"]=anObject;
  131. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeModel)})},
  132. args: ["anObject"],
  133. source: "receiver: anObject\x0a\x09receiver := anObject",
  134. messageSends: [],
  135. referencedClasses: []
  136. }),
  137. smalltalk.HLCodeModel);
  138. smalltalk.addMethod(
  139. smalltalk.method({
  140. selector: "subscribe:",
  141. category: 'actions',
  142. fn: function (aWidget){
  143. var self=this;
  144. return smalltalk.withContext(function($ctx1) {
  145. _st(aWidget)._subscribeTo_(_st(self)._announcer());
  146. return self}, function($ctx1) {$ctx1.fill(self,"subscribe:",{aWidget:aWidget},smalltalk.HLCodeModel)})},
  147. args: ["aWidget"],
  148. source: "subscribe: aWidget\x0a\x09aWidget subscribeTo: self announcer",
  149. messageSends: ["subscribeTo:", "announcer"],
  150. referencedClasses: []
  151. }),
  152. smalltalk.HLCodeModel);
  153. smalltalk.addMethod(
  154. smalltalk.method({
  155. selector: "on:",
  156. category: 'actions',
  157. fn: function (anEnvironment){
  158. var self=this;
  159. return smalltalk.withContext(function($ctx1) {
  160. var $2,$3,$1;
  161. $2=_st(self)._new();
  162. _st($2)._environment_(anEnvironment);
  163. $3=_st($2)._yourself();
  164. $1=$3;
  165. return $1;
  166. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel.klass)})},
  167. args: ["anEnvironment"],
  168. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  169. messageSends: ["environment:", "new", "yourself"],
  170. referencedClasses: []
  171. }),
  172. smalltalk.HLCodeModel.klass);
  173. smalltalk.addClass('HLCodeWidget', smalltalk.HLWidget, ['model', 'wrapper', 'code', 'editor'], 'Helios-Workspace');
  174. smalltalk.addMethod(
  175. smalltalk.method({
  176. selector: "announcer",
  177. category: 'accessing',
  178. fn: function (){
  179. var self=this;
  180. return smalltalk.withContext(function($ctx1) {
  181. var $1;
  182. $1=_st(_st(self)._model())._announcer();
  183. return $1;
  184. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeWidget)})},
  185. args: [],
  186. source: "announcer\x0a\x09^ self model announcer",
  187. messageSends: ["announcer", "model"],
  188. referencedClasses: []
  189. }),
  190. smalltalk.HLCodeWidget);
  191. smalltalk.addMethod(
  192. smalltalk.method({
  193. selector: "canHaveFocus",
  194. category: 'testing',
  195. fn: function (){
  196. var self=this;
  197. return smalltalk.withContext(function($ctx1) {
  198. return true;
  199. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLCodeWidget)})},
  200. args: [],
  201. source: "canHaveFocus\x0a\x09^ true",
  202. messageSends: [],
  203. referencedClasses: []
  204. }),
  205. smalltalk.HLCodeWidget);
  206. smalltalk.addMethod(
  207. smalltalk.method({
  208. selector: "clear",
  209. category: 'actions',
  210. fn: function (){
  211. var self=this;
  212. return smalltalk.withContext(function($ctx1) {
  213. _st(self)._contents_("");
  214. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLCodeWidget)})},
  215. args: [],
  216. source: "clear\x0a self contents: ''",
  217. messageSends: ["contents:"],
  218. referencedClasses: []
  219. }),
  220. smalltalk.HLCodeWidget);
  221. smalltalk.addMethod(
  222. smalltalk.method({
  223. selector: "configureEditor",
  224. category: 'actions',
  225. fn: function (){
  226. var self=this;
  227. return smalltalk.withContext(function($ctx1) {
  228. _st(_st(self)._editor())._at_put_("amberCodeWidget",self);
  229. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLCodeWidget)})},
  230. args: [],
  231. source: "configureEditor\x0a\x09self editor at: 'amberCodeWidget' put: self",
  232. messageSends: ["at:put:", "editor"],
  233. referencedClasses: []
  234. }),
  235. smalltalk.HLCodeWidget);
  236. smalltalk.addMethod(
  237. smalltalk.method({
  238. selector: "contents",
  239. category: 'accessing',
  240. fn: function (){
  241. var self=this;
  242. return smalltalk.withContext(function($ctx1) {
  243. var $1;
  244. $1=_st(self["@editor"])._getValue();
  245. return $1;
  246. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.HLCodeWidget)})},
  247. args: [],
  248. source: "contents\x0a\x09^ editor getValue",
  249. messageSends: ["getValue"],
  250. referencedClasses: []
  251. }),
  252. smalltalk.HLCodeWidget);
  253. smalltalk.addMethod(
  254. smalltalk.method({
  255. selector: "contents:",
  256. category: 'accessing',
  257. fn: function (aString){
  258. var self=this;
  259. return smalltalk.withContext(function($ctx1) {
  260. _st(self["@editor"])._setValue_(aString);
  261. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLCodeWidget)})},
  262. args: ["aString"],
  263. source: "contents: aString\x0a\x09editor setValue: aString",
  264. messageSends: ["setValue:"],
  265. referencedClasses: []
  266. }),
  267. smalltalk.HLCodeWidget);
  268. smalltalk.addMethod(
  269. smalltalk.method({
  270. selector: "currentLine",
  271. category: 'accessing',
  272. fn: function (){
  273. var self=this;
  274. return smalltalk.withContext(function($ctx1) {
  275. var $1;
  276. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  277. return $1;
  278. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},smalltalk.HLCodeWidget)})},
  279. args: [],
  280. source: "currentLine\x0a ^editor getLine: (editor getCursor line)",
  281. messageSends: ["getLine:", "line", "getCursor"],
  282. referencedClasses: []
  283. }),
  284. smalltalk.HLCodeWidget);
  285. smalltalk.addMethod(
  286. smalltalk.method({
  287. selector: "currentLineOrSelection",
  288. category: 'accessing',
  289. fn: function (){
  290. var self=this;
  291. return smalltalk.withContext(function($ctx1) {
  292. var $2,$1;
  293. $2=_st(self["@editor"])._somethingSelected();
  294. if(smalltalk.assert($2)){
  295. $1=_st(self)._selection();
  296. } else {
  297. $1=_st(self)._currentLine();
  298. };
  299. return $1;
  300. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},smalltalk.HLCodeWidget)})},
  301. args: [],
  302. source: "currentLineOrSelection\x0a ^editor somethingSelected\x0a\x09\x09ifFalse: [ self currentLine ]\x0a\x09\x09ifTrue: [ self selection ]",
  303. messageSends: ["ifFalse:ifTrue:", "currentLine", "selection", "somethingSelected"],
  304. referencedClasses: []
  305. }),
  306. smalltalk.HLCodeWidget);
  307. smalltalk.addMethod(
  308. smalltalk.method({
  309. selector: "doIt",
  310. category: 'actions',
  311. fn: function (){
  312. var self=this;
  313. var result;
  314. function $HLDoItRequested(){return smalltalk.HLDoItRequested||(typeof HLDoItRequested=="undefined"?nil:HLDoItRequested)}
  315. function $HLDoItExecuted(){return smalltalk.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
  316. return smalltalk.withContext(function($ctx1) {
  317. var $1;
  318. _st(_st(self)._announcer())._announce_(_st($HLDoItRequested())._on_(self["@model"]));
  319. result=_st(self["@model"])._doIt_(_st(self)._currentLineOrSelection());
  320. _st(_st(self)._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
  321. $1=result;
  322. return $1;
  323. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},smalltalk.HLCodeWidget)})},
  324. args: [],
  325. 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 ",
  326. messageSends: ["announce:", "on:", "announcer", "doIt:", "currentLineOrSelection"],
  327. referencedClasses: ["HLDoItRequested", "HLDoItExecuted"]
  328. }),
  329. smalltalk.HLCodeWidget);
  330. smalltalk.addMethod(
  331. smalltalk.method({
  332. selector: "editor",
  333. category: 'actions',
  334. fn: function (){
  335. var self=this;
  336. return smalltalk.withContext(function($ctx1) {
  337. var $1;
  338. $1=self["@editor"];
  339. return $1;
  340. }, function($ctx1) {$ctx1.fill(self,"editor",{},smalltalk.HLCodeWidget)})},
  341. args: [],
  342. source: "editor\x0a\x09^editor",
  343. messageSends: [],
  344. referencedClasses: []
  345. }),
  346. smalltalk.HLCodeWidget);
  347. smalltalk.addMethod(
  348. smalltalk.method({
  349. selector: "focus",
  350. category: 'actions',
  351. fn: function (){
  352. var self=this;
  353. return smalltalk.withContext(function($ctx1) {
  354. _st(self["@editor"])._focus();
  355. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLCodeWidget)})},
  356. args: [],
  357. source: "focus\x0a\x09editor focus",
  358. messageSends: ["focus"],
  359. referencedClasses: []
  360. }),
  361. smalltalk.HLCodeWidget);
  362. smalltalk.addMethod(
  363. smalltalk.method({
  364. selector: "hasFocus",
  365. category: 'testing',
  366. fn: function (){
  367. var self=this;
  368. return smalltalk.withContext(function($ctx1) {
  369. var $1;
  370. $1=_st(_st(self["@code"])._asJQuery())._is_(":active");
  371. return $1;
  372. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLCodeWidget)})},
  373. args: [],
  374. source: "hasFocus\x0a\x09^ code asJQuery is: ':active'",
  375. messageSends: ["is:", "asJQuery"],
  376. referencedClasses: []
  377. }),
  378. smalltalk.HLCodeWidget);
  379. smalltalk.addMethod(
  380. smalltalk.method({
  381. selector: "inspectIt",
  382. category: 'actions',
  383. fn: function (){
  384. var self=this;
  385. var newInspector;
  386. function $HLInspectItRequested(){return smalltalk.HLInspectItRequested||(typeof HLInspectItRequested=="undefined"?nil:HLInspectItRequested)}
  387. return smalltalk.withContext(function($ctx1) {
  388. _st(_st(self)._announcer())._announce_(_st($HLInspectItRequested())._on_(self["@model"]));
  389. newInspector=_st(self)._makeInspectorOn_(_st(self)._doIt());
  390. _st(newInspector)._open();
  391. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},smalltalk.HLCodeWidget)})},
  392. args: [],
  393. source: "inspectIt\x0a\x09| newInspector |\x0a \x0a\x09self announcer announce: (HLInspectItRequested on: model).\x0a\x09newInspector := self makeInspectorOn: self doIt.\x0a\x09newInspector open",
  394. messageSends: ["announce:", "on:", "announcer", "makeInspectorOn:", "doIt", "open"],
  395. referencedClasses: ["HLInspectItRequested"]
  396. }),
  397. smalltalk.HLCodeWidget);
  398. smalltalk.addMethod(
  399. smalltalk.method({
  400. selector: "makeInspectorOn:",
  401. category: 'actions',
  402. fn: function (anObject){
  403. var self=this;
  404. function $HLInspector(){return smalltalk.HLInspector||(typeof HLInspector=="undefined"?nil:HLInspector)}
  405. return smalltalk.withContext(function($ctx1) {
  406. var $2,$3,$1;
  407. $2=_st($HLInspector())._new();
  408. _st($2)._inspect_(anObject);
  409. $3=_st($2)._yourself();
  410. $1=$3;
  411. return $1;
  412. }, function($ctx1) {$ctx1.fill(self,"makeInspectorOn:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  413. args: ["anObject"],
  414. source: "makeInspectorOn: anObject\x0a\x0a\x09^ HLInspector new \x0a\x09\x09inspect: anObject;\x0a\x09\x09yourself",
  415. messageSends: ["inspect:", "new", "yourself"],
  416. referencedClasses: ["HLInspector"]
  417. }),
  418. smalltalk.HLCodeWidget);
  419. smalltalk.addMethod(
  420. smalltalk.method({
  421. selector: "messageHintFor:token:",
  422. category: 'hints',
  423. fn: function (anEditor,aToken){
  424. var self=this;
  425. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  426. return smalltalk.withContext(function($ctx1) {
  427. var $1;
  428. $1=_st(_st(_st(_st(_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value())._asSet())._asArray())._select_((function(each){
  429. return smalltalk.withContext(function($ctx2) {
  430. return _st(each)._includesSubString_(_st(aToken)._string());
  431. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  432. return smalltalk.withContext(function($ctx2) {
  433. return _st(each).__eq(_st(aToken)._string());
  434. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  435. return $1;
  436. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget)})},
  437. args: ["anEditor", "aToken"],
  438. source: "messageHintFor: anEditor token: aToken\x0a\x09^ ((Smalltalk current at: 'allSelectors') value asSet asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
  439. messageSends: ["reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", "value", "at:", "current"],
  440. referencedClasses: ["Smalltalk"]
  441. }),
  442. smalltalk.HLCodeWidget);
  443. smalltalk.addMethod(
  444. smalltalk.method({
  445. selector: "model",
  446. category: 'accessing',
  447. fn: function (){
  448. var self=this;
  449. function $HLCodeModel(){return smalltalk.HLCodeModel||(typeof HLCodeModel=="undefined"?nil:HLCodeModel)}
  450. return smalltalk.withContext(function($ctx1) {
  451. var $2,$1;
  452. $2=self["@model"];
  453. if(($receiver = $2) == nil || $receiver == undefined){
  454. self["@model"]=_st($HLCodeModel())._new();
  455. $1=self["@model"];
  456. } else {
  457. $1=$2;
  458. };
  459. return $1;
  460. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLCodeWidget)})},
  461. args: [],
  462. source: "model\x0a\x09^ model ifNil: [ model := HLCodeModel new ]",
  463. messageSends: ["ifNil:", "new"],
  464. referencedClasses: ["HLCodeModel"]
  465. }),
  466. smalltalk.HLCodeWidget);
  467. smalltalk.addMethod(
  468. smalltalk.method({
  469. selector: "model:",
  470. category: 'accessing',
  471. fn: function (aModel){
  472. var self=this;
  473. return smalltalk.withContext(function($ctx1) {
  474. self["@model"]=aModel;
  475. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLCodeWidget)})},
  476. args: ["aModel"],
  477. source: "model: aModel\x0a\x09model := aModel",
  478. messageSends: [],
  479. referencedClasses: []
  480. }),
  481. smalltalk.HLCodeWidget);
  482. smalltalk.addMethod(
  483. smalltalk.method({
  484. selector: "onDoIt",
  485. category: 'reactions',
  486. fn: function (){
  487. var self=this;
  488. return smalltalk.withContext(function($ctx1) {
  489. _st(self)._doIt();
  490. return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{},smalltalk.HLCodeWidget)})},
  491. args: [],
  492. source: "onDoIt\x0a\x09\x0a self doIt",
  493. messageSends: ["doIt"],
  494. referencedClasses: []
  495. }),
  496. smalltalk.HLCodeWidget);
  497. smalltalk.addMethod(
  498. smalltalk.method({
  499. selector: "onInspectIt",
  500. category: 'reactions',
  501. fn: function (){
  502. var self=this;
  503. return smalltalk.withContext(function($ctx1) {
  504. _st(self)._inspectIt();
  505. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},smalltalk.HLCodeWidget)})},
  506. args: [],
  507. source: "onInspectIt\x0a\x0a\x09self inspectIt",
  508. messageSends: ["inspectIt"],
  509. referencedClasses: []
  510. }),
  511. smalltalk.HLCodeWidget);
  512. smalltalk.addMethod(
  513. smalltalk.method({
  514. selector: "onPrintIt",
  515. category: 'reactions',
  516. fn: function (){
  517. var self=this;
  518. return smalltalk.withContext(function($ctx1) {
  519. _st(self)._printIt();
  520. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},smalltalk.HLCodeWidget)})},
  521. args: [],
  522. source: "onPrintIt\x0a\x0a\x09self printIt",
  523. messageSends: ["printIt"],
  524. referencedClasses: []
  525. }),
  526. smalltalk.HLCodeWidget);
  527. smalltalk.addMethod(
  528. smalltalk.method({
  529. selector: "onSaveIt",
  530. category: 'reactions',
  531. fn: function (){
  532. var self=this;
  533. return smalltalk.withContext(function($ctx1) {
  534. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLCodeWidget)})},
  535. args: [],
  536. source: "onSaveIt\x0a\x09\x22I do not do anything\x22",
  537. messageSends: [],
  538. referencedClasses: []
  539. }),
  540. smalltalk.HLCodeWidget);
  541. smalltalk.addMethod(
  542. smalltalk.method({
  543. selector: "print:",
  544. category: 'actions',
  545. fn: function (aString){
  546. var self=this;
  547. var start,stop,currentLine;
  548. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  549. return smalltalk.withContext(function($ctx1) {
  550. currentLine=_st(_st(self["@editor"])._getCursor_(false))._line();
  551. start=_st($HashedCollection())._new();
  552. _st(start)._at_put_("line",currentLine);
  553. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getCursor_(false))._ch());
  554. _st(_st(self["@editor"])._getSelection())._ifEmpty_((function(){
  555. return smalltalk.withContext(function($ctx2) {
  556. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getLine_(currentLine))._size());
  557. return _st(self["@editor"])._setSelection_end_(smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(currentLine),_st("ch").__minus_gt((0))]),start);
  558. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  559. stop=_st($HashedCollection())._new();
  560. _st(stop)._at_put_("line",currentLine);
  561. _st(stop)._at_put_("ch",_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2)));
  562. _st(self["@editor"])._replaceSelection_(_st(_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString)).__comma(" "));
  563. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  564. _st(self["@editor"])._setSelection_end_(stop,start);
  565. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},smalltalk.HLCodeWidget)})},
  566. args: ["aString"],
  567. source: "print: aString\x0a\x09| start stop currentLine |\x0a currentLine := (editor getCursor: false) line.\x0a\x09start := HashedCollection new.\x0a\x09start at: 'line' put: currentLine.\x0a\x09start at: 'ch' put: (editor getCursor: false) ch.\x0a (editor getSelection) ifEmpty: [\x0a \x09\x22select current line if selection is empty\x22\x0a \x09start at: 'ch' put: (editor getLine: currentLine) size.\x0a editor setSelection: #{'line' -> currentLine. 'ch' -> 0} end: start.\x0a ].\x0a\x09stop := HashedCollection new.\x0a\x09stop at: 'line' put: currentLine.\x0a\x09stop at: 'ch' put: ((start at: 'ch') + aString size + 2).\x0a\x0a\x09editor replaceSelection: (editor getSelection, ' ', aString, ' ').\x0a\x09editor setCursor: (editor getCursor: true).\x0a\x09editor setSelection: stop end: start",
  568. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "size", "getLine:", "setSelection:end:", "->", "getSelection", "+", "at:", "replaceSelection:", ",", "setCursor:"],
  569. referencedClasses: ["HashedCollection"]
  570. }),
  571. smalltalk.HLCodeWidget);
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "printIt",
  575. category: 'actions',
  576. fn: function (){
  577. var self=this;
  578. var result;
  579. function $HLPrintItRequested(){return smalltalk.HLPrintItRequested||(typeof HLPrintItRequested=="undefined"?nil:HLPrintItRequested)}
  580. return smalltalk.withContext(function($ctx1) {
  581. result=_st(self)._doIt();
  582. _st(_st(self)._announcer())._announce_(_st($HLPrintItRequested())._on_(self["@model"]));
  583. _st(self)._print_(_st(result)._printString());
  584. _st(self)._focus();
  585. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{result:result},smalltalk.HLCodeWidget)})},
  586. args: [],
  587. 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.",
  588. messageSends: ["doIt", "announce:", "on:", "announcer", "print:", "printString", "focus"],
  589. referencedClasses: ["HLPrintItRequested"]
  590. }),
  591. smalltalk.HLCodeWidget);
  592. smalltalk.addMethod(
  593. smalltalk.method({
  594. selector: "receiver",
  595. category: 'accessing',
  596. fn: function (){
  597. var self=this;
  598. return smalltalk.withContext(function($ctx1) {
  599. var $1;
  600. $1=_st(_st(self)._model())._receiver();
  601. return $1;
  602. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeWidget)})},
  603. args: [],
  604. source: "receiver\x0a\x09^ self model receiver",
  605. messageSends: ["receiver", "model"],
  606. referencedClasses: []
  607. }),
  608. smalltalk.HLCodeWidget);
  609. smalltalk.addMethod(
  610. smalltalk.method({
  611. selector: "receiver:",
  612. category: 'accessing',
  613. fn: function (anObject){
  614. var self=this;
  615. return smalltalk.withContext(function($ctx1) {
  616. _st(_st(self)._model())._receiver_(anObject);
  617. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  618. args: ["anObject"],
  619. source: "receiver: anObject\x0a\x09self model receiver: anObject",
  620. messageSends: ["receiver:", "model"],
  621. referencedClasses: []
  622. }),
  623. smalltalk.HLCodeWidget);
  624. smalltalk.addMethod(
  625. smalltalk.method({
  626. selector: "renderContentOn:",
  627. category: 'rendering',
  628. fn: function (html){
  629. var self=this;
  630. return smalltalk.withContext(function($ctx1) {
  631. self["@code"]=_st(html)._textarea();
  632. _st(self)._setEditorOn_(_st(self["@code"])._element());
  633. _st(self)._configureEditor();
  634. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLCodeWidget)})},
  635. args: ["html"],
  636. source: "renderContentOn: html\x0a code := html textarea.\x0a self setEditorOn: code element.\x0a self configureEditor",
  637. messageSends: ["textarea", "setEditorOn:", "element", "configureEditor"],
  638. referencedClasses: []
  639. }),
  640. smalltalk.HLCodeWidget);
  641. smalltalk.addMethod(
  642. smalltalk.method({
  643. selector: "saveIt",
  644. category: 'actions',
  645. fn: function (){
  646. var self=this;
  647. return smalltalk.withContext(function($ctx1) {
  648. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLCodeWidget)})},
  649. args: [],
  650. source: "saveIt\x0a\x09\x22I do not do anything\x22",
  651. messageSends: [],
  652. referencedClasses: []
  653. }),
  654. smalltalk.HLCodeWidget);
  655. smalltalk.addMethod(
  656. smalltalk.method({
  657. selector: "selection",
  658. category: 'accessing',
  659. fn: function (){
  660. var self=this;
  661. return smalltalk.withContext(function($ctx1) {
  662. var $1;
  663. $1=_st(self["@editor"])._getSelection();
  664. return $1;
  665. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.HLCodeWidget)})},
  666. args: [],
  667. source: "selection\x0a\x09^editor getSelection",
  668. messageSends: ["getSelection"],
  669. referencedClasses: []
  670. }),
  671. smalltalk.HLCodeWidget);
  672. smalltalk.addMethod(
  673. smalltalk.method({
  674. selector: "selectionEnd",
  675. category: 'accessing',
  676. fn: function (){
  677. var self=this;
  678. return smalltalk.withContext(function($ctx1) {
  679. var $1;
  680. $1=_st(_st(self["@code"])._element())._selectionEnd();
  681. return $1;
  682. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},smalltalk.HLCodeWidget)})},
  683. args: [],
  684. source: "selectionEnd\x0a ^code element selectionEnd",
  685. messageSends: ["selectionEnd", "element"],
  686. referencedClasses: []
  687. }),
  688. smalltalk.HLCodeWidget);
  689. smalltalk.addMethod(
  690. smalltalk.method({
  691. selector: "selectionEnd:",
  692. category: 'accessing',
  693. fn: function (anInteger){
  694. var self=this;
  695. return smalltalk.withContext(function($ctx1) {
  696. _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  697. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  698. args: ["anInteger"],
  699. source: "selectionEnd: anInteger\x0a code element selectionEnd: anInteger",
  700. messageSends: ["selectionEnd:", "element"],
  701. referencedClasses: []
  702. }),
  703. smalltalk.HLCodeWidget);
  704. smalltalk.addMethod(
  705. smalltalk.method({
  706. selector: "selectionStart",
  707. category: 'accessing',
  708. fn: function (){
  709. var self=this;
  710. return smalltalk.withContext(function($ctx1) {
  711. var $1;
  712. $1=_st(_st(self["@code"])._element())._selectionStart();
  713. return $1;
  714. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},smalltalk.HLCodeWidget)})},
  715. args: [],
  716. source: "selectionStart\x0a ^code element selectionStart",
  717. messageSends: ["selectionStart", "element"],
  718. referencedClasses: []
  719. }),
  720. smalltalk.HLCodeWidget);
  721. smalltalk.addMethod(
  722. smalltalk.method({
  723. selector: "selectionStart:",
  724. category: 'accessing',
  725. fn: function (anInteger){
  726. var self=this;
  727. return smalltalk.withContext(function($ctx1) {
  728. _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  729. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  730. args: ["anInteger"],
  731. source: "selectionStart: anInteger\x0a code element selectionStart: anInteger",
  732. messageSends: ["selectionStart:", "element"],
  733. referencedClasses: []
  734. }),
  735. smalltalk.HLCodeWidget);
  736. smalltalk.addMethod(
  737. smalltalk.method({
  738. selector: "setEditorOn:",
  739. category: 'actions',
  740. fn: function (aTextarea){
  741. var self=this;
  742. return smalltalk.withContext(function($ctx1) {
  743. self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
  744. theme: 'amber',
  745. lineNumbers: true,
  746. enterMode: 'flat',
  747. indentWithTabs: true,
  748. indentUnit: 4,
  749. matchBrackets: true,
  750. electricChars: false,
  751. keyMap: 'Amber',
  752. extraKeys: {"Shift-Space": "autocomplete"}
  753. });
  754. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},smalltalk.HLCodeWidget)})},
  755. args: ["aTextarea"],
  756. source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {\x0a\x09\x09theme: 'amber',\x0a lineNumbers: true,\x0a enterMode: 'flat',\x0a indentWithTabs: true,\x0a\x09\x09\x09\x09indentUnit: 4,\x0a matchBrackets: true,\x0a electricChars: false,\x0a\x09\x09\x09\x09keyMap: 'Amber',\x0a\x09\x09\x09\x09extraKeys: {\x22Shift-Space\x22: \x22autocomplete\x22}\x0a\x09})>",
  757. messageSends: [],
  758. referencedClasses: []
  759. }),
  760. smalltalk.HLCodeWidget);
  761. smalltalk.addMethod(
  762. smalltalk.method({
  763. selector: "variableHintFor:token:",
  764. category: 'hints',
  765. fn: function (anEditor,aToken){
  766. var self=this;
  767. var variables,classNames,pseudoVariables;
  768. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  769. return smalltalk.withContext(function($ctx1) {
  770. var $1;
  771. variables=_st(_st(_st(_st(window)._jQuery_(_st(_st(anEditor)._display())._wrapper()))._find_("span.cm-variable"))._get())._collect_((function(each){
  772. return smalltalk.withContext(function($ctx2) {
  773. return _st(_st(window)._jQuery_(each))._html();
  774. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  775. classNames=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  776. return smalltalk.withContext(function($ctx2) {
  777. return _st(each)._name();
  778. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  779. pseudoVariables=_st(_st($Smalltalk())._current())._pseudoVariableNames();
  780. $1=_st(_st(_st(_st(_st(_st(variables).__comma(classNames)).__comma(pseudoVariables))._asSet())._asArray())._select_((function(each){
  781. return smalltalk.withContext(function($ctx2) {
  782. return _st(each)._includesSubString_(_st(aToken)._string());
  783. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  784. return smalltalk.withContext(function($ctx2) {
  785. return _st(each).__eq(_st(aToken)._string());
  786. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  787. return $1;
  788. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},smalltalk.HLCodeWidget)})},
  789. args: ["anEditor", "aToken"],
  790. source: "variableHintFor: anEditor token: aToken\x0a\x09| variables classNames pseudoVariables |\x0a\x09\x0a\x09variables := ((window jQuery: anEditor display wrapper) find: 'span.cm-variable') get\x0a\x09\x09collect: [ :each | (window jQuery: each) html ].\x0a\x09\x0a\x09classNames := Smalltalk current classes collect: [ :each | each name ].\x0a\x09pseudoVariables := Smalltalk current pseudoVariableNames.\x0a\x09\x0a\x09^ ((variables, classNames, pseudoVariables) asSet asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
  791. messageSends: ["collect:", "html", "jQuery:", "get", "find:", "wrapper", "display", "name", "classes", "current", "pseudoVariableNames", "reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", ","],
  792. referencedClasses: ["Smalltalk"]
  793. }),
  794. smalltalk.HLCodeWidget);
  795. smalltalk.addMethod(
  796. smalltalk.method({
  797. selector: "hintFor:options:",
  798. category: 'hints',
  799. fn: function (anEditor,options){
  800. var self=this;
  801. var cursor,token,completions;
  802. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  803. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  804. return smalltalk.withContext(function($ctx1) {
  805. var $1,$2;
  806. cursor=_st(anEditor)._getCursor();
  807. token=_st(anEditor)._getTokenAt_(cursor);
  808. _st(token)._at_put_("state",_st(_st(_st($CodeMirror())._basicAt_("innerMode"))._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state")))._state());
  809. $1=_st(_st(token)._type()).__eq("variable");
  810. if(smalltalk.assert($1)){
  811. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  812. } else {
  813. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  814. };
  815. $2=smalltalk.HashedCollection._fromPairs_([_st("list").__minus_gt(completions),_st("from").__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._end())),_st("to").__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._start()))]);
  816. return $2;
  817. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},smalltalk.HLCodeWidget.klass)})},
  818. args: ["anEditor", "options"],
  819. source: "hintFor: anEditor options: options\x0a\x09| cursor token completions |\x0a\x09\x0a\x09cursor := anEditor getCursor.\x0a\x09token := anEditor getTokenAt: cursor.\x0a\x09token at: 'state' put: ((CodeMirror basicAt: 'innerMode')\x0a\x09\x09value: anEditor getMode value: (token at: 'state')) state.\x0a\x09\x0a\x09completions := token type = 'variable' \x0a\x09\x09ifTrue: [ HLCodeWidget variableHintFor: anEditor token: token ]\x0a\x09\x09ifFalse: [ HLCodeWidget messageHintFor: anEditor token: token ].\x0a\x09\x0a\x09^ #{\x0a\x09\x09'list' -> completions.\x0a\x09\x09'from' -> ((CodeMirror basicAt: 'Pos') value: cursor line value: token end).\x0a\x09\x09'to' -> ((CodeMirror basicAt: 'Pos') value: cursor line value: token start)\x0a\x09}",
  820. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "getMode", "at:", "basicAt:", "ifTrue:ifFalse:", "variableHintFor:token:", "messageHintFor:token:", "=", "type", "->", "line", "end", "start"],
  821. referencedClasses: ["CodeMirror", "HLCodeWidget"]
  822. }),
  823. smalltalk.HLCodeWidget.klass);
  824. smalltalk.addMethod(
  825. smalltalk.method({
  826. selector: "initialize",
  827. category: 'initialization',
  828. fn: function (){
  829. var self=this;
  830. return smalltalk.withContext(function($ctx1) {
  831. var $1,$2;
  832. smalltalk.HLWidget.klass.fn.prototype._initialize.apply(_st(self), []);
  833. $1=self;
  834. _st($1)._setupCodeMirror();
  835. _st($1)._setupCommands();
  836. $2=_st($1)._setupKeyMaps();
  837. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLCodeWidget.klass)})},
  838. args: [],
  839. source: "initialize\x0a\x09super initialize.\x0a\x09self \x0a\x09\x09setupCodeMirror;\x0a\x09\x09setupCommands;\x0a\x09\x09setupKeyMaps.",
  840. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"],
  841. referencedClasses: []
  842. }),
  843. smalltalk.HLCodeWidget.klass);
  844. smalltalk.addMethod(
  845. smalltalk.method({
  846. selector: "keyMap",
  847. category: 'accessing',
  848. fn: function (){
  849. var self=this;
  850. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  851. return smalltalk.withContext(function($ctx1) {
  852. var $2,$1;
  853. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  854. if(smalltalk.assert($2)){
  855. $1=_st(self)._macKeyMap();
  856. } else {
  857. $1=_st(self)._pcKeyMap();
  858. };
  859. return $1;
  860. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},smalltalk.HLCodeWidget.klass)})},
  861. args: [],
  862. source: "keyMap\x0a\x09^ HLManager current keyBinder systemIsMac\x0a\x09\x09ifTrue: [ self macKeyMap ]\x0a\x09\x09ifFalse: [ self pcKeyMap ]",
  863. messageSends: ["ifTrue:ifFalse:", "macKeyMap", "pcKeyMap", "systemIsMac", "keyBinder", "current"],
  864. referencedClasses: ["HLManager"]
  865. }),
  866. smalltalk.HLCodeWidget.klass);
  867. smalltalk.addMethod(
  868. smalltalk.method({
  869. selector: "macKeyMap",
  870. category: 'accessing',
  871. fn: function (){
  872. var self=this;
  873. return smalltalk.withContext(function($ctx1) {
  874. var $1;
  875. $1=smalltalk.HashedCollection._fromPairs_([_st("Alt-Backspace").__minus_gt("delWordBefore"),_st("Alt-Delete").__minus_gt("delWordAfter"),_st("Alt-Left").__minus_gt("goWordBoundaryLeft"),_st("Alt-Right").__minus_gt("goWordBoundaryRight"),_st("Cmd-A").__minus_gt("selectAll"),_st("Cmd-Alt-F").__minus_gt("replace"),_st("Cmd-D").__minus_gt("doIt"),_st("Cmd-Down").__minus_gt("goDocEnd"),_st("Cmd-End").__minus_gt("goDocEnd"),_st("Cmd-F").__minus_gt("find"),_st("Cmd-G").__minus_gt("findNext"),_st("Cmd-I").__minus_gt("inspectIt"),_st("Cmd-Left").__minus_gt("goLineStart"),_st("Cmd-P").__minus_gt("printIt"),_st("Cmd-Right").__minus_gt("goLineEnd"),_st("Cmd-S").__minus_gt("saveIt"),_st("Cmd-Up").__minus_gt("goDocStart"),_st("Cmd-Y").__minus_gt("redo"),_st("Cmd-Z").__minus_gt("undo"),_st("Cmd-[").__minus_gt("indentLess"),_st("Cmd-]").__minus_gt("indentMore"),_st("Ctrl-Alt-Backspace").__minus_gt("delWordAfter"),_st("Shift-Cmd-Alt-F").__minus_gt("replaceAll"),_st("Shift-Cmd-G").__minus_gt("findPrev"),_st("Shift-Cmd-Z").__minus_gt("redo"),_st("fallthrough").__minus_gt(["basic","emacsy"])]);
  876. return $1;
  877. }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  878. args: [],
  879. source: "macKeyMap\x0a\x09^ #{\x0a\x09\x09'Alt-Backspace'\x09\x09-> 'delWordBefore'.\x0a\x09\x09'Alt-Delete'\x09\x09-> 'delWordAfter'. \x0a\x09\x09'Alt-Left'\x09\x09-> 'goWordBoundaryLeft'.\x0a\x09\x09'Alt-Right'\x09\x09-> 'goWordBoundaryRight'. \x0a\x09\x09'Cmd-A'\x09\x09\x09-> 'selectAll'. \x0a\x09\x09'Cmd-Alt-F'\x09\x09-> 'replace'. \x0a\x09\x09'Cmd-D'\x09\x09\x09-> 'doIt'. \x0a\x09\x09'Cmd-Down'\x09\x09-> 'goDocEnd'. \x0a\x09\x09'Cmd-End'\x09\x09-> 'goDocEnd'. \x0a\x09\x09'Cmd-F'\x09\x09\x09-> 'find'.\x0a\x09\x09'Cmd-G'\x09\x09\x09-> 'findNext'. \x0a\x09\x09'Cmd-I'\x09\x09\x09-> 'inspectIt'. \x0a\x09\x09'Cmd-Left'\x09\x09-> 'goLineStart'. \x0a\x09\x09'Cmd-P'\x09\x09\x09-> 'printIt'. \x0a\x09\x09'Cmd-Right'\x09\x09-> 'goLineEnd'. \x0a\x09\x09'Cmd-S'\x09\x09\x09-> 'saveIt'. \x0a\x09\x09'Cmd-Up'\x09\x09-> 'goDocStart'. \x0a\x09\x09'Cmd-Y'\x09\x09\x09-> 'redo'.\x0a\x09\x09'Cmd-Z'\x09\x09\x09-> 'undo'. \x0a\x09\x09'Cmd-['\x09\x09\x09-> 'indentLess'. \x0a\x09\x09'Cmd-]'\x09\x09\x09-> 'indentMore'.\x0a\x09\x09'Ctrl-Alt-Backspace'\x09-> 'delWordAfter'. \x0a\x09\x09'Shift-Cmd-Alt-F'\x09-> 'replaceAll'.\x0a\x09\x09'Shift-Cmd-G'\x09\x09-> 'findPrev'. \x0a\x09\x09'Shift-Cmd-Z'\x09\x09-> 'redo'. \x0a \x09'fallthrough' \x09-> { 'basic'. 'emacsy' }\x0a }",
  880. messageSends: ["->"],
  881. referencedClasses: []
  882. }),
  883. smalltalk.HLCodeWidget.klass);
  884. smalltalk.addMethod(
  885. smalltalk.method({
  886. selector: "messageHintFor:token:",
  887. category: 'hints',
  888. fn: function (anEditor,aToken){
  889. var self=this;
  890. return smalltalk.withContext(function($ctx1) {
  891. var $1;
  892. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  893. return $1;
  894. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  895. args: ["anEditor", "aToken"],
  896. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09messageHintFor: anEditor token: aToken",
  897. messageSends: ["messageHintFor:token:", "at:"],
  898. referencedClasses: []
  899. }),
  900. smalltalk.HLCodeWidget.klass);
  901. smalltalk.addMethod(
  902. smalltalk.method({
  903. selector: "pcKeyMap",
  904. category: 'accessing',
  905. fn: function (){
  906. var self=this;
  907. return smalltalk.withContext(function($ctx1) {
  908. var $1;
  909. $1=[_st("Alt-Left").__minus_gt("goLineStart"),_st("Alt-Right").__minus_gt("goLineEnd"),_st("Alt-Up").__minus_gt("goDocStart"),_st("Ctrl-A").__minus_gt("selectAll"),_st("Ctrl-Backspace").__minus_gt("delWordBefore"),_st("Ctrl-D").__minus_gt("doIt"),_st("Ctrl-Delete").__minus_gt("delWordAfter"),_st("Ctrl-Down").__minus_gt("goDocEnd"),_st("Ctrl-End").__minus_gt("goDocEnd"),_st("Ctrl-F").__minus_gt("find"),_st("Ctrl-G").__minus_gt("findNext"),_st("Ctrl-I").__minus_gt("inspectIt"),_st("Ctrl-Home").__minus_gt("goDocStart"),_st("Ctrl-Left").__minus_gt("goWordBoundaryLeft"),_st("Ctrl-P").__minus_gt("printIt"),_st("Ctrl-Right").__minus_gt("goWordBoundaryRight"),_st("Ctrl-S").__minus_gt("saveIt"),_st("Ctrl-Y").__minus_gt("redo"),_st("Ctrl-Z").__minus_gt("undo"),_st("Ctrl-[").__minus_gt("indentLess"),_st("Ctrl-]").__minus_gt("indentMore"),_st("Shift-Ctrl-F").__minus_gt("replace"),_st("Shift-Ctrl-G").__minus_gt("findPrev"),_st("Shift-Ctrl-R").__minus_gt("replaceAll"),_st("Shift-Ctrl-Z").__minus_gt("redo"),_st("fallthrough").__minus_gt(["basic"])];
  910. return $1;
  911. }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  912. args: [],
  913. source: "pcKeyMap\x0a\x09^ {\x0a\x09\x09'Alt-Left' -> 'goLineStart'. \x0a\x09\x09'Alt-Right' -> 'goLineEnd'.\x0a\x09\x09'Alt-Up' -> 'goDocStart'. \x0a\x09\x09'Ctrl-A' -> 'selectAll'. \x0a\x09\x09'Ctrl-Backspace' -> 'delWordBefore'. \x0a\x09\x09'Ctrl-D' -> 'doIt'. \x0a\x09\x09'Ctrl-Delete' -> 'delWordAfter'. \x0a\x09\x09'Ctrl-Down' -> 'goDocEnd'.\x0a\x09\x09'Ctrl-End' -> 'goDocEnd'. \x0a\x09\x09'Ctrl-F' -> 'find'.\x0a\x09\x09'Ctrl-G' -> 'findNext'. \x0a\x09\x09'Ctrl-I' -> 'inspectIt'.\x0a\x09\x09'Ctrl-Home' -> 'goDocStart'. \x0a\x09\x09'Ctrl-Left' -> 'goWordBoundaryLeft'. \x0a\x09\x09'Ctrl-P' -> 'printIt'.\x0a\x09\x09'Ctrl-Right' -> 'goWordBoundaryRight'. \x0a\x09\x09'Ctrl-S' -> 'saveIt'. \x0a\x09\x09'Ctrl-Y' -> 'redo'.\x0a\x09\x09'Ctrl-Z' -> 'undo'. \x0a\x09\x09'Ctrl-[' -> 'indentLess'. \x0a\x09\x09'Ctrl-]' -> 'indentMore'.\x0a\x09\x09'Shift-Ctrl-F' -> 'replace'. \x0a\x09\x09'Shift-Ctrl-G' -> 'findPrev'. \x0a\x09\x09'Shift-Ctrl-R' -> 'replaceAll'.\x0a\x09\x09'Shift-Ctrl-Z' -> 'redo'. \x0a\x09\x09'fallthrough' -> #('basic')\x0a}",
  914. messageSends: ["->"],
  915. referencedClasses: []
  916. }),
  917. smalltalk.HLCodeWidget.klass);
  918. smalltalk.addMethod(
  919. smalltalk.method({
  920. selector: "setupCodeMirror",
  921. category: 'initialization',
  922. fn: function (){
  923. var self=this;
  924. return smalltalk.withContext(function($ctx1) {
  925. CodeMirror.keyMap.default.fallthrough = ["basic"];
  926. CodeMirror.commands.autocomplete = function(cm) {
  927. CodeMirror.showHint(cm, self._hintFor_options_);
  928. }
  929. ;
  930. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.HLCodeWidget.klass)})},
  931. args: [],
  932. source: "setupCodeMirror\x0a\x09< \x0a\x09\x09CodeMirror.keyMap.default.fallthrough = [\x22basic\x22];\x0a\x09\x09CodeMirror.commands.autocomplete = function(cm) {\x0a \x09CodeMirror.showHint(cm, self._hintFor_options_);\x0a \x09}\x0a\x09>",
  933. messageSends: [],
  934. referencedClasses: []
  935. }),
  936. smalltalk.HLCodeWidget.klass);
  937. smalltalk.addMethod(
  938. smalltalk.method({
  939. selector: "setupCommands",
  940. category: 'initialization',
  941. fn: function (){
  942. var self=this;
  943. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  944. return smalltalk.withContext(function($ctx1) {
  945. var $1,$2;
  946. $1=_st($CodeMirror())._basicAt_("commands");
  947. _st($1)._at_put_("doIt",(function(cm){
  948. return smalltalk.withContext(function($ctx2) {
  949. return _st(_st(cm)._amberCodeWidget())._doIt();
  950. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  951. _st($1)._at_put_("inspectIt",(function(cm){
  952. return smalltalk.withContext(function($ctx2) {
  953. return _st(_st(cm)._amberCodeWidget())._inspectIt();
  954. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  955. _st($1)._at_put_("printIt",(function(cm){
  956. return smalltalk.withContext(function($ctx2) {
  957. return _st(_st(cm)._amberCodeWidget())._printIt();
  958. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  959. $2=_st($1)._at_put_("saveIt",(function(cm){
  960. return smalltalk.withContext(function($ctx2) {
  961. return _st(_st(cm)._amberCodeWidget())._saveIt();
  962. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  963. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},smalltalk.HLCodeWidget.klass)})},
  964. args: [],
  965. source: "setupCommands\x0a\x09(CodeMirror basicAt: 'commands') \x0a\x09\x09at: 'doIt' put: [ :cm | cm amberCodeWidget doIt ];\x0a\x09\x09at: 'inspectIt' put: [ :cm | cm amberCodeWidget inspectIt ];\x0a\x09\x09at: 'printIt' put: [ :cm | cm amberCodeWidget printIt ];\x0a\x09\x09at: 'saveIt' put: [ :cm | cm amberCodeWidget saveIt ]",
  966. messageSends: ["at:put:", "doIt", "amberCodeWidget", "basicAt:", "inspectIt", "printIt", "saveIt"],
  967. referencedClasses: ["CodeMirror"]
  968. }),
  969. smalltalk.HLCodeWidget.klass);
  970. smalltalk.addMethod(
  971. smalltalk.method({
  972. selector: "setupKeyMaps",
  973. category: 'initialization',
  974. fn: function (){
  975. var self=this;
  976. return smalltalk.withContext(function($ctx1) {
  977. CodeMirror.keyMap['Amber'] = self._keyMap();
  978. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},smalltalk.HLCodeWidget.klass)})},
  979. args: [],
  980. source: "setupKeyMaps\x0a\x09<CodeMirror.keyMap['Amber'] = self._keyMap()>",
  981. messageSends: [],
  982. referencedClasses: []
  983. }),
  984. smalltalk.HLCodeWidget.klass);
  985. smalltalk.addMethod(
  986. smalltalk.method({
  987. selector: "variableHintFor:token:",
  988. category: 'hints',
  989. fn: function (anEditor,aToken){
  990. var self=this;
  991. return smalltalk.withContext(function($ctx1) {
  992. var $1;
  993. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  994. return $1;
  995. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  996. args: ["anEditor", "aToken"],
  997. source: "variableHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09variableHintFor: anEditor token: aToken",
  998. messageSends: ["variableHintFor:token:", "at:"],
  999. referencedClasses: []
  1000. }),
  1001. smalltalk.HLCodeWidget.klass);
  1002. smalltalk.addClass('HLNavigationCodeWidget', smalltalk.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
  1003. smalltalk.addMethod(
  1004. smalltalk.method({
  1005. selector: "hasModification",
  1006. category: 'testing',
  1007. fn: function (){
  1008. var self=this;
  1009. return smalltalk.withContext(function($ctx1) {
  1010. var $1;
  1011. $1=_st(_st(_st(self)._methodContents()).__eq(_st(self)._contents()))._not();
  1012. return $1;
  1013. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLNavigationCodeWidget)})},
  1014. args: [],
  1015. source: "hasModification\x0a\x09^ (self methodContents = self contents) not",
  1016. messageSends: ["not", "=", "contents", "methodContents"],
  1017. referencedClasses: []
  1018. }),
  1019. smalltalk.HLNavigationCodeWidget);
  1020. smalltalk.addMethod(
  1021. smalltalk.method({
  1022. selector: "methodContents",
  1023. category: 'accessing',
  1024. fn: function (){
  1025. var self=this;
  1026. return smalltalk.withContext(function($ctx1) {
  1027. var $1;
  1028. $1=self["@methodContents"];
  1029. return $1;
  1030. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},smalltalk.HLNavigationCodeWidget)})},
  1031. args: [],
  1032. source: "methodContents\x0a\x09^ methodContents",
  1033. messageSends: [],
  1034. referencedClasses: []
  1035. }),
  1036. smalltalk.HLNavigationCodeWidget);
  1037. smalltalk.addMethod(
  1038. smalltalk.method({
  1039. selector: "methodContents:",
  1040. category: 'accessing',
  1041. fn: function (aString){
  1042. var self=this;
  1043. return smalltalk.withContext(function($ctx1) {
  1044. var $1;
  1045. self["@methodContents"]=aString;
  1046. $1=self["@methodContents"];
  1047. return $1;
  1048. }, function($ctx1) {$ctx1.fill(self,"methodContents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  1049. args: ["aString"],
  1050. source: "methodContents: aString\x0a\x09^ methodContents := aString",
  1051. messageSends: [],
  1052. referencedClasses: []
  1053. }),
  1054. smalltalk.HLNavigationCodeWidget);
  1055. smalltalk.addMethod(
  1056. smalltalk.method({
  1057. selector: "previous",
  1058. category: 'accessing',
  1059. fn: function (){
  1060. var self=this;
  1061. return smalltalk.withContext(function($ctx1) {
  1062. return self}, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationCodeWidget)})},
  1063. args: [],
  1064. source: "previous\x0a\x09\x22for browser lists widget\x22",
  1065. messageSends: [],
  1066. referencedClasses: []
  1067. }),
  1068. smalltalk.HLNavigationCodeWidget);
  1069. smalltalk.addMethod(
  1070. smalltalk.method({
  1071. selector: "previous:",
  1072. category: 'accessing',
  1073. fn: function (aWidget){
  1074. var self=this;
  1075. return smalltalk.withContext(function($ctx1) {
  1076. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationCodeWidget)})},
  1077. args: ["aWidget"],
  1078. source: "previous: aWidget\x0a\x09\x22for browser lists widget\x22",
  1079. messageSends: [],
  1080. referencedClasses: []
  1081. }),
  1082. smalltalk.HLNavigationCodeWidget);
  1083. smalltalk.addMethod(
  1084. smalltalk.method({
  1085. selector: "canBeOpenAsTab",
  1086. category: 'testing',
  1087. fn: function (){
  1088. var self=this;
  1089. return smalltalk.withContext(function($ctx1) {
  1090. return false;
  1091. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLNavigationCodeWidget.klass)})},
  1092. args: [],
  1093. source: "canBeOpenAsTab\x0a\x09^ false",
  1094. messageSends: [],
  1095. referencedClasses: []
  1096. }),
  1097. smalltalk.HLNavigationCodeWidget.klass);
  1098. smalltalk.addMethod(
  1099. smalltalk.method({
  1100. selector: "on:",
  1101. category: 'instance creation',
  1102. fn: function (aBrowserModel){
  1103. var self=this;
  1104. return smalltalk.withContext(function($ctx1) {
  1105. var $2,$3,$1;
  1106. $2=_st(self)._new();
  1107. _st($2)._browserModel_(aBrowserModel);
  1108. $3=_st($2)._yourself();
  1109. $1=$3;
  1110. return $1;
  1111. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLNavigationCodeWidget.klass)})},
  1112. args: ["aBrowserModel"],
  1113. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1114. messageSends: ["browserModel:", "new", "yourself"],
  1115. referencedClasses: []
  1116. }),
  1117. smalltalk.HLNavigationCodeWidget.klass);
  1118. smalltalk.addClass('HLBrowserCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  1119. smalltalk.addMethod(
  1120. smalltalk.method({
  1121. selector: "browserModel",
  1122. category: 'accessing',
  1123. fn: function (){
  1124. var self=this;
  1125. return smalltalk.withContext(function($ctx1) {
  1126. var $1;
  1127. $1=self["@browserModel"];
  1128. return $1;
  1129. }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLSourceCodeWidget)})},
  1130. args: [],
  1131. source: "browserModel\x0a\x09^ browserModel",
  1132. messageSends: [],
  1133. referencedClasses: []
  1134. }),
  1135. smalltalk.HLBrowserCodeWidget);
  1136. smalltalk.addMethod(
  1137. smalltalk.method({
  1138. selector: "browserModel:",
  1139. category: 'accessing',
  1140. fn: function (aBrowserModel){
  1141. var self=this;
  1142. return smalltalk.withContext(function($ctx1) {
  1143. var $1,$2;
  1144. self["@browserModel"]=aBrowserModel;
  1145. $1=self;
  1146. _st($1)._observeSystem();
  1147. $2=_st($1)._observeBrowserModel();
  1148. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget)})},
  1149. args: ["aBrowserModel"],
  1150. source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x09self \x0a\x09\x09observeSystem;\x0a\x09\x09observeBrowserModel",
  1151. messageSends: ["observeSystem", "observeBrowserModel"],
  1152. referencedClasses: []
  1153. }),
  1154. smalltalk.HLBrowserCodeWidget);
  1155. smalltalk.addMethod(
  1156. smalltalk.method({
  1157. selector: "observeBrowserModel",
  1158. category: 'actions',
  1159. fn: function (){
  1160. var self=this;
  1161. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  1162. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  1163. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  1164. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  1165. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  1166. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1167. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1168. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1169. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1170. return smalltalk.withContext(function($ctx1) {
  1171. var $1,$2;
  1172. $1=_st(_st(self)._browserModel())._announcer();
  1173. _st($1)._on_do_($HLSaveSourceCode(),(function(ann){
  1174. return smalltalk.withContext(function($ctx2) {
  1175. return _st(self)._onSaveIt();
  1176. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1177. _st($1)._on_do_($HLParseErrorRaised(),(function(ann){
  1178. return smalltalk.withContext(function($ctx2) {
  1179. return _st(self)._onParseError_(ann);
  1180. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1181. _st($1)._on_do_($HLCompileErrorRaised(),(function(ann){
  1182. return smalltalk.withContext(function($ctx2) {
  1183. return _st(self)._onCompileError_(_st(ann)._error());
  1184. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1185. _st($1)._on_do_($HLUnknownVariableErrorRaised(),(function(ann){
  1186. return smalltalk.withContext(function($ctx2) {
  1187. return _st(self)._onUnknownVariableError_(_st(ann)._error());
  1188. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1189. _st($1)._on_do_($HLInstVarAdded(),(function(ann){
  1190. return smalltalk.withContext(function($ctx2) {
  1191. return _st(self)._onInstVarAdded();
  1192. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1193. _st($1)._on_do_($HLMethodSelected(),(function(ann){
  1194. return smalltalk.withContext(function($ctx2) {
  1195. return _st(self)._onMethodSelected_(_st(ann)._item());
  1196. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1197. _st($1)._on_do_($HLClassSelected(),(function(ann){
  1198. return smalltalk.withContext(function($ctx2) {
  1199. return _st(self)._onClassSelected_(_st(ann)._item());
  1200. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1201. _st($1)._on_do_($HLProtocolSelected(),(function(ann){
  1202. return smalltalk.withContext(function($ctx2) {
  1203. return _st(self)._onProtocolSelected_(_st(ann)._item());
  1204. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1205. $2=_st($1)._on_do_($HLSourceCodeFocusRequested(),(function(ann){
  1206. return smalltalk.withContext(function($ctx2) {
  1207. return _st(self)._onSourceCodeFocusRequested();
  1208. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1209. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLSourceCodeWidget)})},
  1210. args: [],
  1211. source: "observeBrowserModel\x0a\x09self browserModel announcer\x0a\x09\x09on: HLSaveSourceCode\x0a\x09\x09do: [ :ann | self onSaveIt ];\x0a\x09\x09on: HLParseErrorRaised\x0a\x09\x09do: [ :ann | self onParseError: ann ];\x0a\x09\x09on: HLCompileErrorRaised\x0a\x09\x09do: [ :ann | self onCompileError: ann error ];\x0a\x09\x09on: HLUnknownVariableErrorRaised\x0a\x09\x09do: [ :ann | self onUnknownVariableError: ann error ];\x0a\x09\x09on: HLInstVarAdded \x0a\x09\x09do: [ :ann | self onInstVarAdded ];\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09do: [ :ann | self onMethodSelected: ann item ];\x0a \x09on: HLClassSelected \x0a\x09\x09do: [ :ann | self onClassSelected: ann item ];\x0a \x09on: HLProtocolSelected \x0a\x09\x09do: [ :ann | self onProtocolSelected: ann item ];\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09do: [ :ann | self onSourceCodeFocusRequested ]",
  1212. messageSends: ["on:do:", "onSaveIt", "announcer", "browserModel", "onParseError:", "onCompileError:", "error", "onUnknownVariableError:", "onInstVarAdded", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"],
  1213. referencedClasses: ["HLSaveSourceCode", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
  1214. }),
  1215. smalltalk.HLBrowserCodeWidget);
  1216. smalltalk.addMethod(
  1217. smalltalk.method({
  1218. selector: "observeSystem",
  1219. category: 'actions',
  1220. fn: function (){
  1221. var self=this;
  1222. function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  1223. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1224. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1225. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1226. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1227. return smalltalk.withContext(function($ctx1) {
  1228. var $1,$2;
  1229. $1=_st(_st(self)._browserModel())._systemAnnouncer();
  1230. _st($1)._on_do_($MethodModified(),(function(ann){
  1231. return smalltalk.withContext(function($ctx2) {
  1232. return _st(self)._onMethodModified_(_st(ann)._method());
  1233. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1234. _st($1)._on_do_($HLMethodSelected(),(function(ann){
  1235. return smalltalk.withContext(function($ctx2) {
  1236. return _st(self)._onMethodSelected_(_st(ann)._item());
  1237. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1238. _st($1)._on_do_($HLClassSelected(),(function(ann){
  1239. return smalltalk.withContext(function($ctx2) {
  1240. return _st(self)._onClassSelected_(_st(ann)._item());
  1241. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1242. _st($1)._on_do_($HLProtocolSelected(),(function(ann){
  1243. return smalltalk.withContext(function($ctx2) {
  1244. return _st(self)._onProtocolSelected_(_st(ann)._item());
  1245. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1246. $2=_st($1)._on_do_($HLSourceCodeFocusRequested(),(function(ann){
  1247. return smalltalk.withContext(function($ctx2) {
  1248. return _st(self)._onSourceCodeFocusRequested();
  1249. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1250. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLSourceCodeWidget)})},
  1251. args: [],
  1252. source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a \x09on: MethodModified\x0a do: [ :ann | self onMethodModified: ann method ];\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09do: [ :ann | self onMethodSelected: ann item ];\x0a \x09on: HLClassSelected \x0a\x09\x09do: [ :ann | self onClassSelected: ann item ];\x0a \x09on: HLProtocolSelected \x0a\x09\x09do: [ :ann | self onProtocolSelected: ann item ];\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09do: [ :ann | self onSourceCodeFocusRequested ]",
  1253. messageSends: ["on:do:", "onMethodModified:", "method", "systemAnnouncer", "browserModel", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"],
  1254. referencedClasses: ["MethodModified", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
  1255. }),
  1256. smalltalk.HLBrowserCodeWidget);
  1257. smalltalk.addMethod(
  1258. smalltalk.method({
  1259. selector: "onClassSelected:",
  1260. category: 'reactions',
  1261. fn: function (aClass){
  1262. var self=this;
  1263. return smalltalk.withContext(function($ctx1) {
  1264. var $1,$2;
  1265. $1=aClass;
  1266. if(($receiver = $1) == nil || $receiver == undefined){
  1267. $2=_st(self)._contents_("");
  1268. return $2;
  1269. } else {
  1270. $1;
  1271. };
  1272. _st(self)._contents_(_st(aClass)._definition());
  1273. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{aClass:aClass},smalltalk.HLSourceCodeWidget)})},
  1274. args: ["aClass"],
  1275. source: "onClassSelected: aClass\x0a\x09aClass ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: aClass definition",
  1276. messageSends: ["ifNil:", "contents:", "definition"],
  1277. referencedClasses: []
  1278. }),
  1279. smalltalk.HLBrowserCodeWidget);
  1280. smalltalk.addMethod(
  1281. smalltalk.method({
  1282. selector: "onCompileError:",
  1283. category: 'reactions',
  1284. fn: function (anError){
  1285. var self=this;
  1286. return smalltalk.withContext(function($ctx1) {
  1287. _st(self)._alert_(_st(anError)._messageText());
  1288. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anError:anError},smalltalk.HLSourceCodeWidget)})},
  1289. args: ["anError"],
  1290. source: "onCompileError: anError\x0a\x09self alert: anError messageText",
  1291. messageSends: ["alert:", "messageText"],
  1292. referencedClasses: []
  1293. }),
  1294. smalltalk.HLBrowserCodeWidget);
  1295. smalltalk.addMethod(
  1296. smalltalk.method({
  1297. selector: "onInstVarAdded",
  1298. category: 'reactions',
  1299. fn: function (){
  1300. var self=this;
  1301. return smalltalk.withContext(function($ctx1) {
  1302. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1303. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLSourceCodeWidget)})},
  1304. args: [],
  1305. source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
  1306. messageSends: ["save:", "contents", "browserModel"],
  1307. referencedClasses: []
  1308. }),
  1309. smalltalk.HLBrowserCodeWidget);
  1310. smalltalk.addMethod(
  1311. smalltalk.method({
  1312. selector: "onMethodModified:",
  1313. category: 'reactions',
  1314. fn: function (aMethod){
  1315. var self=this;
  1316. return smalltalk.withContext(function($ctx1) {
  1317. var $1,$2,$3,$4,$5,$6;
  1318. $1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(aMethod)._methodClass());
  1319. if(! smalltalk.assert($1)){
  1320. $2=self;
  1321. return $2;
  1322. };
  1323. $3=_st(_st(self)._browserModel())._selectedMethod();
  1324. if(($receiver = $3) == nil || $receiver == undefined){
  1325. $4=self;
  1326. return $4;
  1327. } else {
  1328. $3;
  1329. };
  1330. $5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(aMethod)._selector());
  1331. if(! smalltalk.assert($5)){
  1332. $6=self;
  1333. return $6;
  1334. };
  1335. _st(self)._refresh();
  1336. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{aMethod:aMethod},smalltalk.HLSourceCodeWidget)})},
  1337. args: ["aMethod"],
  1338. source: "onMethodModified: aMethod\x0a\x09self browserModel selectedClass = aMethod methodClass ifFalse: [ ^ self ].\x0a\x09self browserModel selectedMethod ifNil: [ ^ self ].\x0a self browserModel selectedMethod selector = aMethod selector ifFalse: [ ^ self ].\x0a\x0a self refresh",
  1339. messageSends: ["ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"],
  1340. referencedClasses: []
  1341. }),
  1342. smalltalk.HLBrowserCodeWidget);
  1343. smalltalk.addMethod(
  1344. smalltalk.method({
  1345. selector: "onMethodSelected:",
  1346. category: 'reactions',
  1347. fn: function (aCompiledMethod){
  1348. var self=this;
  1349. return smalltalk.withContext(function($ctx1) {
  1350. var $1,$2;
  1351. $1=aCompiledMethod;
  1352. if(($receiver = $1) == nil || $receiver == undefined){
  1353. $2=_st(self)._contents_("");
  1354. return $2;
  1355. } else {
  1356. $1;
  1357. };
  1358. _st(self)._contents_(_st(aCompiledMethod)._source());
  1359. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{aCompiledMethod:aCompiledMethod},smalltalk.HLSourceCodeWidget)})},
  1360. args: ["aCompiledMethod"],
  1361. source: "onMethodSelected: aCompiledMethod\x0a\x09aCompiledMethod ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: aCompiledMethod source",
  1362. messageSends: ["ifNil:", "contents:", "source"],
  1363. referencedClasses: []
  1364. }),
  1365. smalltalk.HLBrowserCodeWidget);
  1366. smalltalk.addMethod(
  1367. smalltalk.method({
  1368. selector: "onParseError:",
  1369. category: 'reactions',
  1370. fn: function (anAnnouncement){
  1371. var self=this;
  1372. var lineIndex,newContents;
  1373. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1374. return smalltalk.withContext(function($ctx1) {
  1375. var $1,$2,$3;
  1376. lineIndex=(1);
  1377. _st(self)._contents_(_st($String())._streamContents_((function(stream){
  1378. return smalltalk.withContext(function($ctx2) {
  1379. return _st(_st(self)._contents())._linesDo_((function(each){
  1380. return smalltalk.withContext(function($ctx3) {
  1381. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1382. if(smalltalk.assert($1)){
  1383. $2=stream;
  1384. _st($2)._nextPutAll_(_st(each)._copyFrom_to_((1),_st(anAnnouncement)._column()));
  1385. _st($2)._nextPutAll_("<- ");
  1386. _st($2)._nextPutAll_(_st(anAnnouncement)._message());
  1387. _st($2)._nextPutAll_(" ");
  1388. $3=_st($2)._nextPutAll_(_st(each)._copyFrom_to_(_st(_st(anAnnouncement)._column()).__plus((1)),_st(each)._size()));
  1389. $3;
  1390. } else {
  1391. _st(stream)._nextPutAll_(each);
  1392. };
  1393. _st(stream)._nextPutAll_(_st($String())._cr());
  1394. lineIndex=_st(lineIndex).__plus((1));
  1395. return lineIndex;
  1396. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1397. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1398. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
  1399. args: ["anAnnouncement"],
  1400. source: "onParseError: anAnnouncement\x0a\x09| lineIndex newContents |\x0a\x09\x0a\x09lineIndex := 1.\x0a\x09\x0a\x09self contents: (String streamContents: [ :stream |\x0a\x09\x09self contents linesDo: [ :each |\x0a\x09\x09\x09lineIndex = anAnnouncement line \x0a\x09\x09\x09\x09ifTrue: [ \x0a\x09\x09\x09\x09\x09stream \x0a\x09\x09\x09\x09\x09\x09nextPutAll: (each copyFrom: 1 to: anAnnouncement column);\x0a\x09\x09\x09\x09\x09\x09nextPutAll: '<- ';\x0a\x09\x09\x09\x09\x09\x09nextPutAll: anAnnouncement message;\x0a\x09\x09\x09\x09\x09\x09nextPutAll: ' ';\x0a\x09\x09\x09\x09\x09\x09nextPutAll: (each copyFrom: anAnnouncement column + 1 to: each size) ]\x0a\x09\x09\x09\x09ifFalse: [ stream nextPutAll: each ].\x0a\x09\x09\x09stream nextPutAll: String cr.\x0a\x09\x09\x09lineIndex := lineIndex + 1 ] ])",
  1401. messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"],
  1402. referencedClasses: ["String"]
  1403. }),
  1404. smalltalk.HLBrowserCodeWidget);
  1405. smalltalk.addMethod(
  1406. smalltalk.method({
  1407. selector: "onProtocolSelected:",
  1408. category: 'reactions',
  1409. fn: function (aString){
  1410. var self=this;
  1411. return smalltalk.withContext(function($ctx1) {
  1412. var $1,$2;
  1413. $1=_st(_st(self)._browserModel())._selectedClass();
  1414. if(($receiver = $1) == nil || $receiver == undefined){
  1415. $2=_st(self)._contents_("");
  1416. return $2;
  1417. } else {
  1418. $1;
  1419. };
  1420. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1421. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{aString:aString},smalltalk.HLSourceCodeWidget)})},
  1422. args: ["aString"],
  1423. source: "onProtocolSelected: aString\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: self browserModel selectedClass definition",
  1424. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
  1425. referencedClasses: []
  1426. }),
  1427. smalltalk.HLBrowserCodeWidget);
  1428. smalltalk.addMethod(
  1429. smalltalk.method({
  1430. selector: "onSaveIt",
  1431. category: 'reactions',
  1432. fn: function (){
  1433. var self=this;
  1434. return smalltalk.withContext(function($ctx1) {
  1435. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1436. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
  1437. args: [],
  1438. source: "onSaveIt\x0a\x09self browserModel save: self contents",
  1439. messageSends: ["save:", "contents", "browserModel"],
  1440. referencedClasses: []
  1441. }),
  1442. smalltalk.HLBrowserCodeWidget);
  1443. smalltalk.addMethod(
  1444. smalltalk.method({
  1445. selector: "onSourceCodeFocusRequested",
  1446. category: 'reactions',
  1447. fn: function (){
  1448. var self=this;
  1449. return smalltalk.withContext(function($ctx1) {
  1450. _st(self)._focus();
  1451. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLSourceCodeWidget)})},
  1452. args: [],
  1453. source: "onSourceCodeFocusRequested\x0a\x09self focus",
  1454. messageSends: ["focus"],
  1455. referencedClasses: []
  1456. }),
  1457. smalltalk.HLBrowserCodeWidget);
  1458. smalltalk.addMethod(
  1459. smalltalk.method({
  1460. selector: "onUnknownVariableError:",
  1461. category: 'reactions',
  1462. fn: function (anError){
  1463. var self=this;
  1464. var confirm;
  1465. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1466. return smalltalk.withContext(function($ctx1) {
  1467. var $1,$2,$3,$4;
  1468. confirm=_st(self)._confirm_(_st($String())._streamContents_((function(stream){
  1469. return smalltalk.withContext(function($ctx2) {
  1470. $1=stream;
  1471. _st($1)._nextPutAll_(_st(anError)._messageText());
  1472. _st($1)._nextPutAll_(_st($String())._cr());
  1473. $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
  1474. return $2;
  1475. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1476. $3=confirm;
  1477. if(! smalltalk.assert($3)){
  1478. $4=self;
  1479. return $4;
  1480. };
  1481. _st(_st(self)._browserModel())._addInstVarNamed_(_st(anError)._variableName());
  1482. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anError:anError,confirm:confirm},smalltalk.HLSourceCodeWidget)})},
  1483. args: ["anError"],
  1484. source: "onUnknownVariableError: anError\x0a\x09| confirm |\x0a\x0a\x09confirm := self confirm: (String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09\x09\x09nextPutAll: anError messageText;\x0a\x09\x09\x09nextPutAll: String cr;\x0a\x09\x09\x09nextPutAll: 'Would you like to define an instance variable?' ]).\x0a\x09\x09\x09\x0a\x09confirm ifFalse: [ ^ self ].\x0a\x09\x0a\x09self browserModel addInstVarNamed: anError variableName",
  1485. messageSends: ["confirm:", "streamContents:", "nextPutAll:", "messageText", "cr", "ifFalse:", "addInstVarNamed:", "variableName", "browserModel"],
  1486. referencedClasses: ["String"]
  1487. }),
  1488. smalltalk.HLBrowserCodeWidget);
  1489. smalltalk.addMethod(
  1490. smalltalk.method({
  1491. selector: "refresh",
  1492. category: 'actions',
  1493. fn: function (){
  1494. var self=this;
  1495. return smalltalk.withContext(function($ctx1) {
  1496. var $1,$2,$3,$4;
  1497. $1=_st(self)._hasModification();
  1498. if(smalltalk.assert($1)){
  1499. $2=self;
  1500. return $2;
  1501. };
  1502. $3=_st(self)._hasFocus();
  1503. if(smalltalk.assert($3)){
  1504. $4=self;
  1505. return $4;
  1506. };
  1507. _st(self)._contents_(_st(_st(_st(self)._model())._selectedMethod())._source());
  1508. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLSourceCodeWidget)})},
  1509. args: [],
  1510. source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self model selectedMethod source",
  1511. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "model"],
  1512. referencedClasses: []
  1513. }),
  1514. smalltalk.HLBrowserCodeWidget);
  1515. smalltalk.addMethod(
  1516. smalltalk.method({
  1517. selector: "saveIt",
  1518. category: 'actions',
  1519. fn: function (){
  1520. var self=this;
  1521. return smalltalk.withContext(function($ctx1) {
  1522. _st(_st(self)._browserModel())._saveSourceCode();
  1523. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
  1524. args: [],
  1525. source: "saveIt\x0a\x09self browserModel saveSourceCode",
  1526. messageSends: ["saveSourceCode", "browserModel"],
  1527. referencedClasses: []
  1528. }),
  1529. smalltalk.HLBrowserCodeWidget);
  1530. smalltalk.addMethod(
  1531. smalltalk.method({
  1532. selector: "canBeOpenAsTab",
  1533. category: 'testing',
  1534. fn: function (){
  1535. var self=this;
  1536. return smalltalk.withContext(function($ctx1) {
  1537. return false;
  1538. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
  1539. args: [],
  1540. source: "canBeOpenAsTab\x0a\x09^ false",
  1541. messageSends: [],
  1542. referencedClasses: []
  1543. }),
  1544. smalltalk.HLBrowserCodeWidget.klass);
  1545. smalltalk.addMethod(
  1546. smalltalk.method({
  1547. selector: "on:",
  1548. category: 'instance creation',
  1549. fn: function (aBrowserModel){
  1550. var self=this;
  1551. return smalltalk.withContext(function($ctx1) {
  1552. var $2,$3,$1;
  1553. $2=_st(self)._new();
  1554. _st($2)._browserModel_(aBrowserModel);
  1555. $3=_st($2)._yourself();
  1556. $1=$3;
  1557. return $1;
  1558. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
  1559. args: ["aBrowserModel"],
  1560. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1561. messageSends: ["browserModel:", "new", "yourself"],
  1562. referencedClasses: []
  1563. }),
  1564. smalltalk.HLBrowserCodeWidget.klass);
  1565. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget'], 'Helios-Workspace');
  1566. smalltalk.addMethod(
  1567. smalltalk.method({
  1568. selector: "canHaveFocus",
  1569. category: 'testing',
  1570. fn: function (){
  1571. var self=this;
  1572. return smalltalk.withContext(function($ctx1) {
  1573. return true;
  1574. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
  1575. args: [],
  1576. source: "canHaveFocus\x0a\x09^ true",
  1577. messageSends: [],
  1578. referencedClasses: []
  1579. }),
  1580. smalltalk.HLWorkspace);
  1581. smalltalk.addMethod(
  1582. smalltalk.method({
  1583. selector: "codeWidget",
  1584. category: 'accessing',
  1585. fn: function (){
  1586. var self=this;
  1587. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  1588. return smalltalk.withContext(function($ctx1) {
  1589. var $2,$1;
  1590. $2=self["@codeWidget"];
  1591. if(($receiver = $2) == nil || $receiver == undefined){
  1592. self["@codeWidget"]=_st($HLCodeWidget())._new();
  1593. $1=self["@codeWidget"];
  1594. } else {
  1595. $1=$2;
  1596. };
  1597. return $1;
  1598. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
  1599. args: [],
  1600. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
  1601. messageSends: ["ifNil:", "new"],
  1602. referencedClasses: ["HLCodeWidget"]
  1603. }),
  1604. smalltalk.HLWorkspace);
  1605. smalltalk.addMethod(
  1606. smalltalk.method({
  1607. selector: "focus",
  1608. category: 'actions',
  1609. fn: function (){
  1610. var self=this;
  1611. return smalltalk.withContext(function($ctx1) {
  1612. var $1;
  1613. $1=_st(_st(self)._codeWidget())._focus();
  1614. return $1;
  1615. }, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
  1616. args: [],
  1617. source: "focus\x0a\x09^ self codeWidget focus",
  1618. messageSends: ["focus", "codeWidget"],
  1619. referencedClasses: []
  1620. }),
  1621. smalltalk.HLWorkspace);
  1622. smalltalk.addMethod(
  1623. smalltalk.method({
  1624. selector: "renderContentOn:",
  1625. category: 'rendering',
  1626. fn: function (html){
  1627. var self=this;
  1628. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  1629. return smalltalk.withContext(function($ctx1) {
  1630. _st(html)._with_(_st($HLContainer())._with_(_st(self)._codeWidget()));
  1631. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
  1632. args: ["html"],
  1633. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: self codeWidget)",
  1634. messageSends: ["with:", "codeWidget"],
  1635. referencedClasses: ["HLContainer"]
  1636. }),
  1637. smalltalk.HLWorkspace);
  1638. smalltalk.addMethod(
  1639. smalltalk.method({
  1640. selector: "canBeOpenAsTab",
  1641. category: 'testing',
  1642. fn: function (){
  1643. var self=this;
  1644. return smalltalk.withContext(function($ctx1) {
  1645. return true;
  1646. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
  1647. args: [],
  1648. source: "canBeOpenAsTab\x0a\x09^ true",
  1649. messageSends: [],
  1650. referencedClasses: []
  1651. }),
  1652. smalltalk.HLWorkspace.klass);
  1653. smalltalk.addMethod(
  1654. smalltalk.method({
  1655. selector: "tabLabel",
  1656. category: 'accessing',
  1657. fn: function (){
  1658. var self=this;
  1659. return smalltalk.withContext(function($ctx1) {
  1660. return "Workspace";
  1661. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
  1662. args: [],
  1663. source: "tabLabel\x0a\x09^ 'Workspace'",
  1664. messageSends: [],
  1665. referencedClasses: []
  1666. }),
  1667. smalltalk.HLWorkspace.klass);
  1668. smalltalk.addMethod(
  1669. smalltalk.method({
  1670. selector: "tabPriority",
  1671. category: 'accessing',
  1672. fn: function (){
  1673. var self=this;
  1674. return smalltalk.withContext(function($ctx1) {
  1675. var $1;
  1676. $1=(10);
  1677. return $1;
  1678. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
  1679. args: [],
  1680. source: "tabPriority\x0a\x09^ 10",
  1681. messageSends: [],
  1682. referencedClasses: []
  1683. }),
  1684. smalltalk.HLWorkspace.klass);