Helios-Workspace.deploy.js 53 KB

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