Helios-Workspace.js 89 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372
  1. define("helios/Helios-Workspace", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects", "helios/Helios-Core"], function(smalltalk,nil,_st, globals){
  2. smalltalk.addPackage('Helios-Workspace');
  3. smalltalk.packages["Helios-Workspace"].transport = {"type":"amd","amdNamespace":"helios"};
  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,$receiver;
  14. $2=self["@announcer"];
  15. if(($receiver = $2) == null || $receiver.isNil){
  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=_st((function(){
  71. return smalltalk.withContext(function($ctx2) {
  72. return _st(self._environment())._evaluate_for_(aString,self._receiver());
  73. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._tryCatch_((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 environment evaluate: aString for: self receiver ]\x0a\x09\x09tryCatch: [ :e | \x0a\x09\x09\x09ErrorHandler handleError: e.\x0a\x09\x09\x09nil ]",
  82. messageSends: ["tryCatch:", "evaluate:for:", "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,$receiver;
  95. $2=self["@environment"];
  96. if(($receiver = $2) == null || $receiver.isNil){
  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,$receiver;
  146. $2=self["@receiver"];
  147. if(($receiver = $2) == null || $receiver.isNil){
  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,$receiver;
  333. _st(self["@editor"])._setValue_(aString);
  334. $1=self["@state"];
  335. if(($receiver = $1) == null || $receiver.isNil){
  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.editorTheme"._settingValueIfAbsent_("default");
  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.editorTheme' settingValueIfAbsent: 'default').\x0a\x09\x09'mode' -> 'text/x-stsrc'.\x0a 'lineNumbers' -> true.\x0a 'enterMode' -> 'flat'.\x0a 'indentWithTabs' -> true.\x0a\x09\x09'indentUnit' -> 4.\x0a 'matchBrackets' -> true.\x0a 'electricChars' -> false.\x0a\x09\x09'keyMap' -> 'Amber'.\x0a\x09\x09'extraKeys' -> (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,$receiver;
  541. $2=self["@model"];
  542. if(($receiver = $2) == null || $receiver.isNil){
  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 (aPoint){
  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 $early={};
  628. try {
  629. ast=_st((function(){
  630. return smalltalk.withContext(function($ctx2) {
  631. return _st($Smalltalk())._parse_(_st(self._editor())._getValue());
  632. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(error){
  633. throw $early=[self];
  634. }));
  635. node=_st(ast)._navigationNodeAt_ifAbsent_(aPoint,(function(){
  636. throw $early=[nil];
  637. }));
  638. self._navigateTo_(_st(node)._navigationLink());
  639. return self}
  640. catch(e) {if(e===$early)return e[0]; throw e}
  641. }, function($ctx1) {$ctx1.fill(self,"onCtrlClickAt:",{aPoint:aPoint,ast:ast,node:node},globals.HLCodeWidget)})},
  642. args: ["aPoint"],
  643. source: "onCtrlClickAt: aPoint\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 \x0a\x09\x09navigationNodeAt: aPoint \x0a\x09\x09ifAbsent: [ ^ nil ].\x0a\x09\x09\x0a\x09self navigateTo: node navigationLink",
  644. messageSends: ["on:do:", "parse:", "getValue", "editor", "navigationNodeAt:ifAbsent:", "navigateTo:", "navigationLink"],
  645. referencedClasses: ["Smalltalk", "Error"]
  646. }),
  647. globals.HLCodeWidget);
  648. smalltalk.addMethod(
  649. smalltalk.method({
  650. selector: "onInspectIt",
  651. protocol: 'reactions',
  652. fn: function (){
  653. var self=this;
  654. return smalltalk.withContext(function($ctx1) {
  655. self._inspectIt();
  656. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},globals.HLCodeWidget)})},
  657. args: [],
  658. source: "onInspectIt\x0a\x0a\x09self inspectIt",
  659. messageSends: ["inspectIt"],
  660. referencedClasses: []
  661. }),
  662. globals.HLCodeWidget);
  663. smalltalk.addMethod(
  664. smalltalk.method({
  665. selector: "onPrintIt",
  666. protocol: 'reactions',
  667. fn: function (){
  668. var self=this;
  669. return smalltalk.withContext(function($ctx1) {
  670. self._printIt();
  671. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},globals.HLCodeWidget)})},
  672. args: [],
  673. source: "onPrintIt\x0a\x0a\x09self printIt",
  674. messageSends: ["printIt"],
  675. referencedClasses: []
  676. }),
  677. globals.HLCodeWidget);
  678. smalltalk.addMethod(
  679. smalltalk.method({
  680. selector: "onSaveIt",
  681. protocol: 'reactions',
  682. fn: function (){
  683. var self=this;
  684. return self},
  685. args: [],
  686. source: "onSaveIt\x0a\x09\x22I do not do anything\x22",
  687. messageSends: [],
  688. referencedClasses: []
  689. }),
  690. globals.HLCodeWidget);
  691. smalltalk.addMethod(
  692. smalltalk.method({
  693. selector: "print:",
  694. protocol: 'actions',
  695. fn: function (aString){
  696. var self=this;
  697. var start,stop,currentLine;
  698. function $HashedCollection(){return globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  699. return smalltalk.withContext(function($ctx1) {
  700. var $1,$2,$4,$3,$5,$6,$7,$8,$9,$10,$12,$11;
  701. $1=_st(self["@editor"])._getCursor_(false);
  702. $ctx1.sendIdx["getCursor:"]=1;
  703. currentLine=_st($1)._line();
  704. start=_st($HashedCollection())._new();
  705. $ctx1.sendIdx["new"]=1;
  706. _st(start)._at_put_("line",currentLine);
  707. $ctx1.sendIdx["at:put:"]=1;
  708. $2=start;
  709. $4=_st(self["@editor"])._getCursor_(false);
  710. $ctx1.sendIdx["getCursor:"]=2;
  711. $3=_st($4)._ch();
  712. _st($2)._at_put_("ch",$3);
  713. $ctx1.sendIdx["at:put:"]=2;
  714. $5=_st(self["@editor"])._getSelection();
  715. $ctx1.sendIdx["getSelection"]=1;
  716. _st($5)._ifEmpty_((function(){
  717. return smalltalk.withContext(function($ctx2) {
  718. $6=start;
  719. $7=_st(_st(self["@editor"])._getLine_(currentLine))._size();
  720. $ctx2.sendIdx["size"]=1;
  721. _st($6)._at_put_("ch",$7);
  722. $ctx2.sendIdx["at:put:"]=3;
  723. return _st(self["@editor"])._setSelection_end_(globals.HashedCollection._newFromPairs_(["line",currentLine,"ch",(0)]),start);
  724. $ctx2.sendIdx["setSelection:end:"]=1;
  725. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  726. stop=_st($HashedCollection())._new();
  727. _st(stop)._at_put_("line",currentLine);
  728. $ctx1.sendIdx["at:put:"]=4;
  729. $8=stop;
  730. $9=_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2));
  731. $ctx1.sendIdx["+"]=1;
  732. _st($8)._at_put_("ch",$9);
  733. $10=self["@editor"];
  734. $12=_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString);
  735. $ctx1.sendIdx[","]=2;
  736. $11=_st($12).__comma(" ");
  737. $ctx1.sendIdx[","]=1;
  738. _st($10)._replaceSelection_($11);
  739. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  740. _st(self["@editor"])._setSelection_end_(stop,start);
  741. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},globals.HLCodeWidget)})},
  742. args: ["aString"],
  743. 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",
  744. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "getSelection", "size", "getLine:", "setSelection:end:", "+", "at:", "replaceSelection:", ",", "setCursor:"],
  745. referencedClasses: ["HashedCollection"]
  746. }),
  747. globals.HLCodeWidget);
  748. smalltalk.addMethod(
  749. smalltalk.method({
  750. selector: "printIt",
  751. protocol: 'actions',
  752. fn: function (){
  753. var self=this;
  754. return smalltalk.withContext(function($ctx1) {
  755. self._print_(_st(self._doIt())._printString());
  756. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{},globals.HLCodeWidget)})},
  757. args: [],
  758. source: "printIt\x0a\x09self print: self doIt printString",
  759. messageSends: ["print:", "printString", "doIt"],
  760. referencedClasses: []
  761. }),
  762. globals.HLCodeWidget);
  763. smalltalk.addMethod(
  764. smalltalk.method({
  765. selector: "receiver",
  766. protocol: 'accessing',
  767. fn: function (){
  768. var self=this;
  769. return smalltalk.withContext(function($ctx1) {
  770. var $1;
  771. $1=_st(self._model())._receiver();
  772. return $1;
  773. }, function($ctx1) {$ctx1.fill(self,"receiver",{},globals.HLCodeWidget)})},
  774. args: [],
  775. source: "receiver\x0a\x09^ self model receiver",
  776. messageSends: ["receiver", "model"],
  777. referencedClasses: []
  778. }),
  779. globals.HLCodeWidget);
  780. smalltalk.addMethod(
  781. smalltalk.method({
  782. selector: "receiver:",
  783. protocol: 'accessing',
  784. fn: function (anObject){
  785. var self=this;
  786. return smalltalk.withContext(function($ctx1) {
  787. _st(self._model())._receiver_(anObject);
  788. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},globals.HLCodeWidget)})},
  789. args: ["anObject"],
  790. source: "receiver: anObject\x0a\x09self model receiver: anObject",
  791. messageSends: ["receiver:", "model"],
  792. referencedClasses: []
  793. }),
  794. globals.HLCodeWidget);
  795. smalltalk.addMethod(
  796. smalltalk.method({
  797. selector: "renderButtonsOn:",
  798. protocol: 'rendering',
  799. fn: function (html){
  800. var self=this;
  801. return smalltalk.withContext(function($ctx1) {
  802. var $1,$2,$3,$4,$5,$6,$7,$8;
  803. $1=_st(html)._button();
  804. $ctx1.sendIdx["button"]=1;
  805. _st($1)._class_("button");
  806. $ctx1.sendIdx["class:"]=1;
  807. _st($1)._with_("DoIt");
  808. $ctx1.sendIdx["with:"]=1;
  809. $2=_st($1)._onClick_((function(){
  810. return smalltalk.withContext(function($ctx2) {
  811. return self._doIt();
  812. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  813. $ctx1.sendIdx["onClick:"]=1;
  814. $3=_st(html)._button();
  815. $ctx1.sendIdx["button"]=2;
  816. _st($3)._class_("button");
  817. $ctx1.sendIdx["class:"]=2;
  818. _st($3)._with_("PrintIt");
  819. $ctx1.sendIdx["with:"]=2;
  820. $4=_st($3)._onClick_((function(){
  821. return smalltalk.withContext(function($ctx2) {
  822. return self._printIt();
  823. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  824. $ctx1.sendIdx["onClick:"]=2;
  825. $5=_st(html)._button();
  826. $ctx1.sendIdx["button"]=3;
  827. _st($5)._class_("button");
  828. $ctx1.sendIdx["class:"]=3;
  829. _st($5)._with_("InspectIt");
  830. $ctx1.sendIdx["with:"]=3;
  831. $6=_st($5)._onClick_((function(){
  832. return smalltalk.withContext(function($ctx2) {
  833. return self._inspectIt();
  834. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,3)})}));
  835. $ctx1.sendIdx["onClick:"]=3;
  836. $7=_st(html)._button();
  837. _st($7)._class_("button");
  838. _st($7)._with_("BrowseIt");
  839. $8=_st($7)._onClick_((function(){
  840. return smalltalk.withContext(function($ctx2) {
  841. return self._browseIt();
  842. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,4)})}));
  843. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLCodeWidget)})},
  844. args: ["html"],
  845. 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 ]",
  846. messageSends: ["class:", "button", "with:", "onClick:", "doIt", "printIt", "inspectIt", "browseIt"],
  847. referencedClasses: []
  848. }),
  849. globals.HLCodeWidget);
  850. smalltalk.addMethod(
  851. smalltalk.method({
  852. selector: "renderContentOn:",
  853. protocol: 'rendering',
  854. fn: function (html){
  855. var self=this;
  856. return smalltalk.withContext(function($ctx1) {
  857. var $1,$2,$3,$4,$5,$6;
  858. $1=_st(html)._div();
  859. $ctx1.sendIdx["div"]=1;
  860. _st($1)._class_("editor");
  861. $ctx1.sendIdx["class:"]=1;
  862. $2=_st($1)._with_((function(){
  863. return smalltalk.withContext(function($ctx2) {
  864. self["@code"]=_st(html)._textarea();
  865. return self["@code"];
  866. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  867. $ctx1.sendIdx["with:"]=1;
  868. $3=_st(html)._div();
  869. $ctx1.sendIdx["div"]=2;
  870. self["@state"]=_st($3)._class_("state");
  871. $ctx1.sendIdx["class:"]=2;
  872. $4=_st(html)._div();
  873. _st($4)._class_("buttons_bar");
  874. $5=_st($4)._with_((function(){
  875. return smalltalk.withContext(function($ctx2) {
  876. return self._renderButtonsOn_(html);
  877. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  878. self._setEditorOn_(_st(self["@code"])._element());
  879. self._configureEditor();
  880. $6=self._updateState();
  881. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLCodeWidget)})},
  882. args: ["html"],
  883. 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",
  884. messageSends: ["class:", "div", "with:", "textarea", "renderButtonsOn:", "setEditorOn:", "element", "configureEditor", "updateState"],
  885. referencedClasses: []
  886. }),
  887. globals.HLCodeWidget);
  888. smalltalk.addMethod(
  889. smalltalk.method({
  890. selector: "saveIt",
  891. protocol: 'actions',
  892. fn: function (){
  893. var self=this;
  894. return self},
  895. args: [],
  896. source: "saveIt\x0a\x09\x22I do not do anything\x22",
  897. messageSends: [],
  898. referencedClasses: []
  899. }),
  900. globals.HLCodeWidget);
  901. smalltalk.addMethod(
  902. smalltalk.method({
  903. selector: "selection",
  904. protocol: 'accessing',
  905. fn: function (){
  906. var self=this;
  907. return smalltalk.withContext(function($ctx1) {
  908. var $1;
  909. $1=_st(self["@editor"])._getSelection();
  910. return $1;
  911. }, function($ctx1) {$ctx1.fill(self,"selection",{},globals.HLCodeWidget)})},
  912. args: [],
  913. source: "selection\x0a\x09^editor getSelection",
  914. messageSends: ["getSelection"],
  915. referencedClasses: []
  916. }),
  917. globals.HLCodeWidget);
  918. smalltalk.addMethod(
  919. smalltalk.method({
  920. selector: "selectionEnd",
  921. protocol: 'accessing',
  922. fn: function (){
  923. var self=this;
  924. return smalltalk.withContext(function($ctx1) {
  925. var $1;
  926. $1=_st(_st(self["@code"])._element())._selectionEnd();
  927. return $1;
  928. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},globals.HLCodeWidget)})},
  929. args: [],
  930. source: "selectionEnd\x0a ^code element selectionEnd",
  931. messageSends: ["selectionEnd", "element"],
  932. referencedClasses: []
  933. }),
  934. globals.HLCodeWidget);
  935. smalltalk.addMethod(
  936. smalltalk.method({
  937. selector: "selectionEnd:",
  938. protocol: 'accessing',
  939. fn: function (anInteger){
  940. var self=this;
  941. return smalltalk.withContext(function($ctx1) {
  942. _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  943. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},globals.HLCodeWidget)})},
  944. args: ["anInteger"],
  945. source: "selectionEnd: anInteger\x0a code element selectionEnd: anInteger",
  946. messageSends: ["selectionEnd:", "element"],
  947. referencedClasses: []
  948. }),
  949. globals.HLCodeWidget);
  950. smalltalk.addMethod(
  951. smalltalk.method({
  952. selector: "selectionStart",
  953. protocol: 'accessing',
  954. fn: function (){
  955. var self=this;
  956. return smalltalk.withContext(function($ctx1) {
  957. var $1;
  958. $1=_st(_st(self["@code"])._element())._selectionStart();
  959. return $1;
  960. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},globals.HLCodeWidget)})},
  961. args: [],
  962. source: "selectionStart\x0a ^code element selectionStart",
  963. messageSends: ["selectionStart", "element"],
  964. referencedClasses: []
  965. }),
  966. globals.HLCodeWidget);
  967. smalltalk.addMethod(
  968. smalltalk.method({
  969. selector: "selectionStart:",
  970. protocol: 'accessing',
  971. fn: function (anInteger){
  972. var self=this;
  973. return smalltalk.withContext(function($ctx1) {
  974. _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  975. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},globals.HLCodeWidget)})},
  976. args: ["anInteger"],
  977. source: "selectionStart: anInteger\x0a code element selectionStart: anInteger",
  978. messageSends: ["selectionStart:", "element"],
  979. referencedClasses: []
  980. }),
  981. globals.HLCodeWidget);
  982. smalltalk.addMethod(
  983. smalltalk.method({
  984. selector: "setEditorOn:",
  985. protocol: 'actions',
  986. fn: function (aTextarea){
  987. var self=this;
  988. return smalltalk.withContext(function($ctx1) {
  989. self['@editor'] = CodeMirror.fromTextArea(aTextarea, self._editorOptions());
  990. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},globals.HLCodeWidget)})},
  991. args: ["aTextarea"],
  992. source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, self._editorOptions())>",
  993. messageSends: [],
  994. referencedClasses: []
  995. }),
  996. globals.HLCodeWidget);
  997. smalltalk.addMethod(
  998. smalltalk.method({
  999. selector: "updateState",
  1000. protocol: 'updating',
  1001. fn: function (){
  1002. var self=this;
  1003. return smalltalk.withContext(function($ctx1) {
  1004. var $1,$2;
  1005. $1=self._hasModification();
  1006. if(smalltalk.assert($1)){
  1007. $2=_st(self["@state"])._asJQuery();
  1008. $ctx1.sendIdx["asJQuery"]=1;
  1009. _st($2)._addClass_("modified");
  1010. } else {
  1011. _st(_st(self["@state"])._asJQuery())._removeClass_("modified");
  1012. };
  1013. return self}, function($ctx1) {$ctx1.fill(self,"updateState",{},globals.HLCodeWidget)})},
  1014. args: [],
  1015. source: "updateState\x0a\x09self hasModification \x0a\x09\x09ifTrue: [ state asJQuery addClass: 'modified' ]\x0a\x09\x09ifFalse: [ state asJQuery removeClass: 'modified' ]",
  1016. messageSends: ["ifTrue:ifFalse:", "hasModification", "addClass:", "asJQuery", "removeClass:"],
  1017. referencedClasses: []
  1018. }),
  1019. globals.HLCodeWidget);
  1020. smalltalk.addMethod(
  1021. smalltalk.method({
  1022. selector: "variableHintFor:token:",
  1023. protocol: 'hints',
  1024. fn: function (anEditor,aToken){
  1025. var self=this;
  1026. var variables,classNames,pseudoVariables;
  1027. function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  1028. return smalltalk.withContext(function($ctx1) {
  1029. var $3,$2,$1,$9,$8,$7,$6,$10,$5,$4;
  1030. $3=_st(_st(_st(anEditor)._display())._wrapper())._asJQuery();
  1031. $ctx1.sendIdx["asJQuery"]=1;
  1032. $2=_st($3)._find_("span.cm-variable");
  1033. $1=_st($2)._get();
  1034. variables=_st($1)._collect_((function(each){
  1035. return smalltalk.withContext(function($ctx2) {
  1036. return _st(_st(each)._asJQuery())._html();
  1037. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  1038. $ctx1.sendIdx["collect:"]=1;
  1039. classNames=_st(_st($Smalltalk())._classes())._collect_((function(each){
  1040. return smalltalk.withContext(function($ctx2) {
  1041. return _st(each)._name();
  1042. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  1043. pseudoVariables=_st($Smalltalk())._pseudoVariableNames();
  1044. $9=_st(_st(variables).__comma(classNames)).__comma(pseudoVariables);
  1045. $ctx1.sendIdx[","]=1;
  1046. $8=_st($9)._asSet();
  1047. $7=_st($8)._asArray();
  1048. $6=_st($7)._sort();
  1049. $5=_st($6)._select_((function(each){
  1050. return smalltalk.withContext(function($ctx2) {
  1051. $10=_st(aToken)._string();
  1052. $ctx2.sendIdx["string"]=1;
  1053. return _st(each)._includesSubString_($10);
  1054. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})}));
  1055. $4=_st($5)._reject_((function(each){
  1056. return smalltalk.withContext(function($ctx2) {
  1057. return _st(each).__eq(_st(aToken)._string());
  1058. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
  1059. return $4;
  1060. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},globals.HLCodeWidget)})},
  1061. args: ["anEditor", "aToken"],
  1062. 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 ]",
  1063. messageSends: ["collect:", "get", "find:", "asJQuery", "wrapper", "display", "html", "classes", "name", "pseudoVariableNames", "reject:", "select:", "sort", "asArray", "asSet", ",", "includesSubString:", "string", "="],
  1064. referencedClasses: ["Smalltalk"]
  1065. }),
  1066. globals.HLCodeWidget);
  1067. smalltalk.addMethod(
  1068. smalltalk.method({
  1069. selector: "hintFor:options:",
  1070. protocol: 'hints',
  1071. fn: function (anEditor,options){
  1072. var self=this;
  1073. var cursor,token,completions;
  1074. function $CodeMirror(){return globals.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  1075. function $HLCodeWidget(){return globals.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  1076. return smalltalk.withContext(function($ctx1) {
  1077. var $1,$4,$3,$2,$5,$7,$9,$10,$8,$6;
  1078. cursor=_st(anEditor)._getCursor();
  1079. token=_st(anEditor)._getTokenAt_(cursor);
  1080. $1=token;
  1081. $4=_st($CodeMirror())._basicAt_("innerMode");
  1082. $ctx1.sendIdx["basicAt:"]=1;
  1083. $3=_st($4)._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state"));
  1084. $ctx1.sendIdx["value:value:"]=1;
  1085. $2=_st($3)._state();
  1086. _st($1)._at_put_("state",$2);
  1087. $5=_st(_st(token)._type()).__eq("variable");
  1088. if(smalltalk.assert($5)){
  1089. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  1090. } else {
  1091. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  1092. };
  1093. $7=completions;
  1094. $9=_st($CodeMirror())._basicAt_("Pos");
  1095. $ctx1.sendIdx["basicAt:"]=2;
  1096. $10=_st(cursor)._line();
  1097. $ctx1.sendIdx["line"]=1;
  1098. $8=_st($9)._value_value_($10,_st(token)._end());
  1099. $ctx1.sendIdx["value:value:"]=2;
  1100. $6=globals.HashedCollection._newFromPairs_(["list",$7,"from",$8,"to",_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._start())]);
  1101. return $6;
  1102. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},globals.HLCodeWidget.klass)})},
  1103. args: ["anEditor", "options"],
  1104. 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}",
  1105. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "basicAt:", "getMode", "at:", "ifTrue:ifFalse:", "=", "type", "variableHintFor:token:", "messageHintFor:token:", "line", "end", "start"],
  1106. referencedClasses: ["CodeMirror", "HLCodeWidget"]
  1107. }),
  1108. globals.HLCodeWidget.klass);
  1109. smalltalk.addMethod(
  1110. smalltalk.method({
  1111. selector: "initialize",
  1112. protocol: 'initialization',
  1113. fn: function (){
  1114. var self=this;
  1115. return smalltalk.withContext(function($ctx1) {
  1116. var $1;
  1117. ($ctx1.supercall = true, globals.HLCodeWidget.klass.superclass.fn.prototype._initialize.apply(_st(self), []));
  1118. $ctx1.supercall = false;
  1119. self._setupCodeMirror();
  1120. self._setupCommands();
  1121. $1=self._setupKeyMaps();
  1122. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.HLCodeWidget.klass)})},
  1123. args: [],
  1124. source: "initialize\x0a\x09super initialize.\x0a\x09self \x0a\x09\x09setupCodeMirror;\x0a\x09\x09setupCommands;\x0a\x09\x09setupKeyMaps.",
  1125. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"],
  1126. referencedClasses: []
  1127. }),
  1128. globals.HLCodeWidget.klass);
  1129. smalltalk.addMethod(
  1130. smalltalk.method({
  1131. selector: "keyMap",
  1132. protocol: 'accessing',
  1133. fn: function (){
  1134. var self=this;
  1135. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1136. return smalltalk.withContext(function($ctx1) {
  1137. var $2,$1;
  1138. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  1139. if(smalltalk.assert($2)){
  1140. $1=self._macKeyMap();
  1141. } else {
  1142. $1=self._pcKeyMap();
  1143. };
  1144. return $1;
  1145. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},globals.HLCodeWidget.klass)})},
  1146. args: [],
  1147. source: "keyMap\x0a\x09^ HLManager current keyBinder systemIsMac\x0a\x09\x09ifTrue: [ self macKeyMap ]\x0a\x09\x09ifFalse: [ self pcKeyMap ]",
  1148. messageSends: ["ifTrue:ifFalse:", "systemIsMac", "keyBinder", "current", "macKeyMap", "pcKeyMap"],
  1149. referencedClasses: ["HLManager"]
  1150. }),
  1151. globals.HLCodeWidget.klass);
  1152. smalltalk.addMethod(
  1153. smalltalk.method({
  1154. selector: "macKeyMap",
  1155. protocol: 'accessing',
  1156. fn: function (){
  1157. var self=this;
  1158. var $1;
  1159. $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"]]);
  1160. return $1;
  1161. },
  1162. args: [],
  1163. 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 }",
  1164. messageSends: [],
  1165. referencedClasses: []
  1166. }),
  1167. globals.HLCodeWidget.klass);
  1168. smalltalk.addMethod(
  1169. smalltalk.method({
  1170. selector: "messageHintFor:token:",
  1171. protocol: 'hints',
  1172. fn: function (anEditor,aToken){
  1173. var self=this;
  1174. return smalltalk.withContext(function($ctx1) {
  1175. var $1;
  1176. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  1177. return $1;
  1178. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},globals.HLCodeWidget.klass)})},
  1179. args: ["anEditor", "aToken"],
  1180. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09messageHintFor: anEditor token: aToken",
  1181. messageSends: ["messageHintFor:token:", "at:"],
  1182. referencedClasses: []
  1183. }),
  1184. globals.HLCodeWidget.klass);
  1185. smalltalk.addMethod(
  1186. smalltalk.method({
  1187. selector: "pcKeyMap",
  1188. protocol: 'accessing',
  1189. fn: function (){
  1190. var self=this;
  1191. var $1;
  1192. $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"]]);
  1193. return $1;
  1194. },
  1195. args: [],
  1196. 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}",
  1197. messageSends: [],
  1198. referencedClasses: []
  1199. }),
  1200. globals.HLCodeWidget.klass);
  1201. smalltalk.addMethod(
  1202. smalltalk.method({
  1203. selector: "setupCodeMirror",
  1204. protocol: 'initialization',
  1205. fn: function (){
  1206. var self=this;
  1207. return smalltalk.withContext(function($ctx1) {
  1208. CodeMirror.keyMap.default.fallthrough = ["basic"];
  1209. CodeMirror.commands.autocomplete = function(cm) {
  1210. CodeMirror.showHint(cm, self._hintFor_options_);
  1211. }
  1212. ;
  1213. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},globals.HLCodeWidget.klass)})},
  1214. args: [],
  1215. 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>",
  1216. messageSends: [],
  1217. referencedClasses: []
  1218. }),
  1219. globals.HLCodeWidget.klass);
  1220. smalltalk.addMethod(
  1221. smalltalk.method({
  1222. selector: "setupCommands",
  1223. protocol: 'initialization',
  1224. fn: function (){
  1225. var self=this;
  1226. function $CodeMirror(){return globals.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  1227. return smalltalk.withContext(function($ctx1) {
  1228. var $1,$2,$3,$4,$5,$6;
  1229. $1=_st($CodeMirror())._basicAt_("commands");
  1230. _st($1)._at_put_("doIt",(function(cm){
  1231. return smalltalk.withContext(function($ctx2) {
  1232. $2=_st(cm)._amberCodeWidget();
  1233. $ctx2.sendIdx["amberCodeWidget"]=1;
  1234. return _st($2)._doIt();
  1235. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,1)})}));
  1236. $ctx1.sendIdx["at:put:"]=1;
  1237. _st($1)._at_put_("inspectIt",(function(cm){
  1238. return smalltalk.withContext(function($ctx2) {
  1239. $3=_st(cm)._amberCodeWidget();
  1240. $ctx2.sendIdx["amberCodeWidget"]=2;
  1241. return _st($3)._inspectIt();
  1242. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,2)})}));
  1243. $ctx1.sendIdx["at:put:"]=2;
  1244. _st($1)._at_put_("printIt",(function(cm){
  1245. return smalltalk.withContext(function($ctx2) {
  1246. $4=_st(cm)._amberCodeWidget();
  1247. $ctx2.sendIdx["amberCodeWidget"]=3;
  1248. return _st($4)._printIt();
  1249. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,3)})}));
  1250. $ctx1.sendIdx["at:put:"]=3;
  1251. _st($1)._at_put_("saveIt",(function(cm){
  1252. return smalltalk.withContext(function($ctx2) {
  1253. $5=_st(cm)._amberCodeWidget();
  1254. $ctx2.sendIdx["amberCodeWidget"]=4;
  1255. return _st($5)._saveIt();
  1256. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,4)})}));
  1257. $ctx1.sendIdx["at:put:"]=4;
  1258. $6=_st($1)._at_put_("browseIt",(function(cm){
  1259. return smalltalk.withContext(function($ctx2) {
  1260. return _st(_st(cm)._amberCodeWidget())._browseIt();
  1261. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,5)})}));
  1262. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},globals.HLCodeWidget.klass)})},
  1263. args: [],
  1264. 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 ]",
  1265. messageSends: ["at:put:", "basicAt:", "doIt", "amberCodeWidget", "inspectIt", "printIt", "saveIt", "browseIt"],
  1266. referencedClasses: ["CodeMirror"]
  1267. }),
  1268. globals.HLCodeWidget.klass);
  1269. smalltalk.addMethod(
  1270. smalltalk.method({
  1271. selector: "setupKeyMaps",
  1272. protocol: 'initialization',
  1273. fn: function (){
  1274. var self=this;
  1275. return smalltalk.withContext(function($ctx1) {
  1276. CodeMirror.keyMap['Amber'] = self._keyMap();
  1277. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},globals.HLCodeWidget.klass)})},
  1278. args: [],
  1279. source: "setupKeyMaps\x0a\x09<CodeMirror.keyMap['Amber'] = self._keyMap()>",
  1280. messageSends: [],
  1281. referencedClasses: []
  1282. }),
  1283. globals.HLCodeWidget.klass);
  1284. smalltalk.addMethod(
  1285. smalltalk.method({
  1286. selector: "variableHintFor:token:",
  1287. protocol: 'hints',
  1288. fn: function (anEditor,aToken){
  1289. var self=this;
  1290. return smalltalk.withContext(function($ctx1) {
  1291. var $1;
  1292. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  1293. return $1;
  1294. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},globals.HLCodeWidget.klass)})},
  1295. args: ["anEditor", "aToken"],
  1296. source: "variableHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09variableHintFor: anEditor token: aToken",
  1297. messageSends: ["variableHintFor:token:", "at:"],
  1298. referencedClasses: []
  1299. }),
  1300. globals.HLCodeWidget.klass);
  1301. smalltalk.addClass('HLNavigationCodeWidget', globals.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
  1302. smalltalk.addMethod(
  1303. smalltalk.method({
  1304. selector: "configureEditor",
  1305. protocol: 'accessing',
  1306. fn: function (){
  1307. var self=this;
  1308. return smalltalk.withContext(function($ctx1) {
  1309. ($ctx1.supercall = true, globals.HLNavigationCodeWidget.superclass.fn.prototype._configureEditor.apply(_st(self), []));
  1310. $ctx1.supercall = false;
  1311. self._contents_(self._methodContents());
  1312. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},globals.HLNavigationCodeWidget)})},
  1313. args: [],
  1314. source: "configureEditor\x0a\x09super configureEditor.\x0a\x09self contents: self methodContents",
  1315. messageSends: ["configureEditor", "contents:", "methodContents"],
  1316. referencedClasses: []
  1317. }),
  1318. globals.HLNavigationCodeWidget);
  1319. smalltalk.addMethod(
  1320. smalltalk.method({
  1321. selector: "contents:",
  1322. protocol: 'accessing',
  1323. fn: function (aString){
  1324. var self=this;
  1325. return smalltalk.withContext(function($ctx1) {
  1326. self._methodContents_(aString);
  1327. ($ctx1.supercall = true, globals.HLNavigationCodeWidget.superclass.fn.prototype._contents_.apply(_st(self), [aString]));
  1328. $ctx1.supercall = false;
  1329. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},globals.HLNavigationCodeWidget)})},
  1330. args: ["aString"],
  1331. source: "contents: aString\x0a\x09self methodContents: aString.\x0a\x09super contents: aString",
  1332. messageSends: ["methodContents:", "contents:"],
  1333. referencedClasses: []
  1334. }),
  1335. globals.HLNavigationCodeWidget);
  1336. smalltalk.addMethod(
  1337. smalltalk.method({
  1338. selector: "hasModification",
  1339. protocol: 'testing',
  1340. fn: function (){
  1341. var self=this;
  1342. return smalltalk.withContext(function($ctx1) {
  1343. var $1;
  1344. $1=_st(_st(self._methodContents()).__eq(self._contents()))._not();
  1345. return $1;
  1346. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},globals.HLNavigationCodeWidget)})},
  1347. args: [],
  1348. source: "hasModification\x0a\x09^ (self methodContents = self contents) not",
  1349. messageSends: ["not", "=", "methodContents", "contents"],
  1350. referencedClasses: []
  1351. }),
  1352. globals.HLNavigationCodeWidget);
  1353. smalltalk.addMethod(
  1354. smalltalk.method({
  1355. selector: "methodContents",
  1356. protocol: 'accessing',
  1357. fn: function (){
  1358. var self=this;
  1359. return smalltalk.withContext(function($ctx1) {
  1360. var $2,$1,$receiver;
  1361. $2=self["@methodContents"];
  1362. if(($receiver = $2) == null || $receiver.isNil){
  1363. $1="";
  1364. } else {
  1365. $1=$2;
  1366. };
  1367. return $1;
  1368. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},globals.HLNavigationCodeWidget)})},
  1369. args: [],
  1370. source: "methodContents\x0a\x09^ methodContents ifNil: [ '' ]",
  1371. messageSends: ["ifNil:"],
  1372. referencedClasses: []
  1373. }),
  1374. globals.HLNavigationCodeWidget);
  1375. smalltalk.addMethod(
  1376. smalltalk.method({
  1377. selector: "methodContents:",
  1378. protocol: 'accessing',
  1379. fn: function (aString){
  1380. var self=this;
  1381. var $1;
  1382. self["@methodContents"]=aString;
  1383. $1=self["@methodContents"];
  1384. return $1;
  1385. },
  1386. args: ["aString"],
  1387. source: "methodContents: aString\x0a\x09^ methodContents := aString",
  1388. messageSends: [],
  1389. referencedClasses: []
  1390. }),
  1391. globals.HLNavigationCodeWidget);
  1392. smalltalk.addMethod(
  1393. smalltalk.method({
  1394. selector: "previous",
  1395. protocol: 'accessing',
  1396. fn: function (){
  1397. var self=this;
  1398. return self},
  1399. args: [],
  1400. source: "previous\x0a\x09\x22for browser lists widget\x22",
  1401. messageSends: [],
  1402. referencedClasses: []
  1403. }),
  1404. globals.HLNavigationCodeWidget);
  1405. smalltalk.addMethod(
  1406. smalltalk.method({
  1407. selector: "previous:",
  1408. protocol: 'accessing',
  1409. fn: function (aWidget){
  1410. var self=this;
  1411. return self},
  1412. args: ["aWidget"],
  1413. source: "previous: aWidget\x0a\x09\x22for browser lists widget\x22",
  1414. messageSends: [],
  1415. referencedClasses: []
  1416. }),
  1417. globals.HLNavigationCodeWidget);
  1418. smalltalk.addMethod(
  1419. smalltalk.method({
  1420. selector: "canBeOpenAsTab",
  1421. protocol: 'testing',
  1422. fn: function (){
  1423. var self=this;
  1424. return false;
  1425. },
  1426. args: [],
  1427. source: "canBeOpenAsTab\x0a\x09^ false",
  1428. messageSends: [],
  1429. referencedClasses: []
  1430. }),
  1431. globals.HLNavigationCodeWidget.klass);
  1432. smalltalk.addMethod(
  1433. smalltalk.method({
  1434. selector: "on:",
  1435. protocol: 'instance creation',
  1436. fn: function (aBrowserModel){
  1437. var self=this;
  1438. return smalltalk.withContext(function($ctx1) {
  1439. var $2,$3,$1;
  1440. $2=self._new();
  1441. _st($2)._browserModel_(aBrowserModel);
  1442. $3=_st($2)._yourself();
  1443. $1=$3;
  1444. return $1;
  1445. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},globals.HLNavigationCodeWidget.klass)})},
  1446. args: ["aBrowserModel"],
  1447. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1448. messageSends: ["browserModel:", "new", "yourself"],
  1449. referencedClasses: []
  1450. }),
  1451. globals.HLNavigationCodeWidget.klass);
  1452. smalltalk.addClass('HLBrowserCodeWidget', globals.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  1453. smalltalk.addMethod(
  1454. smalltalk.method({
  1455. selector: "browserModel",
  1456. protocol: 'accessing',
  1457. fn: function (){
  1458. var self=this;
  1459. var $1;
  1460. $1=self["@browserModel"];
  1461. return $1;
  1462. },
  1463. args: [],
  1464. source: "browserModel\x0a\x09^ browserModel",
  1465. messageSends: [],
  1466. referencedClasses: []
  1467. }),
  1468. globals.HLBrowserCodeWidget);
  1469. smalltalk.addMethod(
  1470. smalltalk.method({
  1471. selector: "browserModel:",
  1472. protocol: 'accessing',
  1473. fn: function (aBrowserModel){
  1474. var self=this;
  1475. return smalltalk.withContext(function($ctx1) {
  1476. var $1;
  1477. self["@browserModel"]=aBrowserModel;
  1478. self._observeSystem();
  1479. $1=self._observeBrowserModel();
  1480. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},globals.HLBrowserCodeWidget)})},
  1481. args: ["aBrowserModel"],
  1482. source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x09self \x0a\x09\x09observeSystem;\x0a\x09\x09observeBrowserModel",
  1483. messageSends: ["observeSystem", "observeBrowserModel"],
  1484. referencedClasses: []
  1485. }),
  1486. globals.HLBrowserCodeWidget);
  1487. smalltalk.addMethod(
  1488. smalltalk.method({
  1489. selector: "observeBrowserModel",
  1490. protocol: 'actions',
  1491. fn: function (){
  1492. var self=this;
  1493. function $HLSaveSourceCode(){return globals.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  1494. function $HLShowInstanceToggled(){return globals.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
  1495. function $HLSourceCodeSaved(){return globals.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  1496. function $HLAboutToChange(){return globals.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  1497. function $HLParseErrorRaised(){return globals.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  1498. function $HLCompileErrorRaised(){return globals.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  1499. function $HLUnknownVariableErrorRaised(){return globals.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  1500. function $HLInstVarAdded(){return globals.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  1501. function $HLMethodSelected(){return globals.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1502. function $HLClassSelected(){return globals.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1503. function $HLPackageSelected(){return globals.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  1504. function $HLProtocolSelected(){return globals.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1505. function $HLSourceCodeFocusRequested(){return globals.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1506. function $HLShowTemplate(){return globals.HLShowTemplate||(typeof HLShowTemplate=="undefined"?nil:HLShowTemplate)}
  1507. return smalltalk.withContext(function($ctx1) {
  1508. var $1,$2;
  1509. $1=_st(self._browserModel())._announcer();
  1510. _st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
  1511. $ctx1.sendIdx["on:send:to:"]=1;
  1512. _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
  1513. $ctx1.sendIdx["on:send:to:"]=2;
  1514. _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
  1515. $ctx1.sendIdx["on:send:to:"]=3;
  1516. _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
  1517. $ctx1.sendIdx["on:send:to:"]=4;
  1518. _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
  1519. $ctx1.sendIdx["on:send:to:"]=5;
  1520. _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
  1521. $ctx1.sendIdx["on:send:to:"]=6;
  1522. _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
  1523. $ctx1.sendIdx["on:send:to:"]=7;
  1524. _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
  1525. $ctx1.sendIdx["on:send:to:"]=8;
  1526. _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
  1527. $ctx1.sendIdx["on:send:to:"]=9;
  1528. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  1529. $ctx1.sendIdx["on:send:to:"]=10;
  1530. _st($1)._on_send_to_($HLPackageSelected(),"onPackageSelected:",self);
  1531. $ctx1.sendIdx["on:send:to:"]=11;
  1532. _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
  1533. $ctx1.sendIdx["on:send:to:"]=12;
  1534. _st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
  1535. $ctx1.sendIdx["on:send:to:"]=13;
  1536. $2=_st($1)._on_send_to_($HLShowTemplate(),"onShowTemplate:",self);
  1537. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},globals.HLBrowserCodeWidget)})},
  1538. args: [],
  1539. 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",
  1540. messageSends: ["on:send:to:", "announcer", "browserModel"],
  1541. referencedClasses: ["HLSaveSourceCode", "HLShowInstanceToggled", "HLSourceCodeSaved", "HLAboutToChange", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLPackageSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested", "HLShowTemplate"]
  1542. }),
  1543. globals.HLBrowserCodeWidget);
  1544. smalltalk.addMethod(
  1545. smalltalk.method({
  1546. selector: "observeSystem",
  1547. protocol: 'actions',
  1548. fn: function (){
  1549. var self=this;
  1550. function $MethodModified(){return globals.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  1551. return smalltalk.withContext(function($ctx1) {
  1552. _st(_st(self._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
  1553. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},globals.HLBrowserCodeWidget)})},
  1554. args: [],
  1555. source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a \x09on: MethodModified\x0a send: #onMethodModified:\x0a\x09\x09to: self",
  1556. messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"],
  1557. referencedClasses: ["MethodModified"]
  1558. }),
  1559. globals.HLBrowserCodeWidget);
  1560. smalltalk.addMethod(
  1561. smalltalk.method({
  1562. selector: "onBrowserAboutToChange:",
  1563. protocol: 'reactions',
  1564. fn: function (anAnnouncement){
  1565. var self=this;
  1566. var block;
  1567. function $HLChangeForbidden(){return globals.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  1568. return smalltalk.withContext(function($ctx1) {
  1569. var $1;
  1570. block=_st(anAnnouncement)._actionBlock();
  1571. $1=self._hasModification();
  1572. if(smalltalk.assert($1)){
  1573. self._confirm_ifTrue_("Changes have not been saved. Do you want to discard these changes?",(function(){
  1574. return smalltalk.withContext(function($ctx2) {
  1575. self._methodContents_(self._contents());
  1576. return _st(block)._value();
  1577. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1578. _st($HLChangeForbidden())._signal();
  1579. };
  1580. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},globals.HLBrowserCodeWidget)})},
  1581. args: ["anAnnouncement"],
  1582. 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 ]",
  1583. messageSends: ["actionBlock", "ifTrue:", "hasModification", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal"],
  1584. referencedClasses: ["HLChangeForbidden"]
  1585. }),
  1586. globals.HLBrowserCodeWidget);
  1587. smalltalk.addMethod(
  1588. smalltalk.method({
  1589. selector: "onClassSelected:",
  1590. protocol: 'reactions',
  1591. fn: function (anAnnouncement){
  1592. var self=this;
  1593. var class_;
  1594. return smalltalk.withContext(function($ctx1) {
  1595. var $1,$2,$receiver;
  1596. class_=_st(anAnnouncement)._item();
  1597. $1=class_;
  1598. if(($receiver = $1) == null || $receiver.isNil){
  1599. $2=self._contents_("");
  1600. $ctx1.sendIdx["contents:"]=1;
  1601. return $2;
  1602. } else {
  1603. $1;
  1604. };
  1605. self._contents_(_st(class_)._definition());
  1606. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},globals.HLBrowserCodeWidget)})},
  1607. args: ["anAnnouncement"],
  1608. source: "onClassSelected: anAnnouncement\x0a\x09| class |\x0a\x09\x0a\x09class:= anAnnouncement item.\x0a\x09\x0a\x09class ifNil: [ ^ self contents: '' ].\x0a\x09self contents: class definition",
  1609. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1610. referencedClasses: []
  1611. }),
  1612. globals.HLBrowserCodeWidget);
  1613. smalltalk.addMethod(
  1614. smalltalk.method({
  1615. selector: "onCompileError:",
  1616. protocol: 'reactions',
  1617. fn: function (anAnnouncement){
  1618. var self=this;
  1619. return smalltalk.withContext(function($ctx1) {
  1620. self._alert_(_st(_st(anAnnouncement)._error())._messageText());
  1621. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1622. args: ["anAnnouncement"],
  1623. source: "onCompileError: anAnnouncement\x0a\x09self alert: anAnnouncement error messageText",
  1624. messageSends: ["alert:", "messageText", "error"],
  1625. referencedClasses: []
  1626. }),
  1627. globals.HLBrowserCodeWidget);
  1628. smalltalk.addMethod(
  1629. smalltalk.method({
  1630. selector: "onInstVarAdded",
  1631. protocol: 'reactions',
  1632. fn: function (){
  1633. var self=this;
  1634. return smalltalk.withContext(function($ctx1) {
  1635. _st(self._browserModel())._save_(self._contents());
  1636. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},globals.HLBrowserCodeWidget)})},
  1637. args: [],
  1638. source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
  1639. messageSends: ["save:", "browserModel", "contents"],
  1640. referencedClasses: []
  1641. }),
  1642. globals.HLBrowserCodeWidget);
  1643. smalltalk.addMethod(
  1644. smalltalk.method({
  1645. selector: "onMethodModified:",
  1646. protocol: 'reactions',
  1647. fn: function (anAnnouncement){
  1648. var self=this;
  1649. var method;
  1650. return smalltalk.withContext(function($ctx1) {
  1651. var $3,$2,$1,$5,$4,$7,$6,$receiver;
  1652. method=_st(anAnnouncement)._method();
  1653. $3=self._browserModel();
  1654. $ctx1.sendIdx["browserModel"]=1;
  1655. $2=_st($3)._selectedClass();
  1656. $1=_st($2).__eq(_st(method)._methodClass());
  1657. $ctx1.sendIdx["="]=1;
  1658. if(! smalltalk.assert($1)){
  1659. return self;
  1660. };
  1661. $5=self._browserModel();
  1662. $ctx1.sendIdx["browserModel"]=2;
  1663. $4=_st($5)._selectedMethod();
  1664. $ctx1.sendIdx["selectedMethod"]=1;
  1665. if(($receiver = $4) == null || $receiver.isNil){
  1666. return self;
  1667. } else {
  1668. $4;
  1669. };
  1670. $7=_st(_st(self._browserModel())._selectedMethod())._selector();
  1671. $ctx1.sendIdx["selector"]=1;
  1672. $6=_st($7).__eq(_st(method)._selector());
  1673. if(! smalltalk.assert($6)){
  1674. return self;
  1675. };
  1676. self._refresh();
  1677. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},globals.HLBrowserCodeWidget)})},
  1678. args: ["anAnnouncement"],
  1679. 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",
  1680. messageSends: ["method", "ifFalse:", "=", "selectedClass", "browserModel", "methodClass", "ifNil:", "selectedMethod", "selector", "refresh"],
  1681. referencedClasses: []
  1682. }),
  1683. globals.HLBrowserCodeWidget);
  1684. smalltalk.addMethod(
  1685. smalltalk.method({
  1686. selector: "onMethodSelected:",
  1687. protocol: 'reactions',
  1688. fn: function (anAnnouncement){
  1689. var self=this;
  1690. var method;
  1691. return smalltalk.withContext(function($ctx1) {
  1692. var $1,$2,$receiver;
  1693. method=_st(anAnnouncement)._item();
  1694. $1=method;
  1695. if(($receiver = $1) == null || $receiver.isNil){
  1696. $2=self._contents_("");
  1697. $ctx1.sendIdx["contents:"]=1;
  1698. return $2;
  1699. } else {
  1700. $1;
  1701. };
  1702. self._contents_(_st(method)._source());
  1703. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},globals.HLBrowserCodeWidget)})},
  1704. args: ["anAnnouncement"],
  1705. source: "onMethodSelected: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement item.\x0a\x09\x0a\x09method ifNil: [ ^ self contents: '' ].\x0a\x09self contents: method source",
  1706. messageSends: ["item", "ifNil:", "contents:", "source"],
  1707. referencedClasses: []
  1708. }),
  1709. globals.HLBrowserCodeWidget);
  1710. smalltalk.addMethod(
  1711. smalltalk.method({
  1712. selector: "onPackageSelected:",
  1713. protocol: 'reactions',
  1714. fn: function (anAnnouncement){
  1715. var self=this;
  1716. var package_;
  1717. return smalltalk.withContext(function($ctx1) {
  1718. var $1,$2,$receiver;
  1719. package_=_st(anAnnouncement)._item();
  1720. $1=package_;
  1721. if(($receiver = $1) == null || $receiver.isNil){
  1722. $2=self._contents_("");
  1723. $ctx1.sendIdx["contents:"]=1;
  1724. return $2;
  1725. } else {
  1726. $1;
  1727. };
  1728. self._contents_(_st(package_)._definition());
  1729. return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{anAnnouncement:anAnnouncement,package_:package_},globals.HLBrowserCodeWidget)})},
  1730. args: ["anAnnouncement"],
  1731. source: "onPackageSelected: anAnnouncement\x0a\x09| package |\x0a\x09\x0a\x09package := anAnnouncement item.\x0a\x09\x0a\x09package ifNil: [ ^ self contents: '' ].\x0a\x09self contents: package definition",
  1732. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1733. referencedClasses: []
  1734. }),
  1735. globals.HLBrowserCodeWidget);
  1736. smalltalk.addMethod(
  1737. smalltalk.method({
  1738. selector: "onParseError:",
  1739. protocol: 'reactions',
  1740. fn: function (anAnnouncement){
  1741. var self=this;
  1742. var lineIndex,newContents;
  1743. function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
  1744. return smalltalk.withContext(function($ctx1) {
  1745. var $1,$3,$2,$6,$5,$4;
  1746. lineIndex=(1);
  1747. self._contents_(_st($String())._streamContents_((function(stream){
  1748. return smalltalk.withContext(function($ctx2) {
  1749. return _st(self._contents())._linesDo_((function(each){
  1750. return smalltalk.withContext(function($ctx3) {
  1751. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1752. if(smalltalk.assert($1)){
  1753. $3=_st(anAnnouncement)._column();
  1754. $ctx3.sendIdx["column"]=1;
  1755. $2=_st(each)._copyFrom_to_((1),$3);
  1756. $ctx3.sendIdx["copyFrom:to:"]=1;
  1757. _st(stream)._nextPutAll_($2);
  1758. $ctx3.sendIdx["nextPutAll:"]=1;
  1759. _st(stream)._nextPutAll_("<- ");
  1760. $ctx3.sendIdx["nextPutAll:"]=2;
  1761. _st(stream)._nextPutAll_(_st(anAnnouncement)._message());
  1762. $ctx3.sendIdx["nextPutAll:"]=3;
  1763. _st(stream)._nextPutAll_(" ");
  1764. $ctx3.sendIdx["nextPutAll:"]=4;
  1765. $6=_st(_st(anAnnouncement)._column()).__plus((1));
  1766. $ctx3.sendIdx["+"]=1;
  1767. $5=_st(each)._copyFrom_to_($6,_st(each)._size());
  1768. $4=_st(stream)._nextPutAll_($5);
  1769. $ctx3.sendIdx["nextPutAll:"]=5;
  1770. $4;
  1771. } else {
  1772. _st(stream)._nextPutAll_(each);
  1773. $ctx3.sendIdx["nextPutAll:"]=6;
  1774. };
  1775. _st(stream)._nextPutAll_(_st($String())._cr());
  1776. lineIndex=_st(lineIndex).__plus((1));
  1777. return lineIndex;
  1778. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  1779. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})));
  1780. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},globals.HLBrowserCodeWidget)})},
  1781. args: ["anAnnouncement"],
  1782. 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 ] ])",
  1783. messageSends: ["contents:", "streamContents:", "linesDo:", "contents", "ifTrue:ifFalse:", "=", "line", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "cr"],
  1784. referencedClasses: ["String"]
  1785. }),
  1786. globals.HLBrowserCodeWidget);
  1787. smalltalk.addMethod(
  1788. smalltalk.method({
  1789. selector: "onProtocolSelected:",
  1790. protocol: 'reactions',
  1791. fn: function (anAnnouncement){
  1792. var self=this;
  1793. return smalltalk.withContext(function($ctx1) {
  1794. var $2,$1,$3,$receiver;
  1795. $2=self._browserModel();
  1796. $ctx1.sendIdx["browserModel"]=1;
  1797. $1=_st($2)._selectedClass();
  1798. $ctx1.sendIdx["selectedClass"]=1;
  1799. if(($receiver = $1) == null || $receiver.isNil){
  1800. $3=self._contents_("");
  1801. $ctx1.sendIdx["contents:"]=1;
  1802. return $3;
  1803. } else {
  1804. $1;
  1805. };
  1806. self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
  1807. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1808. args: ["anAnnouncement"],
  1809. source: "onProtocolSelected: anAnnouncement\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a\x09self contents: self browserModel selectedClass definition",
  1810. messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
  1811. referencedClasses: []
  1812. }),
  1813. globals.HLBrowserCodeWidget);
  1814. smalltalk.addMethod(
  1815. smalltalk.method({
  1816. selector: "onSaveIt",
  1817. protocol: 'reactions',
  1818. fn: function (){
  1819. var self=this;
  1820. return smalltalk.withContext(function($ctx1) {
  1821. _st(self._browserModel())._save_(self._contents());
  1822. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},globals.HLBrowserCodeWidget)})},
  1823. args: [],
  1824. source: "onSaveIt\x0a\x09self browserModel save: self contents",
  1825. messageSends: ["save:", "browserModel", "contents"],
  1826. referencedClasses: []
  1827. }),
  1828. globals.HLBrowserCodeWidget);
  1829. smalltalk.addMethod(
  1830. smalltalk.method({
  1831. selector: "onShowInstanceToggled",
  1832. protocol: 'reactions',
  1833. fn: function (){
  1834. var self=this;
  1835. return smalltalk.withContext(function($ctx1) {
  1836. var $2,$1,$3,$receiver;
  1837. $2=self._browserModel();
  1838. $ctx1.sendIdx["browserModel"]=1;
  1839. $1=_st($2)._selectedClass();
  1840. $ctx1.sendIdx["selectedClass"]=1;
  1841. if(($receiver = $1) == null || $receiver.isNil){
  1842. $3=self._contents_("");
  1843. $ctx1.sendIdx["contents:"]=1;
  1844. return $3;
  1845. } else {
  1846. $1;
  1847. };
  1848. self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
  1849. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},globals.HLBrowserCodeWidget)})},
  1850. args: [],
  1851. source: "onShowInstanceToggled\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a\x09self contents: self browserModel selectedClass definition",
  1852. messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
  1853. referencedClasses: []
  1854. }),
  1855. globals.HLBrowserCodeWidget);
  1856. smalltalk.addMethod(
  1857. smalltalk.method({
  1858. selector: "onShowTemplate:",
  1859. protocol: 'reactions',
  1860. fn: function (anAnnouncement){
  1861. var self=this;
  1862. return smalltalk.withContext(function($ctx1) {
  1863. self._contents_(_st(anAnnouncement)._template());
  1864. return self}, function($ctx1) {$ctx1.fill(self,"onShowTemplate:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1865. args: ["anAnnouncement"],
  1866. source: "onShowTemplate: anAnnouncement\x0a\x09self contents: anAnnouncement template",
  1867. messageSends: ["contents:", "template"],
  1868. referencedClasses: []
  1869. }),
  1870. globals.HLBrowserCodeWidget);
  1871. smalltalk.addMethod(
  1872. smalltalk.method({
  1873. selector: "onSourceCodeFocusRequested",
  1874. protocol: 'reactions',
  1875. fn: function (){
  1876. var self=this;
  1877. return smalltalk.withContext(function($ctx1) {
  1878. self._focus();
  1879. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},globals.HLBrowserCodeWidget)})},
  1880. args: [],
  1881. source: "onSourceCodeFocusRequested\x0a\x09self focus",
  1882. messageSends: ["focus"],
  1883. referencedClasses: []
  1884. }),
  1885. globals.HLBrowserCodeWidget);
  1886. smalltalk.addMethod(
  1887. smalltalk.method({
  1888. selector: "onSourceCodeSaved",
  1889. protocol: 'reactions',
  1890. fn: function (){
  1891. var self=this;
  1892. return smalltalk.withContext(function($ctx1) {
  1893. self._methodContents_(self._contents());
  1894. self._updateState();
  1895. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},globals.HLBrowserCodeWidget)})},
  1896. args: [],
  1897. source: "onSourceCodeSaved\x0a\x09self methodContents: self contents.\x0a\x09self updateState",
  1898. messageSends: ["methodContents:", "contents", "updateState"],
  1899. referencedClasses: []
  1900. }),
  1901. globals.HLBrowserCodeWidget);
  1902. smalltalk.addMethod(
  1903. smalltalk.method({
  1904. selector: "onUnknownVariableError:",
  1905. protocol: 'reactions',
  1906. fn: function (anAnnouncement){
  1907. var self=this;
  1908. var error;
  1909. function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
  1910. return smalltalk.withContext(function($ctx1) {
  1911. var $1;
  1912. error=_st(anAnnouncement)._error();
  1913. self._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1914. return smalltalk.withContext(function($ctx2) {
  1915. _st(stream)._nextPutAll_(_st(error)._messageText());
  1916. $ctx2.sendIdx["nextPutAll:"]=1;
  1917. _st(stream)._nextPutAll_(_st($String())._cr());
  1918. $ctx2.sendIdx["nextPutAll:"]=2;
  1919. $1=_st(stream)._nextPutAll_("Would you like to define an instance variable?");
  1920. return $1;
  1921. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})),(function(){
  1922. return smalltalk.withContext(function($ctx2) {
  1923. return _st(self._browserModel())._addInstVarNamed_(_st(error)._variableName());
  1924. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1925. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},globals.HLBrowserCodeWidget)})},
  1926. args: ["anAnnouncement"],
  1927. 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 ]",
  1928. messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "browserModel", "variableName"],
  1929. referencedClasses: ["String"]
  1930. }),
  1931. globals.HLBrowserCodeWidget);
  1932. smalltalk.addMethod(
  1933. smalltalk.method({
  1934. selector: "refresh",
  1935. protocol: 'actions',
  1936. fn: function (){
  1937. var self=this;
  1938. return smalltalk.withContext(function($ctx1) {
  1939. var $1,$2;
  1940. $1=self._hasModification();
  1941. if(smalltalk.assert($1)){
  1942. return self;
  1943. };
  1944. $2=self._hasFocus();
  1945. if(smalltalk.assert($2)){
  1946. return self;
  1947. };
  1948. self._contents_(_st(_st(self._browserModel())._selectedMethod())._source());
  1949. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},globals.HLBrowserCodeWidget)})},
  1950. args: [],
  1951. source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self browserModel selectedMethod source",
  1952. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"],
  1953. referencedClasses: []
  1954. }),
  1955. globals.HLBrowserCodeWidget);
  1956. smalltalk.addMethod(
  1957. smalltalk.method({
  1958. selector: "renderButtonsOn:",
  1959. protocol: 'actions',
  1960. fn: function (html){
  1961. var self=this;
  1962. return smalltalk.withContext(function($ctx1) {
  1963. var $1,$2;
  1964. $1=_st(html)._button();
  1965. _st($1)._class_("button");
  1966. _st($1)._with_("SaveIt");
  1967. $2=_st($1)._onClick_((function(){
  1968. return smalltalk.withContext(function($ctx2) {
  1969. return self._saveIt();
  1970. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1971. ($ctx1.supercall = true, globals.HLBrowserCodeWidget.superclass.fn.prototype._renderButtonsOn_.apply(_st(self), [html]));
  1972. $ctx1.supercall = false;
  1973. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLBrowserCodeWidget)})},
  1974. args: ["html"],
  1975. source: "renderButtonsOn: html\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'SaveIt';\x0a\x09\x09onClick: [ self saveIt ].\x0a\x09super renderButtonsOn: html",
  1976. messageSends: ["class:", "button", "with:", "onClick:", "saveIt", "renderButtonsOn:"],
  1977. referencedClasses: []
  1978. }),
  1979. globals.HLBrowserCodeWidget);
  1980. smalltalk.addMethod(
  1981. smalltalk.method({
  1982. selector: "saveIt",
  1983. protocol: 'actions',
  1984. fn: function (){
  1985. var self=this;
  1986. return smalltalk.withContext(function($ctx1) {
  1987. _st(self._browserModel())._saveSourceCode();
  1988. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},globals.HLBrowserCodeWidget)})},
  1989. args: [],
  1990. source: "saveIt\x0a\x09self browserModel saveSourceCode",
  1991. messageSends: ["saveSourceCode", "browserModel"],
  1992. referencedClasses: []
  1993. }),
  1994. globals.HLBrowserCodeWidget);
  1995. smalltalk.addMethod(
  1996. smalltalk.method({
  1997. selector: "unregister",
  1998. protocol: 'actions',
  1999. fn: function (){
  2000. var self=this;
  2001. return smalltalk.withContext(function($ctx1) {
  2002. var $2,$1;
  2003. ($ctx1.supercall = true, globals.HLBrowserCodeWidget.superclass.fn.prototype._unregsiter.apply(_st(self), []));
  2004. $ctx1.supercall = false;
  2005. $2=self._browserModel();
  2006. $ctx1.sendIdx["browserModel"]=1;
  2007. $1=_st($2)._announcer();
  2008. _st($1)._unsubscribe_(self);
  2009. $ctx1.sendIdx["unsubscribe:"]=1;
  2010. _st(_st(self._browserModel())._systemAnnouncer())._unsubscribe_(self);
  2011. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLBrowserCodeWidget)})},
  2012. args: [],
  2013. source: "unregister\x0a\x09super unregsiter.\x0a\x09\x0a\x09self browserModel announcer unsubscribe: self.\x0a\x09self browserModel systemAnnouncer unsubscribe: self",
  2014. messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"],
  2015. referencedClasses: []
  2016. }),
  2017. globals.HLBrowserCodeWidget);
  2018. smalltalk.addMethod(
  2019. smalltalk.method({
  2020. selector: "canBeOpenAsTab",
  2021. protocol: 'testing',
  2022. fn: function (){
  2023. var self=this;
  2024. return false;
  2025. },
  2026. args: [],
  2027. source: "canBeOpenAsTab\x0a\x09^ false",
  2028. messageSends: [],
  2029. referencedClasses: []
  2030. }),
  2031. globals.HLBrowserCodeWidget.klass);
  2032. smalltalk.addMethod(
  2033. smalltalk.method({
  2034. selector: "on:",
  2035. protocol: 'instance creation',
  2036. fn: function (aBrowserModel){
  2037. var self=this;
  2038. return smalltalk.withContext(function($ctx1) {
  2039. var $2,$3,$1;
  2040. $2=self._new();
  2041. _st($2)._browserModel_(aBrowserModel);
  2042. $3=_st($2)._yourself();
  2043. $1=$3;
  2044. return $1;
  2045. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},globals.HLBrowserCodeWidget.klass)})},
  2046. args: ["aBrowserModel"],
  2047. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  2048. messageSends: ["browserModel:", "new", "yourself"],
  2049. referencedClasses: []
  2050. }),
  2051. globals.HLBrowserCodeWidget.klass);
  2052. smalltalk.addClass('HLWorkspace', globals.HLWidget, ['codeWidget', 'transcript'], 'Helios-Workspace');
  2053. smalltalk.addMethod(
  2054. smalltalk.method({
  2055. selector: "canHaveFocus",
  2056. protocol: 'testing',
  2057. fn: function (){
  2058. var self=this;
  2059. return true;
  2060. },
  2061. args: [],
  2062. source: "canHaveFocus\x0a\x09^ true",
  2063. messageSends: [],
  2064. referencedClasses: []
  2065. }),
  2066. globals.HLWorkspace);
  2067. smalltalk.addMethod(
  2068. smalltalk.method({
  2069. selector: "codeWidget",
  2070. protocol: 'accessing',
  2071. fn: function (){
  2072. var self=this;
  2073. function $HLCodeWidget(){return globals.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  2074. return smalltalk.withContext(function($ctx1) {
  2075. var $2,$1,$receiver;
  2076. $2=self["@codeWidget"];
  2077. if(($receiver = $2) == null || $receiver.isNil){
  2078. self["@codeWidget"]=_st($HLCodeWidget())._new();
  2079. $1=self["@codeWidget"];
  2080. } else {
  2081. $1=$2;
  2082. };
  2083. return $1;
  2084. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},globals.HLWorkspace)})},
  2085. args: [],
  2086. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
  2087. messageSends: ["ifNil:", "new"],
  2088. referencedClasses: ["HLCodeWidget"]
  2089. }),
  2090. globals.HLWorkspace);
  2091. smalltalk.addMethod(
  2092. smalltalk.method({
  2093. selector: "focus",
  2094. protocol: 'actions',
  2095. fn: function (){
  2096. var self=this;
  2097. return smalltalk.withContext(function($ctx1) {
  2098. var $1;
  2099. $1=_st(self._codeWidget())._focus();
  2100. return $1;
  2101. }, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLWorkspace)})},
  2102. args: [],
  2103. source: "focus\x0a\x09^ self codeWidget focus",
  2104. messageSends: ["focus", "codeWidget"],
  2105. referencedClasses: []
  2106. }),
  2107. globals.HLWorkspace);
  2108. smalltalk.addMethod(
  2109. smalltalk.method({
  2110. selector: "renderContentOn:",
  2111. protocol: 'rendering',
  2112. fn: function (html){
  2113. var self=this;
  2114. function $HLContainer(){return globals.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  2115. function $HLHorizontalSplitter(){return globals.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  2116. return smalltalk.withContext(function($ctx1) {
  2117. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._codeWidget(),(function(canvas){
  2118. return smalltalk.withContext(function($ctx2) {
  2119. return self._renderTranscriptOn_(canvas);
  2120. }, function($ctx2) {$ctx2.fillBlock({canvas:canvas},$ctx1,1)})}))));
  2121. $ctx1.sendIdx["with:"]=1;
  2122. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLWorkspace)})},
  2123. args: ["html"],
  2124. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter\x0a\x09\x09with: self codeWidget\x0a\x09\x09with: [ :canvas | self renderTranscriptOn: canvas ]))",
  2125. messageSends: ["with:", "with:with:", "codeWidget", "renderTranscriptOn:"],
  2126. referencedClasses: ["HLContainer", "HLHorizontalSplitter"]
  2127. }),
  2128. globals.HLWorkspace);
  2129. smalltalk.addMethod(
  2130. smalltalk.method({
  2131. selector: "renderTranscriptOn:",
  2132. protocol: 'rendering',
  2133. fn: function (html){
  2134. var self=this;
  2135. return smalltalk.withContext(function($ctx1) {
  2136. var $1,$3,$4,$2;
  2137. $1=_st(html)._div();
  2138. $ctx1.sendIdx["div"]=1;
  2139. _st($1)._class_("transcript-container");
  2140. $ctx1.sendIdx["class:"]=1;
  2141. $2=_st($1)._with_((function(){
  2142. return smalltalk.withContext(function($ctx2) {
  2143. $3=_st(html)._div();
  2144. _st($3)._class_("list-label");
  2145. $4=_st($3)._with_("Transcript");
  2146. $4;
  2147. return _st(self._transcript())._renderOn_(html);
  2148. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2149. $ctx1.sendIdx["with:"]=1;
  2150. return self}, function($ctx1) {$ctx1.fill(self,"renderTranscriptOn:",{html:html},globals.HLWorkspace)})},
  2151. args: ["html"],
  2152. 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 ]",
  2153. messageSends: ["class:", "div", "with:", "renderOn:", "transcript"],
  2154. referencedClasses: []
  2155. }),
  2156. globals.HLWorkspace);
  2157. smalltalk.addMethod(
  2158. smalltalk.method({
  2159. selector: "transcript",
  2160. protocol: 'accessing',
  2161. fn: function (){
  2162. var self=this;
  2163. function $HLTranscript(){return globals.HLTranscript||(typeof HLTranscript=="undefined"?nil:HLTranscript)}
  2164. return smalltalk.withContext(function($ctx1) {
  2165. var $2,$1,$receiver;
  2166. $2=self["@transcript"];
  2167. if(($receiver = $2) == null || $receiver.isNil){
  2168. self["@transcript"]=_st($HLTranscript())._new();
  2169. $1=self["@transcript"];
  2170. } else {
  2171. $1=$2;
  2172. };
  2173. return $1;
  2174. }, function($ctx1) {$ctx1.fill(self,"transcript",{},globals.HLWorkspace)})},
  2175. args: [],
  2176. source: "transcript\x0a\x09^ transcript ifNil: [ transcript := HLTranscript new ]",
  2177. messageSends: ["ifNil:", "new"],
  2178. referencedClasses: ["HLTranscript"]
  2179. }),
  2180. globals.HLWorkspace);
  2181. smalltalk.addMethod(
  2182. smalltalk.method({
  2183. selector: "unregister",
  2184. protocol: 'actions',
  2185. fn: function (){
  2186. var self=this;
  2187. return smalltalk.withContext(function($ctx1) {
  2188. ($ctx1.supercall = true, globals.HLWorkspace.superclass.fn.prototype._unregister.apply(_st(self), []));
  2189. $ctx1.supercall = false;
  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. });