Helios-Workspace.deploy.js 55 KB

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