Helios-Workspace.deploy.js 53 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452
  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: "configureEditor",
  782. fn: function (){
  783. var self=this;
  784. return smalltalk.withContext(function($ctx1) {
  785. smalltalk.HLCodeWidget.fn.prototype._configureEditor.apply(_st(self), []);
  786. _st(self)._contents_(_st(self)._methodContents());
  787. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLNavigationCodeWidget)})},
  788. messageSends: ["configureEditor", "contents:", "methodContents"]}),
  789. smalltalk.HLNavigationCodeWidget);
  790. smalltalk.addMethod(
  791. smalltalk.method({
  792. selector: "contents:",
  793. fn: function (aString){
  794. var self=this;
  795. return smalltalk.withContext(function($ctx1) {
  796. _st(self)._methodContents_(aString);
  797. smalltalk.HLCodeWidget.fn.prototype._contents_.apply(_st(self), [aString]);
  798. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  799. messageSends: ["methodContents:", "contents:"]}),
  800. smalltalk.HLNavigationCodeWidget);
  801. smalltalk.addMethod(
  802. smalltalk.method({
  803. selector: "hasModification",
  804. fn: function (){
  805. var self=this;
  806. return smalltalk.withContext(function($ctx1) {
  807. var $1;
  808. $1=_st(_st(_st(self)._methodContents()).__eq(_st(self)._contents()))._not();
  809. return $1;
  810. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLNavigationCodeWidget)})},
  811. messageSends: ["not", "=", "contents", "methodContents"]}),
  812. smalltalk.HLNavigationCodeWidget);
  813. smalltalk.addMethod(
  814. smalltalk.method({
  815. selector: "methodContents",
  816. fn: function (){
  817. var self=this;
  818. return smalltalk.withContext(function($ctx1) {
  819. var $2,$1;
  820. $2=self["@methodContents"];
  821. if(($receiver = $2) == nil || $receiver == undefined){
  822. $1="";
  823. } else {
  824. $1=$2;
  825. };
  826. return $1;
  827. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},smalltalk.HLNavigationCodeWidget)})},
  828. messageSends: ["ifNil:"]}),
  829. smalltalk.HLNavigationCodeWidget);
  830. smalltalk.addMethod(
  831. smalltalk.method({
  832. selector: "methodContents:",
  833. fn: function (aString){
  834. var self=this;
  835. return smalltalk.withContext(function($ctx1) {
  836. var $1;
  837. self["@methodContents"]=aString;
  838. $1=self["@methodContents"];
  839. return $1;
  840. }, function($ctx1) {$ctx1.fill(self,"methodContents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  841. messageSends: []}),
  842. smalltalk.HLNavigationCodeWidget);
  843. smalltalk.addMethod(
  844. smalltalk.method({
  845. selector: "previous",
  846. fn: function (){
  847. var self=this;
  848. return smalltalk.withContext(function($ctx1) {
  849. return self}, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationCodeWidget)})},
  850. messageSends: []}),
  851. smalltalk.HLNavigationCodeWidget);
  852. smalltalk.addMethod(
  853. smalltalk.method({
  854. selector: "previous:",
  855. fn: function (aWidget){
  856. var self=this;
  857. return smalltalk.withContext(function($ctx1) {
  858. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationCodeWidget)})},
  859. messageSends: []}),
  860. smalltalk.HLNavigationCodeWidget);
  861. smalltalk.addMethod(
  862. smalltalk.method({
  863. selector: "canBeOpenAsTab",
  864. fn: function (){
  865. var self=this;
  866. return smalltalk.withContext(function($ctx1) {
  867. return false;
  868. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLNavigationCodeWidget.klass)})},
  869. messageSends: []}),
  870. smalltalk.HLNavigationCodeWidget.klass);
  871. smalltalk.addMethod(
  872. smalltalk.method({
  873. selector: "on:",
  874. fn: function (aBrowserModel){
  875. var self=this;
  876. return smalltalk.withContext(function($ctx1) {
  877. var $2,$3,$1;
  878. $2=_st(self)._new();
  879. _st($2)._browserModel_(aBrowserModel);
  880. $3=_st($2)._yourself();
  881. $1=$3;
  882. return $1;
  883. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLNavigationCodeWidget.klass)})},
  884. messageSends: ["browserModel:", "new", "yourself"]}),
  885. smalltalk.HLNavigationCodeWidget.klass);
  886. smalltalk.addClass('HLBrowserCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  887. smalltalk.addMethod(
  888. smalltalk.method({
  889. selector: "browserModel",
  890. fn: function (){
  891. var self=this;
  892. return smalltalk.withContext(function($ctx1) {
  893. var $1;
  894. $1=self["@browserModel"];
  895. return $1;
  896. }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLSourceCodeWidget)})},
  897. messageSends: []}),
  898. smalltalk.HLBrowserCodeWidget);
  899. smalltalk.addMethod(
  900. smalltalk.method({
  901. selector: "browserModel:",
  902. fn: function (aBrowserModel){
  903. var self=this;
  904. return smalltalk.withContext(function($ctx1) {
  905. var $1,$2;
  906. self["@browserModel"]=aBrowserModel;
  907. $1=self;
  908. _st($1)._observeSystem();
  909. $2=_st($1)._observeBrowserModel();
  910. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget)})},
  911. messageSends: ["observeSystem", "observeBrowserModel"]}),
  912. smalltalk.HLBrowserCodeWidget);
  913. smalltalk.addMethod(
  914. smalltalk.method({
  915. selector: "observeBrowserModel",
  916. fn: function (){
  917. var self=this;
  918. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  919. function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
  920. function $HLSourceCodeSaved(){return smalltalk.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  921. function $HLAboutToChange(){return smalltalk.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  922. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  923. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  924. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  925. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  926. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  927. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  928. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  929. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  930. return smalltalk.withContext(function($ctx1) {
  931. var $1,$2;
  932. $1=_st(_st(self)._browserModel())._announcer();
  933. _st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
  934. _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
  935. _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
  936. _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
  937. _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
  938. _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
  939. _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
  940. _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
  941. _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
  942. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  943. _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
  944. $2=_st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
  945. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLBrowserCodeWidget)})},
  946. messageSends: ["on:send:to:", "announcer", "browserModel"]}),
  947. smalltalk.HLBrowserCodeWidget);
  948. smalltalk.addMethod(
  949. smalltalk.method({
  950. selector: "observeSystem",
  951. fn: function (){
  952. var self=this;
  953. function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  954. return smalltalk.withContext(function($ctx1) {
  955. _st(_st(_st(self)._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
  956. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLBrowserCodeWidget)})},
  957. messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"]}),
  958. smalltalk.HLBrowserCodeWidget);
  959. smalltalk.addMethod(
  960. smalltalk.method({
  961. selector: "onBrowserAboutToChange:",
  962. fn: function (anAnnouncement){
  963. var self=this;
  964. var block;
  965. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  966. return smalltalk.withContext(function($ctx1) {
  967. var $1;
  968. block=_st(anAnnouncement)._actionBlock();
  969. $1=_st(self)._hasModification();
  970. if(smalltalk.assert($1)){
  971. _st(self)._confirm_ifTrue_("Do you want to cancel changes?",(function(){
  972. return smalltalk.withContext(function($ctx2) {
  973. _st(self)._methodContents_(_st(self)._contents());
  974. return _st(block)._value();
  975. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  976. _st($HLChangeForbidden())._signal();
  977. };
  978. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},smalltalk.HLBrowserCodeWidget)})},
  979. messageSends: ["actionBlock", "ifTrue:", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal", "hasModification"]}),
  980. smalltalk.HLBrowserCodeWidget);
  981. smalltalk.addMethod(
  982. smalltalk.method({
  983. selector: "onClassSelected:",
  984. fn: function (anAnnouncement){
  985. var self=this;
  986. var class_;
  987. return smalltalk.withContext(function($ctx1) {
  988. var $1,$2;
  989. class_=_st(anAnnouncement)._item();
  990. $1=class_;
  991. if(($receiver = $1) == nil || $receiver == undefined){
  992. $2=_st(self)._contents_("");
  993. return $2;
  994. } else {
  995. $1;
  996. };
  997. _st(self)._contents_(_st(class_)._definition());
  998. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLBrowserCodeWidget)})},
  999. messageSends: ["item", "ifNil:", "contents:", "definition"]}),
  1000. smalltalk.HLBrowserCodeWidget);
  1001. smalltalk.addMethod(
  1002. smalltalk.method({
  1003. selector: "onCompileError:",
  1004. fn: function (anAnnouncement){
  1005. var self=this;
  1006. return smalltalk.withContext(function($ctx1) {
  1007. _st(self)._alert_(_st(_st(anAnnouncement)._error())._messageText());
  1008. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1009. messageSends: ["alert:", "messageText", "error"]}),
  1010. smalltalk.HLBrowserCodeWidget);
  1011. smalltalk.addMethod(
  1012. smalltalk.method({
  1013. selector: "onInstVarAdded",
  1014. fn: function (){
  1015. var self=this;
  1016. return smalltalk.withContext(function($ctx1) {
  1017. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1018. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLBrowserCodeWidget)})},
  1019. messageSends: ["save:", "contents", "browserModel"]}),
  1020. smalltalk.HLBrowserCodeWidget);
  1021. smalltalk.addMethod(
  1022. smalltalk.method({
  1023. selector: "onMethodModified:",
  1024. fn: function (anAnnouncement){
  1025. var self=this;
  1026. var method;
  1027. return smalltalk.withContext(function($ctx1) {
  1028. var $1,$2,$3,$4,$5,$6;
  1029. method=_st(anAnnouncement)._method();
  1030. $1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(method)._methodClass());
  1031. if(! smalltalk.assert($1)){
  1032. $2=self;
  1033. return $2;
  1034. };
  1035. $3=_st(_st(self)._browserModel())._selectedMethod();
  1036. if(($receiver = $3) == nil || $receiver == undefined){
  1037. $4=self;
  1038. return $4;
  1039. } else {
  1040. $3;
  1041. };
  1042. $5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(method)._selector());
  1043. if(! smalltalk.assert($5)){
  1044. $6=self;
  1045. return $6;
  1046. };
  1047. _st(self)._refresh();
  1048. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1049. messageSends: ["method", "ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"]}),
  1050. smalltalk.HLBrowserCodeWidget);
  1051. smalltalk.addMethod(
  1052. smalltalk.method({
  1053. selector: "onMethodSelected:",
  1054. fn: function (anAnnouncement){
  1055. var self=this;
  1056. var method;
  1057. return smalltalk.withContext(function($ctx1) {
  1058. var $1,$2;
  1059. method=_st(anAnnouncement)._item();
  1060. $1=method;
  1061. if(($receiver = $1) == nil || $receiver == undefined){
  1062. $2=_st(self)._contents_("");
  1063. return $2;
  1064. } else {
  1065. $1;
  1066. };
  1067. _st(self)._contents_(_st(method)._source());
  1068. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1069. messageSends: ["item", "ifNil:", "contents:", "source"]}),
  1070. smalltalk.HLBrowserCodeWidget);
  1071. smalltalk.addMethod(
  1072. smalltalk.method({
  1073. selector: "onParseError:",
  1074. fn: function (anAnnouncement){
  1075. var self=this;
  1076. var lineIndex,newContents;
  1077. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1078. return smalltalk.withContext(function($ctx1) {
  1079. var $1,$2,$3;
  1080. lineIndex=(1);
  1081. _st(self)._contents_(_st($String())._streamContents_((function(stream){
  1082. return smalltalk.withContext(function($ctx2) {
  1083. return _st(_st(self)._contents())._linesDo_((function(each){
  1084. return smalltalk.withContext(function($ctx3) {
  1085. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1086. if(smalltalk.assert($1)){
  1087. $2=stream;
  1088. _st($2)._nextPutAll_(_st(each)._copyFrom_to_((1),_st(anAnnouncement)._column()));
  1089. _st($2)._nextPutAll_("<- ");
  1090. _st($2)._nextPutAll_(_st(anAnnouncement)._message());
  1091. _st($2)._nextPutAll_(" ");
  1092. $3=_st($2)._nextPutAll_(_st(each)._copyFrom_to_(_st(_st(anAnnouncement)._column()).__plus((1)),_st(each)._size()));
  1093. $3;
  1094. } else {
  1095. _st(stream)._nextPutAll_(each);
  1096. };
  1097. _st(stream)._nextPutAll_(_st($String())._cr());
  1098. lineIndex=_st(lineIndex).__plus((1));
  1099. return lineIndex;
  1100. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1101. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1102. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
  1103. messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"]}),
  1104. smalltalk.HLBrowserCodeWidget);
  1105. smalltalk.addMethod(
  1106. smalltalk.method({
  1107. selector: "onProtocolSelected:",
  1108. fn: function (anAnnouncement){
  1109. var self=this;
  1110. return smalltalk.withContext(function($ctx1) {
  1111. var $1,$2;
  1112. $1=_st(_st(self)._browserModel())._selectedClass();
  1113. if(($receiver = $1) == nil || $receiver == undefined){
  1114. $2=_st(self)._contents_("");
  1115. return $2;
  1116. } else {
  1117. $1;
  1118. };
  1119. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1120. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1121. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"]}),
  1122. smalltalk.HLBrowserCodeWidget);
  1123. smalltalk.addMethod(
  1124. smalltalk.method({
  1125. selector: "onSaveIt",
  1126. fn: function (){
  1127. var self=this;
  1128. return smalltalk.withContext(function($ctx1) {
  1129. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1130. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
  1131. messageSends: ["save:", "contents", "browserModel"]}),
  1132. smalltalk.HLBrowserCodeWidget);
  1133. smalltalk.addMethod(
  1134. smalltalk.method({
  1135. selector: "onShowInstanceToggled",
  1136. fn: function (){
  1137. var self=this;
  1138. return smalltalk.withContext(function($ctx1) {
  1139. var $1,$2;
  1140. $1=_st(_st(self)._browserModel())._selectedClass();
  1141. if(($receiver = $1) == nil || $receiver == undefined){
  1142. $2=_st(self)._contents_("");
  1143. return $2;
  1144. } else {
  1145. $1;
  1146. };
  1147. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1148. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},smalltalk.HLBrowserCodeWidget)})},
  1149. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"]}),
  1150. smalltalk.HLBrowserCodeWidget);
  1151. smalltalk.addMethod(
  1152. smalltalk.method({
  1153. selector: "onSourceCodeFocusRequested",
  1154. fn: function (){
  1155. var self=this;
  1156. return smalltalk.withContext(function($ctx1) {
  1157. _st(self)._focus();
  1158. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLSourceCodeWidget)})},
  1159. messageSends: ["focus"]}),
  1160. smalltalk.HLBrowserCodeWidget);
  1161. smalltalk.addMethod(
  1162. smalltalk.method({
  1163. selector: "onSourceCodeSaved",
  1164. fn: function (){
  1165. var self=this;
  1166. return smalltalk.withContext(function($ctx1) {
  1167. _st(self)._methodContents_(_st(self)._contents());
  1168. _st(self)._updateState();
  1169. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},smalltalk.HLBrowserCodeWidget)})},
  1170. messageSends: ["methodContents:", "contents", "updateState"]}),
  1171. smalltalk.HLBrowserCodeWidget);
  1172. smalltalk.addMethod(
  1173. smalltalk.method({
  1174. selector: "onUnknownVariableError:",
  1175. fn: function (anAnnouncement){
  1176. var self=this;
  1177. var error;
  1178. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1179. return smalltalk.withContext(function($ctx1) {
  1180. var $1,$2;
  1181. error=_st(anAnnouncement)._error();
  1182. _st(self)._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1183. return smalltalk.withContext(function($ctx2) {
  1184. $1=stream;
  1185. _st($1)._nextPutAll_(_st(error)._messageText());
  1186. _st($1)._nextPutAll_(_st($String())._cr());
  1187. $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
  1188. return $2;
  1189. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})),(function(){
  1190. return smalltalk.withContext(function($ctx2) {
  1191. return _st(_st(self)._browserModel())._addInstVarNamed_(_st(error)._variableName());
  1192. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1193. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},smalltalk.HLBrowserCodeWidget)})},
  1194. messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "variableName", "browserModel"]}),
  1195. smalltalk.HLBrowserCodeWidget);
  1196. smalltalk.addMethod(
  1197. smalltalk.method({
  1198. selector: "refresh",
  1199. fn: function (){
  1200. var self=this;
  1201. return smalltalk.withContext(function($ctx1) {
  1202. var $1,$2,$3,$4;
  1203. $1=_st(self)._hasModification();
  1204. if(smalltalk.assert($1)){
  1205. $2=self;
  1206. return $2;
  1207. };
  1208. $3=_st(self)._hasFocus();
  1209. if(smalltalk.assert($3)){
  1210. $4=self;
  1211. return $4;
  1212. };
  1213. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedMethod())._source());
  1214. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLBrowserCodeWidget)})},
  1215. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"]}),
  1216. smalltalk.HLBrowserCodeWidget);
  1217. smalltalk.addMethod(
  1218. smalltalk.method({
  1219. selector: "saveIt",
  1220. fn: function (){
  1221. var self=this;
  1222. return smalltalk.withContext(function($ctx1) {
  1223. _st(_st(self)._browserModel())._saveSourceCode();
  1224. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
  1225. messageSends: ["saveSourceCode", "browserModel"]}),
  1226. smalltalk.HLBrowserCodeWidget);
  1227. smalltalk.addMethod(
  1228. smalltalk.method({
  1229. selector: "unregister",
  1230. fn: function (){
  1231. var self=this;
  1232. return smalltalk.withContext(function($ctx1) {
  1233. smalltalk.HLNavigationCodeWidget.fn.prototype._unregsiter.apply(_st(self), []);
  1234. _st(_st(_st(self)._browserModel())._announcer())._unsubscribe_(self);
  1235. _st(_st(_st(self)._browserModel())._systemAnnouncer())._unsubscribe_(self);
  1236. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLBrowserCodeWidget)})},
  1237. messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"]}),
  1238. smalltalk.HLBrowserCodeWidget);
  1239. smalltalk.addMethod(
  1240. smalltalk.method({
  1241. selector: "canBeOpenAsTab",
  1242. fn: function (){
  1243. var self=this;
  1244. return smalltalk.withContext(function($ctx1) {
  1245. return false;
  1246. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
  1247. messageSends: []}),
  1248. smalltalk.HLBrowserCodeWidget.klass);
  1249. smalltalk.addMethod(
  1250. smalltalk.method({
  1251. selector: "on:",
  1252. fn: function (aBrowserModel){
  1253. var self=this;
  1254. return smalltalk.withContext(function($ctx1) {
  1255. var $2,$3,$1;
  1256. $2=_st(self)._new();
  1257. _st($2)._browserModel_(aBrowserModel);
  1258. $3=_st($2)._yourself();
  1259. $1=$3;
  1260. return $1;
  1261. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
  1262. messageSends: ["browserModel:", "new", "yourself"]}),
  1263. smalltalk.HLBrowserCodeWidget.klass);
  1264. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget'], 'Helios-Workspace');
  1265. smalltalk.addMethod(
  1266. smalltalk.method({
  1267. selector: "canHaveFocus",
  1268. fn: function (){
  1269. var self=this;
  1270. return smalltalk.withContext(function($ctx1) {
  1271. return true;
  1272. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
  1273. messageSends: []}),
  1274. smalltalk.HLWorkspace);
  1275. smalltalk.addMethod(
  1276. smalltalk.method({
  1277. selector: "codeWidget",
  1278. fn: function (){
  1279. var self=this;
  1280. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  1281. return smalltalk.withContext(function($ctx1) {
  1282. var $2,$1;
  1283. $2=self["@codeWidget"];
  1284. if(($receiver = $2) == nil || $receiver == undefined){
  1285. self["@codeWidget"]=_st($HLCodeWidget())._new();
  1286. $1=self["@codeWidget"];
  1287. } else {
  1288. $1=$2;
  1289. };
  1290. return $1;
  1291. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
  1292. messageSends: ["ifNil:", "new"]}),
  1293. smalltalk.HLWorkspace);
  1294. smalltalk.addMethod(
  1295. smalltalk.method({
  1296. selector: "focus",
  1297. fn: function (){
  1298. var self=this;
  1299. return smalltalk.withContext(function($ctx1) {
  1300. var $1;
  1301. $1=_st(_st(self)._codeWidget())._focus();
  1302. return $1;
  1303. }, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
  1304. messageSends: ["focus", "codeWidget"]}),
  1305. smalltalk.HLWorkspace);
  1306. smalltalk.addMethod(
  1307. smalltalk.method({
  1308. selector: "renderContentOn:",
  1309. fn: function (html){
  1310. var self=this;
  1311. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  1312. return smalltalk.withContext(function($ctx1) {
  1313. _st(html)._with_(_st($HLContainer())._with_(_st(self)._codeWidget()));
  1314. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
  1315. messageSends: ["with:", "codeWidget"]}),
  1316. smalltalk.HLWorkspace);
  1317. smalltalk.addMethod(
  1318. smalltalk.method({
  1319. selector: "canBeOpenAsTab",
  1320. fn: function (){
  1321. var self=this;
  1322. return smalltalk.withContext(function($ctx1) {
  1323. return true;
  1324. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
  1325. messageSends: []}),
  1326. smalltalk.HLWorkspace.klass);
  1327. smalltalk.addMethod(
  1328. smalltalk.method({
  1329. selector: "tabLabel",
  1330. fn: function (){
  1331. var self=this;
  1332. return smalltalk.withContext(function($ctx1) {
  1333. return "Workspace";
  1334. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
  1335. messageSends: []}),
  1336. smalltalk.HLWorkspace.klass);
  1337. smalltalk.addMethod(
  1338. smalltalk.method({
  1339. selector: "tabPriority",
  1340. fn: function (){
  1341. var self=this;
  1342. return smalltalk.withContext(function($ctx1) {
  1343. var $1;
  1344. $1=(10);
  1345. return $1;
  1346. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
  1347. messageSends: []}),
  1348. smalltalk.HLWorkspace.klass);