Helios-Workspace.js 89 KB

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