1
0

Helios-Workspace.js 85 KB

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