Helios-Workspace.deploy.js 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027
  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. fn: function (){
  7. var self=this;
  8. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  9. return smalltalk.withContext(function($ctx1) {
  10. var $2,$1;
  11. $2=self["@announcer"];
  12. if(($receiver = $2) == nil || $receiver == undefined){
  13. self["@announcer"]=_st($Announcer())._new();
  14. $1=self["@announcer"];
  15. } else {
  16. $1=$2;
  17. };
  18. return $1;
  19. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeModel)})},
  20. messageSends: ["ifNil:", "new"]}),
  21. smalltalk.HLCodeModel);
  22. smalltalk.addMethod(
  23. smalltalk.method({
  24. selector: "defaultReceiver",
  25. fn: function (){
  26. var self=this;
  27. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  28. return smalltalk.withContext(function($ctx1) {
  29. var $1;
  30. $1=_st($DoIt())._new();
  31. return $1;
  32. }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{},smalltalk.HLCodeModel)})},
  33. messageSends: ["new"]}),
  34. smalltalk.HLCodeModel);
  35. smalltalk.addMethod(
  36. smalltalk.method({
  37. selector: "doIt:",
  38. fn: function (someCode){
  39. var self=this;
  40. return smalltalk.withContext(function($ctx1) {
  41. var $1;
  42. $1=_st(_st(self)._environment())._eval_on_(someCode,_st(self)._receiver());
  43. return $1;
  44. }, function($ctx1) {$ctx1.fill(self,"doIt:",{someCode:someCode},smalltalk.HLCodeModel)})},
  45. messageSends: ["eval:on:", "receiver", "environment"]}),
  46. smalltalk.HLCodeModel);
  47. smalltalk.addMethod(
  48. smalltalk.method({
  49. selector: "environment",
  50. fn: function (){
  51. var self=this;
  52. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  53. return smalltalk.withContext(function($ctx1) {
  54. var $2,$1;
  55. $2=self["@environment"];
  56. if(($receiver = $2) == nil || $receiver == undefined){
  57. $1=_st(_st($HLManager())._current())._environment();
  58. } else {
  59. $1=$2;
  60. };
  61. return $1;
  62. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLCodeModel)})},
  63. messageSends: ["ifNil:", "environment", "current"]}),
  64. smalltalk.HLCodeModel);
  65. smalltalk.addMethod(
  66. smalltalk.method({
  67. selector: "environment:",
  68. fn: function (anEnvironment){
  69. var self=this;
  70. return smalltalk.withContext(function($ctx1) {
  71. self["@environment"]=anEnvironment;
  72. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel)})},
  73. messageSends: []}),
  74. smalltalk.HLCodeModel);
  75. smalltalk.addMethod(
  76. smalltalk.method({
  77. selector: "receiver",
  78. fn: function (){
  79. var self=this;
  80. return smalltalk.withContext(function($ctx1) {
  81. var $2,$1;
  82. $2=self["@receiver"];
  83. if(($receiver = $2) == nil || $receiver == undefined){
  84. self["@receiver"]=_st(self)._defaultReceiver();
  85. $1=self["@receiver"];
  86. } else {
  87. $1=$2;
  88. };
  89. return $1;
  90. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeModel)})},
  91. messageSends: ["ifNil:", "defaultReceiver"]}),
  92. smalltalk.HLCodeModel);
  93. smalltalk.addMethod(
  94. smalltalk.method({
  95. selector: "receiver:",
  96. fn: function (anObject){
  97. var self=this;
  98. return smalltalk.withContext(function($ctx1) {
  99. self["@receiver"]=anObject;
  100. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeModel)})},
  101. messageSends: []}),
  102. smalltalk.HLCodeModel);
  103. smalltalk.addMethod(
  104. smalltalk.method({
  105. selector: "subscribe:",
  106. fn: function (aWidget){
  107. var self=this;
  108. return smalltalk.withContext(function($ctx1) {
  109. _st(aWidget)._subscribeTo_(_st(self)._announcer());
  110. return self}, function($ctx1) {$ctx1.fill(self,"subscribe:",{aWidget:aWidget},smalltalk.HLCodeModel)})},
  111. messageSends: ["subscribeTo:", "announcer"]}),
  112. smalltalk.HLCodeModel);
  113. smalltalk.addMethod(
  114. smalltalk.method({
  115. selector: "on:",
  116. fn: function (anEnvironment){
  117. var self=this;
  118. return smalltalk.withContext(function($ctx1) {
  119. var $2,$3,$1;
  120. $2=_st(self)._new();
  121. _st($2)._environment_(anEnvironment);
  122. $3=_st($2)._yourself();
  123. $1=$3;
  124. return $1;
  125. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel.klass)})},
  126. messageSends: ["environment:", "new", "yourself"]}),
  127. smalltalk.HLCodeModel.klass);
  128. smalltalk.addClass('HLCodeWidget', smalltalk.HLWidget, ['model', 'wrapper', 'code', 'editor'], 'Helios-Workspace');
  129. smalltalk.addMethod(
  130. smalltalk.method({
  131. selector: "announcer",
  132. fn: function (){
  133. var self=this;
  134. return smalltalk.withContext(function($ctx1) {
  135. var $1;
  136. $1=_st(_st(self)._model())._announcer();
  137. return $1;
  138. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeWidget)})},
  139. messageSends: ["announcer", "model"]}),
  140. smalltalk.HLCodeWidget);
  141. smalltalk.addMethod(
  142. smalltalk.method({
  143. selector: "canHaveFocus",
  144. fn: function (){
  145. var self=this;
  146. return smalltalk.withContext(function($ctx1) {
  147. return true;
  148. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLCodeWidget)})},
  149. messageSends: []}),
  150. smalltalk.HLCodeWidget);
  151. smalltalk.addMethod(
  152. smalltalk.method({
  153. selector: "clear",
  154. fn: function (){
  155. var self=this;
  156. return smalltalk.withContext(function($ctx1) {
  157. _st(self)._contents_("");
  158. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLCodeWidget)})},
  159. messageSends: ["contents:"]}),
  160. smalltalk.HLCodeWidget);
  161. smalltalk.addMethod(
  162. smalltalk.method({
  163. selector: "configureEditor",
  164. fn: function (){
  165. var self=this;
  166. return smalltalk.withContext(function($ctx1) {
  167. _st(_st(self)._editor())._at_put_("amberCodeWidget",self);
  168. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLCodeWidget)})},
  169. messageSends: ["at:put:", "editor"]}),
  170. smalltalk.HLCodeWidget);
  171. smalltalk.addMethod(
  172. smalltalk.method({
  173. selector: "contents",
  174. fn: function (){
  175. var self=this;
  176. return smalltalk.withContext(function($ctx1) {
  177. var $1;
  178. $1=_st(self["@editor"])._getValue();
  179. return $1;
  180. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.HLCodeWidget)})},
  181. messageSends: ["getValue"]}),
  182. smalltalk.HLCodeWidget);
  183. smalltalk.addMethod(
  184. smalltalk.method({
  185. selector: "contents:",
  186. fn: function (aString){
  187. var self=this;
  188. return smalltalk.withContext(function($ctx1) {
  189. _st(self["@editor"])._setValue_(aString);
  190. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLCodeWidget)})},
  191. messageSends: ["setValue:"]}),
  192. smalltalk.HLCodeWidget);
  193. smalltalk.addMethod(
  194. smalltalk.method({
  195. selector: "currentLine",
  196. fn: function (){
  197. var self=this;
  198. return smalltalk.withContext(function($ctx1) {
  199. var $1;
  200. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  201. return $1;
  202. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},smalltalk.HLCodeWidget)})},
  203. messageSends: ["getLine:", "line", "getCursor"]}),
  204. smalltalk.HLCodeWidget);
  205. smalltalk.addMethod(
  206. smalltalk.method({
  207. selector: "currentLineOrSelection",
  208. fn: function (){
  209. var self=this;
  210. return smalltalk.withContext(function($ctx1) {
  211. var $2,$1;
  212. $2=_st(self["@editor"])._somethingSelected();
  213. if(smalltalk.assert($2)){
  214. $1=_st(self)._selection();
  215. } else {
  216. $1=_st(self)._currentLine();
  217. };
  218. return $1;
  219. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},smalltalk.HLCodeWidget)})},
  220. messageSends: ["ifFalse:ifTrue:", "currentLine", "selection", "somethingSelected"]}),
  221. smalltalk.HLCodeWidget);
  222. smalltalk.addMethod(
  223. smalltalk.method({
  224. selector: "doIt",
  225. fn: function (){
  226. var self=this;
  227. var result;
  228. function $HLDoItRequested(){return smalltalk.HLDoItRequested||(typeof HLDoItRequested=="undefined"?nil:HLDoItRequested)}
  229. function $HLDoItExecuted(){return smalltalk.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
  230. return smalltalk.withContext(function($ctx1) {
  231. var $1;
  232. _st(_st(self)._announcer())._announce_(_st($HLDoItRequested())._on_(self["@model"]));
  233. result=_st(self["@model"])._doIt_(_st(self)._currentLineOrSelection());
  234. _st(_st(self)._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
  235. $1=result;
  236. return $1;
  237. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},smalltalk.HLCodeWidget)})},
  238. messageSends: ["announce:", "on:", "announcer", "doIt:", "currentLineOrSelection"]}),
  239. smalltalk.HLCodeWidget);
  240. smalltalk.addMethod(
  241. smalltalk.method({
  242. selector: "editor",
  243. fn: function (){
  244. var self=this;
  245. return smalltalk.withContext(function($ctx1) {
  246. var $1;
  247. $1=self["@editor"];
  248. return $1;
  249. }, function($ctx1) {$ctx1.fill(self,"editor",{},smalltalk.HLCodeWidget)})},
  250. messageSends: []}),
  251. smalltalk.HLCodeWidget);
  252. smalltalk.addMethod(
  253. smalltalk.method({
  254. selector: "focus",
  255. fn: function (){
  256. var self=this;
  257. return smalltalk.withContext(function($ctx1) {
  258. _st(self["@editor"])._focus();
  259. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLCodeWidget)})},
  260. messageSends: ["focus"]}),
  261. smalltalk.HLCodeWidget);
  262. smalltalk.addMethod(
  263. smalltalk.method({
  264. selector: "hasFocus",
  265. fn: function (){
  266. var self=this;
  267. return smalltalk.withContext(function($ctx1) {
  268. var $1;
  269. $1=_st(_st(self["@code"])._asJQuery())._is_(":active");
  270. return $1;
  271. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLCodeWidget)})},
  272. messageSends: ["is:", "asJQuery"]}),
  273. smalltalk.HLCodeWidget);
  274. smalltalk.addMethod(
  275. smalltalk.method({
  276. selector: "inspectIt",
  277. fn: function (){
  278. var self=this;
  279. var newInspector;
  280. function $HLInspectItRequested(){return smalltalk.HLInspectItRequested||(typeof HLInspectItRequested=="undefined"?nil:HLInspectItRequested)}
  281. return smalltalk.withContext(function($ctx1) {
  282. _st(_st(self)._announcer())._announce_(_st($HLInspectItRequested())._on_(self["@model"]));
  283. newInspector=_st(self)._makeInspectorOn_(_st(self)._doIt());
  284. _st(newInspector)._open();
  285. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},smalltalk.HLCodeWidget)})},
  286. messageSends: ["announce:", "on:", "announcer", "makeInspectorOn:", "doIt", "open"]}),
  287. smalltalk.HLCodeWidget);
  288. smalltalk.addMethod(
  289. smalltalk.method({
  290. selector: "makeInspectorOn:",
  291. fn: function (anObject){
  292. var self=this;
  293. function $HLInspector(){return smalltalk.HLInspector||(typeof HLInspector=="undefined"?nil:HLInspector)}
  294. return smalltalk.withContext(function($ctx1) {
  295. var $2,$3,$1;
  296. $2=_st($HLInspector())._new();
  297. _st($2)._inspect_(anObject);
  298. $3=_st($2)._yourself();
  299. $1=$3;
  300. return $1;
  301. }, function($ctx1) {$ctx1.fill(self,"makeInspectorOn:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  302. messageSends: ["inspect:", "new", "yourself"]}),
  303. smalltalk.HLCodeWidget);
  304. smalltalk.addMethod(
  305. smalltalk.method({
  306. selector: "messageHintFor:token:",
  307. fn: function (anEditor,aToken){
  308. var self=this;
  309. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  310. return smalltalk.withContext(function($ctx1) {
  311. var $1;
  312. $1=_st(_st(_st(_st(_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value())._asSet())._asArray())._select_((function(each){
  313. return smalltalk.withContext(function($ctx2) {
  314. return _st(each)._includesSubString_(_st(aToken)._string());
  315. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  316. return smalltalk.withContext(function($ctx2) {
  317. return _st(each).__eq(_st(aToken)._string());
  318. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  319. return $1;
  320. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget)})},
  321. messageSends: ["reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", "value", "at:", "current"]}),
  322. smalltalk.HLCodeWidget);
  323. smalltalk.addMethod(
  324. smalltalk.method({
  325. selector: "model",
  326. fn: function (){
  327. var self=this;
  328. function $HLCodeModel(){return smalltalk.HLCodeModel||(typeof HLCodeModel=="undefined"?nil:HLCodeModel)}
  329. return smalltalk.withContext(function($ctx1) {
  330. var $2,$1;
  331. $2=self["@model"];
  332. if(($receiver = $2) == nil || $receiver == undefined){
  333. self["@model"]=_st($HLCodeModel())._new();
  334. $1=self["@model"];
  335. } else {
  336. $1=$2;
  337. };
  338. return $1;
  339. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLCodeWidget)})},
  340. messageSends: ["ifNil:", "new"]}),
  341. smalltalk.HLCodeWidget);
  342. smalltalk.addMethod(
  343. smalltalk.method({
  344. selector: "model:",
  345. fn: function (aModel){
  346. var self=this;
  347. return smalltalk.withContext(function($ctx1) {
  348. self["@model"]=aModel;
  349. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLCodeWidget)})},
  350. messageSends: []}),
  351. smalltalk.HLCodeWidget);
  352. smalltalk.addMethod(
  353. smalltalk.method({
  354. selector: "onDoIt",
  355. fn: function (){
  356. var self=this;
  357. return smalltalk.withContext(function($ctx1) {
  358. _st(self)._doIt();
  359. return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{},smalltalk.HLCodeWidget)})},
  360. messageSends: ["doIt"]}),
  361. smalltalk.HLCodeWidget);
  362. smalltalk.addMethod(
  363. smalltalk.method({
  364. selector: "onInspectIt",
  365. fn: function (){
  366. var self=this;
  367. return smalltalk.withContext(function($ctx1) {
  368. _st(self)._inspectIt();
  369. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},smalltalk.HLCodeWidget)})},
  370. messageSends: ["inspectIt"]}),
  371. smalltalk.HLCodeWidget);
  372. smalltalk.addMethod(
  373. smalltalk.method({
  374. selector: "onPrintIt",
  375. fn: function (){
  376. var self=this;
  377. return smalltalk.withContext(function($ctx1) {
  378. _st(self)._printIt();
  379. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},smalltalk.HLCodeWidget)})},
  380. messageSends: ["printIt"]}),
  381. smalltalk.HLCodeWidget);
  382. smalltalk.addMethod(
  383. smalltalk.method({
  384. selector: "onSaveIt",
  385. fn: function (){
  386. var self=this;
  387. return smalltalk.withContext(function($ctx1) {
  388. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLCodeWidget)})},
  389. messageSends: []}),
  390. smalltalk.HLCodeWidget);
  391. smalltalk.addMethod(
  392. smalltalk.method({
  393. selector: "print:",
  394. fn: function (aString){
  395. var self=this;
  396. var start,stop,currentLine;
  397. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  398. return smalltalk.withContext(function($ctx1) {
  399. currentLine=_st(_st(self["@editor"])._getCursor_(false))._line();
  400. start=_st($HashedCollection())._new();
  401. _st(start)._at_put_("line",currentLine);
  402. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getCursor_(false))._ch());
  403. _st(_st(self["@editor"])._getSelection())._ifEmpty_((function(){
  404. return smalltalk.withContext(function($ctx2) {
  405. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getLine_(currentLine))._size());
  406. return _st(self["@editor"])._setSelection_end_(smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(currentLine),_st("ch").__minus_gt((0))]),start);
  407. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  408. stop=_st($HashedCollection())._new();
  409. _st(stop)._at_put_("line",currentLine);
  410. _st(stop)._at_put_("ch",_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2)));
  411. _st(self["@editor"])._replaceSelection_(_st(_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString)).__comma(" "));
  412. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  413. _st(self["@editor"])._setSelection_end_(stop,start);
  414. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},smalltalk.HLCodeWidget)})},
  415. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "size", "getLine:", "setSelection:end:", "->", "getSelection", "+", "at:", "replaceSelection:", ",", "setCursor:"]}),
  416. smalltalk.HLCodeWidget);
  417. smalltalk.addMethod(
  418. smalltalk.method({
  419. selector: "printIt",
  420. fn: function (){
  421. var self=this;
  422. var result;
  423. function $HLPrintItRequested(){return smalltalk.HLPrintItRequested||(typeof HLPrintItRequested=="undefined"?nil:HLPrintItRequested)}
  424. return smalltalk.withContext(function($ctx1) {
  425. result=_st(self)._doIt();
  426. _st(_st(self)._announcer())._announce_(_st($HLPrintItRequested())._on_(self["@model"]));
  427. _st(self)._print_(_st(result)._printString());
  428. _st(self)._focus();
  429. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{result:result},smalltalk.HLCodeWidget)})},
  430. messageSends: ["doIt", "announce:", "on:", "announcer", "print:", "printString", "focus"]}),
  431. smalltalk.HLCodeWidget);
  432. smalltalk.addMethod(
  433. smalltalk.method({
  434. selector: "receiver",
  435. fn: function (){
  436. var self=this;
  437. return smalltalk.withContext(function($ctx1) {
  438. var $1;
  439. $1=_st(_st(self)._model())._receiver();
  440. return $1;
  441. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeWidget)})},
  442. messageSends: ["receiver", "model"]}),
  443. smalltalk.HLCodeWidget);
  444. smalltalk.addMethod(
  445. smalltalk.method({
  446. selector: "receiver:",
  447. fn: function (anObject){
  448. var self=this;
  449. return smalltalk.withContext(function($ctx1) {
  450. _st(_st(self)._model())._receiver_(anObject);
  451. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  452. messageSends: ["receiver:", "model"]}),
  453. smalltalk.HLCodeWidget);
  454. smalltalk.addMethod(
  455. smalltalk.method({
  456. selector: "renderContentOn:",
  457. fn: function (html){
  458. var self=this;
  459. return smalltalk.withContext(function($ctx1) {
  460. self["@code"]=_st(html)._textarea();
  461. _st(self)._setEditorOn_(_st(self["@code"])._element());
  462. _st(self)._configureEditor();
  463. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLCodeWidget)})},
  464. messageSends: ["textarea", "setEditorOn:", "element", "configureEditor"]}),
  465. smalltalk.HLCodeWidget);
  466. smalltalk.addMethod(
  467. smalltalk.method({
  468. selector: "saveIt",
  469. fn: function (){
  470. var self=this;
  471. return smalltalk.withContext(function($ctx1) {
  472. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLCodeWidget)})},
  473. messageSends: []}),
  474. smalltalk.HLCodeWidget);
  475. smalltalk.addMethod(
  476. smalltalk.method({
  477. selector: "selection",
  478. fn: function (){
  479. var self=this;
  480. return smalltalk.withContext(function($ctx1) {
  481. var $1;
  482. $1=_st(self["@editor"])._getSelection();
  483. return $1;
  484. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.HLCodeWidget)})},
  485. messageSends: ["getSelection"]}),
  486. smalltalk.HLCodeWidget);
  487. smalltalk.addMethod(
  488. smalltalk.method({
  489. selector: "selectionEnd",
  490. fn: function (){
  491. var self=this;
  492. return smalltalk.withContext(function($ctx1) {
  493. var $1;
  494. $1=_st(_st(self["@code"])._element())._selectionEnd();
  495. return $1;
  496. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},smalltalk.HLCodeWidget)})},
  497. messageSends: ["selectionEnd", "element"]}),
  498. smalltalk.HLCodeWidget);
  499. smalltalk.addMethod(
  500. smalltalk.method({
  501. selector: "selectionEnd:",
  502. fn: function (anInteger){
  503. var self=this;
  504. return smalltalk.withContext(function($ctx1) {
  505. _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  506. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  507. messageSends: ["selectionEnd:", "element"]}),
  508. smalltalk.HLCodeWidget);
  509. smalltalk.addMethod(
  510. smalltalk.method({
  511. selector: "selectionStart",
  512. fn: function (){
  513. var self=this;
  514. return smalltalk.withContext(function($ctx1) {
  515. var $1;
  516. $1=_st(_st(self["@code"])._element())._selectionStart();
  517. return $1;
  518. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},smalltalk.HLCodeWidget)})},
  519. messageSends: ["selectionStart", "element"]}),
  520. smalltalk.HLCodeWidget);
  521. smalltalk.addMethod(
  522. smalltalk.method({
  523. selector: "selectionStart:",
  524. fn: function (anInteger){
  525. var self=this;
  526. return smalltalk.withContext(function($ctx1) {
  527. _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  528. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  529. messageSends: ["selectionStart:", "element"]}),
  530. smalltalk.HLCodeWidget);
  531. smalltalk.addMethod(
  532. smalltalk.method({
  533. selector: "setEditorOn:",
  534. fn: function (aTextarea){
  535. var self=this;
  536. return smalltalk.withContext(function($ctx1) {
  537. self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
  538. theme: 'amber',
  539. lineNumbers: true,
  540. enterMode: 'flat',
  541. indentWithTabs: true,
  542. indentUnit: 4,
  543. matchBrackets: true,
  544. electricChars: false,
  545. keyMap: 'Amber',
  546. extraKeys: {"Shift-Space": "autocomplete"}
  547. });
  548. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},smalltalk.HLCodeWidget)})},
  549. messageSends: []}),
  550. smalltalk.HLCodeWidget);
  551. smalltalk.addMethod(
  552. smalltalk.method({
  553. selector: "variableHintFor:token:",
  554. fn: function (anEditor,aToken){
  555. var self=this;
  556. var variables,classNames,pseudoVariables;
  557. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  558. return smalltalk.withContext(function($ctx1) {
  559. var $1;
  560. variables=_st(_st(_st(_st(window)._jQuery_(_st(_st(anEditor)._display())._wrapper()))._find_("span.cm-variable"))._get())._collect_((function(each){
  561. return smalltalk.withContext(function($ctx2) {
  562. return _st(_st(window)._jQuery_(each))._html();
  563. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  564. classNames=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  565. return smalltalk.withContext(function($ctx2) {
  566. return _st(each)._name();
  567. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  568. pseudoVariables=_st(_st($Smalltalk())._current())._pseudoVariableNames();
  569. $1=_st(_st(_st(_st(_st(_st(variables).__comma(classNames)).__comma(pseudoVariables))._asSet())._asArray())._select_((function(each){
  570. return smalltalk.withContext(function($ctx2) {
  571. return _st(each)._includesSubString_(_st(aToken)._string());
  572. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  573. return smalltalk.withContext(function($ctx2) {
  574. return _st(each).__eq(_st(aToken)._string());
  575. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  576. return $1;
  577. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},smalltalk.HLCodeWidget)})},
  578. messageSends: ["collect:", "html", "jQuery:", "get", "find:", "wrapper", "display", "name", "classes", "current", "pseudoVariableNames", "reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", ","]}),
  579. smalltalk.HLCodeWidget);
  580. smalltalk.addMethod(
  581. smalltalk.method({
  582. selector: "canBeOpenAsTab",
  583. fn: function (){
  584. var self=this;
  585. return smalltalk.withContext(function($ctx1) {
  586. return true;
  587. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLCodeWidget.klass)})},
  588. messageSends: []}),
  589. smalltalk.HLCodeWidget.klass);
  590. smalltalk.addMethod(
  591. smalltalk.method({
  592. selector: "hintFor:options:",
  593. fn: function (anEditor,options){
  594. var self=this;
  595. var cursor,token,completions;
  596. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  597. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  598. return smalltalk.withContext(function($ctx1) {
  599. var $1,$2;
  600. cursor=_st(anEditor)._getCursor();
  601. token=_st(anEditor)._getTokenAt_(cursor);
  602. _st(token)._at_put_("state",_st(_st(_st($CodeMirror())._basicAt_("innerMode"))._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state")))._state());
  603. $1=_st(_st(token)._type()).__eq("variable");
  604. if(smalltalk.assert($1)){
  605. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  606. } else {
  607. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  608. };
  609. $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()))]);
  610. return $2;
  611. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},smalltalk.HLCodeWidget.klass)})},
  612. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "getMode", "at:", "basicAt:", "ifTrue:ifFalse:", "variableHintFor:token:", "messageHintFor:token:", "=", "type", "->", "line", "end", "start"]}),
  613. smalltalk.HLCodeWidget.klass);
  614. smalltalk.addMethod(
  615. smalltalk.method({
  616. selector: "initialize",
  617. fn: function (){
  618. var self=this;
  619. return smalltalk.withContext(function($ctx1) {
  620. var $1,$2;
  621. smalltalk.HLWidget.klass.fn.prototype._initialize.apply(_st(self), []);
  622. $1=self;
  623. _st($1)._setupCodeMirror();
  624. _st($1)._setupCommands();
  625. $2=_st($1)._setupKeyMaps();
  626. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLCodeWidget.klass)})},
  627. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"]}),
  628. smalltalk.HLCodeWidget.klass);
  629. smalltalk.addMethod(
  630. smalltalk.method({
  631. selector: "keyMap",
  632. fn: function (){
  633. var self=this;
  634. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  635. return smalltalk.withContext(function($ctx1) {
  636. var $2,$1;
  637. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  638. if(smalltalk.assert($2)){
  639. $1=_st(self)._macKeyMap();
  640. } else {
  641. $1=_st(self)._pcKeyMap();
  642. };
  643. return $1;
  644. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},smalltalk.HLCodeWidget.klass)})},
  645. messageSends: ["ifTrue:ifFalse:", "macKeyMap", "pcKeyMap", "systemIsMac", "keyBinder", "current"]}),
  646. smalltalk.HLCodeWidget.klass);
  647. smalltalk.addMethod(
  648. smalltalk.method({
  649. selector: "macKeyMap",
  650. fn: function (){
  651. var self=this;
  652. return smalltalk.withContext(function($ctx1) {
  653. var $1;
  654. $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"])]);
  655. return $1;
  656. }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  657. messageSends: ["->"]}),
  658. smalltalk.HLCodeWidget.klass);
  659. smalltalk.addMethod(
  660. smalltalk.method({
  661. selector: "messageHintFor:token:",
  662. fn: function (anEditor,aToken){
  663. var self=this;
  664. return smalltalk.withContext(function($ctx1) {
  665. var $1;
  666. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  667. return $1;
  668. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  669. messageSends: ["messageHintFor:token:", "at:"]}),
  670. smalltalk.HLCodeWidget.klass);
  671. smalltalk.addMethod(
  672. smalltalk.method({
  673. selector: "pcKeyMap",
  674. fn: function (){
  675. var self=this;
  676. return smalltalk.withContext(function($ctx1) {
  677. var $1;
  678. $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"])];
  679. return $1;
  680. }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  681. messageSends: ["->"]}),
  682. smalltalk.HLCodeWidget.klass);
  683. smalltalk.addMethod(
  684. smalltalk.method({
  685. selector: "setupCodeMirror",
  686. fn: function (){
  687. var self=this;
  688. return smalltalk.withContext(function($ctx1) {
  689. CodeMirror.keyMap.default.fallthrough = ["basic"];
  690. CodeMirror.commands.autocomplete = function(cm) {
  691. CodeMirror.showHint(cm, self._hintFor_options_);
  692. }
  693. ;
  694. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.HLCodeWidget.klass)})},
  695. messageSends: []}),
  696. smalltalk.HLCodeWidget.klass);
  697. smalltalk.addMethod(
  698. smalltalk.method({
  699. selector: "setupCommands",
  700. fn: function (){
  701. var self=this;
  702. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  703. return smalltalk.withContext(function($ctx1) {
  704. var $1,$2;
  705. $1=_st($CodeMirror())._basicAt_("commands");
  706. _st($1)._at_put_("doIt",(function(cm){
  707. return smalltalk.withContext(function($ctx2) {
  708. return _st(_st(cm)._amberCodeWidget())._doIt();
  709. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  710. _st($1)._at_put_("inspectIt",(function(cm){
  711. return smalltalk.withContext(function($ctx2) {
  712. return _st(_st(cm)._amberCodeWidget())._inspectIt();
  713. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  714. _st($1)._at_put_("printIt",(function(cm){
  715. return smalltalk.withContext(function($ctx2) {
  716. return _st(_st(cm)._amberCodeWidget())._printIt();
  717. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  718. $2=_st($1)._at_put_("saveIt",(function(cm){
  719. return smalltalk.withContext(function($ctx2) {
  720. return _st(_st(cm)._amberCodeWidget())._saveIt();
  721. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  722. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},smalltalk.HLCodeWidget.klass)})},
  723. messageSends: ["at:put:", "doIt", "amberCodeWidget", "basicAt:", "inspectIt", "printIt", "saveIt"]}),
  724. smalltalk.HLCodeWidget.klass);
  725. smalltalk.addMethod(
  726. smalltalk.method({
  727. selector: "setupKeyMaps",
  728. fn: function (){
  729. var self=this;
  730. return smalltalk.withContext(function($ctx1) {
  731. CodeMirror.keyMap['Amber'] = self._keyMap();
  732. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},smalltalk.HLCodeWidget.klass)})},
  733. messageSends: []}),
  734. smalltalk.HLCodeWidget.klass);
  735. smalltalk.addMethod(
  736. smalltalk.method({
  737. selector: "tabLabel",
  738. fn: function (){
  739. var self=this;
  740. return smalltalk.withContext(function($ctx1) {
  741. return "Workspace";
  742. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLCodeWidget.klass)})},
  743. messageSends: []}),
  744. smalltalk.HLCodeWidget.klass);
  745. smalltalk.addMethod(
  746. smalltalk.method({
  747. selector: "tabPriority",
  748. fn: function (){
  749. var self=this;
  750. return smalltalk.withContext(function($ctx1) {
  751. var $1;
  752. $1=(10);
  753. return $1;
  754. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLCodeWidget.klass)})},
  755. messageSends: []}),
  756. smalltalk.HLCodeWidget.klass);
  757. smalltalk.addMethod(
  758. smalltalk.method({
  759. selector: "variableHintFor:token:",
  760. fn: function (anEditor,aToken){
  761. var self=this;
  762. return smalltalk.withContext(function($ctx1) {
  763. var $1;
  764. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  765. return $1;
  766. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  767. messageSends: ["variableHintFor:token:", "at:"]}),
  768. smalltalk.HLCodeWidget.klass);
  769. smalltalk.addClass('HLSourceCodeWidget', smalltalk.HLCodeWidget, ['browserModel'], 'Helios-Workspace');
  770. smalltalk.addMethod(
  771. smalltalk.method({
  772. selector: "browserModel",
  773. fn: function (){
  774. var self=this;
  775. return smalltalk.withContext(function($ctx1) {
  776. var $1;
  777. $1=self["@browserModel"];
  778. return $1;
  779. }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLSourceCodeWidget)})},
  780. messageSends: []}),
  781. smalltalk.HLSourceCodeWidget);
  782. smalltalk.addMethod(
  783. smalltalk.method({
  784. selector: "browserModel:",
  785. fn: function (aBrowserModel){
  786. var self=this;
  787. return smalltalk.withContext(function($ctx1) {
  788. self["@browserModel"]=aBrowserModel;
  789. _st(self)._observeBrowserModel();
  790. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget)})},
  791. messageSends: ["observeBrowserModel"]}),
  792. smalltalk.HLSourceCodeWidget);
  793. smalltalk.addMethod(
  794. smalltalk.method({
  795. selector: "observeBrowserModel",
  796. fn: function (){
  797. var self=this;
  798. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  799. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  800. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  801. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  802. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  803. return smalltalk.withContext(function($ctx1) {
  804. var $1,$2;
  805. $1=_st(_st(self)._browserModel())._announcer();
  806. _st($1)._on_do_($HLSaveSourceCode(),(function(ann){
  807. return smalltalk.withContext(function($ctx2) {
  808. return _st(self)._onSaveIt();
  809. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  810. _st($1)._on_do_($HLParseErrorRaised(),(function(ann){
  811. return smalltalk.withContext(function($ctx2) {
  812. return _st(self)._onParseError_(ann);
  813. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  814. _st($1)._on_do_($HLCompileErrorRaised(),(function(ann){
  815. return smalltalk.withContext(function($ctx2) {
  816. return _st(self)._onCompileError_(_st(ann)._error());
  817. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  818. _st($1)._on_do_($HLUnknownVariableErrorRaised(),(function(ann){
  819. return smalltalk.withContext(function($ctx2) {
  820. return _st(self)._onUnknownVariableError_(_st(ann)._error());
  821. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  822. $2=_st($1)._on_do_($HLInstVarAdded(),(function(ann){
  823. return smalltalk.withContext(function($ctx2) {
  824. return _st(self)._onInstVarAdded();
  825. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  826. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLSourceCodeWidget)})},
  827. messageSends: ["on:do:", "onSaveIt", "announcer", "browserModel", "onParseError:", "onCompileError:", "error", "onUnknownVariableError:", "onInstVarAdded"]}),
  828. smalltalk.HLSourceCodeWidget);
  829. smalltalk.addMethod(
  830. smalltalk.method({
  831. selector: "onCompileError:",
  832. fn: function (anError){
  833. var self=this;
  834. return smalltalk.withContext(function($ctx1) {
  835. _st(self)._alert_(_st(anError)._messageText());
  836. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anError:anError},smalltalk.HLSourceCodeWidget)})},
  837. messageSends: ["alert:", "messageText"]}),
  838. smalltalk.HLSourceCodeWidget);
  839. smalltalk.addMethod(
  840. smalltalk.method({
  841. selector: "onInstVarAdded",
  842. fn: function (){
  843. var self=this;
  844. return smalltalk.withContext(function($ctx1) {
  845. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  846. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLSourceCodeWidget)})},
  847. messageSends: ["save:", "contents", "browserModel"]}),
  848. smalltalk.HLSourceCodeWidget);
  849. smalltalk.addMethod(
  850. smalltalk.method({
  851. selector: "onParseError:",
  852. fn: function (anAnnouncement){
  853. var self=this;
  854. var lineIndex,newContents;
  855. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  856. return smalltalk.withContext(function($ctx1) {
  857. var $1,$2,$3;
  858. lineIndex=(1);
  859. _st(self)._contents_(_st($String())._streamContents_((function(stream){
  860. return smalltalk.withContext(function($ctx2) {
  861. return _st(_st(self)._contents())._linesDo_((function(each){
  862. return smalltalk.withContext(function($ctx3) {
  863. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  864. if(smalltalk.assert($1)){
  865. $2=stream;
  866. _st($2)._nextPutAll_(_st(each)._copyFrom_to_((1),_st(anAnnouncement)._column()));
  867. _st($2)._nextPutAll_("<- ");
  868. _st($2)._nextPutAll_(_st(anAnnouncement)._message());
  869. _st($2)._nextPutAll_(" ");
  870. $3=_st($2)._nextPutAll_(_st(each)._copyFrom_to_(_st(_st(anAnnouncement)._column()).__plus((1)),_st(each)._size()));
  871. $3;
  872. } else {
  873. _st(stream)._nextPutAll_(each);
  874. };
  875. _st(stream)._nextPutAll_(_st($String())._cr());
  876. lineIndex=_st(lineIndex).__plus((1));
  877. return lineIndex;
  878. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  879. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  880. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
  881. messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"]}),
  882. smalltalk.HLSourceCodeWidget);
  883. smalltalk.addMethod(
  884. smalltalk.method({
  885. selector: "onSaveIt",
  886. fn: function (){
  887. var self=this;
  888. return smalltalk.withContext(function($ctx1) {
  889. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  890. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
  891. messageSends: ["save:", "contents", "browserModel"]}),
  892. smalltalk.HLSourceCodeWidget);
  893. smalltalk.addMethod(
  894. smalltalk.method({
  895. selector: "onUnknownVariableError:",
  896. fn: function (anError){
  897. var self=this;
  898. var confirm;
  899. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  900. return smalltalk.withContext(function($ctx1) {
  901. var $1,$2,$3,$4;
  902. confirm=_st(self)._confirm_(_st($String())._streamContents_((function(stream){
  903. return smalltalk.withContext(function($ctx2) {
  904. $1=stream;
  905. _st($1)._nextPutAll_(_st(anError)._messageText());
  906. _st($1)._nextPutAll_(_st($String())._cr());
  907. $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
  908. return $2;
  909. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  910. $3=confirm;
  911. if(! smalltalk.assert($3)){
  912. $4=self;
  913. return $4;
  914. };
  915. _st(_st(self)._browserModel())._addInstVarNamed_(_st(anError)._variableName());
  916. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anError:anError,confirm:confirm},smalltalk.HLSourceCodeWidget)})},
  917. messageSends: ["confirm:", "streamContents:", "nextPutAll:", "messageText", "cr", "ifFalse:", "addInstVarNamed:", "variableName", "browserModel"]}),
  918. smalltalk.HLSourceCodeWidget);
  919. smalltalk.addMethod(
  920. smalltalk.method({
  921. selector: "saveIt",
  922. fn: function (){
  923. var self=this;
  924. return smalltalk.withContext(function($ctx1) {
  925. _st(_st(self)._browserModel())._saveSourceCode();
  926. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
  927. messageSends: ["saveSourceCode", "browserModel"]}),
  928. smalltalk.HLSourceCodeWidget);
  929. smalltalk.addMethod(
  930. smalltalk.method({
  931. selector: "canBeOpenAsTab",
  932. fn: function (){
  933. var self=this;
  934. return smalltalk.withContext(function($ctx1) {
  935. return false;
  936. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
  937. messageSends: []}),
  938. smalltalk.HLSourceCodeWidget.klass);
  939. smalltalk.addMethod(
  940. smalltalk.method({
  941. selector: "on:",
  942. fn: function (aBrowserModel){
  943. var self=this;
  944. return smalltalk.withContext(function($ctx1) {
  945. var $2,$3,$1;
  946. $2=_st(self)._new();
  947. _st($2)._browserModel_(aBrowserModel);
  948. $3=_st($2)._yourself();
  949. $1=$3;
  950. return $1;
  951. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
  952. messageSends: ["browserModel:", "new", "yourself"]}),
  953. smalltalk.HLSourceCodeWidget.klass);