Helios-Workspace.js 84 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256
  1. define("amber_core/Helios-Workspace", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects", "amber_core/Helios-Core"], function(smalltalk,nil,_st, globals){
  2. smalltalk.addPackage('Helios-Workspace');
  3. smalltalk.packages["Helios-Workspace"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('HLCodeModel', globals.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "announcer",
  8. protocol: 'accessing',
  9. fn: function (){
  10. var self=this;
  11. function $Announcer(){return globals.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  12. return smalltalk.withContext(function($ctx1) {
  13. var $2,$1;
  14. $2=self["@announcer"];
  15. if(($receiver = $2) == nil || $receiver == null){
  16. self["@announcer"]=_st($Announcer())._new();
  17. $1=self["@announcer"];
  18. } else {
  19. $1=$2;
  20. };
  21. return $1;
  22. }, function($ctx1) {$ctx1.fill(self,"announcer",{},globals.HLCodeModel)})},
  23. args: [],
  24. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  25. messageSends: ["ifNil:", "new"],
  26. referencedClasses: ["Announcer"]
  27. }),
  28. globals.HLCodeModel);
  29. smalltalk.addMethod(
  30. smalltalk.method({
  31. selector: "defaultReceiver",
  32. protocol: 'defaults',
  33. fn: function (){
  34. var self=this;
  35. return smalltalk.withContext(function($ctx1) {
  36. var $1;
  37. $1=_st(self._environment())._doItReceiver();
  38. return $1;
  39. }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{},globals.HLCodeModel)})},
  40. args: [],
  41. source: "defaultReceiver\x0a\x09^ self environment doItReceiver",
  42. messageSends: ["doItReceiver", "environment"],
  43. referencedClasses: []
  44. }),
  45. globals.HLCodeModel);
  46. smalltalk.addMethod(
  47. smalltalk.method({
  48. selector: "doIt:",
  49. protocol: 'actions',
  50. fn: function (aString){
  51. var self=this;
  52. function $ErrorHandler(){return globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  53. return smalltalk.withContext(function($ctx1) {
  54. var $1;
  55. $1=self._try_catch_((function(){
  56. return smalltalk.withContext(function($ctx2) {
  57. return _st(self._environment())._eval_on_(aString,self._receiver());
  58. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}),(function(e){
  59. return smalltalk.withContext(function($ctx2) {
  60. _st($ErrorHandler())._handleError_(e);
  61. return nil;
  62. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,2)})}));
  63. return $1;
  64. }, function($ctx1) {$ctx1.fill(self,"doIt:",{aString:aString},globals.HLCodeModel)})},
  65. args: ["aString"],
  66. source: "doIt: aString\x0a\x09\x22Evaluate aString in the receiver's `environment`.\x0a\x09\x0a\x09Note: Catch any error and handle it manually, bypassing\x0a\x09boot.js behavior to avoid the browser default action on\x0a\x09ctrl+d/ctrl+p.\x0a\x09\x0a\x09See https://github.com/amber-smalltalk/amber/issues/882\x22\x0a\x0a\x09^ self \x0a\x09\x09try: [ self environment eval: aString on: self receiver ]\x0a\x09\x09catch: [ :e | \x0a\x09\x09\x09ErrorHandler handleError: e.\x0a\x09\x09\x09nil ]",
  67. messageSends: ["try:catch:", "eval:on:", "environment", "receiver", "handleError:"],
  68. referencedClasses: ["ErrorHandler"]
  69. }),
  70. globals.HLCodeModel);
  71. smalltalk.addMethod(
  72. smalltalk.method({
  73. selector: "environment",
  74. protocol: 'accessing',
  75. fn: function (){
  76. var self=this;
  77. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  78. return smalltalk.withContext(function($ctx1) {
  79. var $2,$1;
  80. $2=self["@environment"];
  81. if(($receiver = $2) == nil || $receiver == null){
  82. $1=_st(_st($HLManager())._current())._environment();
  83. } else {
  84. $1=$2;
  85. };
  86. return $1;
  87. }, function($ctx1) {$ctx1.fill(self,"environment",{},globals.HLCodeModel)})},
  88. args: [],
  89. source: "environment\x0a\x09^ environment ifNil: [ HLManager current environment ]",
  90. messageSends: ["ifNil:", "environment", "current"],
  91. referencedClasses: ["HLManager"]
  92. }),
  93. globals.HLCodeModel);
  94. smalltalk.addMethod(
  95. smalltalk.method({
  96. selector: "environment:",
  97. protocol: 'accessing',
  98. fn: function (anEnvironment){
  99. var self=this;
  100. self["@environment"]=anEnvironment;
  101. return self},
  102. args: ["anEnvironment"],
  103. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  104. messageSends: [],
  105. referencedClasses: []
  106. }),
  107. globals.HLCodeModel);
  108. smalltalk.addMethod(
  109. smalltalk.method({
  110. selector: "inspect:",
  111. protocol: 'actions',
  112. fn: function (anObject){
  113. var self=this;
  114. return smalltalk.withContext(function($ctx1) {
  115. _st(self._environment())._inspect_(anObject);
  116. return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},globals.HLCodeModel)})},
  117. args: ["anObject"],
  118. source: "inspect: anObject\x0a\x09self environment inspect: anObject",
  119. messageSends: ["inspect:", "environment"],
  120. referencedClasses: []
  121. }),
  122. globals.HLCodeModel);
  123. smalltalk.addMethod(
  124. smalltalk.method({
  125. selector: "receiver",
  126. protocol: 'accessing',
  127. fn: function (){
  128. var self=this;
  129. return smalltalk.withContext(function($ctx1) {
  130. var $2,$1;
  131. $2=self["@receiver"];
  132. if(($receiver = $2) == nil || $receiver == null){
  133. self["@receiver"]=self._defaultReceiver();
  134. $1=self["@receiver"];
  135. } else {
  136. $1=$2;
  137. };
  138. return $1;
  139. }, function($ctx1) {$ctx1.fill(self,"receiver",{},globals.HLCodeModel)})},
  140. args: [],
  141. source: "receiver\x0a\x09^ receiver ifNil: [ receiver := self defaultReceiver ]",
  142. messageSends: ["ifNil:", "defaultReceiver"],
  143. referencedClasses: []
  144. }),
  145. globals.HLCodeModel);
  146. smalltalk.addMethod(
  147. smalltalk.method({
  148. selector: "receiver:",
  149. protocol: 'accessing',
  150. fn: function (anObject){
  151. var self=this;
  152. self["@receiver"]=anObject;
  153. return self},
  154. args: ["anObject"],
  155. source: "receiver: anObject\x0a\x09receiver := anObject",
  156. messageSends: [],
  157. referencedClasses: []
  158. }),
  159. globals.HLCodeModel);
  160. smalltalk.addMethod(
  161. smalltalk.method({
  162. selector: "on:",
  163. protocol: 'actions',
  164. fn: function (anEnvironment){
  165. var self=this;
  166. return smalltalk.withContext(function($ctx1) {
  167. var $2,$3,$1;
  168. $2=self._new();
  169. _st($2)._environment_(anEnvironment);
  170. $3=_st($2)._yourself();
  171. $1=$3;
  172. return $1;
  173. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},globals.HLCodeModel.klass)})},
  174. args: ["anEnvironment"],
  175. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  176. messageSends: ["environment:", "new", "yourself"],
  177. referencedClasses: []
  178. }),
  179. globals.HLCodeModel.klass);
  180. smalltalk.addClass('HLCodeWidget', globals.HLWidget, ['model', 'wrapper', 'code', 'editor', 'state'], 'Helios-Workspace');
  181. smalltalk.addMethod(
  182. smalltalk.method({
  183. selector: "announcer",
  184. protocol: 'accessing',
  185. fn: function (){
  186. var self=this;
  187. return smalltalk.withContext(function($ctx1) {
  188. var $1;
  189. $1=_st(self._model())._announcer();
  190. return $1;
  191. }, function($ctx1) {$ctx1.fill(self,"announcer",{},globals.HLCodeWidget)})},
  192. args: [],
  193. source: "announcer\x0a\x09^ self model announcer",
  194. messageSends: ["announcer", "model"],
  195. referencedClasses: []
  196. }),
  197. globals.HLCodeWidget);
  198. smalltalk.addMethod(
  199. smalltalk.method({
  200. selector: "canHaveFocus",
  201. protocol: 'testing',
  202. fn: function (){
  203. var self=this;
  204. return true;
  205. },
  206. args: [],
  207. source: "canHaveFocus\x0a\x09^ true",
  208. messageSends: [],
  209. referencedClasses: []
  210. }),
  211. globals.HLCodeWidget);
  212. smalltalk.addMethod(
  213. smalltalk.method({
  214. selector: "clear",
  215. protocol: 'actions',
  216. fn: function (){
  217. var self=this;
  218. return smalltalk.withContext(function($ctx1) {
  219. self._contents_("");
  220. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},globals.HLCodeWidget)})},
  221. args: [],
  222. source: "clear\x0a\x09self contents: ''",
  223. messageSends: ["contents:"],
  224. referencedClasses: []
  225. }),
  226. globals.HLCodeWidget);
  227. smalltalk.addMethod(
  228. smalltalk.method({
  229. selector: "configureEditor",
  230. protocol: 'actions',
  231. fn: function (){
  232. var self=this;
  233. return smalltalk.withContext(function($ctx1) {
  234. var $1;
  235. $1=self._editor();
  236. $ctx1.sendIdx["editor"]=1;
  237. _st($1)._at_put_("amberCodeWidget",self);
  238. _st(self._editor())._on_do_("change",(function(){
  239. return smalltalk.withContext(function($ctx2) {
  240. return self._onChange();
  241. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  242. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},globals.HLCodeWidget)})},
  243. args: [],
  244. source: "configureEditor\x0a\x09self editor at: 'amberCodeWidget' put: self.\x0a\x09self editor on: 'change' do: [ self onChange ]",
  245. messageSends: ["at:put:", "editor", "on:do:", "onChange"],
  246. referencedClasses: []
  247. }),
  248. globals.HLCodeWidget);
  249. smalltalk.addMethod(
  250. smalltalk.method({
  251. selector: "contents",
  252. protocol: 'accessing',
  253. fn: function (){
  254. var self=this;
  255. return smalltalk.withContext(function($ctx1) {
  256. var $1;
  257. $1=_st(self["@editor"])._getValue();
  258. return $1;
  259. }, function($ctx1) {$ctx1.fill(self,"contents",{},globals.HLCodeWidget)})},
  260. args: [],
  261. source: "contents\x0a\x09^ editor getValue",
  262. messageSends: ["getValue"],
  263. referencedClasses: []
  264. }),
  265. globals.HLCodeWidget);
  266. smalltalk.addMethod(
  267. smalltalk.method({
  268. selector: "contents:",
  269. protocol: 'accessing',
  270. fn: function (aString){
  271. var self=this;
  272. return smalltalk.withContext(function($ctx1) {
  273. var $1;
  274. _st(self["@editor"])._setValue_(aString);
  275. $1=self["@state"];
  276. if(($receiver = $1) == nil || $receiver == null){
  277. $1;
  278. } else {
  279. self._updateState();
  280. };
  281. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},globals.HLCodeWidget)})},
  282. args: ["aString"],
  283. source: "contents: aString\x0a\x09editor setValue: aString.\x0a\x09state ifNotNil: [ self updateState ]",
  284. messageSends: ["setValue:", "ifNotNil:", "updateState"],
  285. referencedClasses: []
  286. }),
  287. globals.HLCodeWidget);
  288. smalltalk.addMethod(
  289. smalltalk.method({
  290. selector: "currentLine",
  291. protocol: 'accessing',
  292. fn: function (){
  293. var self=this;
  294. return smalltalk.withContext(function($ctx1) {
  295. var $1;
  296. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  297. return $1;
  298. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},globals.HLCodeWidget)})},
  299. args: [],
  300. source: "currentLine\x0a ^editor getLine: (editor getCursor line)",
  301. messageSends: ["getLine:", "line", "getCursor"],
  302. referencedClasses: []
  303. }),
  304. globals.HLCodeWidget);
  305. smalltalk.addMethod(
  306. smalltalk.method({
  307. selector: "currentLineOrSelection",
  308. protocol: 'accessing',
  309. fn: function (){
  310. var self=this;
  311. return smalltalk.withContext(function($ctx1) {
  312. var $2,$1;
  313. $2=_st(self["@editor"])._somethingSelected();
  314. if(smalltalk.assert($2)){
  315. $1=self._selection();
  316. } else {
  317. $1=self._currentLine();
  318. };
  319. return $1;
  320. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},globals.HLCodeWidget)})},
  321. args: [],
  322. source: "currentLineOrSelection\x0a ^editor somethingSelected\x0a\x09\x09ifFalse: [ self currentLine ]\x0a\x09\x09ifTrue: [ self selection ]",
  323. messageSends: ["ifFalse:ifTrue:", "somethingSelected", "currentLine", "selection"],
  324. referencedClasses: []
  325. }),
  326. globals.HLCodeWidget);
  327. smalltalk.addMethod(
  328. smalltalk.method({
  329. selector: "doIt",
  330. protocol: 'actions',
  331. fn: function (){
  332. var self=this;
  333. var result;
  334. function $HLDoItRequested(){return globals.HLDoItRequested||(typeof HLDoItRequested=="undefined"?nil:HLDoItRequested)}
  335. function $HLDoItExecuted(){return globals.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
  336. return smalltalk.withContext(function($ctx1) {
  337. var $2,$1,$3,$4;
  338. $2=self._model();
  339. $ctx1.sendIdx["model"]=1;
  340. $1=_st($2)._announcer();
  341. $ctx1.sendIdx["announcer"]=1;
  342. $3=_st($HLDoItRequested())._on_(self["@model"]);
  343. $ctx1.sendIdx["on:"]=1;
  344. _st($1)._announce_($3);
  345. $ctx1.sendIdx["announce:"]=1;
  346. result=_st(self["@model"])._doIt_(self._currentLineOrSelection());
  347. _st(_st(self._model())._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
  348. $4=result;
  349. return $4;
  350. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},globals.HLCodeWidget)})},
  351. args: [],
  352. source: "doIt\x0a\x09| result |\x0a\x0a\x09self model announcer announce: (HLDoItRequested on: model).\x0a\x09result := model doIt: self currentLineOrSelection.\x0a\x09self model announcer announce: (HLDoItExecuted on: model).\x0a\x0a\x09^ result",
  353. messageSends: ["announce:", "announcer", "model", "on:", "doIt:", "currentLineOrSelection"],
  354. referencedClasses: ["HLDoItRequested", "HLDoItExecuted"]
  355. }),
  356. globals.HLCodeWidget);
  357. smalltalk.addMethod(
  358. smalltalk.method({
  359. selector: "editor",
  360. protocol: 'actions',
  361. fn: function (){
  362. var self=this;
  363. var $1;
  364. $1=self["@editor"];
  365. return $1;
  366. },
  367. args: [],
  368. source: "editor\x0a\x09^ editor",
  369. messageSends: [],
  370. referencedClasses: []
  371. }),
  372. globals.HLCodeWidget);
  373. smalltalk.addMethod(
  374. smalltalk.method({
  375. selector: "editorOptions",
  376. protocol: 'accessing',
  377. fn: function (){
  378. var self=this;
  379. function $HashedCollection(){return globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  380. return smalltalk.withContext(function($ctx1) {
  381. var $2,$1;
  382. $2="helios.codeMirrorTheme"._settingValueIfAbsent_("default helios");
  383. $ctx1.sendIdx["settingValueIfAbsent:"]=1;
  384. $1=globals.HashedCollection._newFromPairs_(["theme",$2,"mode","text/x-stsrc","lineNumbers",true,"enterMode","flat","indentWithTabs",true,"indentUnit",(4),"matchBrackets",true,"electricChars",false,"keyMap","Amber","extraKeys",_st($HashedCollection())._with_(_st("helios.completionKey"._settingValueIfAbsent_("Shift-Space")).__minus_gt("autocomplete"))]);
  385. return $1;
  386. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},globals.HLCodeWidget)})},
  387. args: [],
  388. source: "editorOptions\x0a\x09^ #{\x0a\x09\x09'theme' -> ('helios.codeMirrorTheme' settingValueIfAbsent: 'default helios').\x0a\x09\x09'mode' -> 'text/x-stsrc'.\x0a 'lineNumbers' -> true.\x0a 'enterMode' -> 'flat'.\x0a 'indentWithTabs' -> true.\x0a\x09\x09'indentUnit' -> 4.\x0a 'matchBrackets' -> true.\x0a 'electricChars' -> false.\x0a\x09\x09'keyMap' -> 'Amber'.\x0a\x09\x09'extraKeys' -> (HashedCollection with: ('helios.completionKey' settingValueIfAbsent: 'Shift-Space') -> 'autocomplete')\x0a\x09}",
  389. messageSends: ["settingValueIfAbsent:", "with:", "->"],
  390. referencedClasses: ["HashedCollection"]
  391. }),
  392. globals.HLCodeWidget);
  393. smalltalk.addMethod(
  394. smalltalk.method({
  395. selector: "focus",
  396. protocol: 'actions',
  397. fn: function (){
  398. var self=this;
  399. return smalltalk.withContext(function($ctx1) {
  400. _st(self["@editor"])._focus();
  401. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLCodeWidget)})},
  402. args: [],
  403. source: "focus\x0a\x09editor focus",
  404. messageSends: ["focus"],
  405. referencedClasses: []
  406. }),
  407. globals.HLCodeWidget);
  408. smalltalk.addMethod(
  409. smalltalk.method({
  410. selector: "hasFocus",
  411. protocol: 'testing',
  412. fn: function (){
  413. var self=this;
  414. return smalltalk.withContext(function($ctx1) {
  415. var $1;
  416. $1=_st(_st(self["@code"])._asJQuery())._is_(":active");
  417. return $1;
  418. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},globals.HLCodeWidget)})},
  419. args: [],
  420. source: "hasFocus\x0a\x09^ code asJQuery is: ':active'",
  421. messageSends: ["is:", "asJQuery"],
  422. referencedClasses: []
  423. }),
  424. globals.HLCodeWidget);
  425. smalltalk.addMethod(
  426. smalltalk.method({
  427. selector: "hasModification",
  428. protocol: 'testing',
  429. fn: function (){
  430. var self=this;
  431. return false;
  432. },
  433. args: [],
  434. source: "hasModification\x0a\x09^ false",
  435. messageSends: [],
  436. referencedClasses: []
  437. }),
  438. globals.HLCodeWidget);
  439. smalltalk.addMethod(
  440. smalltalk.method({
  441. selector: "inspectIt",
  442. protocol: 'actions',
  443. fn: function (){
  444. var self=this;
  445. var newInspector;
  446. function $HLInspectItRequested(){return globals.HLInspectItRequested||(typeof HLInspectItRequested=="undefined"?nil:HLInspectItRequested)}
  447. return smalltalk.withContext(function($ctx1) {
  448. var $2,$1;
  449. $2=self._model();
  450. $ctx1.sendIdx["model"]=1;
  451. $1=_st($2)._announcer();
  452. _st($1)._announce_(_st($HLInspectItRequested())._on_(self["@model"]));
  453. _st(self._model())._inspect_(self._doIt());
  454. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},globals.HLCodeWidget)})},
  455. args: [],
  456. source: "inspectIt\x0a\x09| newInspector |\x0a \x0a\x09self model announcer announce: (HLInspectItRequested on: model).\x0a\x09self model inspect: self doIt",
  457. messageSends: ["announce:", "announcer", "model", "on:", "inspect:", "doIt"],
  458. referencedClasses: ["HLInspectItRequested"]
  459. }),
  460. globals.HLCodeWidget);
  461. smalltalk.addMethod(
  462. smalltalk.method({
  463. selector: "messageHintFor:token:",
  464. protocol: 'hints',
  465. fn: function (anEditor,aToken){
  466. var self=this;
  467. function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  468. return smalltalk.withContext(function($ctx1) {
  469. var $2,$1;
  470. $1=_st(_st(_st(_st(_st($Smalltalk())._vm())._allSelectors())._asArray())._select_((function(each){
  471. return smalltalk.withContext(function($ctx2) {
  472. $2=_st(aToken)._string();
  473. $ctx2.sendIdx["string"]=1;
  474. return _st(each)._includesSubString_($2);
  475. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})})))._reject_((function(each){
  476. return smalltalk.withContext(function($ctx2) {
  477. return _st(each).__eq(_st(aToken)._string());
  478. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  479. return $1;
  480. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},globals.HLCodeWidget)})},
  481. args: ["anEditor", "aToken"],
  482. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (Smalltalk vm allSelectors asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
  483. messageSends: ["reject:", "select:", "asArray", "allSelectors", "vm", "includesSubString:", "string", "="],
  484. referencedClasses: ["Smalltalk"]
  485. }),
  486. globals.HLCodeWidget);
  487. smalltalk.addMethod(
  488. smalltalk.method({
  489. selector: "model",
  490. protocol: 'accessing',
  491. fn: function (){
  492. var self=this;
  493. function $HLCodeModel(){return globals.HLCodeModel||(typeof HLCodeModel=="undefined"?nil:HLCodeModel)}
  494. return smalltalk.withContext(function($ctx1) {
  495. var $2,$1;
  496. $2=self["@model"];
  497. if(($receiver = $2) == nil || $receiver == null){
  498. self["@model"]=_st($HLCodeModel())._new();
  499. $1=self["@model"];
  500. } else {
  501. $1=$2;
  502. };
  503. return $1;
  504. }, function($ctx1) {$ctx1.fill(self,"model",{},globals.HLCodeWidget)})},
  505. args: [],
  506. source: "model\x0a\x09^ model ifNil: [ model := HLCodeModel new ]",
  507. messageSends: ["ifNil:", "new"],
  508. referencedClasses: ["HLCodeModel"]
  509. }),
  510. globals.HLCodeWidget);
  511. smalltalk.addMethod(
  512. smalltalk.method({
  513. selector: "model:",
  514. protocol: 'accessing',
  515. fn: function (aModel){
  516. var self=this;
  517. self["@model"]=aModel;
  518. return self},
  519. args: ["aModel"],
  520. source: "model: aModel\x0a\x09model := aModel",
  521. messageSends: [],
  522. referencedClasses: []
  523. }),
  524. globals.HLCodeWidget);
  525. smalltalk.addMethod(
  526. smalltalk.method({
  527. selector: "onChange",
  528. protocol: 'reactions',
  529. fn: function (){
  530. var self=this;
  531. return smalltalk.withContext(function($ctx1) {
  532. self._updateState();
  533. return self}, function($ctx1) {$ctx1.fill(self,"onChange",{},globals.HLCodeWidget)})},
  534. args: [],
  535. source: "onChange\x0a\x09self updateState",
  536. messageSends: ["updateState"],
  537. referencedClasses: []
  538. }),
  539. globals.HLCodeWidget);
  540. smalltalk.addMethod(
  541. smalltalk.method({
  542. selector: "onDoIt",
  543. protocol: 'reactions',
  544. fn: function (){
  545. var self=this;
  546. return smalltalk.withContext(function($ctx1) {
  547. self._doIt();
  548. return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{},globals.HLCodeWidget)})},
  549. args: [],
  550. source: "onDoIt\x0a\x09\x0a\x09self doIt",
  551. messageSends: ["doIt"],
  552. referencedClasses: []
  553. }),
  554. globals.HLCodeWidget);
  555. smalltalk.addMethod(
  556. smalltalk.method({
  557. selector: "onInspectIt",
  558. protocol: 'reactions',
  559. fn: function (){
  560. var self=this;
  561. return smalltalk.withContext(function($ctx1) {
  562. self._inspectIt();
  563. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},globals.HLCodeWidget)})},
  564. args: [],
  565. source: "onInspectIt\x0a\x0a\x09self inspectIt",
  566. messageSends: ["inspectIt"],
  567. referencedClasses: []
  568. }),
  569. globals.HLCodeWidget);
  570. smalltalk.addMethod(
  571. smalltalk.method({
  572. selector: "onPrintIt",
  573. protocol: 'reactions',
  574. fn: function (){
  575. var self=this;
  576. return smalltalk.withContext(function($ctx1) {
  577. self._printIt();
  578. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},globals.HLCodeWidget)})},
  579. args: [],
  580. source: "onPrintIt\x0a\x0a\x09self printIt",
  581. messageSends: ["printIt"],
  582. referencedClasses: []
  583. }),
  584. globals.HLCodeWidget);
  585. smalltalk.addMethod(
  586. smalltalk.method({
  587. selector: "onSaveIt",
  588. protocol: 'reactions',
  589. fn: function (){
  590. var self=this;
  591. return self},
  592. args: [],
  593. source: "onSaveIt\x0a\x09\x22I do not do anything\x22",
  594. messageSends: [],
  595. referencedClasses: []
  596. }),
  597. globals.HLCodeWidget);
  598. smalltalk.addMethod(
  599. smalltalk.method({
  600. selector: "print:",
  601. protocol: 'actions',
  602. fn: function (aString){
  603. var self=this;
  604. var start,stop,currentLine;
  605. function $HashedCollection(){return globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  606. return smalltalk.withContext(function($ctx1) {
  607. var $1,$2,$4,$3,$5,$6,$7,$8,$9,$10,$12,$11;
  608. $1=_st(self["@editor"])._getCursor_(false);
  609. $ctx1.sendIdx["getCursor:"]=1;
  610. currentLine=_st($1)._line();
  611. start=_st($HashedCollection())._new();
  612. $ctx1.sendIdx["new"]=1;
  613. _st(start)._at_put_("line",currentLine);
  614. $ctx1.sendIdx["at:put:"]=1;
  615. $2=start;
  616. $4=_st(self["@editor"])._getCursor_(false);
  617. $ctx1.sendIdx["getCursor:"]=2;
  618. $3=_st($4)._ch();
  619. _st($2)._at_put_("ch",$3);
  620. $ctx1.sendIdx["at:put:"]=2;
  621. $5=_st(self["@editor"])._getSelection();
  622. $ctx1.sendIdx["getSelection"]=1;
  623. _st($5)._ifEmpty_((function(){
  624. return smalltalk.withContext(function($ctx2) {
  625. $6=start;
  626. $7=_st(_st(self["@editor"])._getLine_(currentLine))._size();
  627. $ctx2.sendIdx["size"]=1;
  628. _st($6)._at_put_("ch",$7);
  629. $ctx2.sendIdx["at:put:"]=3;
  630. return _st(self["@editor"])._setSelection_end_(globals.HashedCollection._newFromPairs_(["line",currentLine,"ch",(0)]),start);
  631. $ctx2.sendIdx["setSelection:end:"]=1;
  632. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  633. stop=_st($HashedCollection())._new();
  634. _st(stop)._at_put_("line",currentLine);
  635. $ctx1.sendIdx["at:put:"]=4;
  636. $8=stop;
  637. $9=_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2));
  638. $ctx1.sendIdx["+"]=1;
  639. _st($8)._at_put_("ch",$9);
  640. $10=self["@editor"];
  641. $12=_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString);
  642. $ctx1.sendIdx[","]=2;
  643. $11=_st($12).__comma(" ");
  644. $ctx1.sendIdx[","]=1;
  645. _st($10)._replaceSelection_($11);
  646. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  647. _st(self["@editor"])._setSelection_end_(stop,start);
  648. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},globals.HLCodeWidget)})},
  649. args: ["aString"],
  650. source: "print: aString\x0a\x09| start stop currentLine |\x0a currentLine := (editor getCursor: false) line.\x0a\x09start := HashedCollection new.\x0a\x09start at: 'line' put: currentLine.\x0a\x09start at: 'ch' put: (editor getCursor: false) ch.\x0a (editor getSelection) ifEmpty: [\x0a \x09\x22select current line if selection is empty\x22\x0a \x09start at: 'ch' put: (editor getLine: currentLine) size.\x0a editor setSelection: #{'line' -> currentLine. 'ch' -> 0} end: start.\x0a ].\x0a\x09stop := HashedCollection new.\x0a\x09stop at: 'line' put: currentLine.\x0a\x09stop at: 'ch' put: ((start at: 'ch') + aString size + 2).\x0a\x0a\x09editor replaceSelection: (editor getSelection, ' ', aString, ' ').\x0a\x09editor setCursor: (editor getCursor: true).\x0a\x09editor setSelection: stop end: start",
  651. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "getSelection", "size", "getLine:", "setSelection:end:", "+", "at:", "replaceSelection:", ",", "setCursor:"],
  652. referencedClasses: ["HashedCollection"]
  653. }),
  654. globals.HLCodeWidget);
  655. smalltalk.addMethod(
  656. smalltalk.method({
  657. selector: "printIt",
  658. protocol: 'actions',
  659. fn: function (){
  660. var self=this;
  661. var result;
  662. function $HLPrintItRequested(){return globals.HLPrintItRequested||(typeof HLPrintItRequested=="undefined"?nil:HLPrintItRequested)}
  663. return smalltalk.withContext(function($ctx1) {
  664. result=self._doIt();
  665. _st(_st(self._model())._announcer())._announce_(_st($HLPrintItRequested())._on_(self["@model"]));
  666. self._print_(_st(result)._printString());
  667. self._focus();
  668. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{result:result},globals.HLCodeWidget)})},
  669. args: [],
  670. source: "printIt\x0a\x09| result |\x0a\x0a\x09result := self doIt. \x0a\x09self model announcer announce: (HLPrintItRequested on: model).\x0a\x09self print: result printString.\x0a\x09\x0a\x09self focus.",
  671. messageSends: ["doIt", "announce:", "announcer", "model", "on:", "print:", "printString", "focus"],
  672. referencedClasses: ["HLPrintItRequested"]
  673. }),
  674. globals.HLCodeWidget);
  675. smalltalk.addMethod(
  676. smalltalk.method({
  677. selector: "receiver",
  678. protocol: 'accessing',
  679. fn: function (){
  680. var self=this;
  681. return smalltalk.withContext(function($ctx1) {
  682. var $1;
  683. $1=_st(self._model())._receiver();
  684. return $1;
  685. }, function($ctx1) {$ctx1.fill(self,"receiver",{},globals.HLCodeWidget)})},
  686. args: [],
  687. source: "receiver\x0a\x09^ self model receiver",
  688. messageSends: ["receiver", "model"],
  689. referencedClasses: []
  690. }),
  691. globals.HLCodeWidget);
  692. smalltalk.addMethod(
  693. smalltalk.method({
  694. selector: "receiver:",
  695. protocol: 'accessing',
  696. fn: function (anObject){
  697. var self=this;
  698. return smalltalk.withContext(function($ctx1) {
  699. _st(self._model())._receiver_(anObject);
  700. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},globals.HLCodeWidget)})},
  701. args: ["anObject"],
  702. source: "receiver: anObject\x0a\x09self model receiver: anObject",
  703. messageSends: ["receiver:", "model"],
  704. referencedClasses: []
  705. }),
  706. globals.HLCodeWidget);
  707. smalltalk.addMethod(
  708. smalltalk.method({
  709. selector: "renderButtonsOn:",
  710. protocol: 'rendering',
  711. fn: function (html){
  712. var self=this;
  713. return smalltalk.withContext(function($ctx1) {
  714. var $1,$2,$3,$4,$5,$6;
  715. $1=_st(html)._button();
  716. $ctx1.sendIdx["button"]=1;
  717. _st($1)._class_("button");
  718. $ctx1.sendIdx["class:"]=1;
  719. _st($1)._with_("DoIt");
  720. $ctx1.sendIdx["with:"]=1;
  721. $2=_st($1)._onClick_((function(){
  722. return smalltalk.withContext(function($ctx2) {
  723. return self._doIt();
  724. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  725. $ctx1.sendIdx["onClick:"]=1;
  726. $3=_st(html)._button();
  727. $ctx1.sendIdx["button"]=2;
  728. _st($3)._class_("button");
  729. $ctx1.sendIdx["class:"]=2;
  730. _st($3)._with_("PrintIt");
  731. $ctx1.sendIdx["with:"]=2;
  732. $4=_st($3)._onClick_((function(){
  733. return smalltalk.withContext(function($ctx2) {
  734. return self._printIt();
  735. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  736. $ctx1.sendIdx["onClick:"]=2;
  737. $5=_st(html)._button();
  738. _st($5)._class_("button");
  739. _st($5)._with_("InspectIt");
  740. $6=_st($5)._onClick_((function(){
  741. return smalltalk.withContext(function($ctx2) {
  742. return self._inspectIt();
  743. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  744. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLCodeWidget)})},
  745. args: ["html"],
  746. source: "renderButtonsOn: html\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'DoIt';\x0a\x09\x09onClick: [ self doIt ].\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'PrintIt';\x0a\x09\x09onClick: [ self printIt ].\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'InspectIt';\x0a\x09\x09onClick: [ self inspectIt ]",
  747. messageSends: ["class:", "button", "with:", "onClick:", "doIt", "printIt", "inspectIt"],
  748. referencedClasses: []
  749. }),
  750. globals.HLCodeWidget);
  751. smalltalk.addMethod(
  752. smalltalk.method({
  753. selector: "renderContentOn:",
  754. protocol: 'rendering',
  755. fn: function (html){
  756. var self=this;
  757. return smalltalk.withContext(function($ctx1) {
  758. var $1,$2,$3,$4,$5,$6;
  759. $1=_st(html)._div();
  760. $ctx1.sendIdx["div"]=1;
  761. _st($1)._class_("editor");
  762. $ctx1.sendIdx["class:"]=1;
  763. $2=_st($1)._with_((function(){
  764. return smalltalk.withContext(function($ctx2) {
  765. self["@code"]=_st(html)._textarea();
  766. return self["@code"];
  767. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  768. $ctx1.sendIdx["with:"]=1;
  769. $3=_st(html)._div();
  770. $ctx1.sendIdx["div"]=2;
  771. self["@state"]=_st($3)._class_("state");
  772. $ctx1.sendIdx["class:"]=2;
  773. $4=_st(html)._div();
  774. _st($4)._class_("buttons_bar");
  775. $5=_st($4)._with_((function(){
  776. return smalltalk.withContext(function($ctx2) {
  777. return self._renderButtonsOn_(html);
  778. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  779. self._setEditorOn_(_st(self["@code"])._element());
  780. self._configureEditor();
  781. $6=self._updateState();
  782. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLCodeWidget)})},
  783. args: ["html"],
  784. source: "renderContentOn: html\x0a\x09html div class: 'editor'; with: [\x0a\x09\x09code := html textarea ].\x0a\x09state := html div class: 'state'.\x0a\x09\x0a\x09html div \x0a\x09\x09class: 'buttons_bar';\x0a\x09\x09with: [ self renderButtonsOn: html ].\x0a\x09\x0a\x09self \x0a\x09\x09setEditorOn: code element;\x0a\x09\x09configureEditor;\x0a\x09\x09updateState",
  785. messageSends: ["class:", "div", "with:", "textarea", "renderButtonsOn:", "setEditorOn:", "element", "configureEditor", "updateState"],
  786. referencedClasses: []
  787. }),
  788. globals.HLCodeWidget);
  789. smalltalk.addMethod(
  790. smalltalk.method({
  791. selector: "saveIt",
  792. protocol: 'actions',
  793. fn: function (){
  794. var self=this;
  795. return self},
  796. args: [],
  797. source: "saveIt\x0a\x09\x22I do not do anything\x22",
  798. messageSends: [],
  799. referencedClasses: []
  800. }),
  801. globals.HLCodeWidget);
  802. smalltalk.addMethod(
  803. smalltalk.method({
  804. selector: "selection",
  805. protocol: 'accessing',
  806. fn: function (){
  807. var self=this;
  808. return smalltalk.withContext(function($ctx1) {
  809. var $1;
  810. $1=_st(self["@editor"])._getSelection();
  811. return $1;
  812. }, function($ctx1) {$ctx1.fill(self,"selection",{},globals.HLCodeWidget)})},
  813. args: [],
  814. source: "selection\x0a\x09^editor getSelection",
  815. messageSends: ["getSelection"],
  816. referencedClasses: []
  817. }),
  818. globals.HLCodeWidget);
  819. smalltalk.addMethod(
  820. smalltalk.method({
  821. selector: "selectionEnd",
  822. protocol: 'accessing',
  823. fn: function (){
  824. var self=this;
  825. return smalltalk.withContext(function($ctx1) {
  826. var $1;
  827. $1=_st(_st(self["@code"])._element())._selectionEnd();
  828. return $1;
  829. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},globals.HLCodeWidget)})},
  830. args: [],
  831. source: "selectionEnd\x0a ^code element selectionEnd",
  832. messageSends: ["selectionEnd", "element"],
  833. referencedClasses: []
  834. }),
  835. globals.HLCodeWidget);
  836. smalltalk.addMethod(
  837. smalltalk.method({
  838. selector: "selectionEnd:",
  839. protocol: 'accessing',
  840. fn: function (anInteger){
  841. var self=this;
  842. return smalltalk.withContext(function($ctx1) {
  843. _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  844. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},globals.HLCodeWidget)})},
  845. args: ["anInteger"],
  846. source: "selectionEnd: anInteger\x0a code element selectionEnd: anInteger",
  847. messageSends: ["selectionEnd:", "element"],
  848. referencedClasses: []
  849. }),
  850. globals.HLCodeWidget);
  851. smalltalk.addMethod(
  852. smalltalk.method({
  853. selector: "selectionStart",
  854. protocol: 'accessing',
  855. fn: function (){
  856. var self=this;
  857. return smalltalk.withContext(function($ctx1) {
  858. var $1;
  859. $1=_st(_st(self["@code"])._element())._selectionStart();
  860. return $1;
  861. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},globals.HLCodeWidget)})},
  862. args: [],
  863. source: "selectionStart\x0a ^code element selectionStart",
  864. messageSends: ["selectionStart", "element"],
  865. referencedClasses: []
  866. }),
  867. globals.HLCodeWidget);
  868. smalltalk.addMethod(
  869. smalltalk.method({
  870. selector: "selectionStart:",
  871. protocol: 'accessing',
  872. fn: function (anInteger){
  873. var self=this;
  874. return smalltalk.withContext(function($ctx1) {
  875. _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  876. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},globals.HLCodeWidget)})},
  877. args: ["anInteger"],
  878. source: "selectionStart: anInteger\x0a code element selectionStart: anInteger",
  879. messageSends: ["selectionStart:", "element"],
  880. referencedClasses: []
  881. }),
  882. globals.HLCodeWidget);
  883. smalltalk.addMethod(
  884. smalltalk.method({
  885. selector: "setEditorOn:",
  886. protocol: 'actions',
  887. fn: function (aTextarea){
  888. var self=this;
  889. return smalltalk.withContext(function($ctx1) {
  890. self['@editor'] = CodeMirror.fromTextArea(aTextarea, self._editorOptions());
  891. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},globals.HLCodeWidget)})},
  892. args: ["aTextarea"],
  893. source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, self._editorOptions())>",
  894. messageSends: [],
  895. referencedClasses: []
  896. }),
  897. globals.HLCodeWidget);
  898. smalltalk.addMethod(
  899. smalltalk.method({
  900. selector: "updateState",
  901. protocol: 'updating',
  902. fn: function (){
  903. var self=this;
  904. return smalltalk.withContext(function($ctx1) {
  905. var $1,$2;
  906. $1=self._hasModification();
  907. if(smalltalk.assert($1)){
  908. $2=_st(self["@state"])._asJQuery();
  909. $ctx1.sendIdx["asJQuery"]=1;
  910. _st($2)._addClass_("modified");
  911. } else {
  912. _st(_st(self["@state"])._asJQuery())._removeClass_("modified");
  913. };
  914. return self}, function($ctx1) {$ctx1.fill(self,"updateState",{},globals.HLCodeWidget)})},
  915. args: [],
  916. source: "updateState\x0a\x09self hasModification \x0a\x09\x09ifTrue: [ state asJQuery addClass: 'modified' ]\x0a\x09\x09ifFalse: [ state asJQuery removeClass: 'modified' ]",
  917. messageSends: ["ifTrue:ifFalse:", "hasModification", "addClass:", "asJQuery", "removeClass:"],
  918. referencedClasses: []
  919. }),
  920. globals.HLCodeWidget);
  921. smalltalk.addMethod(
  922. smalltalk.method({
  923. selector: "variableHintFor:token:",
  924. protocol: 'hints',
  925. fn: function (anEditor,aToken){
  926. var self=this;
  927. var variables,classNames,pseudoVariables;
  928. function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  929. return smalltalk.withContext(function($ctx1) {
  930. var $3,$2,$1,$9,$8,$7,$6,$10,$5,$4;
  931. $3=_st(_st(_st(anEditor)._display())._wrapper())._asJQuery();
  932. $ctx1.sendIdx["asJQuery"]=1;
  933. $2=_st($3)._find_("span.cm-variable");
  934. $1=_st($2)._get();
  935. variables=_st($1)._collect_((function(each){
  936. return smalltalk.withContext(function($ctx2) {
  937. return _st(_st(each)._asJQuery())._html();
  938. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  939. $ctx1.sendIdx["collect:"]=1;
  940. classNames=_st(_st($Smalltalk())._classes())._collect_((function(each){
  941. return smalltalk.withContext(function($ctx2) {
  942. return _st(each)._name();
  943. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  944. pseudoVariables=_st($Smalltalk())._pseudoVariableNames();
  945. $9=_st(_st(variables).__comma(classNames)).__comma(pseudoVariables);
  946. $ctx1.sendIdx[","]=1;
  947. $8=_st($9)._asSet();
  948. $7=_st($8)._asArray();
  949. $6=_st($7)._sort();
  950. $5=_st($6)._select_((function(each){
  951. return smalltalk.withContext(function($ctx2) {
  952. $10=_st(aToken)._string();
  953. $ctx2.sendIdx["string"]=1;
  954. return _st(each)._includesSubString_($10);
  955. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})}));
  956. $4=_st($5)._reject_((function(each){
  957. return smalltalk.withContext(function($ctx2) {
  958. return _st(each).__eq(_st(aToken)._string());
  959. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
  960. return $4;
  961. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},globals.HLCodeWidget)})},
  962. args: ["anEditor", "aToken"],
  963. source: "variableHintFor: anEditor token: aToken\x0a\x09| variables classNames pseudoVariables |\x0a\x09\x0a\x09variables := (anEditor display wrapper asJQuery find: 'span.cm-variable') get\x0a\x09\x09collect: [ :each | each asJQuery html ].\x0a\x09\x0a\x09classNames := Smalltalk classes collect: [ :each | each name ].\x0a\x09pseudoVariables := Smalltalk pseudoVariableNames.\x0a\x09\x0a\x09^ ((variables, classNames, pseudoVariables) asSet asArray sort\x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
  964. messageSends: ["collect:", "get", "find:", "asJQuery", "wrapper", "display", "html", "classes", "name", "pseudoVariableNames", "reject:", "select:", "sort", "asArray", "asSet", ",", "includesSubString:", "string", "="],
  965. referencedClasses: ["Smalltalk"]
  966. }),
  967. globals.HLCodeWidget);
  968. smalltalk.addMethod(
  969. smalltalk.method({
  970. selector: "hintFor:options:",
  971. protocol: 'hints',
  972. fn: function (anEditor,options){
  973. var self=this;
  974. var cursor,token,completions;
  975. function $CodeMirror(){return globals.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  976. function $HLCodeWidget(){return globals.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  977. return smalltalk.withContext(function($ctx1) {
  978. var $1,$4,$3,$2,$5,$7,$9,$10,$8,$6;
  979. cursor=_st(anEditor)._getCursor();
  980. token=_st(anEditor)._getTokenAt_(cursor);
  981. $1=token;
  982. $4=_st($CodeMirror())._basicAt_("innerMode");
  983. $ctx1.sendIdx["basicAt:"]=1;
  984. $3=_st($4)._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state"));
  985. $ctx1.sendIdx["value:value:"]=1;
  986. $2=_st($3)._state();
  987. _st($1)._at_put_("state",$2);
  988. $5=_st(_st(token)._type()).__eq("variable");
  989. if(smalltalk.assert($5)){
  990. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  991. } else {
  992. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  993. };
  994. $7=completions;
  995. $9=_st($CodeMirror())._basicAt_("Pos");
  996. $ctx1.sendIdx["basicAt:"]=2;
  997. $10=_st(cursor)._line();
  998. $ctx1.sendIdx["line"]=1;
  999. $8=_st($9)._value_value_($10,_st(token)._end());
  1000. $ctx1.sendIdx["value:value:"]=2;
  1001. $6=globals.HashedCollection._newFromPairs_(["list",$7,"from",$8,"to",_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._start())]);
  1002. return $6;
  1003. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},globals.HLCodeWidget.klass)})},
  1004. args: ["anEditor", "options"],
  1005. source: "hintFor: anEditor options: options\x0a\x09| cursor token completions |\x0a\x09\x0a\x09cursor := anEditor getCursor.\x0a\x09token := anEditor getTokenAt: cursor.\x0a\x09token at: 'state' put: ((CodeMirror basicAt: 'innerMode')\x0a\x09\x09value: anEditor getMode value: (token at: 'state')) state.\x0a\x09\x0a\x09completions := token type = 'variable' \x0a\x09\x09ifTrue: [ HLCodeWidget variableHintFor: anEditor token: token ]\x0a\x09\x09ifFalse: [ HLCodeWidget messageHintFor: anEditor token: token ].\x0a\x09\x0a\x09^ #{\x0a\x09\x09'list' -> completions.\x0a\x09\x09'from' -> ((CodeMirror basicAt: 'Pos') value: cursor line value: token end).\x0a\x09\x09'to' -> ((CodeMirror basicAt: 'Pos') value: cursor line value: token start)\x0a\x09}",
  1006. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "basicAt:", "getMode", "at:", "ifTrue:ifFalse:", "=", "type", "variableHintFor:token:", "messageHintFor:token:", "line", "end", "start"],
  1007. referencedClasses: ["CodeMirror", "HLCodeWidget"]
  1008. }),
  1009. globals.HLCodeWidget.klass);
  1010. smalltalk.addMethod(
  1011. smalltalk.method({
  1012. selector: "initialize",
  1013. protocol: 'initialization',
  1014. fn: function (){
  1015. var self=this;
  1016. return smalltalk.withContext(function($ctx1) {
  1017. var $1;
  1018. globals.HLCodeWidget.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1019. self._setupCodeMirror();
  1020. self._setupCommands();
  1021. $1=self._setupKeyMaps();
  1022. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.HLCodeWidget.klass)})},
  1023. args: [],
  1024. source: "initialize\x0a\x09super initialize.\x0a\x09self \x0a\x09\x09setupCodeMirror;\x0a\x09\x09setupCommands;\x0a\x09\x09setupKeyMaps.",
  1025. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"],
  1026. referencedClasses: []
  1027. }),
  1028. globals.HLCodeWidget.klass);
  1029. smalltalk.addMethod(
  1030. smalltalk.method({
  1031. selector: "keyMap",
  1032. protocol: 'accessing',
  1033. fn: function (){
  1034. var self=this;
  1035. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1036. return smalltalk.withContext(function($ctx1) {
  1037. var $2,$1;
  1038. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  1039. if(smalltalk.assert($2)){
  1040. $1=self._macKeyMap();
  1041. } else {
  1042. $1=self._pcKeyMap();
  1043. };
  1044. return $1;
  1045. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},globals.HLCodeWidget.klass)})},
  1046. args: [],
  1047. source: "keyMap\x0a\x09^ HLManager current keyBinder systemIsMac\x0a\x09\x09ifTrue: [ self macKeyMap ]\x0a\x09\x09ifFalse: [ self pcKeyMap ]",
  1048. messageSends: ["ifTrue:ifFalse:", "systemIsMac", "keyBinder", "current", "macKeyMap", "pcKeyMap"],
  1049. referencedClasses: ["HLManager"]
  1050. }),
  1051. globals.HLCodeWidget.klass);
  1052. smalltalk.addMethod(
  1053. smalltalk.method({
  1054. selector: "macKeyMap",
  1055. protocol: 'accessing',
  1056. fn: function (){
  1057. var self=this;
  1058. var $1;
  1059. $1=globals.HashedCollection._newFromPairs_(["Alt-Backspace","delWordBefore","Alt-Delete","delWordAfter","Alt-Left","goWordLeft","Alt-Right","goWordRight","Cmd-A","selectAll","Cmd-Alt-F","replace","Cmd-D","doIt","Cmd-Down","goDocEnd","Cmd-End","goDocEnd","Cmd-F","find","Cmd-G","findNext","Cmd-I","inspectIt","Cmd-Left","goLineStart","Cmd-P","printIt","Cmd-Right","goLineEnd","Cmd-S","saveIt","Cmd-Up","goDocStart","Cmd-Y","redo","Cmd-Z","undo","Cmd-[","indentLess","Cmd-]","indentMore","Ctrl-Alt-Backspace","delWordAfter","Shift-Cmd-Alt-F","replaceAll","Shift-Cmd-G","findPrev","Shift-Cmd-Z","redo","fallthrough",["basic","emacsy"]]);
  1060. return $1;
  1061. },
  1062. args: [],
  1063. source: "macKeyMap\x0a\x09^ #{\x0a\x09\x09'Alt-Backspace'\x09\x09\x09-> 'delWordBefore'.\x0a\x09\x09'Alt-Delete'\x09\x09\x09-> 'delWordAfter'. \x0a\x09\x09'Alt-Left'\x09\x09\x09\x09-> 'goWordLeft'.\x0a\x09\x09'Alt-Right'\x09\x09\x09\x09-> 'goWordRight'. \x0a\x09\x09'Cmd-A'\x09\x09\x09\x09\x09-> 'selectAll'. \x0a\x09\x09'Cmd-Alt-F'\x09\x09\x09\x09-> 'replace'. \x0a\x09\x09'Cmd-D'\x09\x09\x09\x09\x09-> 'doIt'. \x0a\x09\x09'Cmd-Down'\x09\x09\x09\x09-> 'goDocEnd'. \x0a\x09\x09'Cmd-End'\x09\x09\x09\x09-> 'goDocEnd'. \x0a\x09\x09'Cmd-F'\x09\x09\x09\x09\x09-> 'find'.\x0a\x09\x09'Cmd-G'\x09\x09\x09\x09\x09-> 'findNext'. \x0a\x09\x09'Cmd-I'\x09\x09\x09\x09\x09-> 'inspectIt'. \x0a\x09\x09'Cmd-Left'\x09\x09\x09\x09-> 'goLineStart'. \x0a\x09\x09'Cmd-P'\x09\x09\x09\x09\x09-> 'printIt'. \x0a\x09\x09'Cmd-Right'\x09\x09\x09\x09-> 'goLineEnd'. \x0a\x09\x09'Cmd-S'\x09\x09\x09\x09\x09-> 'saveIt'. \x0a\x09\x09'Cmd-Up'\x09\x09\x09\x09-> 'goDocStart'. \x0a\x09\x09'Cmd-Y'\x09\x09\x09\x09\x09-> 'redo'.\x0a\x09\x09'Cmd-Z'\x09\x09\x09\x09\x09-> 'undo'. \x0a\x09\x09'Cmd-['\x09\x09\x09\x09\x09-> 'indentLess'. \x0a\x09\x09'Cmd-]'\x09\x09\x09\x09\x09-> 'indentMore'.\x0a\x09\x09'Ctrl-Alt-Backspace'\x09-> 'delWordAfter'. \x0a\x09\x09'Shift-Cmd-Alt-F'\x09\x09-> 'replaceAll'.\x0a\x09\x09'Shift-Cmd-G'\x09\x09\x09-> 'findPrev'. \x0a\x09\x09'Shift-Cmd-Z'\x09\x09\x09-> 'redo'. \x0a \x09'fallthrough' \x09\x09\x09-> { 'basic'. 'emacsy' }\x0a }",
  1064. messageSends: [],
  1065. referencedClasses: []
  1066. }),
  1067. globals.HLCodeWidget.klass);
  1068. smalltalk.addMethod(
  1069. smalltalk.method({
  1070. selector: "messageHintFor:token:",
  1071. protocol: 'hints',
  1072. fn: function (anEditor,aToken){
  1073. var self=this;
  1074. return smalltalk.withContext(function($ctx1) {
  1075. var $1;
  1076. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  1077. return $1;
  1078. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},globals.HLCodeWidget.klass)})},
  1079. args: ["anEditor", "aToken"],
  1080. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09messageHintFor: anEditor token: aToken",
  1081. messageSends: ["messageHintFor:token:", "at:"],
  1082. referencedClasses: []
  1083. }),
  1084. globals.HLCodeWidget.klass);
  1085. smalltalk.addMethod(
  1086. smalltalk.method({
  1087. selector: "pcKeyMap",
  1088. protocol: 'accessing',
  1089. fn: function (){
  1090. var self=this;
  1091. var $1;
  1092. $1=globals.HashedCollection._newFromPairs_(["Alt-Left","goLineStart","Alt-Right","goLineEnd","Alt-Up","goDocStart","Ctrl-A","selectAll","Ctrl-Backspace","delWordBefore","Ctrl-D","doIt","Ctrl-Delete","delWordAfter","Ctrl-Down","goDocEnd","Ctrl-End","goDocEnd","Ctrl-F","find","Ctrl-G","findNext","Ctrl-I","inspectIt","Ctrl-Home","goDocStart","Ctrl-Left","goWordLeft","Ctrl-P","printIt","Ctrl-Right","goWordRight","Ctrl-S","saveIt","Ctrl-Y","redo","Ctrl-Z","undo","Ctrl-[","indentLess","Ctrl-]","indentMore","Shift-Ctrl-F","replace","Shift-Ctrl-G","findPrev","Shift-Ctrl-R","replaceAll","Shift-Ctrl-Z","redo","fallthrough",["basic"]]);
  1093. return $1;
  1094. },
  1095. args: [],
  1096. source: "pcKeyMap\x0a\x09^ #{\x0a\x09\x09'Alt-Left' -> \x09\x09'goLineStart'. \x0a\x09\x09'Alt-Right' -> \x09\x09'goLineEnd'.\x0a\x09\x09'Alt-Up' -> \x09\x09'goDocStart'. \x0a\x09\x09'Ctrl-A' -> \x09\x09'selectAll'. \x0a\x09\x09'Ctrl-Backspace' -> 'delWordBefore'. \x0a\x09\x09'Ctrl-D' -> \x09\x09'doIt'. \x0a\x09\x09'Ctrl-Delete' -> \x09\x09'delWordAfter'. \x0a\x09\x09'Ctrl-Down' -> \x09\x09'goDocEnd'.\x0a\x09\x09'Ctrl-End' -> \x09\x09'goDocEnd'. \x0a\x09\x09'Ctrl-F' -> \x09\x09'find'.\x0a\x09\x09'Ctrl-G' -> \x09\x09'findNext'. \x0a\x09\x09'Ctrl-I' -> \x09\x09'inspectIt'.\x0a\x09\x09'Ctrl-Home' -> \x09\x09'goDocStart'. \x0a\x09\x09'Ctrl-Left' -> \x09\x09'goWordLeft'. \x0a\x09\x09'Ctrl-P' -> \x09\x09'printIt'.\x0a\x09\x09'Ctrl-Right' -> \x09'goWordRight'. \x0a\x09\x09'Ctrl-S' -> \x09\x09'saveIt'. \x0a\x09\x09'Ctrl-Y' -> \x09\x09'redo'.\x0a\x09\x09'Ctrl-Z' -> \x09\x09'undo'. \x0a\x09\x09'Ctrl-[' -> \x09\x09'indentLess'. \x0a\x09\x09'Ctrl-]' -> \x09\x09'indentMore'.\x0a\x09\x09'Shift-Ctrl-F' -> \x09'replace'. \x0a\x09\x09'Shift-Ctrl-G' -> \x09'findPrev'. \x0a\x09\x09'Shift-Ctrl-R' -> \x09'replaceAll'.\x0a\x09\x09'Shift-Ctrl-Z' -> \x09'redo'. \x0a\x09\x09'fallthrough' -> \x09#('basic')\x0a}",
  1097. messageSends: [],
  1098. referencedClasses: []
  1099. }),
  1100. globals.HLCodeWidget.klass);
  1101. smalltalk.addMethod(
  1102. smalltalk.method({
  1103. selector: "setupCodeMirror",
  1104. protocol: 'initialization',
  1105. fn: function (){
  1106. var self=this;
  1107. return smalltalk.withContext(function($ctx1) {
  1108. CodeMirror.keyMap.default.fallthrough = ["basic"];
  1109. CodeMirror.commands.autocomplete = function(cm) {
  1110. CodeMirror.showHint(cm, self._hintFor_options_);
  1111. }
  1112. ;
  1113. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},globals.HLCodeWidget.klass)})},
  1114. args: [],
  1115. source: "setupCodeMirror\x0a\x09< \x0a\x09\x09CodeMirror.keyMap.default.fallthrough = [\x22basic\x22];\x0a\x09\x09CodeMirror.commands.autocomplete = function(cm) {\x0a\x09\x09\x09CodeMirror.showHint(cm, self._hintFor_options_);\x0a\x09\x09}\x0a\x09>",
  1116. messageSends: [],
  1117. referencedClasses: []
  1118. }),
  1119. globals.HLCodeWidget.klass);
  1120. smalltalk.addMethod(
  1121. smalltalk.method({
  1122. selector: "setupCommands",
  1123. protocol: 'initialization',
  1124. fn: function (){
  1125. var self=this;
  1126. function $CodeMirror(){return globals.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  1127. return smalltalk.withContext(function($ctx1) {
  1128. var $1,$2,$3,$4,$5;
  1129. $1=_st($CodeMirror())._basicAt_("commands");
  1130. _st($1)._at_put_("doIt",(function(cm){
  1131. return smalltalk.withContext(function($ctx2) {
  1132. $2=_st(cm)._amberCodeWidget();
  1133. $ctx2.sendIdx["amberCodeWidget"]=1;
  1134. return _st($2)._doIt();
  1135. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,1)})}));
  1136. $ctx1.sendIdx["at:put:"]=1;
  1137. _st($1)._at_put_("inspectIt",(function(cm){
  1138. return smalltalk.withContext(function($ctx2) {
  1139. $3=_st(cm)._amberCodeWidget();
  1140. $ctx2.sendIdx["amberCodeWidget"]=2;
  1141. return _st($3)._inspectIt();
  1142. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,2)})}));
  1143. $ctx1.sendIdx["at:put:"]=2;
  1144. _st($1)._at_put_("printIt",(function(cm){
  1145. return smalltalk.withContext(function($ctx2) {
  1146. $4=_st(cm)._amberCodeWidget();
  1147. $ctx2.sendIdx["amberCodeWidget"]=3;
  1148. return _st($4)._printIt();
  1149. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,3)})}));
  1150. $ctx1.sendIdx["at:put:"]=3;
  1151. $5=_st($1)._at_put_("saveIt",(function(cm){
  1152. return smalltalk.withContext(function($ctx2) {
  1153. return _st(_st(cm)._amberCodeWidget())._saveIt();
  1154. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,4)})}));
  1155. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},globals.HLCodeWidget.klass)})},
  1156. args: [],
  1157. source: "setupCommands\x0a\x09(CodeMirror basicAt: 'commands') \x0a\x09\x09at: 'doIt' put: [ :cm | cm amberCodeWidget doIt ];\x0a\x09\x09at: 'inspectIt' put: [ :cm | cm amberCodeWidget inspectIt ];\x0a\x09\x09at: 'printIt' put: [ :cm | cm amberCodeWidget printIt ];\x0a\x09\x09at: 'saveIt' put: [ :cm | cm amberCodeWidget saveIt ]",
  1158. messageSends: ["at:put:", "basicAt:", "doIt", "amberCodeWidget", "inspectIt", "printIt", "saveIt"],
  1159. referencedClasses: ["CodeMirror"]
  1160. }),
  1161. globals.HLCodeWidget.klass);
  1162. smalltalk.addMethod(
  1163. smalltalk.method({
  1164. selector: "setupKeyMaps",
  1165. protocol: 'initialization',
  1166. fn: function (){
  1167. var self=this;
  1168. return smalltalk.withContext(function($ctx1) {
  1169. CodeMirror.keyMap['Amber'] = self._keyMap();
  1170. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},globals.HLCodeWidget.klass)})},
  1171. args: [],
  1172. source: "setupKeyMaps\x0a\x09<CodeMirror.keyMap['Amber'] = self._keyMap()>",
  1173. messageSends: [],
  1174. referencedClasses: []
  1175. }),
  1176. globals.HLCodeWidget.klass);
  1177. smalltalk.addMethod(
  1178. smalltalk.method({
  1179. selector: "variableHintFor:token:",
  1180. protocol: 'hints',
  1181. fn: function (anEditor,aToken){
  1182. var self=this;
  1183. return smalltalk.withContext(function($ctx1) {
  1184. var $1;
  1185. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  1186. return $1;
  1187. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},globals.HLCodeWidget.klass)})},
  1188. args: ["anEditor", "aToken"],
  1189. source: "variableHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09variableHintFor: anEditor token: aToken",
  1190. messageSends: ["variableHintFor:token:", "at:"],
  1191. referencedClasses: []
  1192. }),
  1193. globals.HLCodeWidget.klass);
  1194. smalltalk.addClass('HLNavigationCodeWidget', globals.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
  1195. smalltalk.addMethod(
  1196. smalltalk.method({
  1197. selector: "configureEditor",
  1198. protocol: 'accessing',
  1199. fn: function (){
  1200. var self=this;
  1201. return smalltalk.withContext(function($ctx1) {
  1202. globals.HLNavigationCodeWidget.superclass.fn.prototype._configureEditor.apply(_st(self), []);
  1203. self._contents_(self._methodContents());
  1204. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},globals.HLNavigationCodeWidget)})},
  1205. args: [],
  1206. source: "configureEditor\x0a\x09super configureEditor.\x0a\x09self contents: self methodContents",
  1207. messageSends: ["configureEditor", "contents:", "methodContents"],
  1208. referencedClasses: []
  1209. }),
  1210. globals.HLNavigationCodeWidget);
  1211. smalltalk.addMethod(
  1212. smalltalk.method({
  1213. selector: "contents:",
  1214. protocol: 'accessing',
  1215. fn: function (aString){
  1216. var self=this;
  1217. return smalltalk.withContext(function($ctx1) {
  1218. self._methodContents_(aString);
  1219. globals.HLNavigationCodeWidget.superclass.fn.prototype._contents_.apply(_st(self), [aString]);
  1220. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},globals.HLNavigationCodeWidget)})},
  1221. args: ["aString"],
  1222. source: "contents: aString\x0a\x09self methodContents: aString.\x0a\x09super contents: aString",
  1223. messageSends: ["methodContents:", "contents:"],
  1224. referencedClasses: []
  1225. }),
  1226. globals.HLNavigationCodeWidget);
  1227. smalltalk.addMethod(
  1228. smalltalk.method({
  1229. selector: "hasModification",
  1230. protocol: 'testing',
  1231. fn: function (){
  1232. var self=this;
  1233. return smalltalk.withContext(function($ctx1) {
  1234. var $1;
  1235. $1=_st(_st(self._methodContents()).__eq(self._contents()))._not();
  1236. return $1;
  1237. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},globals.HLNavigationCodeWidget)})},
  1238. args: [],
  1239. source: "hasModification\x0a\x09^ (self methodContents = self contents) not",
  1240. messageSends: ["not", "=", "methodContents", "contents"],
  1241. referencedClasses: []
  1242. }),
  1243. globals.HLNavigationCodeWidget);
  1244. smalltalk.addMethod(
  1245. smalltalk.method({
  1246. selector: "methodContents",
  1247. protocol: 'accessing',
  1248. fn: function (){
  1249. var self=this;
  1250. return smalltalk.withContext(function($ctx1) {
  1251. var $2,$1;
  1252. $2=self["@methodContents"];
  1253. if(($receiver = $2) == nil || $receiver == null){
  1254. $1="";
  1255. } else {
  1256. $1=$2;
  1257. };
  1258. return $1;
  1259. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},globals.HLNavigationCodeWidget)})},
  1260. args: [],
  1261. source: "methodContents\x0a\x09^ methodContents ifNil: [ '' ]",
  1262. messageSends: ["ifNil:"],
  1263. referencedClasses: []
  1264. }),
  1265. globals.HLNavigationCodeWidget);
  1266. smalltalk.addMethod(
  1267. smalltalk.method({
  1268. selector: "methodContents:",
  1269. protocol: 'accessing',
  1270. fn: function (aString){
  1271. var self=this;
  1272. var $1;
  1273. self["@methodContents"]=aString;
  1274. $1=self["@methodContents"];
  1275. return $1;
  1276. },
  1277. args: ["aString"],
  1278. source: "methodContents: aString\x0a\x09^ methodContents := aString",
  1279. messageSends: [],
  1280. referencedClasses: []
  1281. }),
  1282. globals.HLNavigationCodeWidget);
  1283. smalltalk.addMethod(
  1284. smalltalk.method({
  1285. selector: "previous",
  1286. protocol: 'accessing',
  1287. fn: function (){
  1288. var self=this;
  1289. return self},
  1290. args: [],
  1291. source: "previous\x0a\x09\x22for browser lists widget\x22",
  1292. messageSends: [],
  1293. referencedClasses: []
  1294. }),
  1295. globals.HLNavigationCodeWidget);
  1296. smalltalk.addMethod(
  1297. smalltalk.method({
  1298. selector: "previous:",
  1299. protocol: 'accessing',
  1300. fn: function (aWidget){
  1301. var self=this;
  1302. return self},
  1303. args: ["aWidget"],
  1304. source: "previous: aWidget\x0a\x09\x22for browser lists widget\x22",
  1305. messageSends: [],
  1306. referencedClasses: []
  1307. }),
  1308. globals.HLNavigationCodeWidget);
  1309. smalltalk.addMethod(
  1310. smalltalk.method({
  1311. selector: "canBeOpenAsTab",
  1312. protocol: 'testing',
  1313. fn: function (){
  1314. var self=this;
  1315. return false;
  1316. },
  1317. args: [],
  1318. source: "canBeOpenAsTab\x0a\x09^ false",
  1319. messageSends: [],
  1320. referencedClasses: []
  1321. }),
  1322. globals.HLNavigationCodeWidget.klass);
  1323. smalltalk.addMethod(
  1324. smalltalk.method({
  1325. selector: "on:",
  1326. protocol: 'instance creation',
  1327. fn: function (aBrowserModel){
  1328. var self=this;
  1329. return smalltalk.withContext(function($ctx1) {
  1330. var $2,$3,$1;
  1331. $2=self._new();
  1332. _st($2)._browserModel_(aBrowserModel);
  1333. $3=_st($2)._yourself();
  1334. $1=$3;
  1335. return $1;
  1336. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},globals.HLNavigationCodeWidget.klass)})},
  1337. args: ["aBrowserModel"],
  1338. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1339. messageSends: ["browserModel:", "new", "yourself"],
  1340. referencedClasses: []
  1341. }),
  1342. globals.HLNavigationCodeWidget.klass);
  1343. smalltalk.addClass('HLBrowserCodeWidget', globals.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  1344. smalltalk.addMethod(
  1345. smalltalk.method({
  1346. selector: "browserModel",
  1347. protocol: 'accessing',
  1348. fn: function (){
  1349. var self=this;
  1350. var $1;
  1351. $1=self["@browserModel"];
  1352. return $1;
  1353. },
  1354. args: [],
  1355. source: "browserModel\x0a\x09^ browserModel",
  1356. messageSends: [],
  1357. referencedClasses: []
  1358. }),
  1359. globals.HLBrowserCodeWidget);
  1360. smalltalk.addMethod(
  1361. smalltalk.method({
  1362. selector: "browserModel:",
  1363. protocol: 'accessing',
  1364. fn: function (aBrowserModel){
  1365. var self=this;
  1366. return smalltalk.withContext(function($ctx1) {
  1367. var $1;
  1368. self["@browserModel"]=aBrowserModel;
  1369. self._observeSystem();
  1370. $1=self._observeBrowserModel();
  1371. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},globals.HLBrowserCodeWidget)})},
  1372. args: ["aBrowserModel"],
  1373. source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x09self \x0a\x09\x09observeSystem;\x0a\x09\x09observeBrowserModel",
  1374. messageSends: ["observeSystem", "observeBrowserModel"],
  1375. referencedClasses: []
  1376. }),
  1377. globals.HLBrowserCodeWidget);
  1378. smalltalk.addMethod(
  1379. smalltalk.method({
  1380. selector: "observeBrowserModel",
  1381. protocol: 'actions',
  1382. fn: function (){
  1383. var self=this;
  1384. function $HLSaveSourceCode(){return globals.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  1385. function $HLShowInstanceToggled(){return globals.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
  1386. function $HLSourceCodeSaved(){return globals.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  1387. function $HLAboutToChange(){return globals.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  1388. function $HLParseErrorRaised(){return globals.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  1389. function $HLCompileErrorRaised(){return globals.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  1390. function $HLUnknownVariableErrorRaised(){return globals.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  1391. function $HLInstVarAdded(){return globals.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  1392. function $HLMethodSelected(){return globals.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1393. function $HLClassSelected(){return globals.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1394. function $HLPackageSelected(){return globals.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  1395. function $HLProtocolSelected(){return globals.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1396. function $HLSourceCodeFocusRequested(){return globals.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1397. function $HLShowTemplate(){return globals.HLShowTemplate||(typeof HLShowTemplate=="undefined"?nil:HLShowTemplate)}
  1398. return smalltalk.withContext(function($ctx1) {
  1399. var $1,$2;
  1400. $1=_st(self._browserModel())._announcer();
  1401. _st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
  1402. $ctx1.sendIdx["on:send:to:"]=1;
  1403. _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
  1404. $ctx1.sendIdx["on:send:to:"]=2;
  1405. _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
  1406. $ctx1.sendIdx["on:send:to:"]=3;
  1407. _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
  1408. $ctx1.sendIdx["on:send:to:"]=4;
  1409. _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
  1410. $ctx1.sendIdx["on:send:to:"]=5;
  1411. _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
  1412. $ctx1.sendIdx["on:send:to:"]=6;
  1413. _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
  1414. $ctx1.sendIdx["on:send:to:"]=7;
  1415. _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
  1416. $ctx1.sendIdx["on:send:to:"]=8;
  1417. _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
  1418. $ctx1.sendIdx["on:send:to:"]=9;
  1419. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  1420. $ctx1.sendIdx["on:send:to:"]=10;
  1421. _st($1)._on_send_to_($HLPackageSelected(),"onPackageSelected:",self);
  1422. $ctx1.sendIdx["on:send:to:"]=11;
  1423. _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
  1424. $ctx1.sendIdx["on:send:to:"]=12;
  1425. _st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
  1426. $ctx1.sendIdx["on:send:to:"]=13;
  1427. $2=_st($1)._on_send_to_($HLShowTemplate(),"onShowTemplate:",self);
  1428. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},globals.HLBrowserCodeWidget)})},
  1429. args: [],
  1430. source: "observeBrowserModel\x0a\x09self browserModel announcer\x0a\x09\x09on: HLSaveSourceCode\x0a\x09\x09send: #onSaveIt\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLShowInstanceToggled\x0a\x09\x09send: #onShowInstanceToggled\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeSaved\x0a\x09\x09send: #onSourceCodeSaved\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLAboutToChange\x0a\x09\x09send: #onBrowserAboutToChange:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLParseErrorRaised\x0a\x09\x09send: #onParseError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLCompileErrorRaised\x0a\x09\x09send: #onCompileError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLUnknownVariableErrorRaised\x0a\x09\x09send: #onUnknownVariableError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLInstVarAdded \x0a\x09\x09send: #onInstVarAdded\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09send: #onMethodSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a \x09on: HLClassSelected \x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLPackageSelected \x0a\x09\x09send: #onPackageSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a \x09on: HLProtocolSelected \x0a\x09\x09send: #onProtocolSelected: \x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09send: #onSourceCodeFocusRequested\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLShowTemplate\x0a\x09\x09send: #onShowTemplate:\x0a\x09\x09to: self",
  1431. messageSends: ["on:send:to:", "announcer", "browserModel"],
  1432. referencedClasses: ["HLSaveSourceCode", "HLShowInstanceToggled", "HLSourceCodeSaved", "HLAboutToChange", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLPackageSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested", "HLShowTemplate"]
  1433. }),
  1434. globals.HLBrowserCodeWidget);
  1435. smalltalk.addMethod(
  1436. smalltalk.method({
  1437. selector: "observeSystem",
  1438. protocol: 'actions',
  1439. fn: function (){
  1440. var self=this;
  1441. function $MethodModified(){return globals.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  1442. return smalltalk.withContext(function($ctx1) {
  1443. _st(_st(self._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
  1444. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},globals.HLBrowserCodeWidget)})},
  1445. args: [],
  1446. source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a \x09on: MethodModified\x0a send: #onMethodModified:\x0a\x09\x09to: self",
  1447. messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"],
  1448. referencedClasses: ["MethodModified"]
  1449. }),
  1450. globals.HLBrowserCodeWidget);
  1451. smalltalk.addMethod(
  1452. smalltalk.method({
  1453. selector: "onBrowserAboutToChange:",
  1454. protocol: 'reactions',
  1455. fn: function (anAnnouncement){
  1456. var self=this;
  1457. var block;
  1458. function $HLChangeForbidden(){return globals.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  1459. return smalltalk.withContext(function($ctx1) {
  1460. var $1;
  1461. block=_st(anAnnouncement)._actionBlock();
  1462. $1=self._hasModification();
  1463. if(smalltalk.assert($1)){
  1464. self._confirm_ifTrue_("Changes have not been saved. Do you want to discard these changes?",(function(){
  1465. return smalltalk.withContext(function($ctx2) {
  1466. self._methodContents_(self._contents());
  1467. return _st(block)._value();
  1468. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1469. _st($HLChangeForbidden())._signal();
  1470. };
  1471. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},globals.HLBrowserCodeWidget)})},
  1472. args: ["anAnnouncement"],
  1473. source: "onBrowserAboutToChange: anAnnouncement\x0a\x09| block |\x0a\x09\x0a\x09block := anAnnouncement actionBlock.\x0a\x09\x0a\x09self hasModification\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self \x0a\x09\x09\x09\x09confirm: 'Changes have not been saved. Do you want to discard these changes?' \x0a\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x22Don't ask twice\x22\x0a\x09\x09\x09\x09\x09self methodContents: self contents.\x0a\x09\x09\x09\x09\x09block value ].\x0a\x09\x09\x09\x0a\x09\x09\x09\x0a\x09\x09\x09HLChangeForbidden signal ]",
  1474. messageSends: ["actionBlock", "ifTrue:", "hasModification", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal"],
  1475. referencedClasses: ["HLChangeForbidden"]
  1476. }),
  1477. globals.HLBrowserCodeWidget);
  1478. smalltalk.addMethod(
  1479. smalltalk.method({
  1480. selector: "onClassSelected:",
  1481. protocol: 'reactions',
  1482. fn: function (anAnnouncement){
  1483. var self=this;
  1484. var class_;
  1485. return smalltalk.withContext(function($ctx1) {
  1486. var $1,$2;
  1487. class_=_st(anAnnouncement)._item();
  1488. $1=class_;
  1489. if(($receiver = $1) == nil || $receiver == null){
  1490. $2=self._contents_("");
  1491. $ctx1.sendIdx["contents:"]=1;
  1492. return $2;
  1493. } else {
  1494. $1;
  1495. };
  1496. self._contents_(_st(class_)._definition());
  1497. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},globals.HLBrowserCodeWidget)})},
  1498. args: ["anAnnouncement"],
  1499. source: "onClassSelected: anAnnouncement\x0a\x09| class |\x0a\x09\x0a\x09class:= anAnnouncement item.\x0a\x09\x0a\x09class ifNil: [ ^ self contents: '' ].\x0a\x09self contents: class definition",
  1500. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1501. referencedClasses: []
  1502. }),
  1503. globals.HLBrowserCodeWidget);
  1504. smalltalk.addMethod(
  1505. smalltalk.method({
  1506. selector: "onCompileError:",
  1507. protocol: 'reactions',
  1508. fn: function (anAnnouncement){
  1509. var self=this;
  1510. return smalltalk.withContext(function($ctx1) {
  1511. self._alert_(_st(_st(anAnnouncement)._error())._messageText());
  1512. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1513. args: ["anAnnouncement"],
  1514. source: "onCompileError: anAnnouncement\x0a\x09self alert: anAnnouncement error messageText",
  1515. messageSends: ["alert:", "messageText", "error"],
  1516. referencedClasses: []
  1517. }),
  1518. globals.HLBrowserCodeWidget);
  1519. smalltalk.addMethod(
  1520. smalltalk.method({
  1521. selector: "onInstVarAdded",
  1522. protocol: 'reactions',
  1523. fn: function (){
  1524. var self=this;
  1525. return smalltalk.withContext(function($ctx1) {
  1526. _st(self._browserModel())._save_(self._contents());
  1527. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},globals.HLBrowserCodeWidget)})},
  1528. args: [],
  1529. source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
  1530. messageSends: ["save:", "browserModel", "contents"],
  1531. referencedClasses: []
  1532. }),
  1533. globals.HLBrowserCodeWidget);
  1534. smalltalk.addMethod(
  1535. smalltalk.method({
  1536. selector: "onMethodModified:",
  1537. protocol: 'reactions',
  1538. fn: function (anAnnouncement){
  1539. var self=this;
  1540. var method;
  1541. return smalltalk.withContext(function($ctx1) {
  1542. var $3,$2,$1,$5,$4,$7,$6;
  1543. method=_st(anAnnouncement)._method();
  1544. $3=self._browserModel();
  1545. $ctx1.sendIdx["browserModel"]=1;
  1546. $2=_st($3)._selectedClass();
  1547. $1=_st($2).__eq(_st(method)._methodClass());
  1548. $ctx1.sendIdx["="]=1;
  1549. if(! smalltalk.assert($1)){
  1550. return self;
  1551. };
  1552. $5=self._browserModel();
  1553. $ctx1.sendIdx["browserModel"]=2;
  1554. $4=_st($5)._selectedMethod();
  1555. $ctx1.sendIdx["selectedMethod"]=1;
  1556. if(($receiver = $4) == nil || $receiver == null){
  1557. return self;
  1558. } else {
  1559. $4;
  1560. };
  1561. $7=_st(_st(self._browserModel())._selectedMethod())._selector();
  1562. $ctx1.sendIdx["selector"]=1;
  1563. $6=_st($7).__eq(_st(method)._selector());
  1564. if(! smalltalk.assert($6)){
  1565. return self;
  1566. };
  1567. self._refresh();
  1568. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},globals.HLBrowserCodeWidget)})},
  1569. args: ["anAnnouncement"],
  1570. source: "onMethodModified: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement method.\x0a\x09\x0a\x09self browserModel selectedClass = method methodClass ifFalse: [ ^ self ].\x0a\x09self browserModel selectedMethod ifNil: [ ^ self ].\x0a\x09self browserModel selectedMethod selector = method selector ifFalse: [ ^ self ].\x0a\x0a\x09self refresh",
  1571. messageSends: ["method", "ifFalse:", "=", "selectedClass", "browserModel", "methodClass", "ifNil:", "selectedMethod", "selector", "refresh"],
  1572. referencedClasses: []
  1573. }),
  1574. globals.HLBrowserCodeWidget);
  1575. smalltalk.addMethod(
  1576. smalltalk.method({
  1577. selector: "onMethodSelected:",
  1578. protocol: 'reactions',
  1579. fn: function (anAnnouncement){
  1580. var self=this;
  1581. var method;
  1582. return smalltalk.withContext(function($ctx1) {
  1583. var $1,$2;
  1584. method=_st(anAnnouncement)._item();
  1585. $1=method;
  1586. if(($receiver = $1) == nil || $receiver == null){
  1587. $2=self._contents_("");
  1588. $ctx1.sendIdx["contents:"]=1;
  1589. return $2;
  1590. } else {
  1591. $1;
  1592. };
  1593. self._contents_(_st(method)._source());
  1594. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},globals.HLBrowserCodeWidget)})},
  1595. args: ["anAnnouncement"],
  1596. source: "onMethodSelected: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement item.\x0a\x09\x0a\x09method ifNil: [ ^ self contents: '' ].\x0a\x09self contents: method source",
  1597. messageSends: ["item", "ifNil:", "contents:", "source"],
  1598. referencedClasses: []
  1599. }),
  1600. globals.HLBrowserCodeWidget);
  1601. smalltalk.addMethod(
  1602. smalltalk.method({
  1603. selector: "onPackageSelected:",
  1604. protocol: 'reactions',
  1605. fn: function (anAnnouncement){
  1606. var self=this;
  1607. var package_;
  1608. return smalltalk.withContext(function($ctx1) {
  1609. var $1,$2;
  1610. package_=_st(anAnnouncement)._item();
  1611. $1=package_;
  1612. if(($receiver = $1) == nil || $receiver == null){
  1613. $2=self._contents_("");
  1614. $ctx1.sendIdx["contents:"]=1;
  1615. return $2;
  1616. } else {
  1617. $1;
  1618. };
  1619. self._contents_(_st(package_)._definition());
  1620. return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{anAnnouncement:anAnnouncement,package_:package_},globals.HLBrowserCodeWidget)})},
  1621. args: ["anAnnouncement"],
  1622. source: "onPackageSelected: anAnnouncement\x0a\x09| package |\x0a\x09\x0a\x09package := anAnnouncement item.\x0a\x09\x0a\x09package ifNil: [ ^ self contents: '' ].\x0a\x09self contents: package definition",
  1623. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1624. referencedClasses: []
  1625. }),
  1626. globals.HLBrowserCodeWidget);
  1627. smalltalk.addMethod(
  1628. smalltalk.method({
  1629. selector: "onParseError:",
  1630. protocol: 'reactions',
  1631. fn: function (anAnnouncement){
  1632. var self=this;
  1633. var lineIndex,newContents;
  1634. function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
  1635. return smalltalk.withContext(function($ctx1) {
  1636. var $1,$3,$2,$6,$5,$4;
  1637. lineIndex=(1);
  1638. self._contents_(_st($String())._streamContents_((function(stream){
  1639. return smalltalk.withContext(function($ctx2) {
  1640. return _st(self._contents())._linesDo_((function(each){
  1641. return smalltalk.withContext(function($ctx3) {
  1642. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1643. if(smalltalk.assert($1)){
  1644. $3=_st(anAnnouncement)._column();
  1645. $ctx3.sendIdx["column"]=1;
  1646. $2=_st(each)._copyFrom_to_((1),$3);
  1647. $ctx3.sendIdx["copyFrom:to:"]=1;
  1648. _st(stream)._nextPutAll_($2);
  1649. $ctx3.sendIdx["nextPutAll:"]=1;
  1650. _st(stream)._nextPutAll_("<- ");
  1651. $ctx3.sendIdx["nextPutAll:"]=2;
  1652. _st(stream)._nextPutAll_(_st(anAnnouncement)._message());
  1653. $ctx3.sendIdx["nextPutAll:"]=3;
  1654. _st(stream)._nextPutAll_(" ");
  1655. $ctx3.sendIdx["nextPutAll:"]=4;
  1656. $6=_st(_st(anAnnouncement)._column()).__plus((1));
  1657. $ctx3.sendIdx["+"]=1;
  1658. $5=_st(each)._copyFrom_to_($6,_st(each)._size());
  1659. $4=_st(stream)._nextPutAll_($5);
  1660. $ctx3.sendIdx["nextPutAll:"]=5;
  1661. $4;
  1662. } else {
  1663. _st(stream)._nextPutAll_(each);
  1664. $ctx3.sendIdx["nextPutAll:"]=6;
  1665. };
  1666. _st(stream)._nextPutAll_(_st($String())._cr());
  1667. lineIndex=_st(lineIndex).__plus((1));
  1668. return lineIndex;
  1669. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  1670. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})));
  1671. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},globals.HLBrowserCodeWidget)})},
  1672. args: ["anAnnouncement"],
  1673. source: "onParseError: anAnnouncement\x0a\x09| lineIndex newContents |\x0a\x09\x0a\x09lineIndex := 1.\x0a\x09\x0a\x09self contents: (String streamContents: [ :stream |\x0a\x09\x09self contents linesDo: [ :each |\x0a\x09\x09\x09lineIndex = anAnnouncement line \x0a\x09\x09\x09\x09ifTrue: [ \x0a\x09\x09\x09\x09\x09stream \x0a\x09\x09\x09\x09\x09\x09nextPutAll: (each copyFrom: 1 to: anAnnouncement column);\x0a\x09\x09\x09\x09\x09\x09nextPutAll: '<- ';\x0a\x09\x09\x09\x09\x09\x09nextPutAll: anAnnouncement message;\x0a\x09\x09\x09\x09\x09\x09nextPutAll: ' ';\x0a\x09\x09\x09\x09\x09\x09nextPutAll: (each copyFrom: anAnnouncement column + 1 to: each size) ]\x0a\x09\x09\x09\x09ifFalse: [ stream nextPutAll: each ].\x0a\x09\x09\x09stream nextPutAll: String cr.\x0a\x09\x09\x09lineIndex := lineIndex + 1 ] ])",
  1674. messageSends: ["contents:", "streamContents:", "linesDo:", "contents", "ifTrue:ifFalse:", "=", "line", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "cr"],
  1675. referencedClasses: ["String"]
  1676. }),
  1677. globals.HLBrowserCodeWidget);
  1678. smalltalk.addMethod(
  1679. smalltalk.method({
  1680. selector: "onProtocolSelected:",
  1681. protocol: 'reactions',
  1682. fn: function (anAnnouncement){
  1683. var self=this;
  1684. return smalltalk.withContext(function($ctx1) {
  1685. var $2,$1,$3;
  1686. $2=self._browserModel();
  1687. $ctx1.sendIdx["browserModel"]=1;
  1688. $1=_st($2)._selectedClass();
  1689. $ctx1.sendIdx["selectedClass"]=1;
  1690. if(($receiver = $1) == nil || $receiver == null){
  1691. $3=self._contents_("");
  1692. $ctx1.sendIdx["contents:"]=1;
  1693. return $3;
  1694. } else {
  1695. $1;
  1696. };
  1697. self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
  1698. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1699. args: ["anAnnouncement"],
  1700. source: "onProtocolSelected: anAnnouncement\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a\x09self contents: self browserModel selectedClass definition",
  1701. messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
  1702. referencedClasses: []
  1703. }),
  1704. globals.HLBrowserCodeWidget);
  1705. smalltalk.addMethod(
  1706. smalltalk.method({
  1707. selector: "onSaveIt",
  1708. protocol: 'reactions',
  1709. fn: function (){
  1710. var self=this;
  1711. return smalltalk.withContext(function($ctx1) {
  1712. _st(self._browserModel())._save_(self._contents());
  1713. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},globals.HLBrowserCodeWidget)})},
  1714. args: [],
  1715. source: "onSaveIt\x0a\x09self browserModel save: self contents",
  1716. messageSends: ["save:", "browserModel", "contents"],
  1717. referencedClasses: []
  1718. }),
  1719. globals.HLBrowserCodeWidget);
  1720. smalltalk.addMethod(
  1721. smalltalk.method({
  1722. selector: "onShowInstanceToggled",
  1723. protocol: 'reactions',
  1724. fn: function (){
  1725. var self=this;
  1726. return smalltalk.withContext(function($ctx1) {
  1727. var $2,$1,$3;
  1728. $2=self._browserModel();
  1729. $ctx1.sendIdx["browserModel"]=1;
  1730. $1=_st($2)._selectedClass();
  1731. $ctx1.sendIdx["selectedClass"]=1;
  1732. if(($receiver = $1) == nil || $receiver == null){
  1733. $3=self._contents_("");
  1734. $ctx1.sendIdx["contents:"]=1;
  1735. return $3;
  1736. } else {
  1737. $1;
  1738. };
  1739. self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
  1740. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},globals.HLBrowserCodeWidget)})},
  1741. args: [],
  1742. source: "onShowInstanceToggled\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a\x09self contents: self browserModel selectedClass definition",
  1743. messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
  1744. referencedClasses: []
  1745. }),
  1746. globals.HLBrowserCodeWidget);
  1747. smalltalk.addMethod(
  1748. smalltalk.method({
  1749. selector: "onShowTemplate:",
  1750. protocol: 'reactions',
  1751. fn: function (anAnnouncement){
  1752. var self=this;
  1753. return smalltalk.withContext(function($ctx1) {
  1754. self._contents_(_st(anAnnouncement)._template());
  1755. return self}, function($ctx1) {$ctx1.fill(self,"onShowTemplate:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1756. args: ["anAnnouncement"],
  1757. source: "onShowTemplate: anAnnouncement\x0a\x09self contents: anAnnouncement template",
  1758. messageSends: ["contents:", "template"],
  1759. referencedClasses: []
  1760. }),
  1761. globals.HLBrowserCodeWidget);
  1762. smalltalk.addMethod(
  1763. smalltalk.method({
  1764. selector: "onSourceCodeFocusRequested",
  1765. protocol: 'reactions',
  1766. fn: function (){
  1767. var self=this;
  1768. return smalltalk.withContext(function($ctx1) {
  1769. self._focus();
  1770. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},globals.HLBrowserCodeWidget)})},
  1771. args: [],
  1772. source: "onSourceCodeFocusRequested\x0a\x09self focus",
  1773. messageSends: ["focus"],
  1774. referencedClasses: []
  1775. }),
  1776. globals.HLBrowserCodeWidget);
  1777. smalltalk.addMethod(
  1778. smalltalk.method({
  1779. selector: "onSourceCodeSaved",
  1780. protocol: 'reactions',
  1781. fn: function (){
  1782. var self=this;
  1783. return smalltalk.withContext(function($ctx1) {
  1784. self._methodContents_(self._contents());
  1785. self._updateState();
  1786. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},globals.HLBrowserCodeWidget)})},
  1787. args: [],
  1788. source: "onSourceCodeSaved\x0a\x09self methodContents: self contents.\x0a\x09self updateState",
  1789. messageSends: ["methodContents:", "contents", "updateState"],
  1790. referencedClasses: []
  1791. }),
  1792. globals.HLBrowserCodeWidget);
  1793. smalltalk.addMethod(
  1794. smalltalk.method({
  1795. selector: "onUnknownVariableError:",
  1796. protocol: 'reactions',
  1797. fn: function (anAnnouncement){
  1798. var self=this;
  1799. var error;
  1800. function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
  1801. return smalltalk.withContext(function($ctx1) {
  1802. var $1;
  1803. error=_st(anAnnouncement)._error();
  1804. self._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1805. return smalltalk.withContext(function($ctx2) {
  1806. _st(stream)._nextPutAll_(_st(error)._messageText());
  1807. $ctx2.sendIdx["nextPutAll:"]=1;
  1808. _st(stream)._nextPutAll_(_st($String())._cr());
  1809. $ctx2.sendIdx["nextPutAll:"]=2;
  1810. $1=_st(stream)._nextPutAll_("Would you like to define an instance variable?");
  1811. return $1;
  1812. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})),(function(){
  1813. return smalltalk.withContext(function($ctx2) {
  1814. return _st(self._browserModel())._addInstVarNamed_(_st(error)._variableName());
  1815. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1816. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},globals.HLBrowserCodeWidget)})},
  1817. args: ["anAnnouncement"],
  1818. source: "onUnknownVariableError: anAnnouncement\x0a\x09| error |\x0a\x09\x0a\x09error := anAnnouncement error.\x0a\x09\x0a\x09self \x0a\x09\x09confirm: (String streamContents: [ :stream |\x0a\x09\x09\x09stream \x0a\x09\x09\x09\x09nextPutAll: error messageText;\x0a\x09\x09\x09\x09nextPutAll: String cr;\x0a\x09\x09\x09\x09nextPutAll: 'Would you like to define an instance variable?' ])\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self browserModel addInstVarNamed: error variableName ]",
  1819. messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "browserModel", "variableName"],
  1820. referencedClasses: ["String"]
  1821. }),
  1822. globals.HLBrowserCodeWidget);
  1823. smalltalk.addMethod(
  1824. smalltalk.method({
  1825. selector: "refresh",
  1826. protocol: 'actions',
  1827. fn: function (){
  1828. var self=this;
  1829. return smalltalk.withContext(function($ctx1) {
  1830. var $1,$2;
  1831. $1=self._hasModification();
  1832. if(smalltalk.assert($1)){
  1833. return self;
  1834. };
  1835. $2=self._hasFocus();
  1836. if(smalltalk.assert($2)){
  1837. return self;
  1838. };
  1839. self._contents_(_st(_st(self._browserModel())._selectedMethod())._source());
  1840. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},globals.HLBrowserCodeWidget)})},
  1841. args: [],
  1842. source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self browserModel selectedMethod source",
  1843. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"],
  1844. referencedClasses: []
  1845. }),
  1846. globals.HLBrowserCodeWidget);
  1847. smalltalk.addMethod(
  1848. smalltalk.method({
  1849. selector: "renderButtonsOn:",
  1850. protocol: 'actions',
  1851. fn: function (html){
  1852. var self=this;
  1853. return smalltalk.withContext(function($ctx1) {
  1854. var $1,$2;
  1855. $1=_st(html)._button();
  1856. _st($1)._class_("button");
  1857. _st($1)._with_("SaveIt");
  1858. $2=_st($1)._onClick_((function(){
  1859. return smalltalk.withContext(function($ctx2) {
  1860. return self._saveIt();
  1861. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1862. globals.HLBrowserCodeWidget.superclass.fn.prototype._renderButtonsOn_.apply(_st(self), [html]);
  1863. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLBrowserCodeWidget)})},
  1864. args: ["html"],
  1865. source: "renderButtonsOn: html\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'SaveIt';\x0a\x09\x09onClick: [ self saveIt ].\x0a\x09super renderButtonsOn: html",
  1866. messageSends: ["class:", "button", "with:", "onClick:", "saveIt", "renderButtonsOn:"],
  1867. referencedClasses: []
  1868. }),
  1869. globals.HLBrowserCodeWidget);
  1870. smalltalk.addMethod(
  1871. smalltalk.method({
  1872. selector: "saveIt",
  1873. protocol: 'actions',
  1874. fn: function (){
  1875. var self=this;
  1876. return smalltalk.withContext(function($ctx1) {
  1877. _st(self._browserModel())._saveSourceCode();
  1878. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},globals.HLBrowserCodeWidget)})},
  1879. args: [],
  1880. source: "saveIt\x0a\x09self browserModel saveSourceCode",
  1881. messageSends: ["saveSourceCode", "browserModel"],
  1882. referencedClasses: []
  1883. }),
  1884. globals.HLBrowserCodeWidget);
  1885. smalltalk.addMethod(
  1886. smalltalk.method({
  1887. selector: "unregister",
  1888. protocol: 'actions',
  1889. fn: function (){
  1890. var self=this;
  1891. return smalltalk.withContext(function($ctx1) {
  1892. var $2,$1;
  1893. globals.HLBrowserCodeWidget.superclass.fn.prototype._unregsiter.apply(_st(self), []);
  1894. $2=self._browserModel();
  1895. $ctx1.sendIdx["browserModel"]=1;
  1896. $1=_st($2)._announcer();
  1897. _st($1)._unsubscribe_(self);
  1898. $ctx1.sendIdx["unsubscribe:"]=1;
  1899. _st(_st(self._browserModel())._systemAnnouncer())._unsubscribe_(self);
  1900. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLBrowserCodeWidget)})},
  1901. args: [],
  1902. source: "unregister\x0a\x09super unregsiter.\x0a\x09\x0a\x09self browserModel announcer unsubscribe: self.\x0a\x09self browserModel systemAnnouncer unsubscribe: self",
  1903. messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"],
  1904. referencedClasses: []
  1905. }),
  1906. globals.HLBrowserCodeWidget);
  1907. smalltalk.addMethod(
  1908. smalltalk.method({
  1909. selector: "canBeOpenAsTab",
  1910. protocol: 'testing',
  1911. fn: function (){
  1912. var self=this;
  1913. return false;
  1914. },
  1915. args: [],
  1916. source: "canBeOpenAsTab\x0a\x09^ false",
  1917. messageSends: [],
  1918. referencedClasses: []
  1919. }),
  1920. globals.HLBrowserCodeWidget.klass);
  1921. smalltalk.addMethod(
  1922. smalltalk.method({
  1923. selector: "on:",
  1924. protocol: 'instance creation',
  1925. fn: function (aBrowserModel){
  1926. var self=this;
  1927. return smalltalk.withContext(function($ctx1) {
  1928. var $2,$3,$1;
  1929. $2=self._new();
  1930. _st($2)._browserModel_(aBrowserModel);
  1931. $3=_st($2)._yourself();
  1932. $1=$3;
  1933. return $1;
  1934. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},globals.HLBrowserCodeWidget.klass)})},
  1935. args: ["aBrowserModel"],
  1936. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1937. messageSends: ["browserModel:", "new", "yourself"],
  1938. referencedClasses: []
  1939. }),
  1940. globals.HLBrowserCodeWidget.klass);
  1941. smalltalk.addClass('HLWorkspace', globals.HLWidget, ['codeWidget', 'transcript'], 'Helios-Workspace');
  1942. smalltalk.addMethod(
  1943. smalltalk.method({
  1944. selector: "canHaveFocus",
  1945. protocol: 'testing',
  1946. fn: function (){
  1947. var self=this;
  1948. return true;
  1949. },
  1950. args: [],
  1951. source: "canHaveFocus\x0a\x09^ true",
  1952. messageSends: [],
  1953. referencedClasses: []
  1954. }),
  1955. globals.HLWorkspace);
  1956. smalltalk.addMethod(
  1957. smalltalk.method({
  1958. selector: "codeWidget",
  1959. protocol: 'accessing',
  1960. fn: function (){
  1961. var self=this;
  1962. function $HLCodeWidget(){return globals.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  1963. return smalltalk.withContext(function($ctx1) {
  1964. var $2,$1;
  1965. $2=self["@codeWidget"];
  1966. if(($receiver = $2) == nil || $receiver == null){
  1967. self["@codeWidget"]=_st($HLCodeWidget())._new();
  1968. $1=self["@codeWidget"];
  1969. } else {
  1970. $1=$2;
  1971. };
  1972. return $1;
  1973. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},globals.HLWorkspace)})},
  1974. args: [],
  1975. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
  1976. messageSends: ["ifNil:", "new"],
  1977. referencedClasses: ["HLCodeWidget"]
  1978. }),
  1979. globals.HLWorkspace);
  1980. smalltalk.addMethod(
  1981. smalltalk.method({
  1982. selector: "focus",
  1983. protocol: 'actions',
  1984. fn: function (){
  1985. var self=this;
  1986. return smalltalk.withContext(function($ctx1) {
  1987. var $1;
  1988. $1=_st(self._codeWidget())._focus();
  1989. return $1;
  1990. }, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLWorkspace)})},
  1991. args: [],
  1992. source: "focus\x0a\x09^ self codeWidget focus",
  1993. messageSends: ["focus", "codeWidget"],
  1994. referencedClasses: []
  1995. }),
  1996. globals.HLWorkspace);
  1997. smalltalk.addMethod(
  1998. smalltalk.method({
  1999. selector: "renderContentOn:",
  2000. protocol: 'rendering',
  2001. fn: function (html){
  2002. var self=this;
  2003. function $HLContainer(){return globals.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  2004. function $HLHorizontalSplitter(){return globals.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  2005. return smalltalk.withContext(function($ctx1) {
  2006. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._codeWidget(),(function(canvas){
  2007. return smalltalk.withContext(function($ctx2) {
  2008. return self._renderTranscriptOn_(canvas);
  2009. }, function($ctx2) {$ctx2.fillBlock({canvas:canvas},$ctx1,1)})}))));
  2010. $ctx1.sendIdx["with:"]=1;
  2011. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLWorkspace)})},
  2012. args: ["html"],
  2013. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter\x0a\x09\x09with: self codeWidget\x0a\x09\x09with: [ :canvas | self renderTranscriptOn: canvas ]))",
  2014. messageSends: ["with:", "with:with:", "codeWidget", "renderTranscriptOn:"],
  2015. referencedClasses: ["HLContainer", "HLHorizontalSplitter"]
  2016. }),
  2017. globals.HLWorkspace);
  2018. smalltalk.addMethod(
  2019. smalltalk.method({
  2020. selector: "renderTranscriptOn:",
  2021. protocol: 'rendering',
  2022. fn: function (html){
  2023. var self=this;
  2024. return smalltalk.withContext(function($ctx1) {
  2025. var $1,$3,$4,$2;
  2026. $1=_st(html)._div();
  2027. $ctx1.sendIdx["div"]=1;
  2028. _st($1)._class_("transcript-container");
  2029. $ctx1.sendIdx["class:"]=1;
  2030. $2=_st($1)._with_((function(){
  2031. return smalltalk.withContext(function($ctx2) {
  2032. $3=_st(html)._div();
  2033. _st($3)._class_("list-label");
  2034. $4=_st($3)._with_("Transcript");
  2035. $4;
  2036. return _st(self._transcript())._renderOn_(html);
  2037. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2038. $ctx1.sendIdx["with:"]=1;
  2039. return self}, function($ctx1) {$ctx1.fill(self,"renderTranscriptOn:",{html:html},globals.HLWorkspace)})},
  2040. args: ["html"],
  2041. source: "renderTranscriptOn: html\x0a\x09html div \x0a\x09\x09class: 'transcript-container';\x0a\x09\x09with: [\x0a\x09\x09\x09html div\x0a\x09\x09\x09\x09class: 'list-label';\x0a\x09\x09\x09\x09with: 'Transcript'.\x0a\x09\x09\x09self transcript renderOn: html ]",
  2042. messageSends: ["class:", "div", "with:", "renderOn:", "transcript"],
  2043. referencedClasses: []
  2044. }),
  2045. globals.HLWorkspace);
  2046. smalltalk.addMethod(
  2047. smalltalk.method({
  2048. selector: "transcript",
  2049. protocol: 'accessing',
  2050. fn: function (){
  2051. var self=this;
  2052. function $HLTranscript(){return globals.HLTranscript||(typeof HLTranscript=="undefined"?nil:HLTranscript)}
  2053. return smalltalk.withContext(function($ctx1) {
  2054. var $2,$1;
  2055. $2=self["@transcript"];
  2056. if(($receiver = $2) == nil || $receiver == null){
  2057. self["@transcript"]=_st($HLTranscript())._new();
  2058. $1=self["@transcript"];
  2059. } else {
  2060. $1=$2;
  2061. };
  2062. return $1;
  2063. }, function($ctx1) {$ctx1.fill(self,"transcript",{},globals.HLWorkspace)})},
  2064. args: [],
  2065. source: "transcript\x0a\x09^ transcript ifNil: [ transcript := HLTranscript new ]",
  2066. messageSends: ["ifNil:", "new"],
  2067. referencedClasses: ["HLTranscript"]
  2068. }),
  2069. globals.HLWorkspace);
  2070. smalltalk.addMethod(
  2071. smalltalk.method({
  2072. selector: "unregister",
  2073. protocol: 'actions',
  2074. fn: function (){
  2075. var self=this;
  2076. return smalltalk.withContext(function($ctx1) {
  2077. globals.HLWorkspace.superclass.fn.prototype._unregister.apply(_st(self), []);
  2078. $ctx1.sendIdx["unregister"]=1;
  2079. _st(self._transcript())._unregister();
  2080. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLWorkspace)})},
  2081. args: [],
  2082. source: "unregister\x0a\x09super unregister.\x0a\x09self transcript unregister",
  2083. messageSends: ["unregister", "transcript"],
  2084. referencedClasses: []
  2085. }),
  2086. globals.HLWorkspace);
  2087. smalltalk.addMethod(
  2088. smalltalk.method({
  2089. selector: "canBeOpenAsTab",
  2090. protocol: 'testing',
  2091. fn: function (){
  2092. var self=this;
  2093. return true;
  2094. },
  2095. args: [],
  2096. source: "canBeOpenAsTab\x0a\x09^ true",
  2097. messageSends: [],
  2098. referencedClasses: []
  2099. }),
  2100. globals.HLWorkspace.klass);
  2101. smalltalk.addMethod(
  2102. smalltalk.method({
  2103. selector: "tabClass",
  2104. protocol: 'accessing',
  2105. fn: function (){
  2106. var self=this;
  2107. return "workspace";
  2108. },
  2109. args: [],
  2110. source: "tabClass\x0a\x09^ 'workspace'",
  2111. messageSends: [],
  2112. referencedClasses: []
  2113. }),
  2114. globals.HLWorkspace.klass);
  2115. smalltalk.addMethod(
  2116. smalltalk.method({
  2117. selector: "tabLabel",
  2118. protocol: 'accessing',
  2119. fn: function (){
  2120. var self=this;
  2121. return "Workspace";
  2122. },
  2123. args: [],
  2124. source: "tabLabel\x0a\x09^ 'Workspace'",
  2125. messageSends: [],
  2126. referencedClasses: []
  2127. }),
  2128. globals.HLWorkspace.klass);
  2129. smalltalk.addMethod(
  2130. smalltalk.method({
  2131. selector: "tabPriority",
  2132. protocol: 'accessing',
  2133. fn: function (){
  2134. var self=this;
  2135. return (10);
  2136. },
  2137. args: [],
  2138. source: "tabPriority\x0a\x09^ 10",
  2139. messageSends: [],
  2140. referencedClasses: []
  2141. }),
  2142. globals.HLWorkspace.klass);
  2143. });