Helios-Workspace.js 89 KB

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