Helios-Workspace.js 77 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961
  1. smalltalk.addPackage('Helios-Workspace');
  2. smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "announcer",
  6. category: 'accessing',
  7. fn: function (){
  8. var self=this;
  9. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  10. return smalltalk.withContext(function($ctx1) {
  11. var $2,$1;
  12. $2=self["@announcer"];
  13. if(($receiver = $2) == nil || $receiver == undefined){
  14. self["@announcer"]=_st($Announcer())._new();
  15. $1=self["@announcer"];
  16. } else {
  17. $1=$2;
  18. };
  19. return $1;
  20. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeModel)})},
  21. args: [],
  22. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  23. messageSends: ["ifNil:", "new"],
  24. referencedClasses: ["Announcer"]
  25. }),
  26. smalltalk.HLCodeModel);
  27. smalltalk.addMethod(
  28. smalltalk.method({
  29. selector: "defaultReceiver",
  30. category: 'defaults',
  31. fn: function (){
  32. var self=this;
  33. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  34. return smalltalk.withContext(function($ctx1) {
  35. var $1;
  36. $1=_st($DoIt())._new();
  37. return $1;
  38. }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{},smalltalk.HLCodeModel)})},
  39. args: [],
  40. source: "defaultReceiver\x0a\x09^ DoIt new",
  41. messageSends: ["new"],
  42. referencedClasses: ["DoIt"]
  43. }),
  44. smalltalk.HLCodeModel);
  45. smalltalk.addMethod(
  46. smalltalk.method({
  47. selector: "doIt:",
  48. category: 'actions',
  49. fn: function (aString){
  50. var self=this;
  51. return smalltalk.withContext(function($ctx1) {
  52. var $1;
  53. $1=_st(_st(self)._environment())._eval_on_(aString,_st(self)._receiver());
  54. return $1;
  55. }, function($ctx1) {$ctx1.fill(self,"doIt:",{aString:aString},smalltalk.HLCodeModel)})},
  56. args: ["aString"],
  57. source: "doIt: aString\x0a\x0a\x09^ self environment eval: aString on: self receiver",
  58. messageSends: ["eval:on:", "receiver", "environment"],
  59. referencedClasses: []
  60. }),
  61. smalltalk.HLCodeModel);
  62. smalltalk.addMethod(
  63. smalltalk.method({
  64. selector: "environment",
  65. category: 'accessing',
  66. fn: function (){
  67. var self=this;
  68. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  69. return smalltalk.withContext(function($ctx1) {
  70. var $2,$1;
  71. $2=self["@environment"];
  72. if(($receiver = $2) == nil || $receiver == undefined){
  73. $1=_st(_st($HLManager())._current())._environment();
  74. } else {
  75. $1=$2;
  76. };
  77. return $1;
  78. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLCodeModel)})},
  79. args: [],
  80. source: "environment\x0a\x09^ environment ifNil: [ HLManager current environment ]",
  81. messageSends: ["ifNil:", "environment", "current"],
  82. referencedClasses: ["HLManager"]
  83. }),
  84. smalltalk.HLCodeModel);
  85. smalltalk.addMethod(
  86. smalltalk.method({
  87. selector: "environment:",
  88. category: 'accessing',
  89. fn: function (anEnvironment){
  90. var self=this;
  91. return smalltalk.withContext(function($ctx1) {
  92. self["@environment"]=anEnvironment;
  93. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel)})},
  94. args: ["anEnvironment"],
  95. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  96. messageSends: [],
  97. referencedClasses: []
  98. }),
  99. smalltalk.HLCodeModel);
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "receiver",
  103. category: 'accessing',
  104. fn: function (){
  105. var self=this;
  106. return smalltalk.withContext(function($ctx1) {
  107. var $2,$1;
  108. $2=self["@receiver"];
  109. if(($receiver = $2) == nil || $receiver == undefined){
  110. self["@receiver"]=_st(self)._defaultReceiver();
  111. $1=self["@receiver"];
  112. } else {
  113. $1=$2;
  114. };
  115. return $1;
  116. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeModel)})},
  117. args: [],
  118. source: "receiver\x0a\x09^ receiver ifNil: [ receiver := self defaultReceiver ]",
  119. messageSends: ["ifNil:", "defaultReceiver"],
  120. referencedClasses: []
  121. }),
  122. smalltalk.HLCodeModel);
  123. smalltalk.addMethod(
  124. smalltalk.method({
  125. selector: "receiver:",
  126. category: 'accessing',
  127. fn: function (anObject){
  128. var self=this;
  129. return smalltalk.withContext(function($ctx1) {
  130. self["@receiver"]=anObject;
  131. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeModel)})},
  132. args: ["anObject"],
  133. source: "receiver: anObject\x0a\x09receiver := anObject",
  134. messageSends: [],
  135. referencedClasses: []
  136. }),
  137. smalltalk.HLCodeModel);
  138. smalltalk.addMethod(
  139. smalltalk.method({
  140. selector: "on:",
  141. category: 'actions',
  142. fn: function (anEnvironment){
  143. var self=this;
  144. return smalltalk.withContext(function($ctx1) {
  145. var $2,$3,$1;
  146. $2=_st(self)._new();
  147. _st($2)._environment_(anEnvironment);
  148. $3=_st($2)._yourself();
  149. $1=$3;
  150. return $1;
  151. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel.klass)})},
  152. args: ["anEnvironment"],
  153. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  154. messageSends: ["environment:", "new", "yourself"],
  155. referencedClasses: []
  156. }),
  157. smalltalk.HLCodeModel.klass);
  158. smalltalk.addClass('HLCodeWidget', smalltalk.HLWidget, ['model', 'wrapper', 'code', 'editor', 'state'], 'Helios-Workspace');
  159. smalltalk.addMethod(
  160. smalltalk.method({
  161. selector: "announcer",
  162. category: 'accessing',
  163. fn: function (){
  164. var self=this;
  165. return smalltalk.withContext(function($ctx1) {
  166. var $1;
  167. $1=_st(_st(self)._model())._announcer();
  168. return $1;
  169. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeWidget)})},
  170. args: [],
  171. source: "announcer\x0a\x09^ self model announcer",
  172. messageSends: ["announcer", "model"],
  173. referencedClasses: []
  174. }),
  175. smalltalk.HLCodeWidget);
  176. smalltalk.addMethod(
  177. smalltalk.method({
  178. selector: "canHaveFocus",
  179. category: 'testing',
  180. fn: function (){
  181. var self=this;
  182. return smalltalk.withContext(function($ctx1) {
  183. return true;
  184. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLCodeWidget)})},
  185. args: [],
  186. source: "canHaveFocus\x0a\x09^ true",
  187. messageSends: [],
  188. referencedClasses: []
  189. }),
  190. smalltalk.HLCodeWidget);
  191. smalltalk.addMethod(
  192. smalltalk.method({
  193. selector: "clear",
  194. category: 'actions',
  195. fn: function (){
  196. var self=this;
  197. return smalltalk.withContext(function($ctx1) {
  198. _st(self)._contents_("");
  199. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLCodeWidget)})},
  200. args: [],
  201. source: "clear\x0a\x09self contents: ''",
  202. messageSends: ["contents:"],
  203. referencedClasses: []
  204. }),
  205. smalltalk.HLCodeWidget);
  206. smalltalk.addMethod(
  207. smalltalk.method({
  208. selector: "configureEditor",
  209. category: 'actions',
  210. fn: function (){
  211. var self=this;
  212. return smalltalk.withContext(function($ctx1) {
  213. _st(_st(self)._editor())._at_put_("amberCodeWidget",self);
  214. _st(_st(self)._editor())._on_do_("change",(function(){
  215. return smalltalk.withContext(function($ctx2) {
  216. return _st(self)._onChange();
  217. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  218. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLCodeWidget)})},
  219. args: [],
  220. source: "configureEditor\x0a\x09self editor at: 'amberCodeWidget' put: self.\x0a\x09self editor on: 'change' do: [ self onChange ]",
  221. messageSends: ["at:put:", "editor", "on:do:", "onChange"],
  222. referencedClasses: []
  223. }),
  224. smalltalk.HLCodeWidget);
  225. smalltalk.addMethod(
  226. smalltalk.method({
  227. selector: "contents",
  228. category: 'accessing',
  229. fn: function (){
  230. var self=this;
  231. return smalltalk.withContext(function($ctx1) {
  232. var $1;
  233. $1=_st(self["@editor"])._getValue();
  234. return $1;
  235. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.HLCodeWidget)})},
  236. args: [],
  237. source: "contents\x0a\x09^ editor getValue",
  238. messageSends: ["getValue"],
  239. referencedClasses: []
  240. }),
  241. smalltalk.HLCodeWidget);
  242. smalltalk.addMethod(
  243. smalltalk.method({
  244. selector: "contents:",
  245. category: 'accessing',
  246. fn: function (aString){
  247. var self=this;
  248. return smalltalk.withContext(function($ctx1) {
  249. var $1;
  250. _st(self["@editor"])._setValue_(aString);
  251. $1=self["@state"];
  252. if(($receiver = $1) == nil || $receiver == undefined){
  253. $1;
  254. } else {
  255. _st(self)._updateState();
  256. };
  257. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLCodeWidget)})},
  258. args: ["aString"],
  259. source: "contents: aString\x0a\x09editor setValue: aString.\x0a\x09state ifNotNil: [ self updateState ]",
  260. messageSends: ["setValue:", "ifNotNil:", "updateState"],
  261. referencedClasses: []
  262. }),
  263. smalltalk.HLCodeWidget);
  264. smalltalk.addMethod(
  265. smalltalk.method({
  266. selector: "currentLine",
  267. category: 'accessing',
  268. fn: function (){
  269. var self=this;
  270. return smalltalk.withContext(function($ctx1) {
  271. var $1;
  272. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  273. return $1;
  274. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},smalltalk.HLCodeWidget)})},
  275. args: [],
  276. source: "currentLine\x0a ^editor getLine: (editor getCursor line)",
  277. messageSends: ["getLine:", "line", "getCursor"],
  278. referencedClasses: []
  279. }),
  280. smalltalk.HLCodeWidget);
  281. smalltalk.addMethod(
  282. smalltalk.method({
  283. selector: "currentLineOrSelection",
  284. category: 'accessing',
  285. fn: function (){
  286. var self=this;
  287. return smalltalk.withContext(function($ctx1) {
  288. var $2,$1;
  289. $2=_st(self["@editor"])._somethingSelected();
  290. if(smalltalk.assert($2)){
  291. $1=_st(self)._selection();
  292. } else {
  293. $1=_st(self)._currentLine();
  294. };
  295. return $1;
  296. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},smalltalk.HLCodeWidget)})},
  297. args: [],
  298. source: "currentLineOrSelection\x0a ^editor somethingSelected\x0a\x09\x09ifFalse: [ self currentLine ]\x0a\x09\x09ifTrue: [ self selection ]",
  299. messageSends: ["ifFalse:ifTrue:", "currentLine", "selection", "somethingSelected"],
  300. referencedClasses: []
  301. }),
  302. smalltalk.HLCodeWidget);
  303. smalltalk.addMethod(
  304. smalltalk.method({
  305. selector: "doIt",
  306. category: 'actions',
  307. fn: function (){
  308. var self=this;
  309. var result;
  310. function $HLDoItRequested(){return smalltalk.HLDoItRequested||(typeof HLDoItRequested=="undefined"?nil:HLDoItRequested)}
  311. function $HLDoItExecuted(){return smalltalk.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
  312. return smalltalk.withContext(function($ctx1) {
  313. var $1;
  314. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLDoItRequested())._on_(self["@model"]));
  315. result=_st(self["@model"])._doIt_(_st(self)._currentLineOrSelection());
  316. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
  317. $1=result;
  318. return $1;
  319. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},smalltalk.HLCodeWidget)})},
  320. args: [],
  321. source: "doIt\x0a\x09| result |\x0a\x0a\x09self model announcer announce: (HLDoItRequested on: model).\x0a\x09result := model doIt: self currentLineOrSelection.\x0a\x09self model announcer announce: (HLDoItExecuted on: model).\x0a\x0a\x09^ result ",
  322. messageSends: ["announce:", "on:", "announcer", "model", "doIt:", "currentLineOrSelection"],
  323. referencedClasses: ["HLDoItRequested", "HLDoItExecuted"]
  324. }),
  325. smalltalk.HLCodeWidget);
  326. smalltalk.addMethod(
  327. smalltalk.method({
  328. selector: "editor",
  329. category: 'actions',
  330. fn: function (){
  331. var self=this;
  332. return smalltalk.withContext(function($ctx1) {
  333. var $1;
  334. $1=self["@editor"];
  335. return $1;
  336. }, function($ctx1) {$ctx1.fill(self,"editor",{},smalltalk.HLCodeWidget)})},
  337. args: [],
  338. source: "editor\x0a\x09^ editor",
  339. messageSends: [],
  340. referencedClasses: []
  341. }),
  342. smalltalk.HLCodeWidget);
  343. smalltalk.addMethod(
  344. smalltalk.method({
  345. selector: "focus",
  346. category: 'actions',
  347. fn: function (){
  348. var self=this;
  349. return smalltalk.withContext(function($ctx1) {
  350. _st(self["@editor"])._focus();
  351. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLCodeWidget)})},
  352. args: [],
  353. source: "focus\x0a\x09editor focus",
  354. messageSends: ["focus"],
  355. referencedClasses: []
  356. }),
  357. smalltalk.HLCodeWidget);
  358. smalltalk.addMethod(
  359. smalltalk.method({
  360. selector: "hasFocus",
  361. category: 'testing',
  362. fn: function (){
  363. var self=this;
  364. return smalltalk.withContext(function($ctx1) {
  365. var $1;
  366. $1=_st(_st(self["@code"])._asJQuery())._is_(":active");
  367. return $1;
  368. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLCodeWidget)})},
  369. args: [],
  370. source: "hasFocus\x0a\x09^ code asJQuery is: ':active'",
  371. messageSends: ["is:", "asJQuery"],
  372. referencedClasses: []
  373. }),
  374. smalltalk.HLCodeWidget);
  375. smalltalk.addMethod(
  376. smalltalk.method({
  377. selector: "hasModification",
  378. category: 'testing',
  379. fn: function (){
  380. var self=this;
  381. return smalltalk.withContext(function($ctx1) {
  382. return false;
  383. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLCodeWidget)})},
  384. args: [],
  385. source: "hasModification\x0a\x09^ false",
  386. messageSends: [],
  387. referencedClasses: []
  388. }),
  389. smalltalk.HLCodeWidget);
  390. smalltalk.addMethod(
  391. smalltalk.method({
  392. selector: "inspectIt",
  393. category: 'actions',
  394. fn: function (){
  395. var self=this;
  396. var newInspector;
  397. function $HLInspectItRequested(){return smalltalk.HLInspectItRequested||(typeof HLInspectItRequested=="undefined"?nil:HLInspectItRequested)}
  398. return smalltalk.withContext(function($ctx1) {
  399. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLInspectItRequested())._on_(self["@model"]));
  400. _st(_st(self)._doIt())._inspect();
  401. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},smalltalk.HLCodeWidget)})},
  402. args: [],
  403. source: "inspectIt\x0a\x09| newInspector |\x0a \x0a\x09self model announcer announce: (HLInspectItRequested on: model).\x0a\x09self doIt inspect",
  404. messageSends: ["announce:", "on:", "announcer", "model", "inspect", "doIt"],
  405. referencedClasses: ["HLInspectItRequested"]
  406. }),
  407. smalltalk.HLCodeWidget);
  408. smalltalk.addMethod(
  409. smalltalk.method({
  410. selector: "messageHintFor:token:",
  411. category: 'hints',
  412. fn: function (anEditor,aToken){
  413. var self=this;
  414. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  415. return smalltalk.withContext(function($ctx1) {
  416. var $1;
  417. $1=_st(_st(_st(_st(_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value())._asSet())._asArray())._select_((function(each){
  418. return smalltalk.withContext(function($ctx2) {
  419. return _st(each)._includesSubString_(_st(aToken)._string());
  420. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  421. return smalltalk.withContext(function($ctx2) {
  422. return _st(each).__eq(_st(aToken)._string());
  423. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  424. return $1;
  425. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget)})},
  426. args: ["anEditor", "aToken"],
  427. source: "messageHintFor: anEditor token: aToken\x0a\x09^ ((Smalltalk current at: 'allSelectors') value asSet asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
  428. messageSends: ["reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", "value", "at:", "current"],
  429. referencedClasses: ["Smalltalk"]
  430. }),
  431. smalltalk.HLCodeWidget);
  432. smalltalk.addMethod(
  433. smalltalk.method({
  434. selector: "model",
  435. category: 'accessing',
  436. fn: function (){
  437. var self=this;
  438. function $HLCodeModel(){return smalltalk.HLCodeModel||(typeof HLCodeModel=="undefined"?nil:HLCodeModel)}
  439. return smalltalk.withContext(function($ctx1) {
  440. var $2,$1;
  441. $2=self["@model"];
  442. if(($receiver = $2) == nil || $receiver == undefined){
  443. self["@model"]=_st($HLCodeModel())._new();
  444. $1=self["@model"];
  445. } else {
  446. $1=$2;
  447. };
  448. return $1;
  449. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLCodeWidget)})},
  450. args: [],
  451. source: "model\x0a\x09^ model ifNil: [ model := HLCodeModel new ]",
  452. messageSends: ["ifNil:", "new"],
  453. referencedClasses: ["HLCodeModel"]
  454. }),
  455. smalltalk.HLCodeWidget);
  456. smalltalk.addMethod(
  457. smalltalk.method({
  458. selector: "model:",
  459. category: 'accessing',
  460. fn: function (aModel){
  461. var self=this;
  462. return smalltalk.withContext(function($ctx1) {
  463. self["@model"]=aModel;
  464. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLCodeWidget)})},
  465. args: ["aModel"],
  466. source: "model: aModel\x0a\x09model := aModel",
  467. messageSends: [],
  468. referencedClasses: []
  469. }),
  470. smalltalk.HLCodeWidget);
  471. smalltalk.addMethod(
  472. smalltalk.method({
  473. selector: "onChange",
  474. category: 'reactions',
  475. fn: function (){
  476. var self=this;
  477. return smalltalk.withContext(function($ctx1) {
  478. _st(self)._updateState();
  479. return self}, function($ctx1) {$ctx1.fill(self,"onChange",{},smalltalk.HLCodeWidget)})},
  480. args: [],
  481. source: "onChange\x0a\x09self updateState",
  482. messageSends: ["updateState"],
  483. referencedClasses: []
  484. }),
  485. smalltalk.HLCodeWidget);
  486. smalltalk.addMethod(
  487. smalltalk.method({
  488. selector: "onDoIt",
  489. category: 'reactions',
  490. fn: function (){
  491. var self=this;
  492. return smalltalk.withContext(function($ctx1) {
  493. _st(self)._doIt();
  494. return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{},smalltalk.HLCodeWidget)})},
  495. args: [],
  496. source: "onDoIt\x0a\x09\x0a self doIt",
  497. messageSends: ["doIt"],
  498. referencedClasses: []
  499. }),
  500. smalltalk.HLCodeWidget);
  501. smalltalk.addMethod(
  502. smalltalk.method({
  503. selector: "onInspectIt",
  504. category: 'reactions',
  505. fn: function (){
  506. var self=this;
  507. return smalltalk.withContext(function($ctx1) {
  508. _st(self)._inspectIt();
  509. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},smalltalk.HLCodeWidget)})},
  510. args: [],
  511. source: "onInspectIt\x0a\x0a\x09self inspectIt",
  512. messageSends: ["inspectIt"],
  513. referencedClasses: []
  514. }),
  515. smalltalk.HLCodeWidget);
  516. smalltalk.addMethod(
  517. smalltalk.method({
  518. selector: "onPrintIt",
  519. category: 'reactions',
  520. fn: function (){
  521. var self=this;
  522. return smalltalk.withContext(function($ctx1) {
  523. _st(self)._printIt();
  524. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},smalltalk.HLCodeWidget)})},
  525. args: [],
  526. source: "onPrintIt\x0a\x0a\x09self printIt",
  527. messageSends: ["printIt"],
  528. referencedClasses: []
  529. }),
  530. smalltalk.HLCodeWidget);
  531. smalltalk.addMethod(
  532. smalltalk.method({
  533. selector: "onSaveIt",
  534. category: 'reactions',
  535. fn: function (){
  536. var self=this;
  537. return smalltalk.withContext(function($ctx1) {
  538. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLCodeWidget)})},
  539. args: [],
  540. source: "onSaveIt\x0a\x09\x22I do not do anything\x22",
  541. messageSends: [],
  542. referencedClasses: []
  543. }),
  544. smalltalk.HLCodeWidget);
  545. smalltalk.addMethod(
  546. smalltalk.method({
  547. selector: "print:",
  548. category: 'actions',
  549. fn: function (aString){
  550. var self=this;
  551. var start,stop,currentLine;
  552. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  553. return smalltalk.withContext(function($ctx1) {
  554. currentLine=_st(_st(self["@editor"])._getCursor_(false))._line();
  555. start=_st($HashedCollection())._new();
  556. _st(start)._at_put_("line",currentLine);
  557. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getCursor_(false))._ch());
  558. _st(_st(self["@editor"])._getSelection())._ifEmpty_((function(){
  559. return smalltalk.withContext(function($ctx2) {
  560. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getLine_(currentLine))._size());
  561. return _st(self["@editor"])._setSelection_end_(smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(currentLine),_st("ch").__minus_gt((0))]),start);
  562. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  563. stop=_st($HashedCollection())._new();
  564. _st(stop)._at_put_("line",currentLine);
  565. _st(stop)._at_put_("ch",_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2)));
  566. _st(self["@editor"])._replaceSelection_(_st(_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString)).__comma(" "));
  567. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  568. _st(self["@editor"])._setSelection_end_(stop,start);
  569. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},smalltalk.HLCodeWidget)})},
  570. args: ["aString"],
  571. 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",
  572. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "size", "getLine:", "setSelection:end:", "->", "getSelection", "+", "at:", "replaceSelection:", ",", "setCursor:"],
  573. referencedClasses: ["HashedCollection"]
  574. }),
  575. smalltalk.HLCodeWidget);
  576. smalltalk.addMethod(
  577. smalltalk.method({
  578. selector: "printIt",
  579. category: 'actions',
  580. fn: function (){
  581. var self=this;
  582. var result;
  583. function $HLPrintItRequested(){return smalltalk.HLPrintItRequested||(typeof HLPrintItRequested=="undefined"?nil:HLPrintItRequested)}
  584. return smalltalk.withContext(function($ctx1) {
  585. result=_st(self)._doIt();
  586. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLPrintItRequested())._on_(self["@model"]));
  587. _st(self)._print_(_st(result)._printString());
  588. _st(self)._focus();
  589. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{result:result},smalltalk.HLCodeWidget)})},
  590. args: [],
  591. source: "printIt\x0a\x09| result |\x0a\x0a\x09result:= self doIt. \x0a\x09self model announcer announce: (HLPrintItRequested on: model).\x0a self print: result printString.\x0a\x09\x0a\x09self focus.",
  592. messageSends: ["doIt", "announce:", "on:", "announcer", "model", "print:", "printString", "focus"],
  593. referencedClasses: ["HLPrintItRequested"]
  594. }),
  595. smalltalk.HLCodeWidget);
  596. smalltalk.addMethod(
  597. smalltalk.method({
  598. selector: "receiver",
  599. category: 'accessing',
  600. fn: function (){
  601. var self=this;
  602. return smalltalk.withContext(function($ctx1) {
  603. var $1;
  604. $1=_st(_st(self)._model())._receiver();
  605. return $1;
  606. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeWidget)})},
  607. args: [],
  608. source: "receiver\x0a\x09^ self model receiver",
  609. messageSends: ["receiver", "model"],
  610. referencedClasses: []
  611. }),
  612. smalltalk.HLCodeWidget);
  613. smalltalk.addMethod(
  614. smalltalk.method({
  615. selector: "receiver:",
  616. category: 'accessing',
  617. fn: function (anObject){
  618. var self=this;
  619. return smalltalk.withContext(function($ctx1) {
  620. _st(_st(self)._model())._receiver_(anObject);
  621. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  622. args: ["anObject"],
  623. source: "receiver: anObject\x0a\x09self model receiver: anObject",
  624. messageSends: ["receiver:", "model"],
  625. referencedClasses: []
  626. }),
  627. smalltalk.HLCodeWidget);
  628. smalltalk.addMethod(
  629. smalltalk.method({
  630. selector: "renderButtonsOn:",
  631. category: 'rendering',
  632. fn: function (html){
  633. var self=this;
  634. return smalltalk.withContext(function($ctx1) {
  635. var $1,$2,$3,$4,$5,$6;
  636. $1=_st(html)._button();
  637. _st($1)._class_("button");
  638. _st($1)._with_("DoIt");
  639. $2=_st($1)._onClick_((function(){
  640. return smalltalk.withContext(function($ctx2) {
  641. return _st(self)._doIt();
  642. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  643. $3=_st(html)._button();
  644. _st($3)._class_("button");
  645. _st($3)._with_("PintIt");
  646. $4=_st($3)._onClick_((function(){
  647. return smalltalk.withContext(function($ctx2) {
  648. return _st(self)._printIt();
  649. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  650. $5=_st(html)._button();
  651. _st($5)._class_("button");
  652. _st($5)._with_("InspectIt");
  653. $6=_st($5)._onClick_((function(){
  654. return smalltalk.withContext(function($ctx2) {
  655. return _st(self)._inspectIt();
  656. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  657. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLCodeWidget)})},
  658. args: ["html"],
  659. 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: 'PintIt';\x0a\x09\x09onClick: [ self printIt ].\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'InspectIt';\x0a\x09\x09onClick: [ self inspectIt ]",
  660. messageSends: ["class:", "button", "with:", "onClick:", "doIt", "printIt", "inspectIt"],
  661. referencedClasses: []
  662. }),
  663. smalltalk.HLCodeWidget);
  664. smalltalk.addMethod(
  665. smalltalk.method({
  666. selector: "renderContentOn:",
  667. category: 'rendering',
  668. fn: function (html){
  669. var self=this;
  670. return smalltalk.withContext(function($ctx1) {
  671. var $1,$2,$3,$4;
  672. self["@code"]=_st(html)._textarea();
  673. self["@state"]=_st(_st(html)._div())._class_("state");
  674. $1=_st(html)._div();
  675. _st($1)._class_("buttons_bar");
  676. $2=_st($1)._with_((function(){
  677. return smalltalk.withContext(function($ctx2) {
  678. return _st(self)._renderButtonsOn_(html);
  679. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  680. $3=self;
  681. _st($3)._setEditorOn_(_st(self["@code"])._element());
  682. _st($3)._configureEditor();
  683. $4=_st($3)._updateState();
  684. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLCodeWidget)})},
  685. args: ["html"],
  686. source: "renderContentOn: html\x0a\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",
  687. messageSends: ["textarea", "class:", "div", "with:", "renderButtonsOn:", "setEditorOn:", "element", "configureEditor", "updateState"],
  688. referencedClasses: []
  689. }),
  690. smalltalk.HLCodeWidget);
  691. smalltalk.addMethod(
  692. smalltalk.method({
  693. selector: "saveIt",
  694. category: 'actions',
  695. fn: function (){
  696. var self=this;
  697. return smalltalk.withContext(function($ctx1) {
  698. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLCodeWidget)})},
  699. args: [],
  700. source: "saveIt\x0a\x09\x22I do not do anything\x22",
  701. messageSends: [],
  702. referencedClasses: []
  703. }),
  704. smalltalk.HLCodeWidget);
  705. smalltalk.addMethod(
  706. smalltalk.method({
  707. selector: "selection",
  708. category: 'accessing',
  709. fn: function (){
  710. var self=this;
  711. return smalltalk.withContext(function($ctx1) {
  712. var $1;
  713. $1=_st(self["@editor"])._getSelection();
  714. return $1;
  715. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.HLCodeWidget)})},
  716. args: [],
  717. source: "selection\x0a\x09^editor getSelection",
  718. messageSends: ["getSelection"],
  719. referencedClasses: []
  720. }),
  721. smalltalk.HLCodeWidget);
  722. smalltalk.addMethod(
  723. smalltalk.method({
  724. selector: "selectionEnd",
  725. category: 'accessing',
  726. fn: function (){
  727. var self=this;
  728. return smalltalk.withContext(function($ctx1) {
  729. var $1;
  730. $1=_st(_st(self["@code"])._element())._selectionEnd();
  731. return $1;
  732. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},smalltalk.HLCodeWidget)})},
  733. args: [],
  734. source: "selectionEnd\x0a ^code element selectionEnd",
  735. messageSends: ["selectionEnd", "element"],
  736. referencedClasses: []
  737. }),
  738. smalltalk.HLCodeWidget);
  739. smalltalk.addMethod(
  740. smalltalk.method({
  741. selector: "selectionEnd:",
  742. category: 'accessing',
  743. fn: function (anInteger){
  744. var self=this;
  745. return smalltalk.withContext(function($ctx1) {
  746. _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  747. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  748. args: ["anInteger"],
  749. source: "selectionEnd: anInteger\x0a code element selectionEnd: anInteger",
  750. messageSends: ["selectionEnd:", "element"],
  751. referencedClasses: []
  752. }),
  753. smalltalk.HLCodeWidget);
  754. smalltalk.addMethod(
  755. smalltalk.method({
  756. selector: "selectionStart",
  757. category: 'accessing',
  758. fn: function (){
  759. var self=this;
  760. return smalltalk.withContext(function($ctx1) {
  761. var $1;
  762. $1=_st(_st(self["@code"])._element())._selectionStart();
  763. return $1;
  764. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},smalltalk.HLCodeWidget)})},
  765. args: [],
  766. source: "selectionStart\x0a ^code element selectionStart",
  767. messageSends: ["selectionStart", "element"],
  768. referencedClasses: []
  769. }),
  770. smalltalk.HLCodeWidget);
  771. smalltalk.addMethod(
  772. smalltalk.method({
  773. selector: "selectionStart:",
  774. category: 'accessing',
  775. fn: function (anInteger){
  776. var self=this;
  777. return smalltalk.withContext(function($ctx1) {
  778. _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  779. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  780. args: ["anInteger"],
  781. source: "selectionStart: anInteger\x0a code element selectionStart: anInteger",
  782. messageSends: ["selectionStart:", "element"],
  783. referencedClasses: []
  784. }),
  785. smalltalk.HLCodeWidget);
  786. smalltalk.addMethod(
  787. smalltalk.method({
  788. selector: "setEditorOn:",
  789. category: 'actions',
  790. fn: function (aTextarea){
  791. var self=this;
  792. return smalltalk.withContext(function($ctx1) {
  793. self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
  794. theme: 'amber',
  795. lineNumbers: true,
  796. enterMode: 'flat',
  797. indentWithTabs: true,
  798. indentUnit: 4,
  799. matchBrackets: true,
  800. electricChars: true,
  801. keyMap: 'Amber',
  802. extraKeys: {"Shift-Space": "autocomplete"}
  803. });
  804. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},smalltalk.HLCodeWidget)})},
  805. args: ["aTextarea"],
  806. source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {\x0a\x09\x09theme: 'amber',\x0a lineNumbers: true,\x0a enterMode: 'flat',\x0a indentWithTabs: true,\x0a\x09\x09\x09\x09indentUnit: 4,\x0a matchBrackets: true,\x0a electricChars: true,\x0a\x09\x09\x09\x09keyMap: 'Amber',\x0a\x09\x09\x09\x09extraKeys: {\x22Shift-Space\x22: \x22autocomplete\x22}\x0a\x09})>",
  807. messageSends: [],
  808. referencedClasses: []
  809. }),
  810. smalltalk.HLCodeWidget);
  811. smalltalk.addMethod(
  812. smalltalk.method({
  813. selector: "updateState",
  814. category: 'updating',
  815. fn: function (){
  816. var self=this;
  817. return smalltalk.withContext(function($ctx1) {
  818. var $1;
  819. $1=_st(self)._hasModification();
  820. if(smalltalk.assert($1)){
  821. _st(_st(self["@state"])._asJQuery())._addClass_("modified");
  822. } else {
  823. _st(_st(self["@state"])._asJQuery())._removeClass_("modified");
  824. };
  825. return self}, function($ctx1) {$ctx1.fill(self,"updateState",{},smalltalk.HLCodeWidget)})},
  826. args: [],
  827. source: "updateState\x0a\x09self hasModification \x0a\x09\x09ifTrue: [ state asJQuery addClass: 'modified' ]\x0a\x09\x09ifFalse: [ state asJQuery removeClass: 'modified' ]",
  828. messageSends: ["ifTrue:ifFalse:", "addClass:", "asJQuery", "removeClass:", "hasModification"],
  829. referencedClasses: []
  830. }),
  831. smalltalk.HLCodeWidget);
  832. smalltalk.addMethod(
  833. smalltalk.method({
  834. selector: "variableHintFor:token:",
  835. category: 'hints',
  836. fn: function (anEditor,aToken){
  837. var self=this;
  838. var variables,classNames,pseudoVariables;
  839. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  840. return smalltalk.withContext(function($ctx1) {
  841. var $1;
  842. variables=_st(_st(_st(_st(window)._jQuery_(_st(_st(anEditor)._display())._wrapper()))._find_("span.cm-variable"))._get())._collect_((function(each){
  843. return smalltalk.withContext(function($ctx2) {
  844. return _st(_st(window)._jQuery_(each))._html();
  845. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  846. classNames=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  847. return smalltalk.withContext(function($ctx2) {
  848. return _st(each)._name();
  849. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  850. pseudoVariables=_st(_st($Smalltalk())._current())._pseudoVariableNames();
  851. $1=_st(_st(_st(_st(_st(_st(variables).__comma(classNames)).__comma(pseudoVariables))._asSet())._asArray())._select_((function(each){
  852. return smalltalk.withContext(function($ctx2) {
  853. return _st(each)._includesSubString_(_st(aToken)._string());
  854. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  855. return smalltalk.withContext(function($ctx2) {
  856. return _st(each).__eq(_st(aToken)._string());
  857. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  858. return $1;
  859. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},smalltalk.HLCodeWidget)})},
  860. args: ["anEditor", "aToken"],
  861. source: "variableHintFor: anEditor token: aToken\x0a\x09| variables classNames pseudoVariables |\x0a\x09\x0a\x09variables := ((window jQuery: anEditor display wrapper) find: 'span.cm-variable') get\x0a\x09\x09collect: [ :each | (window jQuery: each) html ].\x0a\x09\x0a\x09classNames := Smalltalk current classes collect: [ :each | each name ].\x0a\x09pseudoVariables := Smalltalk current pseudoVariableNames.\x0a\x09\x0a\x09^ ((variables, classNames, pseudoVariables) asSet asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
  862. messageSends: ["collect:", "html", "jQuery:", "get", "find:", "wrapper", "display", "name", "classes", "current", "pseudoVariableNames", "reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", ","],
  863. referencedClasses: ["Smalltalk"]
  864. }),
  865. smalltalk.HLCodeWidget);
  866. smalltalk.addMethod(
  867. smalltalk.method({
  868. selector: "hintFor:options:",
  869. category: 'hints',
  870. fn: function (anEditor,options){
  871. var self=this;
  872. var cursor,token,completions;
  873. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  874. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  875. return smalltalk.withContext(function($ctx1) {
  876. var $1,$2;
  877. cursor=_st(anEditor)._getCursor();
  878. token=_st(anEditor)._getTokenAt_(cursor);
  879. _st(token)._at_put_("state",_st(_st(_st($CodeMirror())._basicAt_("innerMode"))._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state")))._state());
  880. $1=_st(_st(token)._type()).__eq("variable");
  881. if(smalltalk.assert($1)){
  882. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  883. } else {
  884. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  885. };
  886. $2=smalltalk.HashedCollection._fromPairs_([_st("list").__minus_gt(completions),_st("from").__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._end())),_st("to").__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._start()))]);
  887. return $2;
  888. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},smalltalk.HLCodeWidget.klass)})},
  889. args: ["anEditor", "options"],
  890. 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}",
  891. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "getMode", "at:", "basicAt:", "ifTrue:ifFalse:", "variableHintFor:token:", "messageHintFor:token:", "=", "type", "->", "line", "end", "start"],
  892. referencedClasses: ["CodeMirror", "HLCodeWidget"]
  893. }),
  894. smalltalk.HLCodeWidget.klass);
  895. smalltalk.addMethod(
  896. smalltalk.method({
  897. selector: "initialize",
  898. category: 'initialization',
  899. fn: function (){
  900. var self=this;
  901. return smalltalk.withContext(function($ctx1) {
  902. var $1,$2;
  903. smalltalk.HLWidget.klass.fn.prototype._initialize.apply(_st(self), []);
  904. $1=self;
  905. _st($1)._setupCodeMirror();
  906. _st($1)._setupCommands();
  907. $2=_st($1)._setupKeyMaps();
  908. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLCodeWidget.klass)})},
  909. args: [],
  910. source: "initialize\x0a\x09super initialize.\x0a\x09self \x0a\x09\x09setupCodeMirror;\x0a\x09\x09setupCommands;\x0a\x09\x09setupKeyMaps.",
  911. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"],
  912. referencedClasses: []
  913. }),
  914. smalltalk.HLCodeWidget.klass);
  915. smalltalk.addMethod(
  916. smalltalk.method({
  917. selector: "keyMap",
  918. category: 'accessing',
  919. fn: function (){
  920. var self=this;
  921. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  922. return smalltalk.withContext(function($ctx1) {
  923. var $2,$1;
  924. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  925. if(smalltalk.assert($2)){
  926. $1=_st(self)._macKeyMap();
  927. } else {
  928. $1=_st(self)._pcKeyMap();
  929. };
  930. return $1;
  931. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},smalltalk.HLCodeWidget.klass)})},
  932. args: [],
  933. source: "keyMap\x0a\x09^ HLManager current keyBinder systemIsMac\x0a\x09\x09ifTrue: [ self macKeyMap ]\x0a\x09\x09ifFalse: [ self pcKeyMap ]",
  934. messageSends: ["ifTrue:ifFalse:", "macKeyMap", "pcKeyMap", "systemIsMac", "keyBinder", "current"],
  935. referencedClasses: ["HLManager"]
  936. }),
  937. smalltalk.HLCodeWidget.klass);
  938. smalltalk.addMethod(
  939. smalltalk.method({
  940. selector: "macKeyMap",
  941. category: 'accessing',
  942. fn: function (){
  943. var self=this;
  944. return smalltalk.withContext(function($ctx1) {
  945. var $1;
  946. $1=smalltalk.HashedCollection._fromPairs_([_st("Alt-Backspace").__minus_gt("delWordBefore"),_st("Alt-Delete").__minus_gt("delWordAfter"),_st("Alt-Left").__minus_gt("goWordBoundaryLeft"),_st("Alt-Right").__minus_gt("goWordBoundaryRight"),_st("Cmd-A").__minus_gt("selectAll"),_st("Cmd-Alt-F").__minus_gt("replace"),_st("Cmd-D").__minus_gt("doIt"),_st("Cmd-Down").__minus_gt("goDocEnd"),_st("Cmd-End").__minus_gt("goDocEnd"),_st("Cmd-F").__minus_gt("find"),_st("Cmd-G").__minus_gt("findNext"),_st("Cmd-I").__minus_gt("inspectIt"),_st("Cmd-Left").__minus_gt("goLineStart"),_st("Cmd-P").__minus_gt("printIt"),_st("Cmd-Right").__minus_gt("goLineEnd"),_st("Cmd-S").__minus_gt("saveIt"),_st("Cmd-Up").__minus_gt("goDocStart"),_st("Cmd-Y").__minus_gt("redo"),_st("Cmd-Z").__minus_gt("undo"),_st("Cmd-[").__minus_gt("indentLess"),_st("Cmd-]").__minus_gt("indentMore"),_st("Ctrl-Alt-Backspace").__minus_gt("delWordAfter"),_st("Shift-Cmd-Alt-F").__minus_gt("replaceAll"),_st("Shift-Cmd-G").__minus_gt("findPrev"),_st("Shift-Cmd-Z").__minus_gt("redo"),_st("fallthrough").__minus_gt(["basic","emacsy"])]);
  947. return $1;
  948. }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  949. args: [],
  950. source: "macKeyMap\x0a\x09^ #{\x0a\x09\x09'Alt-Backspace'\x09\x09-> 'delWordBefore'.\x0a\x09\x09'Alt-Delete'\x09\x09-> 'delWordAfter'. \x0a\x09\x09'Alt-Left'\x09\x09-> 'goWordBoundaryLeft'.\x0a\x09\x09'Alt-Right'\x09\x09-> 'goWordBoundaryRight'. \x0a\x09\x09'Cmd-A'\x09\x09\x09-> 'selectAll'. \x0a\x09\x09'Cmd-Alt-F'\x09\x09-> 'replace'. \x0a\x09\x09'Cmd-D'\x09\x09\x09-> 'doIt'. \x0a\x09\x09'Cmd-Down'\x09\x09-> 'goDocEnd'. \x0a\x09\x09'Cmd-End'\x09\x09-> 'goDocEnd'. \x0a\x09\x09'Cmd-F'\x09\x09\x09-> 'find'.\x0a\x09\x09'Cmd-G'\x09\x09\x09-> 'findNext'. \x0a\x09\x09'Cmd-I'\x09\x09\x09-> 'inspectIt'. \x0a\x09\x09'Cmd-Left'\x09\x09-> 'goLineStart'. \x0a\x09\x09'Cmd-P'\x09\x09\x09-> 'printIt'. \x0a\x09\x09'Cmd-Right'\x09\x09-> 'goLineEnd'. \x0a\x09\x09'Cmd-S'\x09\x09\x09-> 'saveIt'. \x0a\x09\x09'Cmd-Up'\x09\x09-> 'goDocStart'. \x0a\x09\x09'Cmd-Y'\x09\x09\x09-> 'redo'.\x0a\x09\x09'Cmd-Z'\x09\x09\x09-> 'undo'. \x0a\x09\x09'Cmd-['\x09\x09\x09-> 'indentLess'. \x0a\x09\x09'Cmd-]'\x09\x09\x09-> 'indentMore'.\x0a\x09\x09'Ctrl-Alt-Backspace'\x09-> 'delWordAfter'. \x0a\x09\x09'Shift-Cmd-Alt-F'\x09-> 'replaceAll'.\x0a\x09\x09'Shift-Cmd-G'\x09\x09-> 'findPrev'. \x0a\x09\x09'Shift-Cmd-Z'\x09\x09-> 'redo'. \x0a \x09'fallthrough' \x09-> { 'basic'. 'emacsy' }\x0a }",
  951. messageSends: ["->"],
  952. referencedClasses: []
  953. }),
  954. smalltalk.HLCodeWidget.klass);
  955. smalltalk.addMethod(
  956. smalltalk.method({
  957. selector: "messageHintFor:token:",
  958. category: 'hints',
  959. fn: function (anEditor,aToken){
  960. var self=this;
  961. return smalltalk.withContext(function($ctx1) {
  962. var $1;
  963. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  964. return $1;
  965. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  966. args: ["anEditor", "aToken"],
  967. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09messageHintFor: anEditor token: aToken",
  968. messageSends: ["messageHintFor:token:", "at:"],
  969. referencedClasses: []
  970. }),
  971. smalltalk.HLCodeWidget.klass);
  972. smalltalk.addMethod(
  973. smalltalk.method({
  974. selector: "pcKeyMap",
  975. category: 'accessing',
  976. fn: function (){
  977. var self=this;
  978. return smalltalk.withContext(function($ctx1) {
  979. var $1;
  980. $1=[_st("Alt-Left").__minus_gt("goLineStart"),_st("Alt-Right").__minus_gt("goLineEnd"),_st("Alt-Up").__minus_gt("goDocStart"),_st("Ctrl-A").__minus_gt("selectAll"),_st("Ctrl-Backspace").__minus_gt("delWordBefore"),_st("Ctrl-D").__minus_gt("doIt"),_st("Ctrl-Delete").__minus_gt("delWordAfter"),_st("Ctrl-Down").__minus_gt("goDocEnd"),_st("Ctrl-End").__minus_gt("goDocEnd"),_st("Ctrl-F").__minus_gt("find"),_st("Ctrl-G").__minus_gt("findNext"),_st("Ctrl-I").__minus_gt("inspectIt"),_st("Ctrl-Home").__minus_gt("goDocStart"),_st("Ctrl-Left").__minus_gt("goWordBoundaryLeft"),_st("Ctrl-P").__minus_gt("printIt"),_st("Ctrl-Right").__minus_gt("goWordBoundaryRight"),_st("Ctrl-S").__minus_gt("saveIt"),_st("Ctrl-Y").__minus_gt("redo"),_st("Ctrl-Z").__minus_gt("undo"),_st("Ctrl-[").__minus_gt("indentLess"),_st("Ctrl-]").__minus_gt("indentMore"),_st("Shift-Ctrl-F").__minus_gt("replace"),_st("Shift-Ctrl-G").__minus_gt("findPrev"),_st("Shift-Ctrl-R").__minus_gt("replaceAll"),_st("Shift-Ctrl-Z").__minus_gt("redo"),_st("fallthrough").__minus_gt(["basic"])];
  981. return $1;
  982. }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  983. args: [],
  984. source: "pcKeyMap\x0a\x09^ {\x0a\x09\x09'Alt-Left' -> 'goLineStart'. \x0a\x09\x09'Alt-Right' -> 'goLineEnd'.\x0a\x09\x09'Alt-Up' -> 'goDocStart'. \x0a\x09\x09'Ctrl-A' -> 'selectAll'. \x0a\x09\x09'Ctrl-Backspace' -> 'delWordBefore'. \x0a\x09\x09'Ctrl-D' -> 'doIt'. \x0a\x09\x09'Ctrl-Delete' -> 'delWordAfter'. \x0a\x09\x09'Ctrl-Down' -> 'goDocEnd'.\x0a\x09\x09'Ctrl-End' -> 'goDocEnd'. \x0a\x09\x09'Ctrl-F' -> 'find'.\x0a\x09\x09'Ctrl-G' -> 'findNext'. \x0a\x09\x09'Ctrl-I' -> 'inspectIt'.\x0a\x09\x09'Ctrl-Home' -> 'goDocStart'. \x0a\x09\x09'Ctrl-Left' -> 'goWordBoundaryLeft'. \x0a\x09\x09'Ctrl-P' -> 'printIt'.\x0a\x09\x09'Ctrl-Right' -> 'goWordBoundaryRight'. \x0a\x09\x09'Ctrl-S' -> 'saveIt'. \x0a\x09\x09'Ctrl-Y' -> 'redo'.\x0a\x09\x09'Ctrl-Z' -> 'undo'. \x0a\x09\x09'Ctrl-[' -> 'indentLess'. \x0a\x09\x09'Ctrl-]' -> 'indentMore'.\x0a\x09\x09'Shift-Ctrl-F' -> 'replace'. \x0a\x09\x09'Shift-Ctrl-G' -> 'findPrev'. \x0a\x09\x09'Shift-Ctrl-R' -> 'replaceAll'.\x0a\x09\x09'Shift-Ctrl-Z' -> 'redo'. \x0a\x09\x09'fallthrough' -> #('basic')\x0a}",
  985. messageSends: ["->"],
  986. referencedClasses: []
  987. }),
  988. smalltalk.HLCodeWidget.klass);
  989. smalltalk.addMethod(
  990. smalltalk.method({
  991. selector: "setupCodeMirror",
  992. category: 'initialization',
  993. fn: function (){
  994. var self=this;
  995. return smalltalk.withContext(function($ctx1) {
  996. CodeMirror.keyMap.default.fallthrough = ["basic"];
  997. CodeMirror.commands.autocomplete = function(cm) {
  998. CodeMirror.showHint(cm, self._hintFor_options_);
  999. }
  1000. ;
  1001. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.HLCodeWidget.klass)})},
  1002. args: [],
  1003. source: "setupCodeMirror\x0a\x09< \x0a\x09\x09CodeMirror.keyMap.default.fallthrough = [\x22basic\x22];\x0a\x09\x09CodeMirror.commands.autocomplete = function(cm) {\x0a \x09CodeMirror.showHint(cm, self._hintFor_options_);\x0a \x09}\x0a\x09>",
  1004. messageSends: [],
  1005. referencedClasses: []
  1006. }),
  1007. smalltalk.HLCodeWidget.klass);
  1008. smalltalk.addMethod(
  1009. smalltalk.method({
  1010. selector: "setupCommands",
  1011. category: 'initialization',
  1012. fn: function (){
  1013. var self=this;
  1014. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  1015. return smalltalk.withContext(function($ctx1) {
  1016. var $1,$2;
  1017. $1=_st($CodeMirror())._basicAt_("commands");
  1018. _st($1)._at_put_("doIt",(function(cm){
  1019. return smalltalk.withContext(function($ctx2) {
  1020. return _st(_st(cm)._amberCodeWidget())._doIt();
  1021. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  1022. _st($1)._at_put_("inspectIt",(function(cm){
  1023. return smalltalk.withContext(function($ctx2) {
  1024. return _st(_st(cm)._amberCodeWidget())._inspectIt();
  1025. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  1026. _st($1)._at_put_("printIt",(function(cm){
  1027. return smalltalk.withContext(function($ctx2) {
  1028. return _st(_st(cm)._amberCodeWidget())._printIt();
  1029. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  1030. $2=_st($1)._at_put_("saveIt",(function(cm){
  1031. return smalltalk.withContext(function($ctx2) {
  1032. return _st(_st(cm)._amberCodeWidget())._saveIt();
  1033. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  1034. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},smalltalk.HLCodeWidget.klass)})},
  1035. args: [],
  1036. 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 ]",
  1037. messageSends: ["at:put:", "doIt", "amberCodeWidget", "basicAt:", "inspectIt", "printIt", "saveIt"],
  1038. referencedClasses: ["CodeMirror"]
  1039. }),
  1040. smalltalk.HLCodeWidget.klass);
  1041. smalltalk.addMethod(
  1042. smalltalk.method({
  1043. selector: "setupKeyMaps",
  1044. category: 'initialization',
  1045. fn: function (){
  1046. var self=this;
  1047. return smalltalk.withContext(function($ctx1) {
  1048. CodeMirror.keyMap['Amber'] = self._keyMap();
  1049. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},smalltalk.HLCodeWidget.klass)})},
  1050. args: [],
  1051. source: "setupKeyMaps\x0a\x09<CodeMirror.keyMap['Amber'] = self._keyMap()>",
  1052. messageSends: [],
  1053. referencedClasses: []
  1054. }),
  1055. smalltalk.HLCodeWidget.klass);
  1056. smalltalk.addMethod(
  1057. smalltalk.method({
  1058. selector: "variableHintFor:token:",
  1059. category: 'hints',
  1060. fn: function (anEditor,aToken){
  1061. var self=this;
  1062. return smalltalk.withContext(function($ctx1) {
  1063. var $1;
  1064. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  1065. return $1;
  1066. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  1067. args: ["anEditor", "aToken"],
  1068. source: "variableHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09variableHintFor: anEditor token: aToken",
  1069. messageSends: ["variableHintFor:token:", "at:"],
  1070. referencedClasses: []
  1071. }),
  1072. smalltalk.HLCodeWidget.klass);
  1073. smalltalk.addClass('HLNavigationCodeWidget', smalltalk.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
  1074. smalltalk.addMethod(
  1075. smalltalk.method({
  1076. selector: "configureEditor",
  1077. category: 'accessing',
  1078. fn: function (){
  1079. var self=this;
  1080. return smalltalk.withContext(function($ctx1) {
  1081. smalltalk.HLCodeWidget.fn.prototype._configureEditor.apply(_st(self), []);
  1082. _st(self)._contents_(_st(self)._methodContents());
  1083. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLNavigationCodeWidget)})},
  1084. args: [],
  1085. source: "configureEditor\x0a\x09super configureEditor.\x0a\x09self contents: self methodContents",
  1086. messageSends: ["configureEditor", "contents:", "methodContents"],
  1087. referencedClasses: []
  1088. }),
  1089. smalltalk.HLNavigationCodeWidget);
  1090. smalltalk.addMethod(
  1091. smalltalk.method({
  1092. selector: "contents:",
  1093. category: 'accessing',
  1094. fn: function (aString){
  1095. var self=this;
  1096. return smalltalk.withContext(function($ctx1) {
  1097. _st(self)._methodContents_(aString);
  1098. smalltalk.HLCodeWidget.fn.prototype._contents_.apply(_st(self), [aString]);
  1099. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  1100. args: ["aString"],
  1101. source: "contents: aString\x0a\x09self methodContents: aString.\x0a\x09super contents: aString",
  1102. messageSends: ["methodContents:", "contents:"],
  1103. referencedClasses: []
  1104. }),
  1105. smalltalk.HLNavigationCodeWidget);
  1106. smalltalk.addMethod(
  1107. smalltalk.method({
  1108. selector: "hasModification",
  1109. category: 'testing',
  1110. fn: function (){
  1111. var self=this;
  1112. return smalltalk.withContext(function($ctx1) {
  1113. var $1;
  1114. $1=_st(_st(_st(self)._methodContents()).__eq(_st(self)._contents()))._not();
  1115. return $1;
  1116. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLNavigationCodeWidget)})},
  1117. args: [],
  1118. source: "hasModification\x0a\x09^ (self methodContents = self contents) not",
  1119. messageSends: ["not", "=", "contents", "methodContents"],
  1120. referencedClasses: []
  1121. }),
  1122. smalltalk.HLNavigationCodeWidget);
  1123. smalltalk.addMethod(
  1124. smalltalk.method({
  1125. selector: "methodContents",
  1126. category: 'accessing',
  1127. fn: function (){
  1128. var self=this;
  1129. return smalltalk.withContext(function($ctx1) {
  1130. var $2,$1;
  1131. $2=self["@methodContents"];
  1132. if(($receiver = $2) == nil || $receiver == undefined){
  1133. $1="";
  1134. } else {
  1135. $1=$2;
  1136. };
  1137. return $1;
  1138. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},smalltalk.HLNavigationCodeWidget)})},
  1139. args: [],
  1140. source: "methodContents\x0a\x09^ methodContents ifNil: [ '' ]",
  1141. messageSends: ["ifNil:"],
  1142. referencedClasses: []
  1143. }),
  1144. smalltalk.HLNavigationCodeWidget);
  1145. smalltalk.addMethod(
  1146. smalltalk.method({
  1147. selector: "methodContents:",
  1148. category: 'accessing',
  1149. fn: function (aString){
  1150. var self=this;
  1151. return smalltalk.withContext(function($ctx1) {
  1152. var $1;
  1153. self["@methodContents"]=aString;
  1154. $1=self["@methodContents"];
  1155. return $1;
  1156. }, function($ctx1) {$ctx1.fill(self,"methodContents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  1157. args: ["aString"],
  1158. source: "methodContents: aString\x0a\x09^ methodContents := aString",
  1159. messageSends: [],
  1160. referencedClasses: []
  1161. }),
  1162. smalltalk.HLNavigationCodeWidget);
  1163. smalltalk.addMethod(
  1164. smalltalk.method({
  1165. selector: "previous",
  1166. category: 'accessing',
  1167. fn: function (){
  1168. var self=this;
  1169. return smalltalk.withContext(function($ctx1) {
  1170. return self}, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationCodeWidget)})},
  1171. args: [],
  1172. source: "previous\x0a\x09\x22for browser lists widget\x22",
  1173. messageSends: [],
  1174. referencedClasses: []
  1175. }),
  1176. smalltalk.HLNavigationCodeWidget);
  1177. smalltalk.addMethod(
  1178. smalltalk.method({
  1179. selector: "previous:",
  1180. category: 'accessing',
  1181. fn: function (aWidget){
  1182. var self=this;
  1183. return smalltalk.withContext(function($ctx1) {
  1184. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationCodeWidget)})},
  1185. args: ["aWidget"],
  1186. source: "previous: aWidget\x0a\x09\x22for browser lists widget\x22",
  1187. messageSends: [],
  1188. referencedClasses: []
  1189. }),
  1190. smalltalk.HLNavigationCodeWidget);
  1191. smalltalk.addMethod(
  1192. smalltalk.method({
  1193. selector: "canBeOpenAsTab",
  1194. category: 'testing',
  1195. fn: function (){
  1196. var self=this;
  1197. return smalltalk.withContext(function($ctx1) {
  1198. return false;
  1199. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLNavigationCodeWidget.klass)})},
  1200. args: [],
  1201. source: "canBeOpenAsTab\x0a\x09^ false",
  1202. messageSends: [],
  1203. referencedClasses: []
  1204. }),
  1205. smalltalk.HLNavigationCodeWidget.klass);
  1206. smalltalk.addMethod(
  1207. smalltalk.method({
  1208. selector: "on:",
  1209. category: 'instance creation',
  1210. fn: function (aBrowserModel){
  1211. var self=this;
  1212. return smalltalk.withContext(function($ctx1) {
  1213. var $2,$3,$1;
  1214. $2=_st(self)._new();
  1215. _st($2)._browserModel_(aBrowserModel);
  1216. $3=_st($2)._yourself();
  1217. $1=$3;
  1218. return $1;
  1219. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLNavigationCodeWidget.klass)})},
  1220. args: ["aBrowserModel"],
  1221. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1222. messageSends: ["browserModel:", "new", "yourself"],
  1223. referencedClasses: []
  1224. }),
  1225. smalltalk.HLNavigationCodeWidget.klass);
  1226. smalltalk.addClass('HLBrowserCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  1227. smalltalk.addMethod(
  1228. smalltalk.method({
  1229. selector: "browserModel",
  1230. category: 'accessing',
  1231. fn: function (){
  1232. var self=this;
  1233. return smalltalk.withContext(function($ctx1) {
  1234. var $1;
  1235. $1=self["@browserModel"];
  1236. return $1;
  1237. }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLSourceCodeWidget)})},
  1238. args: [],
  1239. source: "browserModel\x0a\x09^ browserModel",
  1240. messageSends: [],
  1241. referencedClasses: []
  1242. }),
  1243. smalltalk.HLBrowserCodeWidget);
  1244. smalltalk.addMethod(
  1245. smalltalk.method({
  1246. selector: "browserModel:",
  1247. category: 'accessing',
  1248. fn: function (aBrowserModel){
  1249. var self=this;
  1250. return smalltalk.withContext(function($ctx1) {
  1251. var $1,$2;
  1252. self["@browserModel"]=aBrowserModel;
  1253. $1=self;
  1254. _st($1)._observeSystem();
  1255. $2=_st($1)._observeBrowserModel();
  1256. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget)})},
  1257. args: ["aBrowserModel"],
  1258. source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x09self \x0a\x09\x09observeSystem;\x0a\x09\x09observeBrowserModel",
  1259. messageSends: ["observeSystem", "observeBrowserModel"],
  1260. referencedClasses: []
  1261. }),
  1262. smalltalk.HLBrowserCodeWidget);
  1263. smalltalk.addMethod(
  1264. smalltalk.method({
  1265. selector: "observeBrowserModel",
  1266. category: 'actions',
  1267. fn: function (){
  1268. var self=this;
  1269. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  1270. function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
  1271. function $HLSourceCodeSaved(){return smalltalk.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  1272. function $HLAboutToChange(){return smalltalk.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  1273. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  1274. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  1275. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  1276. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  1277. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1278. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1279. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1280. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1281. return smalltalk.withContext(function($ctx1) {
  1282. var $1,$2;
  1283. $1=_st(_st(self)._browserModel())._announcer();
  1284. _st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
  1285. _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
  1286. _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
  1287. _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
  1288. _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
  1289. _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
  1290. _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
  1291. _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
  1292. _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
  1293. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  1294. _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
  1295. $2=_st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
  1296. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLBrowserCodeWidget)})},
  1297. args: [],
  1298. 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 \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",
  1299. messageSends: ["on:send:to:", "announcer", "browserModel"],
  1300. referencedClasses: ["HLSaveSourceCode", "HLShowInstanceToggled", "HLSourceCodeSaved", "HLAboutToChange", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
  1301. }),
  1302. smalltalk.HLBrowserCodeWidget);
  1303. smalltalk.addMethod(
  1304. smalltalk.method({
  1305. selector: "observeSystem",
  1306. category: 'actions',
  1307. fn: function (){
  1308. var self=this;
  1309. function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  1310. return smalltalk.withContext(function($ctx1) {
  1311. _st(_st(_st(self)._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
  1312. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLBrowserCodeWidget)})},
  1313. args: [],
  1314. source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a \x09on: MethodModified\x0a send: #onMethodModified:\x0a\x09\x09to: self",
  1315. messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"],
  1316. referencedClasses: ["MethodModified"]
  1317. }),
  1318. smalltalk.HLBrowserCodeWidget);
  1319. smalltalk.addMethod(
  1320. smalltalk.method({
  1321. selector: "onBrowserAboutToChange:",
  1322. category: 'reactions',
  1323. fn: function (anAnnouncement){
  1324. var self=this;
  1325. var block;
  1326. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  1327. return smalltalk.withContext(function($ctx1) {
  1328. var $1;
  1329. block=_st(anAnnouncement)._actionBlock();
  1330. $1=_st(self)._hasModification();
  1331. if(smalltalk.assert($1)){
  1332. _st(self)._confirm_ifTrue_("Do you want to cancel changes?",(function(){
  1333. return smalltalk.withContext(function($ctx2) {
  1334. _st(self)._methodContents_(_st(self)._contents());
  1335. return _st(block)._value();
  1336. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1337. _st($HLChangeForbidden())._signal();
  1338. };
  1339. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},smalltalk.HLBrowserCodeWidget)})},
  1340. args: ["anAnnouncement"],
  1341. 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: 'Do you want to cancel 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 ]",
  1342. messageSends: ["actionBlock", "ifTrue:", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal", "hasModification"],
  1343. referencedClasses: ["HLChangeForbidden"]
  1344. }),
  1345. smalltalk.HLBrowserCodeWidget);
  1346. smalltalk.addMethod(
  1347. smalltalk.method({
  1348. selector: "onClassSelected:",
  1349. category: 'reactions',
  1350. fn: function (anAnnouncement){
  1351. var self=this;
  1352. var class_;
  1353. return smalltalk.withContext(function($ctx1) {
  1354. var $1,$2;
  1355. class_=_st(anAnnouncement)._item();
  1356. $1=class_;
  1357. if(($receiver = $1) == nil || $receiver == undefined){
  1358. $2=_st(self)._contents_("");
  1359. return $2;
  1360. } else {
  1361. $1;
  1362. };
  1363. _st(self)._contents_(_st(class_)._definition());
  1364. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLBrowserCodeWidget)})},
  1365. args: ["anAnnouncement"],
  1366. source: "onClassSelected: anAnnouncement\x0a\x09| class |\x0a\x09\x0a\x09class:= anAnnouncement item.\x0a\x09\x0a\x09class ifNil: [ ^ self contents: '' ].\x0a self contents: class definition",
  1367. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1368. referencedClasses: []
  1369. }),
  1370. smalltalk.HLBrowserCodeWidget);
  1371. smalltalk.addMethod(
  1372. smalltalk.method({
  1373. selector: "onCompileError:",
  1374. category: 'reactions',
  1375. fn: function (anAnnouncement){
  1376. var self=this;
  1377. return smalltalk.withContext(function($ctx1) {
  1378. _st(self)._alert_(_st(_st(anAnnouncement)._error())._messageText());
  1379. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1380. args: ["anAnnouncement"],
  1381. source: "onCompileError: anAnnouncement\x0a\x09self alert: anAnnouncement error messageText",
  1382. messageSends: ["alert:", "messageText", "error"],
  1383. referencedClasses: []
  1384. }),
  1385. smalltalk.HLBrowserCodeWidget);
  1386. smalltalk.addMethod(
  1387. smalltalk.method({
  1388. selector: "onInstVarAdded",
  1389. category: 'reactions',
  1390. fn: function (){
  1391. var self=this;
  1392. return smalltalk.withContext(function($ctx1) {
  1393. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1394. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLBrowserCodeWidget)})},
  1395. args: [],
  1396. source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
  1397. messageSends: ["save:", "contents", "browserModel"],
  1398. referencedClasses: []
  1399. }),
  1400. smalltalk.HLBrowserCodeWidget);
  1401. smalltalk.addMethod(
  1402. smalltalk.method({
  1403. selector: "onMethodModified:",
  1404. category: 'reactions',
  1405. fn: function (anAnnouncement){
  1406. var self=this;
  1407. var method;
  1408. return smalltalk.withContext(function($ctx1) {
  1409. var $1,$2,$3,$4,$5,$6;
  1410. method=_st(anAnnouncement)._method();
  1411. $1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(method)._methodClass());
  1412. if(! smalltalk.assert($1)){
  1413. $2=self;
  1414. return $2;
  1415. };
  1416. $3=_st(_st(self)._browserModel())._selectedMethod();
  1417. if(($receiver = $3) == nil || $receiver == undefined){
  1418. $4=self;
  1419. return $4;
  1420. } else {
  1421. $3;
  1422. };
  1423. $5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(method)._selector());
  1424. if(! smalltalk.assert($5)){
  1425. $6=self;
  1426. return $6;
  1427. };
  1428. _st(self)._refresh();
  1429. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1430. args: ["anAnnouncement"],
  1431. 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 self browserModel selectedMethod selector = method selector ifFalse: [ ^ self ].\x0a\x0a\x09self refresh",
  1432. messageSends: ["method", "ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"],
  1433. referencedClasses: []
  1434. }),
  1435. smalltalk.HLBrowserCodeWidget);
  1436. smalltalk.addMethod(
  1437. smalltalk.method({
  1438. selector: "onMethodSelected:",
  1439. category: 'reactions',
  1440. fn: function (anAnnouncement){
  1441. var self=this;
  1442. var method;
  1443. return smalltalk.withContext(function($ctx1) {
  1444. var $1,$2;
  1445. method=_st(anAnnouncement)._item();
  1446. $1=method;
  1447. if(($receiver = $1) == nil || $receiver == undefined){
  1448. $2=_st(self)._contents_("");
  1449. return $2;
  1450. } else {
  1451. $1;
  1452. };
  1453. _st(self)._contents_(_st(method)._source());
  1454. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1455. args: ["anAnnouncement"],
  1456. source: "onMethodSelected: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement item.\x0a\x09\x0a\x09method ifNil: [ ^ self contents: '' ].\x0a self contents: method source",
  1457. messageSends: ["item", "ifNil:", "contents:", "source"],
  1458. referencedClasses: []
  1459. }),
  1460. smalltalk.HLBrowserCodeWidget);
  1461. smalltalk.addMethod(
  1462. smalltalk.method({
  1463. selector: "onParseError:",
  1464. category: 'reactions',
  1465. fn: function (anAnnouncement){
  1466. var self=this;
  1467. var lineIndex,newContents;
  1468. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1469. return smalltalk.withContext(function($ctx1) {
  1470. var $1,$2,$3;
  1471. lineIndex=(1);
  1472. _st(self)._contents_(_st($String())._streamContents_((function(stream){
  1473. return smalltalk.withContext(function($ctx2) {
  1474. return _st(_st(self)._contents())._linesDo_((function(each){
  1475. return smalltalk.withContext(function($ctx3) {
  1476. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1477. if(smalltalk.assert($1)){
  1478. $2=stream;
  1479. _st($2)._nextPutAll_(_st(each)._copyFrom_to_((1),_st(anAnnouncement)._column()));
  1480. _st($2)._nextPutAll_("<- ");
  1481. _st($2)._nextPutAll_(_st(anAnnouncement)._message());
  1482. _st($2)._nextPutAll_(" ");
  1483. $3=_st($2)._nextPutAll_(_st(each)._copyFrom_to_(_st(_st(anAnnouncement)._column()).__plus((1)),_st(each)._size()));
  1484. $3;
  1485. } else {
  1486. _st(stream)._nextPutAll_(each);
  1487. };
  1488. _st(stream)._nextPutAll_(_st($String())._cr());
  1489. lineIndex=_st(lineIndex).__plus((1));
  1490. return lineIndex;
  1491. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1492. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1493. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
  1494. args: ["anAnnouncement"],
  1495. 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 ] ])",
  1496. messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"],
  1497. referencedClasses: ["String"]
  1498. }),
  1499. smalltalk.HLBrowserCodeWidget);
  1500. smalltalk.addMethod(
  1501. smalltalk.method({
  1502. selector: "onProtocolSelected:",
  1503. category: 'reactions',
  1504. fn: function (anAnnouncement){
  1505. var self=this;
  1506. return smalltalk.withContext(function($ctx1) {
  1507. var $1,$2;
  1508. $1=_st(_st(self)._browserModel())._selectedClass();
  1509. if(($receiver = $1) == nil || $receiver == undefined){
  1510. $2=_st(self)._contents_("");
  1511. return $2;
  1512. } else {
  1513. $1;
  1514. };
  1515. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1516. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1517. args: ["anAnnouncement"],
  1518. source: "onProtocolSelected: anAnnouncement\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a self contents: self browserModel selectedClass definition",
  1519. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
  1520. referencedClasses: []
  1521. }),
  1522. smalltalk.HLBrowserCodeWidget);
  1523. smalltalk.addMethod(
  1524. smalltalk.method({
  1525. selector: "onSaveIt",
  1526. category: 'reactions',
  1527. fn: function (){
  1528. var self=this;
  1529. return smalltalk.withContext(function($ctx1) {
  1530. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1531. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
  1532. args: [],
  1533. source: "onSaveIt\x0a\x09self browserModel save: self contents",
  1534. messageSends: ["save:", "contents", "browserModel"],
  1535. referencedClasses: []
  1536. }),
  1537. smalltalk.HLBrowserCodeWidget);
  1538. smalltalk.addMethod(
  1539. smalltalk.method({
  1540. selector: "onShowInstanceToggled",
  1541. category: 'reactions',
  1542. fn: function (){
  1543. var self=this;
  1544. return smalltalk.withContext(function($ctx1) {
  1545. var $1,$2;
  1546. $1=_st(_st(self)._browserModel())._selectedClass();
  1547. if(($receiver = $1) == nil || $receiver == undefined){
  1548. $2=_st(self)._contents_("");
  1549. return $2;
  1550. } else {
  1551. $1;
  1552. };
  1553. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1554. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},smalltalk.HLBrowserCodeWidget)})},
  1555. args: [],
  1556. source: "onShowInstanceToggled\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: self browserModel selectedClass definition",
  1557. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
  1558. referencedClasses: []
  1559. }),
  1560. smalltalk.HLBrowserCodeWidget);
  1561. smalltalk.addMethod(
  1562. smalltalk.method({
  1563. selector: "onSourceCodeFocusRequested",
  1564. category: 'reactions',
  1565. fn: function (){
  1566. var self=this;
  1567. return smalltalk.withContext(function($ctx1) {
  1568. _st(self)._focus();
  1569. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLSourceCodeWidget)})},
  1570. args: [],
  1571. source: "onSourceCodeFocusRequested\x0a\x09self focus",
  1572. messageSends: ["focus"],
  1573. referencedClasses: []
  1574. }),
  1575. smalltalk.HLBrowserCodeWidget);
  1576. smalltalk.addMethod(
  1577. smalltalk.method({
  1578. selector: "onSourceCodeSaved",
  1579. category: 'reactions',
  1580. fn: function (){
  1581. var self=this;
  1582. return smalltalk.withContext(function($ctx1) {
  1583. _st(self)._methodContents_(_st(self)._contents());
  1584. _st(self)._updateState();
  1585. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},smalltalk.HLBrowserCodeWidget)})},
  1586. args: [],
  1587. source: "onSourceCodeSaved\x0a\x09self methodContents: self contents.\x0a\x09self updateState",
  1588. messageSends: ["methodContents:", "contents", "updateState"],
  1589. referencedClasses: []
  1590. }),
  1591. smalltalk.HLBrowserCodeWidget);
  1592. smalltalk.addMethod(
  1593. smalltalk.method({
  1594. selector: "onUnknownVariableError:",
  1595. category: 'reactions',
  1596. fn: function (anAnnouncement){
  1597. var self=this;
  1598. var error;
  1599. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1600. return smalltalk.withContext(function($ctx1) {
  1601. var $1,$2;
  1602. error=_st(anAnnouncement)._error();
  1603. _st(self)._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1604. return smalltalk.withContext(function($ctx2) {
  1605. $1=stream;
  1606. _st($1)._nextPutAll_(_st(error)._messageText());
  1607. _st($1)._nextPutAll_(_st($String())._cr());
  1608. $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
  1609. return $2;
  1610. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})),(function(){
  1611. return smalltalk.withContext(function($ctx2) {
  1612. return _st(_st(self)._browserModel())._addInstVarNamed_(_st(error)._variableName());
  1613. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1614. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},smalltalk.HLBrowserCodeWidget)})},
  1615. args: ["anAnnouncement"],
  1616. 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 ]",
  1617. messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "variableName", "browserModel"],
  1618. referencedClasses: ["String"]
  1619. }),
  1620. smalltalk.HLBrowserCodeWidget);
  1621. smalltalk.addMethod(
  1622. smalltalk.method({
  1623. selector: "refresh",
  1624. category: 'actions',
  1625. fn: function (){
  1626. var self=this;
  1627. return smalltalk.withContext(function($ctx1) {
  1628. var $1,$2,$3,$4;
  1629. $1=_st(self)._hasModification();
  1630. if(smalltalk.assert($1)){
  1631. $2=self;
  1632. return $2;
  1633. };
  1634. $3=_st(self)._hasFocus();
  1635. if(smalltalk.assert($3)){
  1636. $4=self;
  1637. return $4;
  1638. };
  1639. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedMethod())._source());
  1640. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLBrowserCodeWidget)})},
  1641. args: [],
  1642. source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self browserModel selectedMethod source",
  1643. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"],
  1644. referencedClasses: []
  1645. }),
  1646. smalltalk.HLBrowserCodeWidget);
  1647. smalltalk.addMethod(
  1648. smalltalk.method({
  1649. selector: "renderButtonsOn:",
  1650. category: 'actions',
  1651. fn: function (html){
  1652. var self=this;
  1653. return smalltalk.withContext(function($ctx1) {
  1654. var $1,$2;
  1655. $1=_st(html)._button();
  1656. _st($1)._class_("button");
  1657. _st($1)._with_("SaveIt");
  1658. $2=_st($1)._onClick_((function(){
  1659. return smalltalk.withContext(function($ctx2) {
  1660. return _st(self)._saveIt();
  1661. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1662. smalltalk.HLNavigationCodeWidget.fn.prototype._renderButtonsOn_.apply(_st(self), [html]);
  1663. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLBrowserCodeWidget)})},
  1664. args: ["html"],
  1665. source: "renderButtonsOn: html\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'SaveIt';\x0a\x09\x09onClick: [ self saveIt ].\x0a\x09super renderButtonsOn: html",
  1666. messageSends: ["class:", "button", "with:", "onClick:", "saveIt", "renderButtonsOn:"],
  1667. referencedClasses: []
  1668. }),
  1669. smalltalk.HLBrowserCodeWidget);
  1670. smalltalk.addMethod(
  1671. smalltalk.method({
  1672. selector: "saveIt",
  1673. category: 'actions',
  1674. fn: function (){
  1675. var self=this;
  1676. return smalltalk.withContext(function($ctx1) {
  1677. _st(_st(self)._browserModel())._saveSourceCode();
  1678. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
  1679. args: [],
  1680. source: "saveIt\x0a\x09self browserModel saveSourceCode",
  1681. messageSends: ["saveSourceCode", "browserModel"],
  1682. referencedClasses: []
  1683. }),
  1684. smalltalk.HLBrowserCodeWidget);
  1685. smalltalk.addMethod(
  1686. smalltalk.method({
  1687. selector: "unregister",
  1688. category: 'actions',
  1689. fn: function (){
  1690. var self=this;
  1691. return smalltalk.withContext(function($ctx1) {
  1692. smalltalk.HLNavigationCodeWidget.fn.prototype._unregsiter.apply(_st(self), []);
  1693. _st(_st(_st(self)._browserModel())._announcer())._unsubscribe_(self);
  1694. _st(_st(_st(self)._browserModel())._systemAnnouncer())._unsubscribe_(self);
  1695. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLBrowserCodeWidget)})},
  1696. args: [],
  1697. source: "unregister\x0a\x09super unregsiter.\x0a\x09\x0a\x09self browserModel announcer unsubscribe: self.\x0a\x09self browserModel systemAnnouncer unsubscribe: self",
  1698. messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"],
  1699. referencedClasses: []
  1700. }),
  1701. smalltalk.HLBrowserCodeWidget);
  1702. smalltalk.addMethod(
  1703. smalltalk.method({
  1704. selector: "canBeOpenAsTab",
  1705. category: 'testing',
  1706. fn: function (){
  1707. var self=this;
  1708. return smalltalk.withContext(function($ctx1) {
  1709. return false;
  1710. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
  1711. args: [],
  1712. source: "canBeOpenAsTab\x0a\x09^ false",
  1713. messageSends: [],
  1714. referencedClasses: []
  1715. }),
  1716. smalltalk.HLBrowserCodeWidget.klass);
  1717. smalltalk.addMethod(
  1718. smalltalk.method({
  1719. selector: "on:",
  1720. category: 'instance creation',
  1721. fn: function (aBrowserModel){
  1722. var self=this;
  1723. return smalltalk.withContext(function($ctx1) {
  1724. var $2,$3,$1;
  1725. $2=_st(self)._new();
  1726. _st($2)._browserModel_(aBrowserModel);
  1727. $3=_st($2)._yourself();
  1728. $1=$3;
  1729. return $1;
  1730. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
  1731. args: ["aBrowserModel"],
  1732. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1733. messageSends: ["browserModel:", "new", "yourself"],
  1734. referencedClasses: []
  1735. }),
  1736. smalltalk.HLBrowserCodeWidget.klass);
  1737. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget'], 'Helios-Workspace');
  1738. smalltalk.addMethod(
  1739. smalltalk.method({
  1740. selector: "canHaveFocus",
  1741. category: 'testing',
  1742. fn: function (){
  1743. var self=this;
  1744. return smalltalk.withContext(function($ctx1) {
  1745. return true;
  1746. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
  1747. args: [],
  1748. source: "canHaveFocus\x0a\x09^ true",
  1749. messageSends: [],
  1750. referencedClasses: []
  1751. }),
  1752. smalltalk.HLWorkspace);
  1753. smalltalk.addMethod(
  1754. smalltalk.method({
  1755. selector: "codeWidget",
  1756. category: 'accessing',
  1757. fn: function (){
  1758. var self=this;
  1759. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  1760. return smalltalk.withContext(function($ctx1) {
  1761. var $2,$1;
  1762. $2=self["@codeWidget"];
  1763. if(($receiver = $2) == nil || $receiver == undefined){
  1764. self["@codeWidget"]=_st($HLCodeWidget())._new();
  1765. $1=self["@codeWidget"];
  1766. } else {
  1767. $1=$2;
  1768. };
  1769. return $1;
  1770. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
  1771. args: [],
  1772. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
  1773. messageSends: ["ifNil:", "new"],
  1774. referencedClasses: ["HLCodeWidget"]
  1775. }),
  1776. smalltalk.HLWorkspace);
  1777. smalltalk.addMethod(
  1778. smalltalk.method({
  1779. selector: "focus",
  1780. category: 'actions',
  1781. fn: function (){
  1782. var self=this;
  1783. return smalltalk.withContext(function($ctx1) {
  1784. var $1;
  1785. $1=_st(_st(self)._codeWidget())._focus();
  1786. return $1;
  1787. }, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
  1788. args: [],
  1789. source: "focus\x0a\x09^ self codeWidget focus",
  1790. messageSends: ["focus", "codeWidget"],
  1791. referencedClasses: []
  1792. }),
  1793. smalltalk.HLWorkspace);
  1794. smalltalk.addMethod(
  1795. smalltalk.method({
  1796. selector: "renderContentOn:",
  1797. category: 'rendering',
  1798. fn: function (html){
  1799. var self=this;
  1800. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  1801. return smalltalk.withContext(function($ctx1) {
  1802. _st(html)._with_(_st($HLContainer())._with_(_st(self)._codeWidget()));
  1803. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
  1804. args: ["html"],
  1805. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: self codeWidget)",
  1806. messageSends: ["with:", "codeWidget"],
  1807. referencedClasses: ["HLContainer"]
  1808. }),
  1809. smalltalk.HLWorkspace);
  1810. smalltalk.addMethod(
  1811. smalltalk.method({
  1812. selector: "canBeOpenAsTab",
  1813. category: 'testing',
  1814. fn: function (){
  1815. var self=this;
  1816. return smalltalk.withContext(function($ctx1) {
  1817. return true;
  1818. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
  1819. args: [],
  1820. source: "canBeOpenAsTab\x0a\x09^ true",
  1821. messageSends: [],
  1822. referencedClasses: []
  1823. }),
  1824. smalltalk.HLWorkspace.klass);
  1825. smalltalk.addMethod(
  1826. smalltalk.method({
  1827. selector: "tabLabel",
  1828. category: 'accessing',
  1829. fn: function (){
  1830. var self=this;
  1831. return smalltalk.withContext(function($ctx1) {
  1832. return "Workspace";
  1833. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
  1834. args: [],
  1835. source: "tabLabel\x0a\x09^ 'Workspace'",
  1836. messageSends: [],
  1837. referencedClasses: []
  1838. }),
  1839. smalltalk.HLWorkspace.klass);
  1840. smalltalk.addMethod(
  1841. smalltalk.method({
  1842. selector: "tabPriority",
  1843. category: 'accessing',
  1844. fn: function (){
  1845. var self=this;
  1846. return smalltalk.withContext(function($ctx1) {
  1847. var $1;
  1848. $1=(10);
  1849. return $1;
  1850. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
  1851. args: [],
  1852. source: "tabPriority\x0a\x09^ 10",
  1853. messageSends: [],
  1854. referencedClasses: []
  1855. }),
  1856. smalltalk.HLWorkspace.klass);