1
0

Helios-Workspace.js 87 KB

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