Helios-Workspace.deploy.js 48 KB

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