Helios-Workspace.deploy.js 58 KB

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