Helios-Workspace.deploy.js 55 KB

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