1
0

Helios-Workspace.deploy.js 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579
  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 (aString){
  39. var self=this;
  40. return smalltalk.withContext(function($ctx1) {
  41. var $1;
  42. $1=_st(_st(self)._environment())._eval_on_(aString,_st(self)._receiver());
  43. return $1;
  44. }, function($ctx1) {$ctx1.fill(self,"doIt:",{aString:aString},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: "inspect:",
  78. fn: function (anObject){
  79. var self=this;
  80. return smalltalk.withContext(function($ctx1) {
  81. _st(_st(self)._environment())._inspect_(anObject);
  82. return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.HLCodeModel)})},
  83. messageSends: ["inspect:", "environment"]}),
  84. smalltalk.HLCodeModel);
  85. smalltalk.addMethod(
  86. smalltalk.method({
  87. selector: "receiver",
  88. fn: function (){
  89. var self=this;
  90. return smalltalk.withContext(function($ctx1) {
  91. var $2,$1;
  92. $2=self["@receiver"];
  93. if(($receiver = $2) == nil || $receiver == undefined){
  94. self["@receiver"]=_st(self)._defaultReceiver();
  95. $1=self["@receiver"];
  96. } else {
  97. $1=$2;
  98. };
  99. return $1;
  100. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeModel)})},
  101. messageSends: ["ifNil:", "defaultReceiver"]}),
  102. smalltalk.HLCodeModel);
  103. smalltalk.addMethod(
  104. smalltalk.method({
  105. selector: "receiver:",
  106. fn: function (anObject){
  107. var self=this;
  108. return smalltalk.withContext(function($ctx1) {
  109. self["@receiver"]=anObject;
  110. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeModel)})},
  111. messageSends: []}),
  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', 'state'], '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. _st(_st(self)._editor())._on_do_("change",(function(){
  169. return smalltalk.withContext(function($ctx2) {
  170. return _st(self)._onChange();
  171. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  172. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLCodeWidget)})},
  173. messageSends: ["at:put:", "editor", "on:do:", "onChange"]}),
  174. smalltalk.HLCodeWidget);
  175. smalltalk.addMethod(
  176. smalltalk.method({
  177. selector: "contents",
  178. fn: function (){
  179. var self=this;
  180. return smalltalk.withContext(function($ctx1) {
  181. var $1;
  182. $1=_st(self["@editor"])._getValue();
  183. return $1;
  184. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.HLCodeWidget)})},
  185. messageSends: ["getValue"]}),
  186. smalltalk.HLCodeWidget);
  187. smalltalk.addMethod(
  188. smalltalk.method({
  189. selector: "contents:",
  190. fn: function (aString){
  191. var self=this;
  192. return smalltalk.withContext(function($ctx1) {
  193. var $1;
  194. _st(self["@editor"])._setValue_(aString);
  195. $1=self["@state"];
  196. if(($receiver = $1) == nil || $receiver == undefined){
  197. $1;
  198. } else {
  199. _st(self)._updateState();
  200. };
  201. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLCodeWidget)})},
  202. messageSends: ["setValue:", "ifNotNil:", "updateState"]}),
  203. smalltalk.HLCodeWidget);
  204. smalltalk.addMethod(
  205. smalltalk.method({
  206. selector: "currentLine",
  207. fn: function (){
  208. var self=this;
  209. return smalltalk.withContext(function($ctx1) {
  210. var $1;
  211. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  212. return $1;
  213. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},smalltalk.HLCodeWidget)})},
  214. messageSends: ["getLine:", "line", "getCursor"]}),
  215. smalltalk.HLCodeWidget);
  216. smalltalk.addMethod(
  217. smalltalk.method({
  218. selector: "currentLineOrSelection",
  219. fn: function (){
  220. var self=this;
  221. return smalltalk.withContext(function($ctx1) {
  222. var $2,$1;
  223. $2=_st(self["@editor"])._somethingSelected();
  224. if(smalltalk.assert($2)){
  225. $1=_st(self)._selection();
  226. } else {
  227. $1=_st(self)._currentLine();
  228. };
  229. return $1;
  230. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},smalltalk.HLCodeWidget)})},
  231. messageSends: ["ifFalse:ifTrue:", "currentLine", "selection", "somethingSelected"]}),
  232. smalltalk.HLCodeWidget);
  233. smalltalk.addMethod(
  234. smalltalk.method({
  235. selector: "doIt",
  236. fn: function (){
  237. var self=this;
  238. var result;
  239. function $HLDoItRequested(){return smalltalk.HLDoItRequested||(typeof HLDoItRequested=="undefined"?nil:HLDoItRequested)}
  240. function $HLDoItExecuted(){return smalltalk.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
  241. return smalltalk.withContext(function($ctx1) {
  242. var $1;
  243. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLDoItRequested())._on_(self["@model"]));
  244. result=_st(self["@model"])._doIt_(_st(self)._currentLineOrSelection());
  245. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
  246. $1=result;
  247. return $1;
  248. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},smalltalk.HLCodeWidget)})},
  249. messageSends: ["announce:", "on:", "announcer", "model", "doIt:", "currentLineOrSelection"]}),
  250. smalltalk.HLCodeWidget);
  251. smalltalk.addMethod(
  252. smalltalk.method({
  253. selector: "editor",
  254. fn: function (){
  255. var self=this;
  256. return smalltalk.withContext(function($ctx1) {
  257. var $1;
  258. $1=self["@editor"];
  259. return $1;
  260. }, function($ctx1) {$ctx1.fill(self,"editor",{},smalltalk.HLCodeWidget)})},
  261. messageSends: []}),
  262. smalltalk.HLCodeWidget);
  263. smalltalk.addMethod(
  264. smalltalk.method({
  265. selector: "editorOptions",
  266. fn: function (){
  267. var self=this;
  268. return smalltalk.withContext(function($ctx1) {
  269. var $1;
  270. $1=smalltalk.HashedCollection._fromPairs_([_st("theme").__minus_gt("amber"),_st("lineNumbers").__minus_gt(true),_st("enterMode").__minus_gt("flat"),_st("indentWithTabs").__minus_gt(true),_st("indentUnit").__minus_gt((4)),_st("matchBrackets").__minus_gt(true),_st("electricChars").__minus_gt(false),_st("keyMap").__minus_gt("Amber"),_st("extraKeys").__minus_gt(smalltalk.HashedCollection._fromPairs_([_st("Shift-Space").__minus_gt("autocomplete")]))]);
  271. return $1;
  272. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},smalltalk.HLCodeWidget)})},
  273. messageSends: ["->"]}),
  274. smalltalk.HLCodeWidget);
  275. smalltalk.addMethod(
  276. smalltalk.method({
  277. selector: "focus",
  278. fn: function (){
  279. var self=this;
  280. return smalltalk.withContext(function($ctx1) {
  281. _st(self["@editor"])._focus();
  282. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLCodeWidget)})},
  283. messageSends: ["focus"]}),
  284. smalltalk.HLCodeWidget);
  285. smalltalk.addMethod(
  286. smalltalk.method({
  287. selector: "hasFocus",
  288. fn: function (){
  289. var self=this;
  290. return smalltalk.withContext(function($ctx1) {
  291. var $1;
  292. $1=_st(_st(self["@code"])._asJQuery())._is_(":active");
  293. return $1;
  294. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLCodeWidget)})},
  295. messageSends: ["is:", "asJQuery"]}),
  296. smalltalk.HLCodeWidget);
  297. smalltalk.addMethod(
  298. smalltalk.method({
  299. selector: "hasModification",
  300. fn: function (){
  301. var self=this;
  302. return smalltalk.withContext(function($ctx1) {
  303. return false;
  304. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLCodeWidget)})},
  305. messageSends: []}),
  306. smalltalk.HLCodeWidget);
  307. smalltalk.addMethod(
  308. smalltalk.method({
  309. selector: "inspectIt",
  310. fn: function (){
  311. var self=this;
  312. var newInspector;
  313. function $HLInspectItRequested(){return smalltalk.HLInspectItRequested||(typeof HLInspectItRequested=="undefined"?nil:HLInspectItRequested)}
  314. return smalltalk.withContext(function($ctx1) {
  315. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLInspectItRequested())._on_(self["@model"]));
  316. _st(_st(self)._model())._inspect_(_st(self)._doIt());
  317. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},smalltalk.HLCodeWidget)})},
  318. messageSends: ["announce:", "on:", "announcer", "model", "inspect:", "doIt"]}),
  319. smalltalk.HLCodeWidget);
  320. smalltalk.addMethod(
  321. smalltalk.method({
  322. selector: "messageHintFor:token:",
  323. fn: function (anEditor,aToken){
  324. var self=this;
  325. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  326. return smalltalk.withContext(function($ctx1) {
  327. var $1;
  328. $1=_st(_st(_st(_st(_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value())._asSet())._asArray())._select_((function(each){
  329. return smalltalk.withContext(function($ctx2) {
  330. return _st(each)._includesSubString_(_st(aToken)._string());
  331. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  332. return smalltalk.withContext(function($ctx2) {
  333. return _st(each).__eq(_st(aToken)._string());
  334. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  335. return $1;
  336. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget)})},
  337. messageSends: ["reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", "value", "at:", "current"]}),
  338. smalltalk.HLCodeWidget);
  339. smalltalk.addMethod(
  340. smalltalk.method({
  341. selector: "model",
  342. fn: function (){
  343. var self=this;
  344. function $HLCodeModel(){return smalltalk.HLCodeModel||(typeof HLCodeModel=="undefined"?nil:HLCodeModel)}
  345. return smalltalk.withContext(function($ctx1) {
  346. var $2,$1;
  347. $2=self["@model"];
  348. if(($receiver = $2) == nil || $receiver == undefined){
  349. self["@model"]=_st($HLCodeModel())._new();
  350. $1=self["@model"];
  351. } else {
  352. $1=$2;
  353. };
  354. return $1;
  355. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLCodeWidget)})},
  356. messageSends: ["ifNil:", "new"]}),
  357. smalltalk.HLCodeWidget);
  358. smalltalk.addMethod(
  359. smalltalk.method({
  360. selector: "model:",
  361. fn: function (aModel){
  362. var self=this;
  363. return smalltalk.withContext(function($ctx1) {
  364. self["@model"]=aModel;
  365. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLCodeWidget)})},
  366. messageSends: []}),
  367. smalltalk.HLCodeWidget);
  368. smalltalk.addMethod(
  369. smalltalk.method({
  370. selector: "onChange",
  371. fn: function (){
  372. var self=this;
  373. return smalltalk.withContext(function($ctx1) {
  374. _st(self)._updateState();
  375. return self}, function($ctx1) {$ctx1.fill(self,"onChange",{},smalltalk.HLCodeWidget)})},
  376. messageSends: ["updateState"]}),
  377. smalltalk.HLCodeWidget);
  378. smalltalk.addMethod(
  379. smalltalk.method({
  380. selector: "onDoIt",
  381. fn: function (){
  382. var self=this;
  383. return smalltalk.withContext(function($ctx1) {
  384. _st(self)._doIt();
  385. return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{},smalltalk.HLCodeWidget)})},
  386. messageSends: ["doIt"]}),
  387. smalltalk.HLCodeWidget);
  388. smalltalk.addMethod(
  389. smalltalk.method({
  390. selector: "onInspectIt",
  391. fn: function (){
  392. var self=this;
  393. return smalltalk.withContext(function($ctx1) {
  394. _st(self)._inspectIt();
  395. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},smalltalk.HLCodeWidget)})},
  396. messageSends: ["inspectIt"]}),
  397. smalltalk.HLCodeWidget);
  398. smalltalk.addMethod(
  399. smalltalk.method({
  400. selector: "onPrintIt",
  401. fn: function (){
  402. var self=this;
  403. return smalltalk.withContext(function($ctx1) {
  404. _st(self)._printIt();
  405. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},smalltalk.HLCodeWidget)})},
  406. messageSends: ["printIt"]}),
  407. smalltalk.HLCodeWidget);
  408. smalltalk.addMethod(
  409. smalltalk.method({
  410. selector: "onSaveIt",
  411. fn: function (){
  412. var self=this;
  413. return smalltalk.withContext(function($ctx1) {
  414. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLCodeWidget)})},
  415. messageSends: []}),
  416. smalltalk.HLCodeWidget);
  417. smalltalk.addMethod(
  418. smalltalk.method({
  419. selector: "print:",
  420. fn: function (aString){
  421. var self=this;
  422. var start,stop,currentLine;
  423. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  424. return smalltalk.withContext(function($ctx1) {
  425. currentLine=_st(_st(self["@editor"])._getCursor_(false))._line();
  426. start=_st($HashedCollection())._new();
  427. _st(start)._at_put_("line",currentLine);
  428. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getCursor_(false))._ch());
  429. _st(_st(self["@editor"])._getSelection())._ifEmpty_((function(){
  430. return smalltalk.withContext(function($ctx2) {
  431. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getLine_(currentLine))._size());
  432. return _st(self["@editor"])._setSelection_end_(smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(currentLine),_st("ch").__minus_gt((0))]),start);
  433. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  434. stop=_st($HashedCollection())._new();
  435. _st(stop)._at_put_("line",currentLine);
  436. _st(stop)._at_put_("ch",_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2)));
  437. _st(self["@editor"])._replaceSelection_(_st(_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString)).__comma(" "));
  438. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  439. _st(self["@editor"])._setSelection_end_(stop,start);
  440. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},smalltalk.HLCodeWidget)})},
  441. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "size", "getLine:", "setSelection:end:", "->", "getSelection", "+", "at:", "replaceSelection:", ",", "setCursor:"]}),
  442. smalltalk.HLCodeWidget);
  443. smalltalk.addMethod(
  444. smalltalk.method({
  445. selector: "printIt",
  446. fn: function (){
  447. var self=this;
  448. var result;
  449. function $HLPrintItRequested(){return smalltalk.HLPrintItRequested||(typeof HLPrintItRequested=="undefined"?nil:HLPrintItRequested)}
  450. return smalltalk.withContext(function($ctx1) {
  451. result=_st(self)._doIt();
  452. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLPrintItRequested())._on_(self["@model"]));
  453. _st(self)._print_(_st(result)._printString());
  454. _st(self)._focus();
  455. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{result:result},smalltalk.HLCodeWidget)})},
  456. messageSends: ["doIt", "announce:", "on:", "announcer", "model", "print:", "printString", "focus"]}),
  457. smalltalk.HLCodeWidget);
  458. smalltalk.addMethod(
  459. smalltalk.method({
  460. selector: "receiver",
  461. fn: function (){
  462. var self=this;
  463. return smalltalk.withContext(function($ctx1) {
  464. var $1;
  465. $1=_st(_st(self)._model())._receiver();
  466. return $1;
  467. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeWidget)})},
  468. messageSends: ["receiver", "model"]}),
  469. smalltalk.HLCodeWidget);
  470. smalltalk.addMethod(
  471. smalltalk.method({
  472. selector: "receiver:",
  473. fn: function (anObject){
  474. var self=this;
  475. return smalltalk.withContext(function($ctx1) {
  476. _st(_st(self)._model())._receiver_(anObject);
  477. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  478. messageSends: ["receiver:", "model"]}),
  479. smalltalk.HLCodeWidget);
  480. smalltalk.addMethod(
  481. smalltalk.method({
  482. selector: "renderButtonsOn:",
  483. fn: function (html){
  484. var self=this;
  485. return smalltalk.withContext(function($ctx1) {
  486. var $1,$2,$3,$4,$5,$6;
  487. $1=_st(html)._button();
  488. _st($1)._class_("button");
  489. _st($1)._with_("DoIt");
  490. $2=_st($1)._onClick_((function(){
  491. return smalltalk.withContext(function($ctx2) {
  492. return _st(self)._doIt();
  493. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  494. $3=_st(html)._button();
  495. _st($3)._class_("button");
  496. _st($3)._with_("PrintIt");
  497. $4=_st($3)._onClick_((function(){
  498. return smalltalk.withContext(function($ctx2) {
  499. return _st(self)._printIt();
  500. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  501. $5=_st(html)._button();
  502. _st($5)._class_("button");
  503. _st($5)._with_("InspectIt");
  504. $6=_st($5)._onClick_((function(){
  505. return smalltalk.withContext(function($ctx2) {
  506. return _st(self)._inspectIt();
  507. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  508. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLCodeWidget)})},
  509. messageSends: ["class:", "button", "with:", "onClick:", "doIt", "printIt", "inspectIt"]}),
  510. smalltalk.HLCodeWidget);
  511. smalltalk.addMethod(
  512. smalltalk.method({
  513. selector: "renderContentOn:",
  514. fn: function (html){
  515. var self=this;
  516. return smalltalk.withContext(function($ctx1) {
  517. var $1,$2,$3,$4,$5,$6;
  518. $1=_st(html)._div();
  519. _st($1)._class_("editor");
  520. $2=_st($1)._with_((function(){
  521. return smalltalk.withContext(function($ctx2) {
  522. self["@code"]=_st(html)._textarea();
  523. return self["@code"];
  524. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  525. self["@state"]=_st(_st(html)._div())._class_("state");
  526. $3=_st(html)._div();
  527. _st($3)._class_("buttons_bar");
  528. $4=_st($3)._with_((function(){
  529. return smalltalk.withContext(function($ctx2) {
  530. return _st(self)._renderButtonsOn_(html);
  531. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  532. $5=self;
  533. _st($5)._setEditorOn_(_st(self["@code"])._element());
  534. _st($5)._configureEditor();
  535. $6=_st($5)._updateState();
  536. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLCodeWidget)})},
  537. messageSends: ["class:", "div", "with:", "textarea", "renderButtonsOn:", "setEditorOn:", "element", "configureEditor", "updateState"]}),
  538. smalltalk.HLCodeWidget);
  539. smalltalk.addMethod(
  540. smalltalk.method({
  541. selector: "saveIt",
  542. fn: function (){
  543. var self=this;
  544. return smalltalk.withContext(function($ctx1) {
  545. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLCodeWidget)})},
  546. messageSends: []}),
  547. smalltalk.HLCodeWidget);
  548. smalltalk.addMethod(
  549. smalltalk.method({
  550. selector: "selection",
  551. fn: function (){
  552. var self=this;
  553. return smalltalk.withContext(function($ctx1) {
  554. var $1;
  555. $1=_st(self["@editor"])._getSelection();
  556. return $1;
  557. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.HLCodeWidget)})},
  558. messageSends: ["getSelection"]}),
  559. smalltalk.HLCodeWidget);
  560. smalltalk.addMethod(
  561. smalltalk.method({
  562. selector: "selectionEnd",
  563. fn: function (){
  564. var self=this;
  565. return smalltalk.withContext(function($ctx1) {
  566. var $1;
  567. $1=_st(_st(self["@code"])._element())._selectionEnd();
  568. return $1;
  569. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},smalltalk.HLCodeWidget)})},
  570. messageSends: ["selectionEnd", "element"]}),
  571. smalltalk.HLCodeWidget);
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "selectionEnd:",
  575. fn: function (anInteger){
  576. var self=this;
  577. return smalltalk.withContext(function($ctx1) {
  578. _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  579. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  580. messageSends: ["selectionEnd:", "element"]}),
  581. smalltalk.HLCodeWidget);
  582. smalltalk.addMethod(
  583. smalltalk.method({
  584. selector: "selectionStart",
  585. fn: function (){
  586. var self=this;
  587. return smalltalk.withContext(function($ctx1) {
  588. var $1;
  589. $1=_st(_st(self["@code"])._element())._selectionStart();
  590. return $1;
  591. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},smalltalk.HLCodeWidget)})},
  592. messageSends: ["selectionStart", "element"]}),
  593. smalltalk.HLCodeWidget);
  594. smalltalk.addMethod(
  595. smalltalk.method({
  596. selector: "selectionStart:",
  597. fn: function (anInteger){
  598. var self=this;
  599. return smalltalk.withContext(function($ctx1) {
  600. _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  601. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  602. messageSends: ["selectionStart:", "element"]}),
  603. smalltalk.HLCodeWidget);
  604. smalltalk.addMethod(
  605. smalltalk.method({
  606. selector: "setEditorOn:",
  607. fn: function (aTextarea){
  608. var self=this;
  609. return smalltalk.withContext(function($ctx1) {
  610. self['@editor'] = CodeMirror.fromTextArea(aTextarea, self._editorOptions());
  611. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},smalltalk.HLCodeWidget)})},
  612. messageSends: []}),
  613. smalltalk.HLCodeWidget);
  614. smalltalk.addMethod(
  615. smalltalk.method({
  616. selector: "updateState",
  617. fn: function (){
  618. var self=this;
  619. return smalltalk.withContext(function($ctx1) {
  620. var $1;
  621. $1=_st(self)._hasModification();
  622. if(smalltalk.assert($1)){
  623. _st(_st(self["@state"])._asJQuery())._addClass_("modified");
  624. } else {
  625. _st(_st(self["@state"])._asJQuery())._removeClass_("modified");
  626. };
  627. return self}, function($ctx1) {$ctx1.fill(self,"updateState",{},smalltalk.HLCodeWidget)})},
  628. messageSends: ["ifTrue:ifFalse:", "addClass:", "asJQuery", "removeClass:", "hasModification"]}),
  629. smalltalk.HLCodeWidget);
  630. smalltalk.addMethod(
  631. smalltalk.method({
  632. selector: "variableHintFor:token:",
  633. fn: function (anEditor,aToken){
  634. var self=this;
  635. var variables,classNames,pseudoVariables;
  636. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  637. return smalltalk.withContext(function($ctx1) {
  638. var $1;
  639. variables=_st(_st(_st(_st(window)._jQuery_(_st(_st(anEditor)._display())._wrapper()))._find_("span.cm-variable"))._get())._collect_((function(each){
  640. return smalltalk.withContext(function($ctx2) {
  641. return _st(_st(window)._jQuery_(each))._html();
  642. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  643. classNames=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  644. return smalltalk.withContext(function($ctx2) {
  645. return _st(each)._name();
  646. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  647. pseudoVariables=_st(_st($Smalltalk())._current())._pseudoVariableNames();
  648. $1=_st(_st(_st(_st(_st(_st(variables).__comma(classNames)).__comma(pseudoVariables))._asSet())._asArray())._select_((function(each){
  649. return smalltalk.withContext(function($ctx2) {
  650. return _st(each)._includesSubString_(_st(aToken)._string());
  651. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  652. return smalltalk.withContext(function($ctx2) {
  653. return _st(each).__eq(_st(aToken)._string());
  654. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  655. return $1;
  656. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},smalltalk.HLCodeWidget)})},
  657. messageSends: ["collect:", "html", "jQuery:", "get", "find:", "wrapper", "display", "name", "classes", "current", "pseudoVariableNames", "reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", ","]}),
  658. smalltalk.HLCodeWidget);
  659. smalltalk.addMethod(
  660. smalltalk.method({
  661. selector: "hintFor:options:",
  662. fn: function (anEditor,options){
  663. var self=this;
  664. var cursor,token,completions;
  665. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  666. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  667. return smalltalk.withContext(function($ctx1) {
  668. var $1,$2;
  669. cursor=_st(anEditor)._getCursor();
  670. token=_st(anEditor)._getTokenAt_(cursor);
  671. _st(token)._at_put_("state",_st(_st(_st($CodeMirror())._basicAt_("innerMode"))._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state")))._state());
  672. $1=_st(_st(token)._type()).__eq("variable");
  673. if(smalltalk.assert($1)){
  674. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  675. } else {
  676. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  677. };
  678. $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()))]);
  679. return $2;
  680. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},smalltalk.HLCodeWidget.klass)})},
  681. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "getMode", "at:", "basicAt:", "ifTrue:ifFalse:", "variableHintFor:token:", "messageHintFor:token:", "=", "type", "->", "line", "end", "start"]}),
  682. smalltalk.HLCodeWidget.klass);
  683. smalltalk.addMethod(
  684. smalltalk.method({
  685. selector: "initialize",
  686. fn: function (){
  687. var self=this;
  688. return smalltalk.withContext(function($ctx1) {
  689. var $1,$2;
  690. smalltalk.HLWidget.klass.fn.prototype._initialize.apply(_st(self), []);
  691. $1=self;
  692. _st($1)._setupCodeMirror();
  693. _st($1)._setupCommands();
  694. $2=_st($1)._setupKeyMaps();
  695. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLCodeWidget.klass)})},
  696. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"]}),
  697. smalltalk.HLCodeWidget.klass);
  698. smalltalk.addMethod(
  699. smalltalk.method({
  700. selector: "keyMap",
  701. fn: function (){
  702. var self=this;
  703. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  704. return smalltalk.withContext(function($ctx1) {
  705. var $2,$1;
  706. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  707. if(smalltalk.assert($2)){
  708. $1=_st(self)._macKeyMap();
  709. } else {
  710. $1=_st(self)._pcKeyMap();
  711. };
  712. return $1;
  713. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},smalltalk.HLCodeWidget.klass)})},
  714. messageSends: ["ifTrue:ifFalse:", "macKeyMap", "pcKeyMap", "systemIsMac", "keyBinder", "current"]}),
  715. smalltalk.HLCodeWidget.klass);
  716. smalltalk.addMethod(
  717. smalltalk.method({
  718. selector: "macKeyMap",
  719. fn: function (){
  720. var self=this;
  721. return smalltalk.withContext(function($ctx1) {
  722. var $1;
  723. $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"])]);
  724. return $1;
  725. }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  726. messageSends: ["->"]}),
  727. smalltalk.HLCodeWidget.klass);
  728. smalltalk.addMethod(
  729. smalltalk.method({
  730. selector: "messageHintFor:token:",
  731. fn: function (anEditor,aToken){
  732. var self=this;
  733. return smalltalk.withContext(function($ctx1) {
  734. var $1;
  735. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  736. return $1;
  737. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  738. messageSends: ["messageHintFor:token:", "at:"]}),
  739. smalltalk.HLCodeWidget.klass);
  740. smalltalk.addMethod(
  741. smalltalk.method({
  742. selector: "pcKeyMap",
  743. fn: function (){
  744. var self=this;
  745. return smalltalk.withContext(function($ctx1) {
  746. var $1;
  747. $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"])];
  748. return $1;
  749. }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  750. messageSends: ["->"]}),
  751. smalltalk.HLCodeWidget.klass);
  752. smalltalk.addMethod(
  753. smalltalk.method({
  754. selector: "setupCodeMirror",
  755. fn: function (){
  756. var self=this;
  757. return smalltalk.withContext(function($ctx1) {
  758. CodeMirror.keyMap.default.fallthrough = ["basic"];
  759. CodeMirror.commands.autocomplete = function(cm) {
  760. CodeMirror.showHint(cm, self._hintFor_options_);
  761. }
  762. ;
  763. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.HLCodeWidget.klass)})},
  764. messageSends: []}),
  765. smalltalk.HLCodeWidget.klass);
  766. smalltalk.addMethod(
  767. smalltalk.method({
  768. selector: "setupCommands",
  769. fn: function (){
  770. var self=this;
  771. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  772. return smalltalk.withContext(function($ctx1) {
  773. var $1,$2;
  774. $1=_st($CodeMirror())._basicAt_("commands");
  775. _st($1)._at_put_("doIt",(function(cm){
  776. return smalltalk.withContext(function($ctx2) {
  777. return _st(_st(cm)._amberCodeWidget())._doIt();
  778. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  779. _st($1)._at_put_("inspectIt",(function(cm){
  780. return smalltalk.withContext(function($ctx2) {
  781. return _st(_st(cm)._amberCodeWidget())._inspectIt();
  782. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  783. _st($1)._at_put_("printIt",(function(cm){
  784. return smalltalk.withContext(function($ctx2) {
  785. return _st(_st(cm)._amberCodeWidget())._printIt();
  786. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  787. $2=_st($1)._at_put_("saveIt",(function(cm){
  788. return smalltalk.withContext(function($ctx2) {
  789. return _st(_st(cm)._amberCodeWidget())._saveIt();
  790. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  791. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},smalltalk.HLCodeWidget.klass)})},
  792. messageSends: ["at:put:", "doIt", "amberCodeWidget", "basicAt:", "inspectIt", "printIt", "saveIt"]}),
  793. smalltalk.HLCodeWidget.klass);
  794. smalltalk.addMethod(
  795. smalltalk.method({
  796. selector: "setupKeyMaps",
  797. fn: function (){
  798. var self=this;
  799. return smalltalk.withContext(function($ctx1) {
  800. CodeMirror.keyMap['Amber'] = self._keyMap();
  801. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},smalltalk.HLCodeWidget.klass)})},
  802. messageSends: []}),
  803. smalltalk.HLCodeWidget.klass);
  804. smalltalk.addMethod(
  805. smalltalk.method({
  806. selector: "variableHintFor:token:",
  807. fn: function (anEditor,aToken){
  808. var self=this;
  809. return smalltalk.withContext(function($ctx1) {
  810. var $1;
  811. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  812. return $1;
  813. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  814. messageSends: ["variableHintFor:token:", "at:"]}),
  815. smalltalk.HLCodeWidget.klass);
  816. smalltalk.addClass('HLNavigationCodeWidget', smalltalk.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
  817. smalltalk.addMethod(
  818. smalltalk.method({
  819. selector: "configureEditor",
  820. fn: function (){
  821. var self=this;
  822. return smalltalk.withContext(function($ctx1) {
  823. smalltalk.HLCodeWidget.fn.prototype._configureEditor.apply(_st(self), []);
  824. _st(self)._contents_(_st(self)._methodContents());
  825. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLNavigationCodeWidget)})},
  826. messageSends: ["configureEditor", "contents:", "methodContents"]}),
  827. smalltalk.HLNavigationCodeWidget);
  828. smalltalk.addMethod(
  829. smalltalk.method({
  830. selector: "contents:",
  831. fn: function (aString){
  832. var self=this;
  833. return smalltalk.withContext(function($ctx1) {
  834. _st(self)._methodContents_(aString);
  835. smalltalk.HLCodeWidget.fn.prototype._contents_.apply(_st(self), [aString]);
  836. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  837. messageSends: ["methodContents:", "contents:"]}),
  838. smalltalk.HLNavigationCodeWidget);
  839. smalltalk.addMethod(
  840. smalltalk.method({
  841. selector: "hasModification",
  842. fn: function (){
  843. var self=this;
  844. return smalltalk.withContext(function($ctx1) {
  845. var $1;
  846. $1=_st(_st(_st(self)._methodContents()).__eq(_st(self)._contents()))._not();
  847. return $1;
  848. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLNavigationCodeWidget)})},
  849. messageSends: ["not", "=", "contents", "methodContents"]}),
  850. smalltalk.HLNavigationCodeWidget);
  851. smalltalk.addMethod(
  852. smalltalk.method({
  853. selector: "methodContents",
  854. fn: function (){
  855. var self=this;
  856. return smalltalk.withContext(function($ctx1) {
  857. var $2,$1;
  858. $2=self["@methodContents"];
  859. if(($receiver = $2) == nil || $receiver == undefined){
  860. $1="";
  861. } else {
  862. $1=$2;
  863. };
  864. return $1;
  865. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},smalltalk.HLNavigationCodeWidget)})},
  866. messageSends: ["ifNil:"]}),
  867. smalltalk.HLNavigationCodeWidget);
  868. smalltalk.addMethod(
  869. smalltalk.method({
  870. selector: "methodContents:",
  871. fn: function (aString){
  872. var self=this;
  873. return smalltalk.withContext(function($ctx1) {
  874. var $1;
  875. self["@methodContents"]=aString;
  876. $1=self["@methodContents"];
  877. return $1;
  878. }, function($ctx1) {$ctx1.fill(self,"methodContents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  879. messageSends: []}),
  880. smalltalk.HLNavigationCodeWidget);
  881. smalltalk.addMethod(
  882. smalltalk.method({
  883. selector: "previous",
  884. fn: function (){
  885. var self=this;
  886. return smalltalk.withContext(function($ctx1) {
  887. return self}, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationCodeWidget)})},
  888. messageSends: []}),
  889. smalltalk.HLNavigationCodeWidget);
  890. smalltalk.addMethod(
  891. smalltalk.method({
  892. selector: "previous:",
  893. fn: function (aWidget){
  894. var self=this;
  895. return smalltalk.withContext(function($ctx1) {
  896. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationCodeWidget)})},
  897. messageSends: []}),
  898. smalltalk.HLNavigationCodeWidget);
  899. smalltalk.addMethod(
  900. smalltalk.method({
  901. selector: "canBeOpenAsTab",
  902. fn: function (){
  903. var self=this;
  904. return smalltalk.withContext(function($ctx1) {
  905. return false;
  906. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLNavigationCodeWidget.klass)})},
  907. messageSends: []}),
  908. smalltalk.HLNavigationCodeWidget.klass);
  909. smalltalk.addMethod(
  910. smalltalk.method({
  911. selector: "on:",
  912. fn: function (aBrowserModel){
  913. var self=this;
  914. return smalltalk.withContext(function($ctx1) {
  915. var $2,$3,$1;
  916. $2=_st(self)._new();
  917. _st($2)._browserModel_(aBrowserModel);
  918. $3=_st($2)._yourself();
  919. $1=$3;
  920. return $1;
  921. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLNavigationCodeWidget.klass)})},
  922. messageSends: ["browserModel:", "new", "yourself"]}),
  923. smalltalk.HLNavigationCodeWidget.klass);
  924. smalltalk.addClass('HLBrowserCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  925. smalltalk.addMethod(
  926. smalltalk.method({
  927. selector: "browserModel",
  928. fn: function (){
  929. var self=this;
  930. return smalltalk.withContext(function($ctx1) {
  931. var $1;
  932. $1=self["@browserModel"];
  933. return $1;
  934. }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLSourceCodeWidget)})},
  935. messageSends: []}),
  936. smalltalk.HLBrowserCodeWidget);
  937. smalltalk.addMethod(
  938. smalltalk.method({
  939. selector: "browserModel:",
  940. fn: function (aBrowserModel){
  941. var self=this;
  942. return smalltalk.withContext(function($ctx1) {
  943. var $1,$2;
  944. self["@browserModel"]=aBrowserModel;
  945. $1=self;
  946. _st($1)._observeSystem();
  947. $2=_st($1)._observeBrowserModel();
  948. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget)})},
  949. messageSends: ["observeSystem", "observeBrowserModel"]}),
  950. smalltalk.HLBrowserCodeWidget);
  951. smalltalk.addMethod(
  952. smalltalk.method({
  953. selector: "observeBrowserModel",
  954. fn: function (){
  955. var self=this;
  956. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  957. function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
  958. function $HLSourceCodeSaved(){return smalltalk.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  959. function $HLAboutToChange(){return smalltalk.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  960. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  961. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  962. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  963. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  964. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  965. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  966. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  967. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  968. return smalltalk.withContext(function($ctx1) {
  969. var $1,$2;
  970. $1=_st(_st(self)._browserModel())._announcer();
  971. _st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
  972. _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
  973. _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
  974. _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
  975. _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
  976. _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
  977. _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
  978. _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
  979. _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
  980. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  981. _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
  982. $2=_st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
  983. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLBrowserCodeWidget)})},
  984. messageSends: ["on:send:to:", "announcer", "browserModel"]}),
  985. smalltalk.HLBrowserCodeWidget);
  986. smalltalk.addMethod(
  987. smalltalk.method({
  988. selector: "observeSystem",
  989. fn: function (){
  990. var self=this;
  991. function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  992. return smalltalk.withContext(function($ctx1) {
  993. _st(_st(_st(self)._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
  994. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLBrowserCodeWidget)})},
  995. messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"]}),
  996. smalltalk.HLBrowserCodeWidget);
  997. smalltalk.addMethod(
  998. smalltalk.method({
  999. selector: "onBrowserAboutToChange:",
  1000. fn: function (anAnnouncement){
  1001. var self=this;
  1002. var block;
  1003. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  1004. return smalltalk.withContext(function($ctx1) {
  1005. var $1;
  1006. block=_st(anAnnouncement)._actionBlock();
  1007. $1=_st(self)._hasModification();
  1008. if(smalltalk.assert($1)){
  1009. _st(self)._confirm_ifTrue_("Changes have not been saved. Do you want to discard these changes?",(function(){
  1010. return smalltalk.withContext(function($ctx2) {
  1011. _st(self)._methodContents_(_st(self)._contents());
  1012. return _st(block)._value();
  1013. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1014. _st($HLChangeForbidden())._signal();
  1015. };
  1016. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},smalltalk.HLBrowserCodeWidget)})},
  1017. messageSends: ["actionBlock", "ifTrue:", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal", "hasModification"]}),
  1018. smalltalk.HLBrowserCodeWidget);
  1019. smalltalk.addMethod(
  1020. smalltalk.method({
  1021. selector: "onClassSelected:",
  1022. fn: function (anAnnouncement){
  1023. var self=this;
  1024. var class_;
  1025. return smalltalk.withContext(function($ctx1) {
  1026. var $1,$2;
  1027. class_=_st(anAnnouncement)._item();
  1028. $1=class_;
  1029. if(($receiver = $1) == nil || $receiver == undefined){
  1030. $2=_st(self)._contents_("");
  1031. return $2;
  1032. } else {
  1033. $1;
  1034. };
  1035. _st(self)._contents_(_st(class_)._definition());
  1036. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLBrowserCodeWidget)})},
  1037. messageSends: ["item", "ifNil:", "contents:", "definition"]}),
  1038. smalltalk.HLBrowserCodeWidget);
  1039. smalltalk.addMethod(
  1040. smalltalk.method({
  1041. selector: "onCompileError:",
  1042. fn: function (anAnnouncement){
  1043. var self=this;
  1044. return smalltalk.withContext(function($ctx1) {
  1045. _st(self)._alert_(_st(_st(anAnnouncement)._error())._messageText());
  1046. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1047. messageSends: ["alert:", "messageText", "error"]}),
  1048. smalltalk.HLBrowserCodeWidget);
  1049. smalltalk.addMethod(
  1050. smalltalk.method({
  1051. selector: "onInstVarAdded",
  1052. fn: function (){
  1053. var self=this;
  1054. return smalltalk.withContext(function($ctx1) {
  1055. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1056. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLBrowserCodeWidget)})},
  1057. messageSends: ["save:", "contents", "browserModel"]}),
  1058. smalltalk.HLBrowserCodeWidget);
  1059. smalltalk.addMethod(
  1060. smalltalk.method({
  1061. selector: "onMethodModified:",
  1062. fn: function (anAnnouncement){
  1063. var self=this;
  1064. var method;
  1065. return smalltalk.withContext(function($ctx1) {
  1066. var $1,$2,$3,$4,$5,$6;
  1067. method=_st(anAnnouncement)._method();
  1068. $1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(method)._methodClass());
  1069. if(! smalltalk.assert($1)){
  1070. $2=self;
  1071. return $2;
  1072. };
  1073. $3=_st(_st(self)._browserModel())._selectedMethod();
  1074. if(($receiver = $3) == nil || $receiver == undefined){
  1075. $4=self;
  1076. return $4;
  1077. } else {
  1078. $3;
  1079. };
  1080. $5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(method)._selector());
  1081. if(! smalltalk.assert($5)){
  1082. $6=self;
  1083. return $6;
  1084. };
  1085. _st(self)._refresh();
  1086. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1087. messageSends: ["method", "ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"]}),
  1088. smalltalk.HLBrowserCodeWidget);
  1089. smalltalk.addMethod(
  1090. smalltalk.method({
  1091. selector: "onMethodSelected:",
  1092. fn: function (anAnnouncement){
  1093. var self=this;
  1094. var method;
  1095. return smalltalk.withContext(function($ctx1) {
  1096. var $1,$2;
  1097. method=_st(anAnnouncement)._item();
  1098. $1=method;
  1099. if(($receiver = $1) == nil || $receiver == undefined){
  1100. $2=_st(self)._contents_("");
  1101. return $2;
  1102. } else {
  1103. $1;
  1104. };
  1105. _st(self)._contents_(_st(method)._source());
  1106. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1107. messageSends: ["item", "ifNil:", "contents:", "source"]}),
  1108. smalltalk.HLBrowserCodeWidget);
  1109. smalltalk.addMethod(
  1110. smalltalk.method({
  1111. selector: "onParseError:",
  1112. fn: function (anAnnouncement){
  1113. var self=this;
  1114. var lineIndex,newContents;
  1115. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1116. return smalltalk.withContext(function($ctx1) {
  1117. var $1,$2,$3;
  1118. lineIndex=(1);
  1119. _st(self)._contents_(_st($String())._streamContents_((function(stream){
  1120. return smalltalk.withContext(function($ctx2) {
  1121. return _st(_st(self)._contents())._linesDo_((function(each){
  1122. return smalltalk.withContext(function($ctx3) {
  1123. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1124. if(smalltalk.assert($1)){
  1125. $2=stream;
  1126. _st($2)._nextPutAll_(_st(each)._copyFrom_to_((1),_st(anAnnouncement)._column()));
  1127. _st($2)._nextPutAll_("<- ");
  1128. _st($2)._nextPutAll_(_st(anAnnouncement)._message());
  1129. _st($2)._nextPutAll_(" ");
  1130. $3=_st($2)._nextPutAll_(_st(each)._copyFrom_to_(_st(_st(anAnnouncement)._column()).__plus((1)),_st(each)._size()));
  1131. $3;
  1132. } else {
  1133. _st(stream)._nextPutAll_(each);
  1134. };
  1135. _st(stream)._nextPutAll_(_st($String())._cr());
  1136. lineIndex=_st(lineIndex).__plus((1));
  1137. return lineIndex;
  1138. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1139. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1140. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
  1141. messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"]}),
  1142. smalltalk.HLBrowserCodeWidget);
  1143. smalltalk.addMethod(
  1144. smalltalk.method({
  1145. selector: "onProtocolSelected:",
  1146. fn: function (anAnnouncement){
  1147. var self=this;
  1148. return smalltalk.withContext(function($ctx1) {
  1149. var $1,$2;
  1150. $1=_st(_st(self)._browserModel())._selectedClass();
  1151. if(($receiver = $1) == nil || $receiver == undefined){
  1152. $2=_st(self)._contents_("");
  1153. return $2;
  1154. } else {
  1155. $1;
  1156. };
  1157. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1158. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1159. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"]}),
  1160. smalltalk.HLBrowserCodeWidget);
  1161. smalltalk.addMethod(
  1162. smalltalk.method({
  1163. selector: "onSaveIt",
  1164. fn: function (){
  1165. var self=this;
  1166. return smalltalk.withContext(function($ctx1) {
  1167. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1168. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
  1169. messageSends: ["save:", "contents", "browserModel"]}),
  1170. smalltalk.HLBrowserCodeWidget);
  1171. smalltalk.addMethod(
  1172. smalltalk.method({
  1173. selector: "onShowInstanceToggled",
  1174. fn: function (){
  1175. var self=this;
  1176. return smalltalk.withContext(function($ctx1) {
  1177. var $1,$2;
  1178. $1=_st(_st(self)._browserModel())._selectedClass();
  1179. if(($receiver = $1) == nil || $receiver == undefined){
  1180. $2=_st(self)._contents_("");
  1181. return $2;
  1182. } else {
  1183. $1;
  1184. };
  1185. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1186. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},smalltalk.HLBrowserCodeWidget)})},
  1187. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"]}),
  1188. smalltalk.HLBrowserCodeWidget);
  1189. smalltalk.addMethod(
  1190. smalltalk.method({
  1191. selector: "onSourceCodeFocusRequested",
  1192. fn: function (){
  1193. var self=this;
  1194. return smalltalk.withContext(function($ctx1) {
  1195. _st(self)._focus();
  1196. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLSourceCodeWidget)})},
  1197. messageSends: ["focus"]}),
  1198. smalltalk.HLBrowserCodeWidget);
  1199. smalltalk.addMethod(
  1200. smalltalk.method({
  1201. selector: "onSourceCodeSaved",
  1202. fn: function (){
  1203. var self=this;
  1204. return smalltalk.withContext(function($ctx1) {
  1205. _st(self)._methodContents_(_st(self)._contents());
  1206. _st(self)._updateState();
  1207. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},smalltalk.HLBrowserCodeWidget)})},
  1208. messageSends: ["methodContents:", "contents", "updateState"]}),
  1209. smalltalk.HLBrowserCodeWidget);
  1210. smalltalk.addMethod(
  1211. smalltalk.method({
  1212. selector: "onUnknownVariableError:",
  1213. fn: function (anAnnouncement){
  1214. var self=this;
  1215. var error;
  1216. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1217. return smalltalk.withContext(function($ctx1) {
  1218. var $1,$2;
  1219. error=_st(anAnnouncement)._error();
  1220. _st(self)._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1221. return smalltalk.withContext(function($ctx2) {
  1222. $1=stream;
  1223. _st($1)._nextPutAll_(_st(error)._messageText());
  1224. _st($1)._nextPutAll_(_st($String())._cr());
  1225. $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
  1226. return $2;
  1227. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})),(function(){
  1228. return smalltalk.withContext(function($ctx2) {
  1229. return _st(_st(self)._browserModel())._addInstVarNamed_(_st(error)._variableName());
  1230. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1231. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},smalltalk.HLBrowserCodeWidget)})},
  1232. messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "variableName", "browserModel"]}),
  1233. smalltalk.HLBrowserCodeWidget);
  1234. smalltalk.addMethod(
  1235. smalltalk.method({
  1236. selector: "refresh",
  1237. fn: function (){
  1238. var self=this;
  1239. return smalltalk.withContext(function($ctx1) {
  1240. var $1,$2,$3,$4;
  1241. $1=_st(self)._hasModification();
  1242. if(smalltalk.assert($1)){
  1243. $2=self;
  1244. return $2;
  1245. };
  1246. $3=_st(self)._hasFocus();
  1247. if(smalltalk.assert($3)){
  1248. $4=self;
  1249. return $4;
  1250. };
  1251. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedMethod())._source());
  1252. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLBrowserCodeWidget)})},
  1253. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"]}),
  1254. smalltalk.HLBrowserCodeWidget);
  1255. smalltalk.addMethod(
  1256. smalltalk.method({
  1257. selector: "renderButtonsOn:",
  1258. fn: function (html){
  1259. var self=this;
  1260. return smalltalk.withContext(function($ctx1) {
  1261. var $1,$2;
  1262. $1=_st(html)._button();
  1263. _st($1)._class_("button");
  1264. _st($1)._with_("SaveIt");
  1265. $2=_st($1)._onClick_((function(){
  1266. return smalltalk.withContext(function($ctx2) {
  1267. return _st(self)._saveIt();
  1268. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1269. smalltalk.HLNavigationCodeWidget.fn.prototype._renderButtonsOn_.apply(_st(self), [html]);
  1270. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLBrowserCodeWidget)})},
  1271. messageSends: ["class:", "button", "with:", "onClick:", "saveIt", "renderButtonsOn:"]}),
  1272. smalltalk.HLBrowserCodeWidget);
  1273. smalltalk.addMethod(
  1274. smalltalk.method({
  1275. selector: "saveIt",
  1276. fn: function (){
  1277. var self=this;
  1278. return smalltalk.withContext(function($ctx1) {
  1279. _st(_st(self)._browserModel())._saveSourceCode();
  1280. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
  1281. messageSends: ["saveSourceCode", "browserModel"]}),
  1282. smalltalk.HLBrowserCodeWidget);
  1283. smalltalk.addMethod(
  1284. smalltalk.method({
  1285. selector: "unregister",
  1286. fn: function (){
  1287. var self=this;
  1288. return smalltalk.withContext(function($ctx1) {
  1289. smalltalk.HLNavigationCodeWidget.fn.prototype._unregsiter.apply(_st(self), []);
  1290. _st(_st(_st(self)._browserModel())._announcer())._unsubscribe_(self);
  1291. _st(_st(_st(self)._browserModel())._systemAnnouncer())._unsubscribe_(self);
  1292. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLBrowserCodeWidget)})},
  1293. messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"]}),
  1294. smalltalk.HLBrowserCodeWidget);
  1295. smalltalk.addMethod(
  1296. smalltalk.method({
  1297. selector: "canBeOpenAsTab",
  1298. fn: function (){
  1299. var self=this;
  1300. return smalltalk.withContext(function($ctx1) {
  1301. return false;
  1302. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
  1303. messageSends: []}),
  1304. smalltalk.HLBrowserCodeWidget.klass);
  1305. smalltalk.addMethod(
  1306. smalltalk.method({
  1307. selector: "on:",
  1308. fn: function (aBrowserModel){
  1309. var self=this;
  1310. return smalltalk.withContext(function($ctx1) {
  1311. var $2,$3,$1;
  1312. $2=_st(self)._new();
  1313. _st($2)._browserModel_(aBrowserModel);
  1314. $3=_st($2)._yourself();
  1315. $1=$3;
  1316. return $1;
  1317. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
  1318. messageSends: ["browserModel:", "new", "yourself"]}),
  1319. smalltalk.HLBrowserCodeWidget.klass);
  1320. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget', 'transcript'], 'Helios-Workspace');
  1321. smalltalk.addMethod(
  1322. smalltalk.method({
  1323. selector: "canHaveFocus",
  1324. fn: function (){
  1325. var self=this;
  1326. return smalltalk.withContext(function($ctx1) {
  1327. return true;
  1328. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
  1329. messageSends: []}),
  1330. smalltalk.HLWorkspace);
  1331. smalltalk.addMethod(
  1332. smalltalk.method({
  1333. selector: "codeWidget",
  1334. fn: function (){
  1335. var self=this;
  1336. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  1337. return smalltalk.withContext(function($ctx1) {
  1338. var $2,$1;
  1339. $2=self["@codeWidget"];
  1340. if(($receiver = $2) == nil || $receiver == undefined){
  1341. self["@codeWidget"]=_st($HLCodeWidget())._new();
  1342. $1=self["@codeWidget"];
  1343. } else {
  1344. $1=$2;
  1345. };
  1346. return $1;
  1347. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
  1348. messageSends: ["ifNil:", "new"]}),
  1349. smalltalk.HLWorkspace);
  1350. smalltalk.addMethod(
  1351. smalltalk.method({
  1352. selector: "focus",
  1353. fn: function (){
  1354. var self=this;
  1355. return smalltalk.withContext(function($ctx1) {
  1356. var $1;
  1357. $1=_st(_st(self)._codeWidget())._focus();
  1358. return $1;
  1359. }, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
  1360. messageSends: ["focus", "codeWidget"]}),
  1361. smalltalk.HLWorkspace);
  1362. smalltalk.addMethod(
  1363. smalltalk.method({
  1364. selector: "renderContentOn:",
  1365. fn: function (html){
  1366. var self=this;
  1367. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  1368. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  1369. return smalltalk.withContext(function($ctx1) {
  1370. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(_st(self)._codeWidget(),(function(canvas){
  1371. return smalltalk.withContext(function($ctx2) {
  1372. return _st(self)._renderTranscriptOn_(canvas);
  1373. }, function($ctx2) {$ctx2.fillBlock({canvas:canvas},$ctx1)})}))));
  1374. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
  1375. messageSends: ["with:", "with:with:", "codeWidget", "renderTranscriptOn:"]}),
  1376. smalltalk.HLWorkspace);
  1377. smalltalk.addMethod(
  1378. smalltalk.method({
  1379. selector: "renderTranscriptOn:",
  1380. fn: function (html){
  1381. var self=this;
  1382. return smalltalk.withContext(function($ctx1) {
  1383. var $1,$3,$4,$2;
  1384. $1=_st(html)._div();
  1385. _st($1)._class_("transcript-container");
  1386. $2=_st($1)._with_((function(){
  1387. return smalltalk.withContext(function($ctx2) {
  1388. $3=_st(html)._div();
  1389. _st($3)._class_("list-label");
  1390. $4=_st($3)._with_("Transcript");
  1391. $4;
  1392. return _st(_st(self)._transcript())._renderOn_(html);
  1393. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1394. return self}, function($ctx1) {$ctx1.fill(self,"renderTranscriptOn:",{html:html},smalltalk.HLWorkspace)})},
  1395. messageSends: ["class:", "div", "with:", "renderOn:", "transcript"]}),
  1396. smalltalk.HLWorkspace);
  1397. smalltalk.addMethod(
  1398. smalltalk.method({
  1399. selector: "transcript",
  1400. fn: function (){
  1401. var self=this;
  1402. function $HLTranscript(){return smalltalk.HLTranscript||(typeof HLTranscript=="undefined"?nil:HLTranscript)}
  1403. return smalltalk.withContext(function($ctx1) {
  1404. var $2,$1;
  1405. $2=self["@transcript"];
  1406. if(($receiver = $2) == nil || $receiver == undefined){
  1407. self["@transcript"]=_st($HLTranscript())._new();
  1408. $1=self["@transcript"];
  1409. } else {
  1410. $1=$2;
  1411. };
  1412. return $1;
  1413. }, function($ctx1) {$ctx1.fill(self,"transcript",{},smalltalk.HLWorkspace)})},
  1414. messageSends: ["ifNil:", "new"]}),
  1415. smalltalk.HLWorkspace);
  1416. smalltalk.addMethod(
  1417. smalltalk.method({
  1418. selector: "unregister",
  1419. fn: function (){
  1420. var self=this;
  1421. return smalltalk.withContext(function($ctx1) {
  1422. smalltalk.HLWidget.fn.prototype._unregister.apply(_st(self), []);
  1423. _st(_st(self)._transcript())._unregister();
  1424. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLWorkspace)})},
  1425. messageSends: ["unregister", "transcript"]}),
  1426. smalltalk.HLWorkspace);
  1427. smalltalk.addMethod(
  1428. smalltalk.method({
  1429. selector: "canBeOpenAsTab",
  1430. fn: function (){
  1431. var self=this;
  1432. return smalltalk.withContext(function($ctx1) {
  1433. return true;
  1434. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
  1435. messageSends: []}),
  1436. smalltalk.HLWorkspace.klass);
  1437. smalltalk.addMethod(
  1438. smalltalk.method({
  1439. selector: "tabClass",
  1440. fn: function (){
  1441. var self=this;
  1442. return smalltalk.withContext(function($ctx1) {
  1443. return "workspace";
  1444. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLWorkspace.klass)})},
  1445. messageSends: []}),
  1446. smalltalk.HLWorkspace.klass);
  1447. smalltalk.addMethod(
  1448. smalltalk.method({
  1449. selector: "tabLabel",
  1450. fn: function (){
  1451. var self=this;
  1452. return smalltalk.withContext(function($ctx1) {
  1453. return "Workspace";
  1454. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
  1455. messageSends: []}),
  1456. smalltalk.HLWorkspace.klass);
  1457. smalltalk.addMethod(
  1458. smalltalk.method({
  1459. selector: "tabPriority",
  1460. fn: function (){
  1461. var self=this;
  1462. return smalltalk.withContext(function($ctx1) {
  1463. var $1;
  1464. $1=(10);
  1465. return $1;
  1466. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
  1467. messageSends: []}),
  1468. smalltalk.HLWorkspace.klass);