Helios-Workspace.js 89 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366
  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) == nil || $receiver == null){
  16. self["@announcer"]=_st($Announcer())._new();
  17. $1=self["@announcer"];
  18. } else {
  19. $1=$2;
  20. };
  21. return $1;
  22. }, function($ctx1) {$ctx1.fill(self,"announcer",{},globals.HLCodeModel)})},
  23. args: [],
  24. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  25. messageSends: ["ifNil:", "new"],
  26. referencedClasses: ["Announcer"]
  27. }),
  28. globals.HLCodeModel);
  29. smalltalk.addMethod(
  30. smalltalk.method({
  31. selector: "browse:",
  32. protocol: 'actions',
  33. fn: function (anObject){
  34. var self=this;
  35. return smalltalk.withContext(function($ctx1) {
  36. _st(anObject)._browse();
  37. return self}, function($ctx1) {$ctx1.fill(self,"browse:",{anObject:anObject},globals.HLCodeModel)})},
  38. args: ["anObject"],
  39. source: "browse: anObject\x0a\x09anObject browse",
  40. messageSends: ["browse"],
  41. referencedClasses: []
  42. }),
  43. globals.HLCodeModel);
  44. smalltalk.addMethod(
  45. smalltalk.method({
  46. selector: "defaultReceiver",
  47. protocol: 'defaults',
  48. fn: function (){
  49. var self=this;
  50. return smalltalk.withContext(function($ctx1) {
  51. var $1;
  52. $1=_st(self._environment())._doItReceiver();
  53. return $1;
  54. }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{},globals.HLCodeModel)})},
  55. args: [],
  56. source: "defaultReceiver\x0a\x09^ self environment doItReceiver",
  57. messageSends: ["doItReceiver", "environment"],
  58. referencedClasses: []
  59. }),
  60. globals.HLCodeModel);
  61. smalltalk.addMethod(
  62. smalltalk.method({
  63. selector: "doIt:",
  64. protocol: 'actions',
  65. fn: function (aString){
  66. var self=this;
  67. function $ErrorHandler(){return globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  68. return smalltalk.withContext(function($ctx1) {
  69. var $1;
  70. $1=_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) == nil || $receiver == null){
  97. $1=_st(_st($HLManager())._current())._environment();
  98. } else {
  99. $1=$2;
  100. };
  101. return $1;
  102. }, function($ctx1) {$ctx1.fill(self,"environment",{},globals.HLCodeModel)})},
  103. args: [],
  104. source: "environment\x0a\x09^ environment ifNil: [ HLManager current environment ]",
  105. messageSends: ["ifNil:", "environment", "current"],
  106. referencedClasses: ["HLManager"]
  107. }),
  108. globals.HLCodeModel);
  109. smalltalk.addMethod(
  110. smalltalk.method({
  111. selector: "environment:",
  112. protocol: 'accessing',
  113. fn: function (anEnvironment){
  114. var self=this;
  115. self["@environment"]=anEnvironment;
  116. return self},
  117. args: ["anEnvironment"],
  118. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  119. messageSends: [],
  120. referencedClasses: []
  121. }),
  122. globals.HLCodeModel);
  123. smalltalk.addMethod(
  124. smalltalk.method({
  125. selector: "inspect:",
  126. protocol: 'actions',
  127. fn: function (anObject){
  128. var self=this;
  129. return smalltalk.withContext(function($ctx1) {
  130. _st(self._environment())._inspect_(anObject);
  131. return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},globals.HLCodeModel)})},
  132. args: ["anObject"],
  133. source: "inspect: anObject\x0a\x09self environment inspect: anObject",
  134. messageSends: ["inspect:", "environment"],
  135. referencedClasses: []
  136. }),
  137. globals.HLCodeModel);
  138. smalltalk.addMethod(
  139. smalltalk.method({
  140. selector: "receiver",
  141. protocol: 'accessing',
  142. fn: function (){
  143. var self=this;
  144. return smalltalk.withContext(function($ctx1) {
  145. var $2,$1,$receiver;
  146. $2=self["@receiver"];
  147. if(($receiver = $2) == nil || $receiver == null){
  148. self["@receiver"]=self._defaultReceiver();
  149. $1=self["@receiver"];
  150. } else {
  151. $1=$2;
  152. };
  153. return $1;
  154. }, function($ctx1) {$ctx1.fill(self,"receiver",{},globals.HLCodeModel)})},
  155. args: [],
  156. source: "receiver\x0a\x09^ receiver ifNil: [ receiver := self defaultReceiver ]",
  157. messageSends: ["ifNil:", "defaultReceiver"],
  158. referencedClasses: []
  159. }),
  160. globals.HLCodeModel);
  161. smalltalk.addMethod(
  162. smalltalk.method({
  163. selector: "receiver:",
  164. protocol: 'accessing',
  165. fn: function (anObject){
  166. var self=this;
  167. self["@receiver"]=anObject;
  168. return self},
  169. args: ["anObject"],
  170. source: "receiver: anObject\x0a\x09receiver := anObject",
  171. messageSends: [],
  172. referencedClasses: []
  173. }),
  174. globals.HLCodeModel);
  175. smalltalk.addMethod(
  176. smalltalk.method({
  177. selector: "on:",
  178. protocol: 'actions',
  179. fn: function (anEnvironment){
  180. var self=this;
  181. return smalltalk.withContext(function($ctx1) {
  182. var $2,$3,$1;
  183. $2=self._new();
  184. _st($2)._environment_(anEnvironment);
  185. $3=_st($2)._yourself();
  186. $1=$3;
  187. return $1;
  188. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},globals.HLCodeModel.klass)})},
  189. args: ["anEnvironment"],
  190. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  191. messageSends: ["environment:", "new", "yourself"],
  192. referencedClasses: []
  193. }),
  194. globals.HLCodeModel.klass);
  195. smalltalk.addClass('HLCodeWidget', globals.HLWidget, ['model', 'wrapper', 'code', 'editor', 'state'], 'Helios-Workspace');
  196. smalltalk.addMethod(
  197. smalltalk.method({
  198. selector: "announcer",
  199. protocol: 'accessing',
  200. fn: function (){
  201. var self=this;
  202. return smalltalk.withContext(function($ctx1) {
  203. var $1;
  204. $1=_st(self._model())._announcer();
  205. return $1;
  206. }, function($ctx1) {$ctx1.fill(self,"announcer",{},globals.HLCodeWidget)})},
  207. args: [],
  208. source: "announcer\x0a\x09^ self model announcer",
  209. messageSends: ["announcer", "model"],
  210. referencedClasses: []
  211. }),
  212. globals.HLCodeWidget);
  213. smalltalk.addMethod(
  214. smalltalk.method({
  215. selector: "browseIt",
  216. protocol: 'actions',
  217. fn: function (){
  218. var self=this;
  219. var result;
  220. function $Error(){return globals.Error||(typeof Error=="undefined"?nil:Error)}
  221. function $ErrorHandler(){return globals.ErrorHandler||(typeof ErrorHandler=="undefined"?nil:ErrorHandler)}
  222. return smalltalk.withContext(function($ctx1) {
  223. var $1;
  224. var $early={};
  225. try {
  226. result=_st((function(){
  227. return smalltalk.withContext(function($ctx2) {
  228. return self._doIt();
  229. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}))._on_do_($Error(),(function(exception){
  230. return smalltalk.withContext(function($ctx2) {
  231. $1=_st($ErrorHandler())._handleError_(exception);
  232. throw $early=[$1];
  233. }, function($ctx2) {$ctx2.fillBlock({exception:exception},$ctx1,2)})}));
  234. _st(self._model())._browse_(result);
  235. return self}
  236. catch(e) {if(e===$early)return e[0]; throw e}
  237. }, function($ctx1) {$ctx1.fill(self,"browseIt",{result:result},globals.HLCodeWidget)})},
  238. args: [],
  239. source: "browseIt\x0a\x09| result |\x0a\x09\x0a\x09result := [ self doIt ] on: Error do: [ :exception | \x0a\x09\x09^ ErrorHandler handleError: exception ].\x0a\x09\x09\x0a\x09self model browse: result",
  240. messageSends: ["on:do:", "doIt", "handleError:", "browse:", "model"],
  241. referencedClasses: ["Error", "ErrorHandler"]
  242. }),
  243. globals.HLCodeWidget);
  244. smalltalk.addMethod(
  245. smalltalk.method({
  246. selector: "canHaveFocus",
  247. protocol: 'testing',
  248. fn: function (){
  249. var self=this;
  250. return true;
  251. },
  252. args: [],
  253. source: "canHaveFocus\x0a\x09^ true",
  254. messageSends: [],
  255. referencedClasses: []
  256. }),
  257. globals.HLCodeWidget);
  258. smalltalk.addMethod(
  259. smalltalk.method({
  260. selector: "clear",
  261. protocol: 'actions',
  262. fn: function (){
  263. var self=this;
  264. return smalltalk.withContext(function($ctx1) {
  265. self._contents_("");
  266. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},globals.HLCodeWidget)})},
  267. args: [],
  268. source: "clear\x0a\x09self contents: ''",
  269. messageSends: ["contents:"],
  270. referencedClasses: []
  271. }),
  272. globals.HLCodeWidget);
  273. smalltalk.addMethod(
  274. smalltalk.method({
  275. selector: "configureEditor",
  276. protocol: 'actions',
  277. fn: function (){
  278. var self=this;
  279. return smalltalk.withContext(function($ctx1) {
  280. var $1,$2,$3;
  281. $1=self._editor();
  282. $ctx1.sendIdx["editor"]=1;
  283. _st($1)._at_put_("amberCodeWidget",self);
  284. $2=self._editor();
  285. $ctx1.sendIdx["editor"]=2;
  286. _st($2)._on_do_("change",(function(){
  287. return smalltalk.withContext(function($ctx2) {
  288. return self._onChange();
  289. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  290. _st(_st(self._wrapper())._asJQuery())._on_in_do_("mousedown",".CodeMirror pre",(function(event){
  291. var position,node;
  292. return smalltalk.withContext(function($ctx2) {
  293. $3=_st(event)._at_("ctrlKey");
  294. if(smalltalk.assert($3)){
  295. position=_st(self._editor())._coordsChar_(globals.HashedCollection._newFromPairs_(["left",_st(event)._clientX(),"top",_st(event)._clientY()]));
  296. position;
  297. self._onCtrlClickAt_(_st(_st(_st(position)._line()).__at(_st(position)._ch())).__plus((1)));
  298. return _st(event)._preventDefault();
  299. };
  300. }, function($ctx2) {$ctx2.fillBlock({event:event,position:position,node:node},$ctx1,2)})}));
  301. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},globals.HLCodeWidget)})},
  302. args: [],
  303. source: "configureEditor\x0a\x09self editor at: 'amberCodeWidget' put: self.\x0a\x09self editor on: 'change' do: [ self onChange ].\x0a\x0a\x09self wrapper asJQuery on: 'mousedown' in: '.CodeMirror pre' do: [ :event | | position node |\x0a\x09\x09(event at: 'ctrlKey') ifTrue: [\x0a\x09\x09\x09position := self editor coordsChar: #{ \x0a\x09\x09\x09\x09'left' -> event clientX.\x0a\x09\x09\x09\x09'top' -> event clientY\x0a\x09\x09\x09}.\x0a\x09\x09\x09self onCtrlClickAt: (position line @ position ch) + 1.\x0a\x09\x09\x09event preventDefault ] ]",
  304. messageSends: ["at:put:", "editor", "on:do:", "onChange", "on:in:do:", "asJQuery", "wrapper", "ifTrue:", "at:", "coordsChar:", "clientX", "clientY", "onCtrlClickAt:", "+", "@", "line", "ch", "preventDefault"],
  305. referencedClasses: []
  306. }),
  307. globals.HLCodeWidget);
  308. smalltalk.addMethod(
  309. smalltalk.method({
  310. selector: "contents",
  311. protocol: 'accessing',
  312. fn: function (){
  313. var self=this;
  314. return smalltalk.withContext(function($ctx1) {
  315. var $1;
  316. $1=_st(self["@editor"])._getValue();
  317. return $1;
  318. }, function($ctx1) {$ctx1.fill(self,"contents",{},globals.HLCodeWidget)})},
  319. args: [],
  320. source: "contents\x0a\x09^ editor getValue",
  321. messageSends: ["getValue"],
  322. referencedClasses: []
  323. }),
  324. globals.HLCodeWidget);
  325. smalltalk.addMethod(
  326. smalltalk.method({
  327. selector: "contents:",
  328. protocol: 'accessing',
  329. fn: function (aString){
  330. var self=this;
  331. return smalltalk.withContext(function($ctx1) {
  332. var $1,$receiver;
  333. _st(self["@editor"])._setValue_(aString);
  334. $1=self["@state"];
  335. if(($receiver = $1) == nil || $receiver == null){
  336. $1;
  337. } else {
  338. self._updateState();
  339. };
  340. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},globals.HLCodeWidget)})},
  341. args: ["aString"],
  342. source: "contents: aString\x0a\x09editor setValue: aString.\x0a\x09state ifNotNil: [ self updateState ]",
  343. messageSends: ["setValue:", "ifNotNil:", "updateState"],
  344. referencedClasses: []
  345. }),
  346. globals.HLCodeWidget);
  347. smalltalk.addMethod(
  348. smalltalk.method({
  349. selector: "currentLine",
  350. protocol: 'accessing',
  351. fn: function (){
  352. var self=this;
  353. return smalltalk.withContext(function($ctx1) {
  354. var $1;
  355. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  356. return $1;
  357. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},globals.HLCodeWidget)})},
  358. args: [],
  359. source: "currentLine\x0a ^editor getLine: (editor getCursor line)",
  360. messageSends: ["getLine:", "line", "getCursor"],
  361. referencedClasses: []
  362. }),
  363. globals.HLCodeWidget);
  364. smalltalk.addMethod(
  365. smalltalk.method({
  366. selector: "currentLineOrSelection",
  367. protocol: 'accessing',
  368. fn: function (){
  369. var self=this;
  370. return smalltalk.withContext(function($ctx1) {
  371. var $2,$1;
  372. $2=_st(self["@editor"])._somethingSelected();
  373. if(smalltalk.assert($2)){
  374. $1=self._selection();
  375. } else {
  376. $1=self._currentLine();
  377. };
  378. return $1;
  379. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},globals.HLCodeWidget)})},
  380. args: [],
  381. source: "currentLineOrSelection\x0a ^editor somethingSelected\x0a\x09\x09ifFalse: [ self currentLine ]\x0a\x09\x09ifTrue: [ self selection ]",
  382. messageSends: ["ifFalse:ifTrue:", "somethingSelected", "currentLine", "selection"],
  383. referencedClasses: []
  384. }),
  385. globals.HLCodeWidget);
  386. smalltalk.addMethod(
  387. smalltalk.method({
  388. selector: "doIt",
  389. protocol: 'actions',
  390. fn: function (){
  391. var self=this;
  392. var result;
  393. function $HLDoItExecuted(){return globals.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
  394. return smalltalk.withContext(function($ctx1) {
  395. var $1,$2;
  396. $1=self._model();
  397. $ctx1.sendIdx["model"]=1;
  398. result=_st($1)._doIt_(self._currentLineOrSelection());
  399. _st(_st(self._model())._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
  400. $2=result;
  401. return $2;
  402. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},globals.HLCodeWidget)})},
  403. args: [],
  404. source: "doIt\x0a\x09| result |\x0a\x0a\x09result := self model doIt: self currentLineOrSelection.\x0a\x09self model announcer announce: (HLDoItExecuted on: model).\x0a\x0a\x09^ result",
  405. messageSends: ["doIt:", "model", "currentLineOrSelection", "announce:", "announcer", "on:"],
  406. referencedClasses: ["HLDoItExecuted"]
  407. }),
  408. globals.HLCodeWidget);
  409. smalltalk.addMethod(
  410. smalltalk.method({
  411. selector: "editor",
  412. protocol: 'actions',
  413. fn: function (){
  414. var self=this;
  415. var $1;
  416. $1=self["@editor"];
  417. return $1;
  418. },
  419. args: [],
  420. source: "editor\x0a\x09^ editor",
  421. messageSends: [],
  422. referencedClasses: []
  423. }),
  424. globals.HLCodeWidget);
  425. smalltalk.addMethod(
  426. smalltalk.method({
  427. selector: "editorOptions",
  428. protocol: 'accessing',
  429. fn: function (){
  430. var self=this;
  431. function $HashedCollection(){return globals.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  432. return smalltalk.withContext(function($ctx1) {
  433. var $2,$1;
  434. $2="helios.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) == nil || $receiver == null){
  543. self["@model"]=_st($HLCodeModel())._new();
  544. $1=self["@model"];
  545. } else {
  546. $1=$2;
  547. };
  548. return $1;
  549. }, function($ctx1) {$ctx1.fill(self,"model",{},globals.HLCodeWidget)})},
  550. args: [],
  551. source: "model\x0a\x09^ model ifNil: [ model := HLCodeModel new ]",
  552. messageSends: ["ifNil:", "new"],
  553. referencedClasses: ["HLCodeModel"]
  554. }),
  555. globals.HLCodeWidget);
  556. smalltalk.addMethod(
  557. smalltalk.method({
  558. selector: "model:",
  559. protocol: 'accessing',
  560. fn: function (aModel){
  561. var self=this;
  562. self["@model"]=aModel;
  563. return self},
  564. args: ["aModel"],
  565. source: "model: aModel\x0a\x09model := aModel",
  566. messageSends: [],
  567. referencedClasses: []
  568. }),
  569. globals.HLCodeWidget);
  570. smalltalk.addMethod(
  571. smalltalk.method({
  572. selector: "navigateTo:",
  573. protocol: 'actions',
  574. fn: function (aString){
  575. var self=this;
  576. function $Finder(){return globals.Finder||(typeof Finder=="undefined"?nil:Finder)}
  577. return smalltalk.withContext(function($ctx1) {
  578. _st($Finder())._findString_(aString);
  579. return self}, function($ctx1) {$ctx1.fill(self,"navigateTo:",{aString:aString},globals.HLCodeWidget)})},
  580. args: ["aString"],
  581. source: "navigateTo: aString\x0a\x09Finder findString: aString",
  582. messageSends: ["findString:"],
  583. referencedClasses: ["Finder"]
  584. }),
  585. globals.HLCodeWidget);
  586. smalltalk.addMethod(
  587. smalltalk.method({
  588. selector: "navigateToReference:",
  589. protocol: 'actions',
  590. fn: function (aString){
  591. var self=this;
  592. function $HLReferences(){return globals.HLReferences||(typeof HLReferences=="undefined"?nil:HLReferences)}
  593. return smalltalk.withContext(function($ctx1) {
  594. _st(_st($HLReferences())._openAsTab())._search_(aString);
  595. return self}, function($ctx1) {$ctx1.fill(self,"navigateToReference:",{aString:aString},globals.HLCodeWidget)})},
  596. args: ["aString"],
  597. source: "navigateToReference: aString\x0a\x09(HLReferences openAsTab)\x0a\x09\x09search: aString",
  598. messageSends: ["search:", "openAsTab"],
  599. referencedClasses: ["HLReferences"]
  600. }),
  601. globals.HLCodeWidget);
  602. smalltalk.addMethod(
  603. smalltalk.method({
  604. selector: "onChange",
  605. protocol: 'reactions',
  606. fn: function (){
  607. var self=this;
  608. return smalltalk.withContext(function($ctx1) {
  609. self._updateState();
  610. return self}, function($ctx1) {$ctx1.fill(self,"onChange",{},globals.HLCodeWidget)})},
  611. args: [],
  612. source: "onChange\x0a\x09self updateState",
  613. messageSends: ["updateState"],
  614. referencedClasses: []
  615. }),
  616. globals.HLCodeWidget);
  617. smalltalk.addMethod(
  618. smalltalk.method({
  619. selector: "onCtrlClickAt:",
  620. protocol: 'reactions',
  621. fn: function (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. globals.HLCodeWidget.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1118. self._setupCodeMirror();
  1119. self._setupCommands();
  1120. $1=self._setupKeyMaps();
  1121. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.HLCodeWidget.klass)})},
  1122. args: [],
  1123. source: "initialize\x0a\x09super initialize.\x0a\x09self \x0a\x09\x09setupCodeMirror;\x0a\x09\x09setupCommands;\x0a\x09\x09setupKeyMaps.",
  1124. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"],
  1125. referencedClasses: []
  1126. }),
  1127. globals.HLCodeWidget.klass);
  1128. smalltalk.addMethod(
  1129. smalltalk.method({
  1130. selector: "keyMap",
  1131. protocol: 'accessing',
  1132. fn: function (){
  1133. var self=this;
  1134. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1135. return smalltalk.withContext(function($ctx1) {
  1136. var $2,$1;
  1137. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  1138. if(smalltalk.assert($2)){
  1139. $1=self._macKeyMap();
  1140. } else {
  1141. $1=self._pcKeyMap();
  1142. };
  1143. return $1;
  1144. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},globals.HLCodeWidget.klass)})},
  1145. args: [],
  1146. source: "keyMap\x0a\x09^ HLManager current keyBinder systemIsMac\x0a\x09\x09ifTrue: [ self macKeyMap ]\x0a\x09\x09ifFalse: [ self pcKeyMap ]",
  1147. messageSends: ["ifTrue:ifFalse:", "systemIsMac", "keyBinder", "current", "macKeyMap", "pcKeyMap"],
  1148. referencedClasses: ["HLManager"]
  1149. }),
  1150. globals.HLCodeWidget.klass);
  1151. smalltalk.addMethod(
  1152. smalltalk.method({
  1153. selector: "macKeyMap",
  1154. protocol: 'accessing',
  1155. fn: function (){
  1156. var self=this;
  1157. var $1;
  1158. $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"]]);
  1159. return $1;
  1160. },
  1161. args: [],
  1162. 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 }",
  1163. messageSends: [],
  1164. referencedClasses: []
  1165. }),
  1166. globals.HLCodeWidget.klass);
  1167. smalltalk.addMethod(
  1168. smalltalk.method({
  1169. selector: "messageHintFor:token:",
  1170. protocol: 'hints',
  1171. fn: function (anEditor,aToken){
  1172. var self=this;
  1173. return smalltalk.withContext(function($ctx1) {
  1174. var $1;
  1175. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  1176. return $1;
  1177. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},globals.HLCodeWidget.klass)})},
  1178. args: ["anEditor", "aToken"],
  1179. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09messageHintFor: anEditor token: aToken",
  1180. messageSends: ["messageHintFor:token:", "at:"],
  1181. referencedClasses: []
  1182. }),
  1183. globals.HLCodeWidget.klass);
  1184. smalltalk.addMethod(
  1185. smalltalk.method({
  1186. selector: "pcKeyMap",
  1187. protocol: 'accessing',
  1188. fn: function (){
  1189. var self=this;
  1190. var $1;
  1191. $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"]]);
  1192. return $1;
  1193. },
  1194. args: [],
  1195. 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}",
  1196. messageSends: [],
  1197. referencedClasses: []
  1198. }),
  1199. globals.HLCodeWidget.klass);
  1200. smalltalk.addMethod(
  1201. smalltalk.method({
  1202. selector: "setupCodeMirror",
  1203. protocol: 'initialization',
  1204. fn: function (){
  1205. var self=this;
  1206. return smalltalk.withContext(function($ctx1) {
  1207. CodeMirror.keyMap.default.fallthrough = ["basic"];
  1208. CodeMirror.commands.autocomplete = function(cm) {
  1209. CodeMirror.showHint(cm, self._hintFor_options_);
  1210. }
  1211. ;
  1212. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},globals.HLCodeWidget.klass)})},
  1213. args: [],
  1214. 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>",
  1215. messageSends: [],
  1216. referencedClasses: []
  1217. }),
  1218. globals.HLCodeWidget.klass);
  1219. smalltalk.addMethod(
  1220. smalltalk.method({
  1221. selector: "setupCommands",
  1222. protocol: 'initialization',
  1223. fn: function (){
  1224. var self=this;
  1225. function $CodeMirror(){return globals.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  1226. return smalltalk.withContext(function($ctx1) {
  1227. var $1,$2,$3,$4,$5,$6;
  1228. $1=_st($CodeMirror())._basicAt_("commands");
  1229. _st($1)._at_put_("doIt",(function(cm){
  1230. return smalltalk.withContext(function($ctx2) {
  1231. $2=_st(cm)._amberCodeWidget();
  1232. $ctx2.sendIdx["amberCodeWidget"]=1;
  1233. return _st($2)._doIt();
  1234. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,1)})}));
  1235. $ctx1.sendIdx["at:put:"]=1;
  1236. _st($1)._at_put_("inspectIt",(function(cm){
  1237. return smalltalk.withContext(function($ctx2) {
  1238. $3=_st(cm)._amberCodeWidget();
  1239. $ctx2.sendIdx["amberCodeWidget"]=2;
  1240. return _st($3)._inspectIt();
  1241. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,2)})}));
  1242. $ctx1.sendIdx["at:put:"]=2;
  1243. _st($1)._at_put_("printIt",(function(cm){
  1244. return smalltalk.withContext(function($ctx2) {
  1245. $4=_st(cm)._amberCodeWidget();
  1246. $ctx2.sendIdx["amberCodeWidget"]=3;
  1247. return _st($4)._printIt();
  1248. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,3)})}));
  1249. $ctx1.sendIdx["at:put:"]=3;
  1250. _st($1)._at_put_("saveIt",(function(cm){
  1251. return smalltalk.withContext(function($ctx2) {
  1252. $5=_st(cm)._amberCodeWidget();
  1253. $ctx2.sendIdx["amberCodeWidget"]=4;
  1254. return _st($5)._saveIt();
  1255. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,4)})}));
  1256. $ctx1.sendIdx["at:put:"]=4;
  1257. $6=_st($1)._at_put_("browseIt",(function(cm){
  1258. return smalltalk.withContext(function($ctx2) {
  1259. return _st(_st(cm)._amberCodeWidget())._browseIt();
  1260. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,5)})}));
  1261. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},globals.HLCodeWidget.klass)})},
  1262. args: [],
  1263. 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 ]",
  1264. messageSends: ["at:put:", "basicAt:", "doIt", "amberCodeWidget", "inspectIt", "printIt", "saveIt", "browseIt"],
  1265. referencedClasses: ["CodeMirror"]
  1266. }),
  1267. globals.HLCodeWidget.klass);
  1268. smalltalk.addMethod(
  1269. smalltalk.method({
  1270. selector: "setupKeyMaps",
  1271. protocol: 'initialization',
  1272. fn: function (){
  1273. var self=this;
  1274. return smalltalk.withContext(function($ctx1) {
  1275. CodeMirror.keyMap['Amber'] = self._keyMap();
  1276. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},globals.HLCodeWidget.klass)})},
  1277. args: [],
  1278. source: "setupKeyMaps\x0a\x09<CodeMirror.keyMap['Amber'] = self._keyMap()>",
  1279. messageSends: [],
  1280. referencedClasses: []
  1281. }),
  1282. globals.HLCodeWidget.klass);
  1283. smalltalk.addMethod(
  1284. smalltalk.method({
  1285. selector: "variableHintFor:token:",
  1286. protocol: 'hints',
  1287. fn: function (anEditor,aToken){
  1288. var self=this;
  1289. return smalltalk.withContext(function($ctx1) {
  1290. var $1;
  1291. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  1292. return $1;
  1293. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},globals.HLCodeWidget.klass)})},
  1294. args: ["anEditor", "aToken"],
  1295. source: "variableHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09variableHintFor: anEditor token: aToken",
  1296. messageSends: ["variableHintFor:token:", "at:"],
  1297. referencedClasses: []
  1298. }),
  1299. globals.HLCodeWidget.klass);
  1300. smalltalk.addClass('HLNavigationCodeWidget', globals.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
  1301. smalltalk.addMethod(
  1302. smalltalk.method({
  1303. selector: "configureEditor",
  1304. protocol: 'accessing',
  1305. fn: function (){
  1306. var self=this;
  1307. return smalltalk.withContext(function($ctx1) {
  1308. globals.HLNavigationCodeWidget.superclass.fn.prototype._configureEditor.apply(_st(self), []);
  1309. self._contents_(self._methodContents());
  1310. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},globals.HLNavigationCodeWidget)})},
  1311. args: [],
  1312. source: "configureEditor\x0a\x09super configureEditor.\x0a\x09self contents: self methodContents",
  1313. messageSends: ["configureEditor", "contents:", "methodContents"],
  1314. referencedClasses: []
  1315. }),
  1316. globals.HLNavigationCodeWidget);
  1317. smalltalk.addMethod(
  1318. smalltalk.method({
  1319. selector: "contents:",
  1320. protocol: 'accessing',
  1321. fn: function (aString){
  1322. var self=this;
  1323. return smalltalk.withContext(function($ctx1) {
  1324. self._methodContents_(aString);
  1325. globals.HLNavigationCodeWidget.superclass.fn.prototype._contents_.apply(_st(self), [aString]);
  1326. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},globals.HLNavigationCodeWidget)})},
  1327. args: ["aString"],
  1328. source: "contents: aString\x0a\x09self methodContents: aString.\x0a\x09super contents: aString",
  1329. messageSends: ["methodContents:", "contents:"],
  1330. referencedClasses: []
  1331. }),
  1332. globals.HLNavigationCodeWidget);
  1333. smalltalk.addMethod(
  1334. smalltalk.method({
  1335. selector: "hasModification",
  1336. protocol: 'testing',
  1337. fn: function (){
  1338. var self=this;
  1339. return smalltalk.withContext(function($ctx1) {
  1340. var $1;
  1341. $1=_st(_st(self._methodContents()).__eq(self._contents()))._not();
  1342. return $1;
  1343. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},globals.HLNavigationCodeWidget)})},
  1344. args: [],
  1345. source: "hasModification\x0a\x09^ (self methodContents = self contents) not",
  1346. messageSends: ["not", "=", "methodContents", "contents"],
  1347. referencedClasses: []
  1348. }),
  1349. globals.HLNavigationCodeWidget);
  1350. smalltalk.addMethod(
  1351. smalltalk.method({
  1352. selector: "methodContents",
  1353. protocol: 'accessing',
  1354. fn: function (){
  1355. var self=this;
  1356. return smalltalk.withContext(function($ctx1) {
  1357. var $2,$1,$receiver;
  1358. $2=self["@methodContents"];
  1359. if(($receiver = $2) == nil || $receiver == null){
  1360. $1="";
  1361. } else {
  1362. $1=$2;
  1363. };
  1364. return $1;
  1365. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},globals.HLNavigationCodeWidget)})},
  1366. args: [],
  1367. source: "methodContents\x0a\x09^ methodContents ifNil: [ '' ]",
  1368. messageSends: ["ifNil:"],
  1369. referencedClasses: []
  1370. }),
  1371. globals.HLNavigationCodeWidget);
  1372. smalltalk.addMethod(
  1373. smalltalk.method({
  1374. selector: "methodContents:",
  1375. protocol: 'accessing',
  1376. fn: function (aString){
  1377. var self=this;
  1378. var $1;
  1379. self["@methodContents"]=aString;
  1380. $1=self["@methodContents"];
  1381. return $1;
  1382. },
  1383. args: ["aString"],
  1384. source: "methodContents: aString\x0a\x09^ methodContents := aString",
  1385. messageSends: [],
  1386. referencedClasses: []
  1387. }),
  1388. globals.HLNavigationCodeWidget);
  1389. smalltalk.addMethod(
  1390. smalltalk.method({
  1391. selector: "previous",
  1392. protocol: 'accessing',
  1393. fn: function (){
  1394. var self=this;
  1395. return self},
  1396. args: [],
  1397. source: "previous\x0a\x09\x22for browser lists widget\x22",
  1398. messageSends: [],
  1399. referencedClasses: []
  1400. }),
  1401. globals.HLNavigationCodeWidget);
  1402. smalltalk.addMethod(
  1403. smalltalk.method({
  1404. selector: "previous:",
  1405. protocol: 'accessing',
  1406. fn: function (aWidget){
  1407. var self=this;
  1408. return self},
  1409. args: ["aWidget"],
  1410. source: "previous: aWidget\x0a\x09\x22for browser lists widget\x22",
  1411. messageSends: [],
  1412. referencedClasses: []
  1413. }),
  1414. globals.HLNavigationCodeWidget);
  1415. smalltalk.addMethod(
  1416. smalltalk.method({
  1417. selector: "canBeOpenAsTab",
  1418. protocol: 'testing',
  1419. fn: function (){
  1420. var self=this;
  1421. return false;
  1422. },
  1423. args: [],
  1424. source: "canBeOpenAsTab\x0a\x09^ false",
  1425. messageSends: [],
  1426. referencedClasses: []
  1427. }),
  1428. globals.HLNavigationCodeWidget.klass);
  1429. smalltalk.addMethod(
  1430. smalltalk.method({
  1431. selector: "on:",
  1432. protocol: 'instance creation',
  1433. fn: function (aBrowserModel){
  1434. var self=this;
  1435. return smalltalk.withContext(function($ctx1) {
  1436. var $2,$3,$1;
  1437. $2=self._new();
  1438. _st($2)._browserModel_(aBrowserModel);
  1439. $3=_st($2)._yourself();
  1440. $1=$3;
  1441. return $1;
  1442. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},globals.HLNavigationCodeWidget.klass)})},
  1443. args: ["aBrowserModel"],
  1444. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1445. messageSends: ["browserModel:", "new", "yourself"],
  1446. referencedClasses: []
  1447. }),
  1448. globals.HLNavigationCodeWidget.klass);
  1449. smalltalk.addClass('HLBrowserCodeWidget', globals.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  1450. smalltalk.addMethod(
  1451. smalltalk.method({
  1452. selector: "browserModel",
  1453. protocol: 'accessing',
  1454. fn: function (){
  1455. var self=this;
  1456. var $1;
  1457. $1=self["@browserModel"];
  1458. return $1;
  1459. },
  1460. args: [],
  1461. source: "browserModel\x0a\x09^ browserModel",
  1462. messageSends: [],
  1463. referencedClasses: []
  1464. }),
  1465. globals.HLBrowserCodeWidget);
  1466. smalltalk.addMethod(
  1467. smalltalk.method({
  1468. selector: "browserModel:",
  1469. protocol: 'accessing',
  1470. fn: function (aBrowserModel){
  1471. var self=this;
  1472. return smalltalk.withContext(function($ctx1) {
  1473. var $1;
  1474. self["@browserModel"]=aBrowserModel;
  1475. self._observeSystem();
  1476. $1=self._observeBrowserModel();
  1477. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},globals.HLBrowserCodeWidget)})},
  1478. args: ["aBrowserModel"],
  1479. source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x09self \x0a\x09\x09observeSystem;\x0a\x09\x09observeBrowserModel",
  1480. messageSends: ["observeSystem", "observeBrowserModel"],
  1481. referencedClasses: []
  1482. }),
  1483. globals.HLBrowserCodeWidget);
  1484. smalltalk.addMethod(
  1485. smalltalk.method({
  1486. selector: "observeBrowserModel",
  1487. protocol: 'actions',
  1488. fn: function (){
  1489. var self=this;
  1490. function $HLSaveSourceCode(){return globals.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  1491. function $HLShowInstanceToggled(){return globals.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
  1492. function $HLSourceCodeSaved(){return globals.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  1493. function $HLAboutToChange(){return globals.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  1494. function $HLParseErrorRaised(){return globals.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  1495. function $HLCompileErrorRaised(){return globals.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  1496. function $HLUnknownVariableErrorRaised(){return globals.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  1497. function $HLInstVarAdded(){return globals.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  1498. function $HLMethodSelected(){return globals.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1499. function $HLClassSelected(){return globals.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1500. function $HLPackageSelected(){return globals.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  1501. function $HLProtocolSelected(){return globals.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1502. function $HLSourceCodeFocusRequested(){return globals.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1503. function $HLShowTemplate(){return globals.HLShowTemplate||(typeof HLShowTemplate=="undefined"?nil:HLShowTemplate)}
  1504. return smalltalk.withContext(function($ctx1) {
  1505. var $1,$2;
  1506. $1=_st(self._browserModel())._announcer();
  1507. _st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
  1508. $ctx1.sendIdx["on:send:to:"]=1;
  1509. _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
  1510. $ctx1.sendIdx["on:send:to:"]=2;
  1511. _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
  1512. $ctx1.sendIdx["on:send:to:"]=3;
  1513. _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
  1514. $ctx1.sendIdx["on:send:to:"]=4;
  1515. _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
  1516. $ctx1.sendIdx["on:send:to:"]=5;
  1517. _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
  1518. $ctx1.sendIdx["on:send:to:"]=6;
  1519. _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
  1520. $ctx1.sendIdx["on:send:to:"]=7;
  1521. _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
  1522. $ctx1.sendIdx["on:send:to:"]=8;
  1523. _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
  1524. $ctx1.sendIdx["on:send:to:"]=9;
  1525. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  1526. $ctx1.sendIdx["on:send:to:"]=10;
  1527. _st($1)._on_send_to_($HLPackageSelected(),"onPackageSelected:",self);
  1528. $ctx1.sendIdx["on:send:to:"]=11;
  1529. _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
  1530. $ctx1.sendIdx["on:send:to:"]=12;
  1531. _st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
  1532. $ctx1.sendIdx["on:send:to:"]=13;
  1533. $2=_st($1)._on_send_to_($HLShowTemplate(),"onShowTemplate:",self);
  1534. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},globals.HLBrowserCodeWidget)})},
  1535. args: [],
  1536. 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",
  1537. messageSends: ["on:send:to:", "announcer", "browserModel"],
  1538. referencedClasses: ["HLSaveSourceCode", "HLShowInstanceToggled", "HLSourceCodeSaved", "HLAboutToChange", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLPackageSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested", "HLShowTemplate"]
  1539. }),
  1540. globals.HLBrowserCodeWidget);
  1541. smalltalk.addMethod(
  1542. smalltalk.method({
  1543. selector: "observeSystem",
  1544. protocol: 'actions',
  1545. fn: function (){
  1546. var self=this;
  1547. function $MethodModified(){return globals.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  1548. return smalltalk.withContext(function($ctx1) {
  1549. _st(_st(self._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
  1550. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},globals.HLBrowserCodeWidget)})},
  1551. args: [],
  1552. source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a \x09on: MethodModified\x0a send: #onMethodModified:\x0a\x09\x09to: self",
  1553. messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"],
  1554. referencedClasses: ["MethodModified"]
  1555. }),
  1556. globals.HLBrowserCodeWidget);
  1557. smalltalk.addMethod(
  1558. smalltalk.method({
  1559. selector: "onBrowserAboutToChange:",
  1560. protocol: 'reactions',
  1561. fn: function (anAnnouncement){
  1562. var self=this;
  1563. var block;
  1564. function $HLChangeForbidden(){return globals.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  1565. return smalltalk.withContext(function($ctx1) {
  1566. var $1;
  1567. block=_st(anAnnouncement)._actionBlock();
  1568. $1=self._hasModification();
  1569. if(smalltalk.assert($1)){
  1570. self._confirm_ifTrue_("Changes have not been saved. Do you want to discard these changes?",(function(){
  1571. return smalltalk.withContext(function($ctx2) {
  1572. self._methodContents_(self._contents());
  1573. return _st(block)._value();
  1574. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1575. _st($HLChangeForbidden())._signal();
  1576. };
  1577. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},globals.HLBrowserCodeWidget)})},
  1578. args: ["anAnnouncement"],
  1579. 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 ]",
  1580. messageSends: ["actionBlock", "ifTrue:", "hasModification", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal"],
  1581. referencedClasses: ["HLChangeForbidden"]
  1582. }),
  1583. globals.HLBrowserCodeWidget);
  1584. smalltalk.addMethod(
  1585. smalltalk.method({
  1586. selector: "onClassSelected:",
  1587. protocol: 'reactions',
  1588. fn: function (anAnnouncement){
  1589. var self=this;
  1590. var class_;
  1591. return smalltalk.withContext(function($ctx1) {
  1592. var $1,$2,$receiver;
  1593. class_=_st(anAnnouncement)._item();
  1594. $1=class_;
  1595. if(($receiver = $1) == nil || $receiver == null){
  1596. $2=self._contents_("");
  1597. $ctx1.sendIdx["contents:"]=1;
  1598. return $2;
  1599. } else {
  1600. $1;
  1601. };
  1602. self._contents_(_st(class_)._definition());
  1603. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},globals.HLBrowserCodeWidget)})},
  1604. args: ["anAnnouncement"],
  1605. source: "onClassSelected: anAnnouncement\x0a\x09| class |\x0a\x09\x0a\x09class:= anAnnouncement item.\x0a\x09\x0a\x09class ifNil: [ ^ self contents: '' ].\x0a\x09self contents: class definition",
  1606. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1607. referencedClasses: []
  1608. }),
  1609. globals.HLBrowserCodeWidget);
  1610. smalltalk.addMethod(
  1611. smalltalk.method({
  1612. selector: "onCompileError:",
  1613. protocol: 'reactions',
  1614. fn: function (anAnnouncement){
  1615. var self=this;
  1616. return smalltalk.withContext(function($ctx1) {
  1617. self._alert_(_st(_st(anAnnouncement)._error())._messageText());
  1618. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1619. args: ["anAnnouncement"],
  1620. source: "onCompileError: anAnnouncement\x0a\x09self alert: anAnnouncement error messageText",
  1621. messageSends: ["alert:", "messageText", "error"],
  1622. referencedClasses: []
  1623. }),
  1624. globals.HLBrowserCodeWidget);
  1625. smalltalk.addMethod(
  1626. smalltalk.method({
  1627. selector: "onInstVarAdded",
  1628. protocol: 'reactions',
  1629. fn: function (){
  1630. var self=this;
  1631. return smalltalk.withContext(function($ctx1) {
  1632. _st(self._browserModel())._save_(self._contents());
  1633. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},globals.HLBrowserCodeWidget)})},
  1634. args: [],
  1635. source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
  1636. messageSends: ["save:", "browserModel", "contents"],
  1637. referencedClasses: []
  1638. }),
  1639. globals.HLBrowserCodeWidget);
  1640. smalltalk.addMethod(
  1641. smalltalk.method({
  1642. selector: "onMethodModified:",
  1643. protocol: 'reactions',
  1644. fn: function (anAnnouncement){
  1645. var self=this;
  1646. var method;
  1647. return smalltalk.withContext(function($ctx1) {
  1648. var $3,$2,$1,$5,$4,$7,$6,$receiver;
  1649. method=_st(anAnnouncement)._method();
  1650. $3=self._browserModel();
  1651. $ctx1.sendIdx["browserModel"]=1;
  1652. $2=_st($3)._selectedClass();
  1653. $1=_st($2).__eq(_st(method)._methodClass());
  1654. $ctx1.sendIdx["="]=1;
  1655. if(! smalltalk.assert($1)){
  1656. return self;
  1657. };
  1658. $5=self._browserModel();
  1659. $ctx1.sendIdx["browserModel"]=2;
  1660. $4=_st($5)._selectedMethod();
  1661. $ctx1.sendIdx["selectedMethod"]=1;
  1662. if(($receiver = $4) == nil || $receiver == null){
  1663. return self;
  1664. } else {
  1665. $4;
  1666. };
  1667. $7=_st(_st(self._browserModel())._selectedMethod())._selector();
  1668. $ctx1.sendIdx["selector"]=1;
  1669. $6=_st($7).__eq(_st(method)._selector());
  1670. if(! smalltalk.assert($6)){
  1671. return self;
  1672. };
  1673. self._refresh();
  1674. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},globals.HLBrowserCodeWidget)})},
  1675. args: ["anAnnouncement"],
  1676. 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",
  1677. messageSends: ["method", "ifFalse:", "=", "selectedClass", "browserModel", "methodClass", "ifNil:", "selectedMethod", "selector", "refresh"],
  1678. referencedClasses: []
  1679. }),
  1680. globals.HLBrowserCodeWidget);
  1681. smalltalk.addMethod(
  1682. smalltalk.method({
  1683. selector: "onMethodSelected:",
  1684. protocol: 'reactions',
  1685. fn: function (anAnnouncement){
  1686. var self=this;
  1687. var method;
  1688. return smalltalk.withContext(function($ctx1) {
  1689. var $1,$2,$receiver;
  1690. method=_st(anAnnouncement)._item();
  1691. $1=method;
  1692. if(($receiver = $1) == nil || $receiver == null){
  1693. $2=self._contents_("");
  1694. $ctx1.sendIdx["contents:"]=1;
  1695. return $2;
  1696. } else {
  1697. $1;
  1698. };
  1699. self._contents_(_st(method)._source());
  1700. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},globals.HLBrowserCodeWidget)})},
  1701. args: ["anAnnouncement"],
  1702. source: "onMethodSelected: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement item.\x0a\x09\x0a\x09method ifNil: [ ^ self contents: '' ].\x0a\x09self contents: method source",
  1703. messageSends: ["item", "ifNil:", "contents:", "source"],
  1704. referencedClasses: []
  1705. }),
  1706. globals.HLBrowserCodeWidget);
  1707. smalltalk.addMethod(
  1708. smalltalk.method({
  1709. selector: "onPackageSelected:",
  1710. protocol: 'reactions',
  1711. fn: function (anAnnouncement){
  1712. var self=this;
  1713. var package_;
  1714. return smalltalk.withContext(function($ctx1) {
  1715. var $1,$2,$receiver;
  1716. package_=_st(anAnnouncement)._item();
  1717. $1=package_;
  1718. if(($receiver = $1) == nil || $receiver == null){
  1719. $2=self._contents_("");
  1720. $ctx1.sendIdx["contents:"]=1;
  1721. return $2;
  1722. } else {
  1723. $1;
  1724. };
  1725. self._contents_(_st(package_)._definition());
  1726. return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{anAnnouncement:anAnnouncement,package_:package_},globals.HLBrowserCodeWidget)})},
  1727. args: ["anAnnouncement"],
  1728. source: "onPackageSelected: anAnnouncement\x0a\x09| package |\x0a\x09\x0a\x09package := anAnnouncement item.\x0a\x09\x0a\x09package ifNil: [ ^ self contents: '' ].\x0a\x09self contents: package definition",
  1729. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1730. referencedClasses: []
  1731. }),
  1732. globals.HLBrowserCodeWidget);
  1733. smalltalk.addMethod(
  1734. smalltalk.method({
  1735. selector: "onParseError:",
  1736. protocol: 'reactions',
  1737. fn: function (anAnnouncement){
  1738. var self=this;
  1739. var lineIndex,newContents;
  1740. function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
  1741. return smalltalk.withContext(function($ctx1) {
  1742. var $1,$3,$2,$6,$5,$4;
  1743. lineIndex=(1);
  1744. self._contents_(_st($String())._streamContents_((function(stream){
  1745. return smalltalk.withContext(function($ctx2) {
  1746. return _st(self._contents())._linesDo_((function(each){
  1747. return smalltalk.withContext(function($ctx3) {
  1748. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1749. if(smalltalk.assert($1)){
  1750. $3=_st(anAnnouncement)._column();
  1751. $ctx3.sendIdx["column"]=1;
  1752. $2=_st(each)._copyFrom_to_((1),$3);
  1753. $ctx3.sendIdx["copyFrom:to:"]=1;
  1754. _st(stream)._nextPutAll_($2);
  1755. $ctx3.sendIdx["nextPutAll:"]=1;
  1756. _st(stream)._nextPutAll_("<- ");
  1757. $ctx3.sendIdx["nextPutAll:"]=2;
  1758. _st(stream)._nextPutAll_(_st(anAnnouncement)._message());
  1759. $ctx3.sendIdx["nextPutAll:"]=3;
  1760. _st(stream)._nextPutAll_(" ");
  1761. $ctx3.sendIdx["nextPutAll:"]=4;
  1762. $6=_st(_st(anAnnouncement)._column()).__plus((1));
  1763. $ctx3.sendIdx["+"]=1;
  1764. $5=_st(each)._copyFrom_to_($6,_st(each)._size());
  1765. $4=_st(stream)._nextPutAll_($5);
  1766. $ctx3.sendIdx["nextPutAll:"]=5;
  1767. $4;
  1768. } else {
  1769. _st(stream)._nextPutAll_(each);
  1770. $ctx3.sendIdx["nextPutAll:"]=6;
  1771. };
  1772. _st(stream)._nextPutAll_(_st($String())._cr());
  1773. lineIndex=_st(lineIndex).__plus((1));
  1774. return lineIndex;
  1775. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  1776. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})));
  1777. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},globals.HLBrowserCodeWidget)})},
  1778. args: ["anAnnouncement"],
  1779. 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 ] ])",
  1780. messageSends: ["contents:", "streamContents:", "linesDo:", "contents", "ifTrue:ifFalse:", "=", "line", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "cr"],
  1781. referencedClasses: ["String"]
  1782. }),
  1783. globals.HLBrowserCodeWidget);
  1784. smalltalk.addMethod(
  1785. smalltalk.method({
  1786. selector: "onProtocolSelected:",
  1787. protocol: 'reactions',
  1788. fn: function (anAnnouncement){
  1789. var self=this;
  1790. return smalltalk.withContext(function($ctx1) {
  1791. var $2,$1,$3,$receiver;
  1792. $2=self._browserModel();
  1793. $ctx1.sendIdx["browserModel"]=1;
  1794. $1=_st($2)._selectedClass();
  1795. $ctx1.sendIdx["selectedClass"]=1;
  1796. if(($receiver = $1) == nil || $receiver == null){
  1797. $3=self._contents_("");
  1798. $ctx1.sendIdx["contents:"]=1;
  1799. return $3;
  1800. } else {
  1801. $1;
  1802. };
  1803. self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
  1804. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1805. args: ["anAnnouncement"],
  1806. source: "onProtocolSelected: anAnnouncement\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a\x09self contents: self browserModel selectedClass definition",
  1807. messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
  1808. referencedClasses: []
  1809. }),
  1810. globals.HLBrowserCodeWidget);
  1811. smalltalk.addMethod(
  1812. smalltalk.method({
  1813. selector: "onSaveIt",
  1814. protocol: 'reactions',
  1815. fn: function (){
  1816. var self=this;
  1817. return smalltalk.withContext(function($ctx1) {
  1818. _st(self._browserModel())._save_(self._contents());
  1819. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},globals.HLBrowserCodeWidget)})},
  1820. args: [],
  1821. source: "onSaveIt\x0a\x09self browserModel save: self contents",
  1822. messageSends: ["save:", "browserModel", "contents"],
  1823. referencedClasses: []
  1824. }),
  1825. globals.HLBrowserCodeWidget);
  1826. smalltalk.addMethod(
  1827. smalltalk.method({
  1828. selector: "onShowInstanceToggled",
  1829. protocol: 'reactions',
  1830. fn: function (){
  1831. var self=this;
  1832. return smalltalk.withContext(function($ctx1) {
  1833. var $2,$1,$3,$receiver;
  1834. $2=self._browserModel();
  1835. $ctx1.sendIdx["browserModel"]=1;
  1836. $1=_st($2)._selectedClass();
  1837. $ctx1.sendIdx["selectedClass"]=1;
  1838. if(($receiver = $1) == nil || $receiver == null){
  1839. $3=self._contents_("");
  1840. $ctx1.sendIdx["contents:"]=1;
  1841. return $3;
  1842. } else {
  1843. $1;
  1844. };
  1845. self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
  1846. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},globals.HLBrowserCodeWidget)})},
  1847. args: [],
  1848. source: "onShowInstanceToggled\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a\x09self contents: self browserModel selectedClass definition",
  1849. messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
  1850. referencedClasses: []
  1851. }),
  1852. globals.HLBrowserCodeWidget);
  1853. smalltalk.addMethod(
  1854. smalltalk.method({
  1855. selector: "onShowTemplate:",
  1856. protocol: 'reactions',
  1857. fn: function (anAnnouncement){
  1858. var self=this;
  1859. return smalltalk.withContext(function($ctx1) {
  1860. self._contents_(_st(anAnnouncement)._template());
  1861. return self}, function($ctx1) {$ctx1.fill(self,"onShowTemplate:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1862. args: ["anAnnouncement"],
  1863. source: "onShowTemplate: anAnnouncement\x0a\x09self contents: anAnnouncement template",
  1864. messageSends: ["contents:", "template"],
  1865. referencedClasses: []
  1866. }),
  1867. globals.HLBrowserCodeWidget);
  1868. smalltalk.addMethod(
  1869. smalltalk.method({
  1870. selector: "onSourceCodeFocusRequested",
  1871. protocol: 'reactions',
  1872. fn: function (){
  1873. var self=this;
  1874. return smalltalk.withContext(function($ctx1) {
  1875. self._focus();
  1876. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},globals.HLBrowserCodeWidget)})},
  1877. args: [],
  1878. source: "onSourceCodeFocusRequested\x0a\x09self focus",
  1879. messageSends: ["focus"],
  1880. referencedClasses: []
  1881. }),
  1882. globals.HLBrowserCodeWidget);
  1883. smalltalk.addMethod(
  1884. smalltalk.method({
  1885. selector: "onSourceCodeSaved",
  1886. protocol: 'reactions',
  1887. fn: function (){
  1888. var self=this;
  1889. return smalltalk.withContext(function($ctx1) {
  1890. self._methodContents_(self._contents());
  1891. self._updateState();
  1892. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},globals.HLBrowserCodeWidget)})},
  1893. args: [],
  1894. source: "onSourceCodeSaved\x0a\x09self methodContents: self contents.\x0a\x09self updateState",
  1895. messageSends: ["methodContents:", "contents", "updateState"],
  1896. referencedClasses: []
  1897. }),
  1898. globals.HLBrowserCodeWidget);
  1899. smalltalk.addMethod(
  1900. smalltalk.method({
  1901. selector: "onUnknownVariableError:",
  1902. protocol: 'reactions',
  1903. fn: function (anAnnouncement){
  1904. var self=this;
  1905. var error;
  1906. function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
  1907. return smalltalk.withContext(function($ctx1) {
  1908. var $1;
  1909. error=_st(anAnnouncement)._error();
  1910. self._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1911. return smalltalk.withContext(function($ctx2) {
  1912. _st(stream)._nextPutAll_(_st(error)._messageText());
  1913. $ctx2.sendIdx["nextPutAll:"]=1;
  1914. _st(stream)._nextPutAll_(_st($String())._cr());
  1915. $ctx2.sendIdx["nextPutAll:"]=2;
  1916. $1=_st(stream)._nextPutAll_("Would you like to define an instance variable?");
  1917. return $1;
  1918. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})),(function(){
  1919. return smalltalk.withContext(function($ctx2) {
  1920. return _st(self._browserModel())._addInstVarNamed_(_st(error)._variableName());
  1921. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1922. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},globals.HLBrowserCodeWidget)})},
  1923. args: ["anAnnouncement"],
  1924. 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 ]",
  1925. messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "browserModel", "variableName"],
  1926. referencedClasses: ["String"]
  1927. }),
  1928. globals.HLBrowserCodeWidget);
  1929. smalltalk.addMethod(
  1930. smalltalk.method({
  1931. selector: "refresh",
  1932. protocol: 'actions',
  1933. fn: function (){
  1934. var self=this;
  1935. return smalltalk.withContext(function($ctx1) {
  1936. var $1,$2;
  1937. $1=self._hasModification();
  1938. if(smalltalk.assert($1)){
  1939. return self;
  1940. };
  1941. $2=self._hasFocus();
  1942. if(smalltalk.assert($2)){
  1943. return self;
  1944. };
  1945. self._contents_(_st(_st(self._browserModel())._selectedMethod())._source());
  1946. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},globals.HLBrowserCodeWidget)})},
  1947. args: [],
  1948. source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self browserModel selectedMethod source",
  1949. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"],
  1950. referencedClasses: []
  1951. }),
  1952. globals.HLBrowserCodeWidget);
  1953. smalltalk.addMethod(
  1954. smalltalk.method({
  1955. selector: "renderButtonsOn:",
  1956. protocol: 'actions',
  1957. fn: function (html){
  1958. var self=this;
  1959. return smalltalk.withContext(function($ctx1) {
  1960. var $1,$2;
  1961. $1=_st(html)._button();
  1962. _st($1)._class_("button");
  1963. _st($1)._with_("SaveIt");
  1964. $2=_st($1)._onClick_((function(){
  1965. return smalltalk.withContext(function($ctx2) {
  1966. return self._saveIt();
  1967. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1968. globals.HLBrowserCodeWidget.superclass.fn.prototype._renderButtonsOn_.apply(_st(self), [html]);
  1969. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLBrowserCodeWidget)})},
  1970. args: ["html"],
  1971. source: "renderButtonsOn: html\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'SaveIt';\x0a\x09\x09onClick: [ self saveIt ].\x0a\x09super renderButtonsOn: html",
  1972. messageSends: ["class:", "button", "with:", "onClick:", "saveIt", "renderButtonsOn:"],
  1973. referencedClasses: []
  1974. }),
  1975. globals.HLBrowserCodeWidget);
  1976. smalltalk.addMethod(
  1977. smalltalk.method({
  1978. selector: "saveIt",
  1979. protocol: 'actions',
  1980. fn: function (){
  1981. var self=this;
  1982. return smalltalk.withContext(function($ctx1) {
  1983. _st(self._browserModel())._saveSourceCode();
  1984. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},globals.HLBrowserCodeWidget)})},
  1985. args: [],
  1986. source: "saveIt\x0a\x09self browserModel saveSourceCode",
  1987. messageSends: ["saveSourceCode", "browserModel"],
  1988. referencedClasses: []
  1989. }),
  1990. globals.HLBrowserCodeWidget);
  1991. smalltalk.addMethod(
  1992. smalltalk.method({
  1993. selector: "unregister",
  1994. protocol: 'actions',
  1995. fn: function (){
  1996. var self=this;
  1997. return smalltalk.withContext(function($ctx1) {
  1998. var $2,$1;
  1999. globals.HLBrowserCodeWidget.superclass.fn.prototype._unregsiter.apply(_st(self), []);
  2000. $2=self._browserModel();
  2001. $ctx1.sendIdx["browserModel"]=1;
  2002. $1=_st($2)._announcer();
  2003. _st($1)._unsubscribe_(self);
  2004. $ctx1.sendIdx["unsubscribe:"]=1;
  2005. _st(_st(self._browserModel())._systemAnnouncer())._unsubscribe_(self);
  2006. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLBrowserCodeWidget)})},
  2007. args: [],
  2008. source: "unregister\x0a\x09super unregsiter.\x0a\x09\x0a\x09self browserModel announcer unsubscribe: self.\x0a\x09self browserModel systemAnnouncer unsubscribe: self",
  2009. messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"],
  2010. referencedClasses: []
  2011. }),
  2012. globals.HLBrowserCodeWidget);
  2013. smalltalk.addMethod(
  2014. smalltalk.method({
  2015. selector: "canBeOpenAsTab",
  2016. protocol: 'testing',
  2017. fn: function (){
  2018. var self=this;
  2019. return false;
  2020. },
  2021. args: [],
  2022. source: "canBeOpenAsTab\x0a\x09^ false",
  2023. messageSends: [],
  2024. referencedClasses: []
  2025. }),
  2026. globals.HLBrowserCodeWidget.klass);
  2027. smalltalk.addMethod(
  2028. smalltalk.method({
  2029. selector: "on:",
  2030. protocol: 'instance creation',
  2031. fn: function (aBrowserModel){
  2032. var self=this;
  2033. return smalltalk.withContext(function($ctx1) {
  2034. var $2,$3,$1;
  2035. $2=self._new();
  2036. _st($2)._browserModel_(aBrowserModel);
  2037. $3=_st($2)._yourself();
  2038. $1=$3;
  2039. return $1;
  2040. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},globals.HLBrowserCodeWidget.klass)})},
  2041. args: ["aBrowserModel"],
  2042. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  2043. messageSends: ["browserModel:", "new", "yourself"],
  2044. referencedClasses: []
  2045. }),
  2046. globals.HLBrowserCodeWidget.klass);
  2047. smalltalk.addClass('HLWorkspace', globals.HLWidget, ['codeWidget', 'transcript'], 'Helios-Workspace');
  2048. smalltalk.addMethod(
  2049. smalltalk.method({
  2050. selector: "canHaveFocus",
  2051. protocol: 'testing',
  2052. fn: function (){
  2053. var self=this;
  2054. return true;
  2055. },
  2056. args: [],
  2057. source: "canHaveFocus\x0a\x09^ true",
  2058. messageSends: [],
  2059. referencedClasses: []
  2060. }),
  2061. globals.HLWorkspace);
  2062. smalltalk.addMethod(
  2063. smalltalk.method({
  2064. selector: "codeWidget",
  2065. protocol: 'accessing',
  2066. fn: function (){
  2067. var self=this;
  2068. function $HLCodeWidget(){return globals.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  2069. return smalltalk.withContext(function($ctx1) {
  2070. var $2,$1,$receiver;
  2071. $2=self["@codeWidget"];
  2072. if(($receiver = $2) == nil || $receiver == null){
  2073. self["@codeWidget"]=_st($HLCodeWidget())._new();
  2074. $1=self["@codeWidget"];
  2075. } else {
  2076. $1=$2;
  2077. };
  2078. return $1;
  2079. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},globals.HLWorkspace)})},
  2080. args: [],
  2081. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
  2082. messageSends: ["ifNil:", "new"],
  2083. referencedClasses: ["HLCodeWidget"]
  2084. }),
  2085. globals.HLWorkspace);
  2086. smalltalk.addMethod(
  2087. smalltalk.method({
  2088. selector: "focus",
  2089. protocol: 'actions',
  2090. fn: function (){
  2091. var self=this;
  2092. return smalltalk.withContext(function($ctx1) {
  2093. var $1;
  2094. $1=_st(self._codeWidget())._focus();
  2095. return $1;
  2096. }, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLWorkspace)})},
  2097. args: [],
  2098. source: "focus\x0a\x09^ self codeWidget focus",
  2099. messageSends: ["focus", "codeWidget"],
  2100. referencedClasses: []
  2101. }),
  2102. globals.HLWorkspace);
  2103. smalltalk.addMethod(
  2104. smalltalk.method({
  2105. selector: "renderContentOn:",
  2106. protocol: 'rendering',
  2107. fn: function (html){
  2108. var self=this;
  2109. function $HLContainer(){return globals.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  2110. function $HLHorizontalSplitter(){return globals.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  2111. return smalltalk.withContext(function($ctx1) {
  2112. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._codeWidget(),(function(canvas){
  2113. return smalltalk.withContext(function($ctx2) {
  2114. return self._renderTranscriptOn_(canvas);
  2115. }, function($ctx2) {$ctx2.fillBlock({canvas:canvas},$ctx1,1)})}))));
  2116. $ctx1.sendIdx["with:"]=1;
  2117. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLWorkspace)})},
  2118. args: ["html"],
  2119. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter\x0a\x09\x09with: self codeWidget\x0a\x09\x09with: [ :canvas | self renderTranscriptOn: canvas ]))",
  2120. messageSends: ["with:", "with:with:", "codeWidget", "renderTranscriptOn:"],
  2121. referencedClasses: ["HLContainer", "HLHorizontalSplitter"]
  2122. }),
  2123. globals.HLWorkspace);
  2124. smalltalk.addMethod(
  2125. smalltalk.method({
  2126. selector: "renderTranscriptOn:",
  2127. protocol: 'rendering',
  2128. fn: function (html){
  2129. var self=this;
  2130. return smalltalk.withContext(function($ctx1) {
  2131. var $1,$3,$4,$2;
  2132. $1=_st(html)._div();
  2133. $ctx1.sendIdx["div"]=1;
  2134. _st($1)._class_("transcript-container");
  2135. $ctx1.sendIdx["class:"]=1;
  2136. $2=_st($1)._with_((function(){
  2137. return smalltalk.withContext(function($ctx2) {
  2138. $3=_st(html)._div();
  2139. _st($3)._class_("list-label");
  2140. $4=_st($3)._with_("Transcript");
  2141. $4;
  2142. return _st(self._transcript())._renderOn_(html);
  2143. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2144. $ctx1.sendIdx["with:"]=1;
  2145. return self}, function($ctx1) {$ctx1.fill(self,"renderTranscriptOn:",{html:html},globals.HLWorkspace)})},
  2146. args: ["html"],
  2147. 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 ]",
  2148. messageSends: ["class:", "div", "with:", "renderOn:", "transcript"],
  2149. referencedClasses: []
  2150. }),
  2151. globals.HLWorkspace);
  2152. smalltalk.addMethod(
  2153. smalltalk.method({
  2154. selector: "transcript",
  2155. protocol: 'accessing',
  2156. fn: function (){
  2157. var self=this;
  2158. function $HLTranscript(){return globals.HLTranscript||(typeof HLTranscript=="undefined"?nil:HLTranscript)}
  2159. return smalltalk.withContext(function($ctx1) {
  2160. var $2,$1,$receiver;
  2161. $2=self["@transcript"];
  2162. if(($receiver = $2) == nil || $receiver == null){
  2163. self["@transcript"]=_st($HLTranscript())._new();
  2164. $1=self["@transcript"];
  2165. } else {
  2166. $1=$2;
  2167. };
  2168. return $1;
  2169. }, function($ctx1) {$ctx1.fill(self,"transcript",{},globals.HLWorkspace)})},
  2170. args: [],
  2171. source: "transcript\x0a\x09^ transcript ifNil: [ transcript := HLTranscript new ]",
  2172. messageSends: ["ifNil:", "new"],
  2173. referencedClasses: ["HLTranscript"]
  2174. }),
  2175. globals.HLWorkspace);
  2176. smalltalk.addMethod(
  2177. smalltalk.method({
  2178. selector: "unregister",
  2179. protocol: 'actions',
  2180. fn: function (){
  2181. var self=this;
  2182. return smalltalk.withContext(function($ctx1) {
  2183. globals.HLWorkspace.superclass.fn.prototype._unregister.apply(_st(self), []);
  2184. $ctx1.sendIdx["unregister"]=1;
  2185. _st(self._transcript())._unregister();
  2186. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLWorkspace)})},
  2187. args: [],
  2188. source: "unregister\x0a\x09super unregister.\x0a\x09self transcript unregister",
  2189. messageSends: ["unregister", "transcript"],
  2190. referencedClasses: []
  2191. }),
  2192. globals.HLWorkspace);
  2193. smalltalk.addMethod(
  2194. smalltalk.method({
  2195. selector: "canBeOpenAsTab",
  2196. protocol: 'testing',
  2197. fn: function (){
  2198. var self=this;
  2199. return true;
  2200. },
  2201. args: [],
  2202. source: "canBeOpenAsTab\x0a\x09^ true",
  2203. messageSends: [],
  2204. referencedClasses: []
  2205. }),
  2206. globals.HLWorkspace.klass);
  2207. smalltalk.addMethod(
  2208. smalltalk.method({
  2209. selector: "tabClass",
  2210. protocol: 'accessing',
  2211. fn: function (){
  2212. var self=this;
  2213. return "workspace";
  2214. },
  2215. args: [],
  2216. source: "tabClass\x0a\x09^ 'workspace'",
  2217. messageSends: [],
  2218. referencedClasses: []
  2219. }),
  2220. globals.HLWorkspace.klass);
  2221. smalltalk.addMethod(
  2222. smalltalk.method({
  2223. selector: "tabLabel",
  2224. protocol: 'accessing',
  2225. fn: function (){
  2226. var self=this;
  2227. return "Workspace";
  2228. },
  2229. args: [],
  2230. source: "tabLabel\x0a\x09^ 'Workspace'",
  2231. messageSends: [],
  2232. referencedClasses: []
  2233. }),
  2234. globals.HLWorkspace.klass);
  2235. smalltalk.addMethod(
  2236. smalltalk.method({
  2237. selector: "tabPriority",
  2238. protocol: 'accessing',
  2239. fn: function (){
  2240. var self=this;
  2241. return (10);
  2242. },
  2243. args: [],
  2244. source: "tabPriority\x0a\x09^ 10",
  2245. messageSends: [],
  2246. referencedClasses: []
  2247. }),
  2248. globals.HLWorkspace.klass);
  2249. });