Helios-Workspace.js 88 KB

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