Helios-Workspace.js 89 KB

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