Helios-Workspace.deploy.js 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573
  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;
  518. self["@code"]=_st(html)._textarea();
  519. self["@state"]=_st(_st(html)._div())._class_("state");
  520. $1=_st(html)._div();
  521. _st($1)._class_("buttons_bar");
  522. $2=_st($1)._with_((function(){
  523. return smalltalk.withContext(function($ctx2) {
  524. return _st(self)._renderButtonsOn_(html);
  525. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  526. $3=self;
  527. _st($3)._setEditorOn_(_st(self["@code"])._element());
  528. _st($3)._configureEditor();
  529. $4=_st($3)._updateState();
  530. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLCodeWidget)})},
  531. messageSends: ["textarea", "class:", "div", "with:", "renderButtonsOn:", "setEditorOn:", "element", "configureEditor", "updateState"]}),
  532. smalltalk.HLCodeWidget);
  533. smalltalk.addMethod(
  534. smalltalk.method({
  535. selector: "saveIt",
  536. fn: function (){
  537. var self=this;
  538. return smalltalk.withContext(function($ctx1) {
  539. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLCodeWidget)})},
  540. messageSends: []}),
  541. smalltalk.HLCodeWidget);
  542. smalltalk.addMethod(
  543. smalltalk.method({
  544. selector: "selection",
  545. fn: function (){
  546. var self=this;
  547. return smalltalk.withContext(function($ctx1) {
  548. var $1;
  549. $1=_st(self["@editor"])._getSelection();
  550. return $1;
  551. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.HLCodeWidget)})},
  552. messageSends: ["getSelection"]}),
  553. smalltalk.HLCodeWidget);
  554. smalltalk.addMethod(
  555. smalltalk.method({
  556. selector: "selectionEnd",
  557. fn: function (){
  558. var self=this;
  559. return smalltalk.withContext(function($ctx1) {
  560. var $1;
  561. $1=_st(_st(self["@code"])._element())._selectionEnd();
  562. return $1;
  563. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},smalltalk.HLCodeWidget)})},
  564. messageSends: ["selectionEnd", "element"]}),
  565. smalltalk.HLCodeWidget);
  566. smalltalk.addMethod(
  567. smalltalk.method({
  568. selector: "selectionEnd:",
  569. fn: function (anInteger){
  570. var self=this;
  571. return smalltalk.withContext(function($ctx1) {
  572. _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  573. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  574. messageSends: ["selectionEnd:", "element"]}),
  575. smalltalk.HLCodeWidget);
  576. smalltalk.addMethod(
  577. smalltalk.method({
  578. selector: "selectionStart",
  579. fn: function (){
  580. var self=this;
  581. return smalltalk.withContext(function($ctx1) {
  582. var $1;
  583. $1=_st(_st(self["@code"])._element())._selectionStart();
  584. return $1;
  585. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},smalltalk.HLCodeWidget)})},
  586. messageSends: ["selectionStart", "element"]}),
  587. smalltalk.HLCodeWidget);
  588. smalltalk.addMethod(
  589. smalltalk.method({
  590. selector: "selectionStart:",
  591. fn: function (anInteger){
  592. var self=this;
  593. return smalltalk.withContext(function($ctx1) {
  594. _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  595. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  596. messageSends: ["selectionStart:", "element"]}),
  597. smalltalk.HLCodeWidget);
  598. smalltalk.addMethod(
  599. smalltalk.method({
  600. selector: "setEditorOn:",
  601. fn: function (aTextarea){
  602. var self=this;
  603. return smalltalk.withContext(function($ctx1) {
  604. self['@editor'] = CodeMirror.fromTextArea(aTextarea, self._editorOptions());
  605. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},smalltalk.HLCodeWidget)})},
  606. messageSends: []}),
  607. smalltalk.HLCodeWidget);
  608. smalltalk.addMethod(
  609. smalltalk.method({
  610. selector: "updateState",
  611. fn: function (){
  612. var self=this;
  613. return smalltalk.withContext(function($ctx1) {
  614. var $1;
  615. $1=_st(self)._hasModification();
  616. if(smalltalk.assert($1)){
  617. _st(_st(self["@state"])._asJQuery())._addClass_("modified");
  618. } else {
  619. _st(_st(self["@state"])._asJQuery())._removeClass_("modified");
  620. };
  621. return self}, function($ctx1) {$ctx1.fill(self,"updateState",{},smalltalk.HLCodeWidget)})},
  622. messageSends: ["ifTrue:ifFalse:", "addClass:", "asJQuery", "removeClass:", "hasModification"]}),
  623. smalltalk.HLCodeWidget);
  624. smalltalk.addMethod(
  625. smalltalk.method({
  626. selector: "variableHintFor:token:",
  627. fn: function (anEditor,aToken){
  628. var self=this;
  629. var variables,classNames,pseudoVariables;
  630. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  631. return smalltalk.withContext(function($ctx1) {
  632. var $1;
  633. variables=_st(_st(_st(_st(window)._jQuery_(_st(_st(anEditor)._display())._wrapper()))._find_("span.cm-variable"))._get())._collect_((function(each){
  634. return smalltalk.withContext(function($ctx2) {
  635. return _st(_st(window)._jQuery_(each))._html();
  636. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  637. classNames=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  638. return smalltalk.withContext(function($ctx2) {
  639. return _st(each)._name();
  640. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  641. pseudoVariables=_st(_st($Smalltalk())._current())._pseudoVariableNames();
  642. $1=_st(_st(_st(_st(_st(_st(variables).__comma(classNames)).__comma(pseudoVariables))._asSet())._asArray())._select_((function(each){
  643. return smalltalk.withContext(function($ctx2) {
  644. return _st(each)._includesSubString_(_st(aToken)._string());
  645. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  646. return smalltalk.withContext(function($ctx2) {
  647. return _st(each).__eq(_st(aToken)._string());
  648. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  649. return $1;
  650. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},smalltalk.HLCodeWidget)})},
  651. messageSends: ["collect:", "html", "jQuery:", "get", "find:", "wrapper", "display", "name", "classes", "current", "pseudoVariableNames", "reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", ","]}),
  652. smalltalk.HLCodeWidget);
  653. smalltalk.addMethod(
  654. smalltalk.method({
  655. selector: "hintFor:options:",
  656. fn: function (anEditor,options){
  657. var self=this;
  658. var cursor,token,completions;
  659. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  660. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  661. return smalltalk.withContext(function($ctx1) {
  662. var $1,$2;
  663. cursor=_st(anEditor)._getCursor();
  664. token=_st(anEditor)._getTokenAt_(cursor);
  665. _st(token)._at_put_("state",_st(_st(_st($CodeMirror())._basicAt_("innerMode"))._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state")))._state());
  666. $1=_st(_st(token)._type()).__eq("variable");
  667. if(smalltalk.assert($1)){
  668. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  669. } else {
  670. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  671. };
  672. $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()))]);
  673. return $2;
  674. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},smalltalk.HLCodeWidget.klass)})},
  675. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "getMode", "at:", "basicAt:", "ifTrue:ifFalse:", "variableHintFor:token:", "messageHintFor:token:", "=", "type", "->", "line", "end", "start"]}),
  676. smalltalk.HLCodeWidget.klass);
  677. smalltalk.addMethod(
  678. smalltalk.method({
  679. selector: "initialize",
  680. fn: function (){
  681. var self=this;
  682. return smalltalk.withContext(function($ctx1) {
  683. var $1,$2;
  684. smalltalk.HLWidget.klass.fn.prototype._initialize.apply(_st(self), []);
  685. $1=self;
  686. _st($1)._setupCodeMirror();
  687. _st($1)._setupCommands();
  688. $2=_st($1)._setupKeyMaps();
  689. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLCodeWidget.klass)})},
  690. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"]}),
  691. smalltalk.HLCodeWidget.klass);
  692. smalltalk.addMethod(
  693. smalltalk.method({
  694. selector: "keyMap",
  695. fn: function (){
  696. var self=this;
  697. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  698. return smalltalk.withContext(function($ctx1) {
  699. var $2,$1;
  700. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  701. if(smalltalk.assert($2)){
  702. $1=_st(self)._macKeyMap();
  703. } else {
  704. $1=_st(self)._pcKeyMap();
  705. };
  706. return $1;
  707. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},smalltalk.HLCodeWidget.klass)})},
  708. messageSends: ["ifTrue:ifFalse:", "macKeyMap", "pcKeyMap", "systemIsMac", "keyBinder", "current"]}),
  709. smalltalk.HLCodeWidget.klass);
  710. smalltalk.addMethod(
  711. smalltalk.method({
  712. selector: "macKeyMap",
  713. fn: function (){
  714. var self=this;
  715. return smalltalk.withContext(function($ctx1) {
  716. var $1;
  717. $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"])]);
  718. return $1;
  719. }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  720. messageSends: ["->"]}),
  721. smalltalk.HLCodeWidget.klass);
  722. smalltalk.addMethod(
  723. smalltalk.method({
  724. selector: "messageHintFor:token:",
  725. fn: function (anEditor,aToken){
  726. var self=this;
  727. return smalltalk.withContext(function($ctx1) {
  728. var $1;
  729. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  730. return $1;
  731. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  732. messageSends: ["messageHintFor:token:", "at:"]}),
  733. smalltalk.HLCodeWidget.klass);
  734. smalltalk.addMethod(
  735. smalltalk.method({
  736. selector: "pcKeyMap",
  737. fn: function (){
  738. var self=this;
  739. return smalltalk.withContext(function($ctx1) {
  740. var $1;
  741. $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"])];
  742. return $1;
  743. }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  744. messageSends: ["->"]}),
  745. smalltalk.HLCodeWidget.klass);
  746. smalltalk.addMethod(
  747. smalltalk.method({
  748. selector: "setupCodeMirror",
  749. fn: function (){
  750. var self=this;
  751. return smalltalk.withContext(function($ctx1) {
  752. CodeMirror.keyMap.default.fallthrough = ["basic"];
  753. CodeMirror.commands.autocomplete = function(cm) {
  754. CodeMirror.showHint(cm, self._hintFor_options_);
  755. }
  756. ;
  757. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.HLCodeWidget.klass)})},
  758. messageSends: []}),
  759. smalltalk.HLCodeWidget.klass);
  760. smalltalk.addMethod(
  761. smalltalk.method({
  762. selector: "setupCommands",
  763. fn: function (){
  764. var self=this;
  765. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  766. return smalltalk.withContext(function($ctx1) {
  767. var $1,$2;
  768. $1=_st($CodeMirror())._basicAt_("commands");
  769. _st($1)._at_put_("doIt",(function(cm){
  770. return smalltalk.withContext(function($ctx2) {
  771. return _st(_st(cm)._amberCodeWidget())._doIt();
  772. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  773. _st($1)._at_put_("inspectIt",(function(cm){
  774. return smalltalk.withContext(function($ctx2) {
  775. return _st(_st(cm)._amberCodeWidget())._inspectIt();
  776. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  777. _st($1)._at_put_("printIt",(function(cm){
  778. return smalltalk.withContext(function($ctx2) {
  779. return _st(_st(cm)._amberCodeWidget())._printIt();
  780. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  781. $2=_st($1)._at_put_("saveIt",(function(cm){
  782. return smalltalk.withContext(function($ctx2) {
  783. return _st(_st(cm)._amberCodeWidget())._saveIt();
  784. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  785. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},smalltalk.HLCodeWidget.klass)})},
  786. messageSends: ["at:put:", "doIt", "amberCodeWidget", "basicAt:", "inspectIt", "printIt", "saveIt"]}),
  787. smalltalk.HLCodeWidget.klass);
  788. smalltalk.addMethod(
  789. smalltalk.method({
  790. selector: "setupKeyMaps",
  791. fn: function (){
  792. var self=this;
  793. return smalltalk.withContext(function($ctx1) {
  794. CodeMirror.keyMap['Amber'] = self._keyMap();
  795. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},smalltalk.HLCodeWidget.klass)})},
  796. messageSends: []}),
  797. smalltalk.HLCodeWidget.klass);
  798. smalltalk.addMethod(
  799. smalltalk.method({
  800. selector: "variableHintFor:token:",
  801. fn: function (anEditor,aToken){
  802. var self=this;
  803. return smalltalk.withContext(function($ctx1) {
  804. var $1;
  805. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  806. return $1;
  807. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  808. messageSends: ["variableHintFor:token:", "at:"]}),
  809. smalltalk.HLCodeWidget.klass);
  810. smalltalk.addClass('HLNavigationCodeWidget', smalltalk.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
  811. smalltalk.addMethod(
  812. smalltalk.method({
  813. selector: "configureEditor",
  814. fn: function (){
  815. var self=this;
  816. return smalltalk.withContext(function($ctx1) {
  817. smalltalk.HLCodeWidget.fn.prototype._configureEditor.apply(_st(self), []);
  818. _st(self)._contents_(_st(self)._methodContents());
  819. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLNavigationCodeWidget)})},
  820. messageSends: ["configureEditor", "contents:", "methodContents"]}),
  821. smalltalk.HLNavigationCodeWidget);
  822. smalltalk.addMethod(
  823. smalltalk.method({
  824. selector: "contents:",
  825. fn: function (aString){
  826. var self=this;
  827. return smalltalk.withContext(function($ctx1) {
  828. _st(self)._methodContents_(aString);
  829. smalltalk.HLCodeWidget.fn.prototype._contents_.apply(_st(self), [aString]);
  830. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  831. messageSends: ["methodContents:", "contents:"]}),
  832. smalltalk.HLNavigationCodeWidget);
  833. smalltalk.addMethod(
  834. smalltalk.method({
  835. selector: "hasModification",
  836. fn: function (){
  837. var self=this;
  838. return smalltalk.withContext(function($ctx1) {
  839. var $1;
  840. $1=_st(_st(_st(self)._methodContents()).__eq(_st(self)._contents()))._not();
  841. return $1;
  842. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLNavigationCodeWidget)})},
  843. messageSends: ["not", "=", "contents", "methodContents"]}),
  844. smalltalk.HLNavigationCodeWidget);
  845. smalltalk.addMethod(
  846. smalltalk.method({
  847. selector: "methodContents",
  848. fn: function (){
  849. var self=this;
  850. return smalltalk.withContext(function($ctx1) {
  851. var $2,$1;
  852. $2=self["@methodContents"];
  853. if(($receiver = $2) == nil || $receiver == undefined){
  854. $1="";
  855. } else {
  856. $1=$2;
  857. };
  858. return $1;
  859. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},smalltalk.HLNavigationCodeWidget)})},
  860. messageSends: ["ifNil:"]}),
  861. smalltalk.HLNavigationCodeWidget);
  862. smalltalk.addMethod(
  863. smalltalk.method({
  864. selector: "methodContents:",
  865. fn: function (aString){
  866. var self=this;
  867. return smalltalk.withContext(function($ctx1) {
  868. var $1;
  869. self["@methodContents"]=aString;
  870. $1=self["@methodContents"];
  871. return $1;
  872. }, function($ctx1) {$ctx1.fill(self,"methodContents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  873. messageSends: []}),
  874. smalltalk.HLNavigationCodeWidget);
  875. smalltalk.addMethod(
  876. smalltalk.method({
  877. selector: "previous",
  878. fn: function (){
  879. var self=this;
  880. return smalltalk.withContext(function($ctx1) {
  881. return self}, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationCodeWidget)})},
  882. messageSends: []}),
  883. smalltalk.HLNavigationCodeWidget);
  884. smalltalk.addMethod(
  885. smalltalk.method({
  886. selector: "previous:",
  887. fn: function (aWidget){
  888. var self=this;
  889. return smalltalk.withContext(function($ctx1) {
  890. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationCodeWidget)})},
  891. messageSends: []}),
  892. smalltalk.HLNavigationCodeWidget);
  893. smalltalk.addMethod(
  894. smalltalk.method({
  895. selector: "canBeOpenAsTab",
  896. fn: function (){
  897. var self=this;
  898. return smalltalk.withContext(function($ctx1) {
  899. return false;
  900. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLNavigationCodeWidget.klass)})},
  901. messageSends: []}),
  902. smalltalk.HLNavigationCodeWidget.klass);
  903. smalltalk.addMethod(
  904. smalltalk.method({
  905. selector: "on:",
  906. fn: function (aBrowserModel){
  907. var self=this;
  908. return smalltalk.withContext(function($ctx1) {
  909. var $2,$3,$1;
  910. $2=_st(self)._new();
  911. _st($2)._browserModel_(aBrowserModel);
  912. $3=_st($2)._yourself();
  913. $1=$3;
  914. return $1;
  915. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLNavigationCodeWidget.klass)})},
  916. messageSends: ["browserModel:", "new", "yourself"]}),
  917. smalltalk.HLNavigationCodeWidget.klass);
  918. smalltalk.addClass('HLBrowserCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  919. smalltalk.addMethod(
  920. smalltalk.method({
  921. selector: "browserModel",
  922. fn: function (){
  923. var self=this;
  924. return smalltalk.withContext(function($ctx1) {
  925. var $1;
  926. $1=self["@browserModel"];
  927. return $1;
  928. }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLSourceCodeWidget)})},
  929. messageSends: []}),
  930. smalltalk.HLBrowserCodeWidget);
  931. smalltalk.addMethod(
  932. smalltalk.method({
  933. selector: "browserModel:",
  934. fn: function (aBrowserModel){
  935. var self=this;
  936. return smalltalk.withContext(function($ctx1) {
  937. var $1,$2;
  938. self["@browserModel"]=aBrowserModel;
  939. $1=self;
  940. _st($1)._observeSystem();
  941. $2=_st($1)._observeBrowserModel();
  942. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget)})},
  943. messageSends: ["observeSystem", "observeBrowserModel"]}),
  944. smalltalk.HLBrowserCodeWidget);
  945. smalltalk.addMethod(
  946. smalltalk.method({
  947. selector: "observeBrowserModel",
  948. fn: function (){
  949. var self=this;
  950. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  951. function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
  952. function $HLSourceCodeSaved(){return smalltalk.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  953. function $HLAboutToChange(){return smalltalk.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  954. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  955. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  956. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  957. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  958. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  959. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  960. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  961. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  962. return smalltalk.withContext(function($ctx1) {
  963. var $1,$2;
  964. $1=_st(_st(self)._browserModel())._announcer();
  965. _st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
  966. _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
  967. _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
  968. _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
  969. _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
  970. _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
  971. _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
  972. _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
  973. _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
  974. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  975. _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
  976. $2=_st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
  977. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLBrowserCodeWidget)})},
  978. messageSends: ["on:send:to:", "announcer", "browserModel"]}),
  979. smalltalk.HLBrowserCodeWidget);
  980. smalltalk.addMethod(
  981. smalltalk.method({
  982. selector: "observeSystem",
  983. fn: function (){
  984. var self=this;
  985. function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  986. return smalltalk.withContext(function($ctx1) {
  987. _st(_st(_st(self)._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
  988. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLBrowserCodeWidget)})},
  989. messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"]}),
  990. smalltalk.HLBrowserCodeWidget);
  991. smalltalk.addMethod(
  992. smalltalk.method({
  993. selector: "onBrowserAboutToChange:",
  994. fn: function (anAnnouncement){
  995. var self=this;
  996. var block;
  997. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  998. return smalltalk.withContext(function($ctx1) {
  999. var $1;
  1000. block=_st(anAnnouncement)._actionBlock();
  1001. $1=_st(self)._hasModification();
  1002. if(smalltalk.assert($1)){
  1003. _st(self)._confirm_ifTrue_("Changes have not been saved. Do you want to discard these changes?",(function(){
  1004. return smalltalk.withContext(function($ctx2) {
  1005. _st(self)._methodContents_(_st(self)._contents());
  1006. return _st(block)._value();
  1007. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1008. _st($HLChangeForbidden())._signal();
  1009. };
  1010. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},smalltalk.HLBrowserCodeWidget)})},
  1011. messageSends: ["actionBlock", "ifTrue:", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal", "hasModification"]}),
  1012. smalltalk.HLBrowserCodeWidget);
  1013. smalltalk.addMethod(
  1014. smalltalk.method({
  1015. selector: "onClassSelected:",
  1016. fn: function (anAnnouncement){
  1017. var self=this;
  1018. var class_;
  1019. return smalltalk.withContext(function($ctx1) {
  1020. var $1,$2;
  1021. class_=_st(anAnnouncement)._item();
  1022. $1=class_;
  1023. if(($receiver = $1) == nil || $receiver == undefined){
  1024. $2=_st(self)._contents_("");
  1025. return $2;
  1026. } else {
  1027. $1;
  1028. };
  1029. _st(self)._contents_(_st(class_)._definition());
  1030. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLBrowserCodeWidget)})},
  1031. messageSends: ["item", "ifNil:", "contents:", "definition"]}),
  1032. smalltalk.HLBrowserCodeWidget);
  1033. smalltalk.addMethod(
  1034. smalltalk.method({
  1035. selector: "onCompileError:",
  1036. fn: function (anAnnouncement){
  1037. var self=this;
  1038. return smalltalk.withContext(function($ctx1) {
  1039. _st(self)._alert_(_st(_st(anAnnouncement)._error())._messageText());
  1040. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1041. messageSends: ["alert:", "messageText", "error"]}),
  1042. smalltalk.HLBrowserCodeWidget);
  1043. smalltalk.addMethod(
  1044. smalltalk.method({
  1045. selector: "onInstVarAdded",
  1046. fn: function (){
  1047. var self=this;
  1048. return smalltalk.withContext(function($ctx1) {
  1049. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1050. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLBrowserCodeWidget)})},
  1051. messageSends: ["save:", "contents", "browserModel"]}),
  1052. smalltalk.HLBrowserCodeWidget);
  1053. smalltalk.addMethod(
  1054. smalltalk.method({
  1055. selector: "onMethodModified:",
  1056. fn: function (anAnnouncement){
  1057. var self=this;
  1058. var method;
  1059. return smalltalk.withContext(function($ctx1) {
  1060. var $1,$2,$3,$4,$5,$6;
  1061. method=_st(anAnnouncement)._method();
  1062. $1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(method)._methodClass());
  1063. if(! smalltalk.assert($1)){
  1064. $2=self;
  1065. return $2;
  1066. };
  1067. $3=_st(_st(self)._browserModel())._selectedMethod();
  1068. if(($receiver = $3) == nil || $receiver == undefined){
  1069. $4=self;
  1070. return $4;
  1071. } else {
  1072. $3;
  1073. };
  1074. $5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(method)._selector());
  1075. if(! smalltalk.assert($5)){
  1076. $6=self;
  1077. return $6;
  1078. };
  1079. _st(self)._refresh();
  1080. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1081. messageSends: ["method", "ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"]}),
  1082. smalltalk.HLBrowserCodeWidget);
  1083. smalltalk.addMethod(
  1084. smalltalk.method({
  1085. selector: "onMethodSelected:",
  1086. fn: function (anAnnouncement){
  1087. var self=this;
  1088. var method;
  1089. return smalltalk.withContext(function($ctx1) {
  1090. var $1,$2;
  1091. method=_st(anAnnouncement)._item();
  1092. $1=method;
  1093. if(($receiver = $1) == nil || $receiver == undefined){
  1094. $2=_st(self)._contents_("");
  1095. return $2;
  1096. } else {
  1097. $1;
  1098. };
  1099. _st(self)._contents_(_st(method)._source());
  1100. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1101. messageSends: ["item", "ifNil:", "contents:", "source"]}),
  1102. smalltalk.HLBrowserCodeWidget);
  1103. smalltalk.addMethod(
  1104. smalltalk.method({
  1105. selector: "onParseError:",
  1106. fn: function (anAnnouncement){
  1107. var self=this;
  1108. var lineIndex,newContents;
  1109. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1110. return smalltalk.withContext(function($ctx1) {
  1111. var $1,$2,$3;
  1112. lineIndex=(1);
  1113. _st(self)._contents_(_st($String())._streamContents_((function(stream){
  1114. return smalltalk.withContext(function($ctx2) {
  1115. return _st(_st(self)._contents())._linesDo_((function(each){
  1116. return smalltalk.withContext(function($ctx3) {
  1117. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1118. if(smalltalk.assert($1)){
  1119. $2=stream;
  1120. _st($2)._nextPutAll_(_st(each)._copyFrom_to_((1),_st(anAnnouncement)._column()));
  1121. _st($2)._nextPutAll_("<- ");
  1122. _st($2)._nextPutAll_(_st(anAnnouncement)._message());
  1123. _st($2)._nextPutAll_(" ");
  1124. $3=_st($2)._nextPutAll_(_st(each)._copyFrom_to_(_st(_st(anAnnouncement)._column()).__plus((1)),_st(each)._size()));
  1125. $3;
  1126. } else {
  1127. _st(stream)._nextPutAll_(each);
  1128. };
  1129. _st(stream)._nextPutAll_(_st($String())._cr());
  1130. lineIndex=_st(lineIndex).__plus((1));
  1131. return lineIndex;
  1132. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1133. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1134. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
  1135. messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"]}),
  1136. smalltalk.HLBrowserCodeWidget);
  1137. smalltalk.addMethod(
  1138. smalltalk.method({
  1139. selector: "onProtocolSelected:",
  1140. fn: function (anAnnouncement){
  1141. var self=this;
  1142. return smalltalk.withContext(function($ctx1) {
  1143. var $1,$2;
  1144. $1=_st(_st(self)._browserModel())._selectedClass();
  1145. if(($receiver = $1) == nil || $receiver == undefined){
  1146. $2=_st(self)._contents_("");
  1147. return $2;
  1148. } else {
  1149. $1;
  1150. };
  1151. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1152. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1153. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"]}),
  1154. smalltalk.HLBrowserCodeWidget);
  1155. smalltalk.addMethod(
  1156. smalltalk.method({
  1157. selector: "onSaveIt",
  1158. fn: function (){
  1159. var self=this;
  1160. return smalltalk.withContext(function($ctx1) {
  1161. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1162. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
  1163. messageSends: ["save:", "contents", "browserModel"]}),
  1164. smalltalk.HLBrowserCodeWidget);
  1165. smalltalk.addMethod(
  1166. smalltalk.method({
  1167. selector: "onShowInstanceToggled",
  1168. fn: function (){
  1169. var self=this;
  1170. return smalltalk.withContext(function($ctx1) {
  1171. var $1,$2;
  1172. $1=_st(_st(self)._browserModel())._selectedClass();
  1173. if(($receiver = $1) == nil || $receiver == undefined){
  1174. $2=_st(self)._contents_("");
  1175. return $2;
  1176. } else {
  1177. $1;
  1178. };
  1179. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1180. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},smalltalk.HLBrowserCodeWidget)})},
  1181. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"]}),
  1182. smalltalk.HLBrowserCodeWidget);
  1183. smalltalk.addMethod(
  1184. smalltalk.method({
  1185. selector: "onSourceCodeFocusRequested",
  1186. fn: function (){
  1187. var self=this;
  1188. return smalltalk.withContext(function($ctx1) {
  1189. _st(self)._focus();
  1190. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLSourceCodeWidget)})},
  1191. messageSends: ["focus"]}),
  1192. smalltalk.HLBrowserCodeWidget);
  1193. smalltalk.addMethod(
  1194. smalltalk.method({
  1195. selector: "onSourceCodeSaved",
  1196. fn: function (){
  1197. var self=this;
  1198. return smalltalk.withContext(function($ctx1) {
  1199. _st(self)._methodContents_(_st(self)._contents());
  1200. _st(self)._updateState();
  1201. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},smalltalk.HLBrowserCodeWidget)})},
  1202. messageSends: ["methodContents:", "contents", "updateState"]}),
  1203. smalltalk.HLBrowserCodeWidget);
  1204. smalltalk.addMethod(
  1205. smalltalk.method({
  1206. selector: "onUnknownVariableError:",
  1207. fn: function (anAnnouncement){
  1208. var self=this;
  1209. var error;
  1210. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1211. return smalltalk.withContext(function($ctx1) {
  1212. var $1,$2;
  1213. error=_st(anAnnouncement)._error();
  1214. _st(self)._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1215. return smalltalk.withContext(function($ctx2) {
  1216. $1=stream;
  1217. _st($1)._nextPutAll_(_st(error)._messageText());
  1218. _st($1)._nextPutAll_(_st($String())._cr());
  1219. $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
  1220. return $2;
  1221. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})),(function(){
  1222. return smalltalk.withContext(function($ctx2) {
  1223. return _st(_st(self)._browserModel())._addInstVarNamed_(_st(error)._variableName());
  1224. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1225. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},smalltalk.HLBrowserCodeWidget)})},
  1226. messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "variableName", "browserModel"]}),
  1227. smalltalk.HLBrowserCodeWidget);
  1228. smalltalk.addMethod(
  1229. smalltalk.method({
  1230. selector: "refresh",
  1231. fn: function (){
  1232. var self=this;
  1233. return smalltalk.withContext(function($ctx1) {
  1234. var $1,$2,$3,$4;
  1235. $1=_st(self)._hasModification();
  1236. if(smalltalk.assert($1)){
  1237. $2=self;
  1238. return $2;
  1239. };
  1240. $3=_st(self)._hasFocus();
  1241. if(smalltalk.assert($3)){
  1242. $4=self;
  1243. return $4;
  1244. };
  1245. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedMethod())._source());
  1246. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLBrowserCodeWidget)})},
  1247. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"]}),
  1248. smalltalk.HLBrowserCodeWidget);
  1249. smalltalk.addMethod(
  1250. smalltalk.method({
  1251. selector: "renderButtonsOn:",
  1252. fn: function (html){
  1253. var self=this;
  1254. return smalltalk.withContext(function($ctx1) {
  1255. var $1,$2;
  1256. $1=_st(html)._button();
  1257. _st($1)._class_("button");
  1258. _st($1)._with_("SaveIt");
  1259. $2=_st($1)._onClick_((function(){
  1260. return smalltalk.withContext(function($ctx2) {
  1261. return _st(self)._saveIt();
  1262. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1263. smalltalk.HLNavigationCodeWidget.fn.prototype._renderButtonsOn_.apply(_st(self), [html]);
  1264. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLBrowserCodeWidget)})},
  1265. messageSends: ["class:", "button", "with:", "onClick:", "saveIt", "renderButtonsOn:"]}),
  1266. smalltalk.HLBrowserCodeWidget);
  1267. smalltalk.addMethod(
  1268. smalltalk.method({
  1269. selector: "saveIt",
  1270. fn: function (){
  1271. var self=this;
  1272. return smalltalk.withContext(function($ctx1) {
  1273. _st(_st(self)._browserModel())._saveSourceCode();
  1274. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
  1275. messageSends: ["saveSourceCode", "browserModel"]}),
  1276. smalltalk.HLBrowserCodeWidget);
  1277. smalltalk.addMethod(
  1278. smalltalk.method({
  1279. selector: "unregister",
  1280. fn: function (){
  1281. var self=this;
  1282. return smalltalk.withContext(function($ctx1) {
  1283. smalltalk.HLNavigationCodeWidget.fn.prototype._unregsiter.apply(_st(self), []);
  1284. _st(_st(_st(self)._browserModel())._announcer())._unsubscribe_(self);
  1285. _st(_st(_st(self)._browserModel())._systemAnnouncer())._unsubscribe_(self);
  1286. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLBrowserCodeWidget)})},
  1287. messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"]}),
  1288. smalltalk.HLBrowserCodeWidget);
  1289. smalltalk.addMethod(
  1290. smalltalk.method({
  1291. selector: "canBeOpenAsTab",
  1292. fn: function (){
  1293. var self=this;
  1294. return smalltalk.withContext(function($ctx1) {
  1295. return false;
  1296. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
  1297. messageSends: []}),
  1298. smalltalk.HLBrowserCodeWidget.klass);
  1299. smalltalk.addMethod(
  1300. smalltalk.method({
  1301. selector: "on:",
  1302. fn: function (aBrowserModel){
  1303. var self=this;
  1304. return smalltalk.withContext(function($ctx1) {
  1305. var $2,$3,$1;
  1306. $2=_st(self)._new();
  1307. _st($2)._browserModel_(aBrowserModel);
  1308. $3=_st($2)._yourself();
  1309. $1=$3;
  1310. return $1;
  1311. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
  1312. messageSends: ["browserModel:", "new", "yourself"]}),
  1313. smalltalk.HLBrowserCodeWidget.klass);
  1314. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget', 'transcript'], 'Helios-Workspace');
  1315. smalltalk.addMethod(
  1316. smalltalk.method({
  1317. selector: "canHaveFocus",
  1318. fn: function (){
  1319. var self=this;
  1320. return smalltalk.withContext(function($ctx1) {
  1321. return true;
  1322. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
  1323. messageSends: []}),
  1324. smalltalk.HLWorkspace);
  1325. smalltalk.addMethod(
  1326. smalltalk.method({
  1327. selector: "codeWidget",
  1328. fn: function (){
  1329. var self=this;
  1330. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  1331. return smalltalk.withContext(function($ctx1) {
  1332. var $2,$1;
  1333. $2=self["@codeWidget"];
  1334. if(($receiver = $2) == nil || $receiver == undefined){
  1335. self["@codeWidget"]=_st($HLCodeWidget())._new();
  1336. $1=self["@codeWidget"];
  1337. } else {
  1338. $1=$2;
  1339. };
  1340. return $1;
  1341. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
  1342. messageSends: ["ifNil:", "new"]}),
  1343. smalltalk.HLWorkspace);
  1344. smalltalk.addMethod(
  1345. smalltalk.method({
  1346. selector: "focus",
  1347. fn: function (){
  1348. var self=this;
  1349. return smalltalk.withContext(function($ctx1) {
  1350. var $1;
  1351. $1=_st(_st(self)._codeWidget())._focus();
  1352. return $1;
  1353. }, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
  1354. messageSends: ["focus", "codeWidget"]}),
  1355. smalltalk.HLWorkspace);
  1356. smalltalk.addMethod(
  1357. smalltalk.method({
  1358. selector: "renderContentOn:",
  1359. fn: function (html){
  1360. var self=this;
  1361. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  1362. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  1363. return smalltalk.withContext(function($ctx1) {
  1364. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(_st(self)._codeWidget(),(function(canvas){
  1365. return smalltalk.withContext(function($ctx2) {
  1366. return _st(self)._renderTranscriptOn_(canvas);
  1367. }, function($ctx2) {$ctx2.fillBlock({canvas:canvas},$ctx1)})}))));
  1368. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
  1369. messageSends: ["with:", "with:with:", "codeWidget", "renderTranscriptOn:"]}),
  1370. smalltalk.HLWorkspace);
  1371. smalltalk.addMethod(
  1372. smalltalk.method({
  1373. selector: "renderTranscriptOn:",
  1374. fn: function (html){
  1375. var self=this;
  1376. return smalltalk.withContext(function($ctx1) {
  1377. var $1,$3,$4,$2;
  1378. $1=_st(html)._div();
  1379. _st($1)._class_("transcript-container");
  1380. $2=_st($1)._with_((function(){
  1381. return smalltalk.withContext(function($ctx2) {
  1382. $3=_st(html)._div();
  1383. _st($3)._class_("list-label");
  1384. $4=_st($3)._with_("Transcript");
  1385. $4;
  1386. return _st(_st(self)._transcript())._renderOn_(html);
  1387. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1388. return self}, function($ctx1) {$ctx1.fill(self,"renderTranscriptOn:",{html:html},smalltalk.HLWorkspace)})},
  1389. messageSends: ["class:", "div", "with:", "renderOn:", "transcript"]}),
  1390. smalltalk.HLWorkspace);
  1391. smalltalk.addMethod(
  1392. smalltalk.method({
  1393. selector: "transcript",
  1394. fn: function (){
  1395. var self=this;
  1396. function $HLTranscript(){return smalltalk.HLTranscript||(typeof HLTranscript=="undefined"?nil:HLTranscript)}
  1397. return smalltalk.withContext(function($ctx1) {
  1398. var $2,$1;
  1399. $2=self["@transcript"];
  1400. if(($receiver = $2) == nil || $receiver == undefined){
  1401. self["@transcript"]=_st($HLTranscript())._new();
  1402. $1=self["@transcript"];
  1403. } else {
  1404. $1=$2;
  1405. };
  1406. return $1;
  1407. }, function($ctx1) {$ctx1.fill(self,"transcript",{},smalltalk.HLWorkspace)})},
  1408. messageSends: ["ifNil:", "new"]}),
  1409. smalltalk.HLWorkspace);
  1410. smalltalk.addMethod(
  1411. smalltalk.method({
  1412. selector: "unregister",
  1413. fn: function (){
  1414. var self=this;
  1415. return smalltalk.withContext(function($ctx1) {
  1416. smalltalk.HLWidget.fn.prototype._unregister.apply(_st(self), []);
  1417. _st(_st(self)._transcript())._unregister();
  1418. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLWorkspace)})},
  1419. messageSends: ["unregister", "transcript"]}),
  1420. smalltalk.HLWorkspace);
  1421. smalltalk.addMethod(
  1422. smalltalk.method({
  1423. selector: "canBeOpenAsTab",
  1424. fn: function (){
  1425. var self=this;
  1426. return smalltalk.withContext(function($ctx1) {
  1427. return true;
  1428. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
  1429. messageSends: []}),
  1430. smalltalk.HLWorkspace.klass);
  1431. smalltalk.addMethod(
  1432. smalltalk.method({
  1433. selector: "tabClass",
  1434. fn: function (){
  1435. var self=this;
  1436. return smalltalk.withContext(function($ctx1) {
  1437. return "workspace";
  1438. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLWorkspace.klass)})},
  1439. messageSends: []}),
  1440. smalltalk.HLWorkspace.klass);
  1441. smalltalk.addMethod(
  1442. smalltalk.method({
  1443. selector: "tabLabel",
  1444. fn: function (){
  1445. var self=this;
  1446. return smalltalk.withContext(function($ctx1) {
  1447. return "Workspace";
  1448. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
  1449. messageSends: []}),
  1450. smalltalk.HLWorkspace.klass);
  1451. smalltalk.addMethod(
  1452. smalltalk.method({
  1453. selector: "tabPriority",
  1454. fn: function (){
  1455. var self=this;
  1456. return smalltalk.withContext(function($ctx1) {
  1457. var $1;
  1458. $1=(10);
  1459. return $1;
  1460. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
  1461. messageSends: []}),
  1462. smalltalk.HLWorkspace.klass);