1
0

Helios-Workspace.deploy.js 56 KB

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