Helios-Workspace.js 88 KB

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