Helios-Workspace.js 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658
  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 (someCode){
  50. var self=this;
  51. return smalltalk.withContext(function($ctx1) {
  52. var $1;
  53. $1=_st(_st(self)._environment())._eval_on_(someCode,_st(self)._receiver());
  54. return $1;
  55. }, function($ctx1) {$ctx1.fill(self,"doIt:",{someCode:someCode},smalltalk.HLCodeModel)})},
  56. args: ["someCode"],
  57. source: "doIt: someCode\x0a\x0a\x09^ self environment eval: someCode 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: "subscribe:",
  141. category: 'actions',
  142. fn: function (aWidget){
  143. var self=this;
  144. return smalltalk.withContext(function($ctx1) {
  145. _st(aWidget)._subscribeTo_(_st(self)._announcer());
  146. return self}, function($ctx1) {$ctx1.fill(self,"subscribe:",{aWidget:aWidget},smalltalk.HLCodeModel)})},
  147. args: ["aWidget"],
  148. source: "subscribe: aWidget\x0a\x09aWidget subscribeTo: self announcer",
  149. messageSends: ["subscribeTo:", "announcer"],
  150. referencedClasses: []
  151. }),
  152. smalltalk.HLCodeModel);
  153. smalltalk.addMethod(
  154. smalltalk.method({
  155. selector: "on:",
  156. category: 'actions',
  157. fn: function (anEnvironment){
  158. var self=this;
  159. return smalltalk.withContext(function($ctx1) {
  160. var $2,$3,$1;
  161. $2=_st(self)._new();
  162. _st($2)._environment_(anEnvironment);
  163. $3=_st($2)._yourself();
  164. $1=$3;
  165. return $1;
  166. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel.klass)})},
  167. args: ["anEnvironment"],
  168. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  169. messageSends: ["environment:", "new", "yourself"],
  170. referencedClasses: []
  171. }),
  172. smalltalk.HLCodeModel.klass);
  173. smalltalk.addClass('HLCodeWidget', smalltalk.HLWidget, ['model', 'wrapper', 'code', 'editor'], 'Helios-Workspace');
  174. smalltalk.addMethod(
  175. smalltalk.method({
  176. selector: "announcer",
  177. category: 'accessing',
  178. fn: function (){
  179. var self=this;
  180. return smalltalk.withContext(function($ctx1) {
  181. var $1;
  182. $1=_st(_st(self)._model())._announcer();
  183. return $1;
  184. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeWidget)})},
  185. args: [],
  186. source: "announcer\x0a\x09^ self model announcer",
  187. messageSends: ["announcer", "model"],
  188. referencedClasses: []
  189. }),
  190. smalltalk.HLCodeWidget);
  191. smalltalk.addMethod(
  192. smalltalk.method({
  193. selector: "canHaveFocus",
  194. category: 'testing',
  195. fn: function (){
  196. var self=this;
  197. return smalltalk.withContext(function($ctx1) {
  198. return true;
  199. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLCodeWidget)})},
  200. args: [],
  201. source: "canHaveFocus\x0a\x09^ true",
  202. messageSends: [],
  203. referencedClasses: []
  204. }),
  205. smalltalk.HLCodeWidget);
  206. smalltalk.addMethod(
  207. smalltalk.method({
  208. selector: "clear",
  209. category: 'actions',
  210. fn: function (){
  211. var self=this;
  212. return smalltalk.withContext(function($ctx1) {
  213. _st(self)._contents_("");
  214. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLCodeWidget)})},
  215. args: [],
  216. source: "clear\x0a self contents: ''",
  217. messageSends: ["contents:"],
  218. referencedClasses: []
  219. }),
  220. smalltalk.HLCodeWidget);
  221. smalltalk.addMethod(
  222. smalltalk.method({
  223. selector: "configureEditor",
  224. category: 'actions',
  225. fn: function (){
  226. var self=this;
  227. return smalltalk.withContext(function($ctx1) {
  228. _st(_st(self)._editor())._at_put_("amberCodeWidget",self);
  229. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLCodeWidget)})},
  230. args: [],
  231. source: "configureEditor\x0a\x09self editor at: 'amberCodeWidget' put: self",
  232. messageSends: ["at:put:", "editor"],
  233. referencedClasses: []
  234. }),
  235. smalltalk.HLCodeWidget);
  236. smalltalk.addMethod(
  237. smalltalk.method({
  238. selector: "contents",
  239. category: 'accessing',
  240. fn: function (){
  241. var self=this;
  242. return smalltalk.withContext(function($ctx1) {
  243. var $1;
  244. $1=_st(self["@editor"])._getValue();
  245. return $1;
  246. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.HLCodeWidget)})},
  247. args: [],
  248. source: "contents\x0a\x09^ editor getValue",
  249. messageSends: ["getValue"],
  250. referencedClasses: []
  251. }),
  252. smalltalk.HLCodeWidget);
  253. smalltalk.addMethod(
  254. smalltalk.method({
  255. selector: "contents:",
  256. category: 'accessing',
  257. fn: function (aString){
  258. var self=this;
  259. return smalltalk.withContext(function($ctx1) {
  260. _st(self["@editor"])._setValue_(aString);
  261. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLCodeWidget)})},
  262. args: ["aString"],
  263. source: "contents: aString\x0a\x09editor setValue: aString",
  264. messageSends: ["setValue:"],
  265. referencedClasses: []
  266. }),
  267. smalltalk.HLCodeWidget);
  268. smalltalk.addMethod(
  269. smalltalk.method({
  270. selector: "currentLine",
  271. category: 'accessing',
  272. fn: function (){
  273. var self=this;
  274. return smalltalk.withContext(function($ctx1) {
  275. var $1;
  276. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  277. return $1;
  278. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},smalltalk.HLCodeWidget)})},
  279. args: [],
  280. source: "currentLine\x0a ^editor getLine: (editor getCursor line)",
  281. messageSends: ["getLine:", "line", "getCursor"],
  282. referencedClasses: []
  283. }),
  284. smalltalk.HLCodeWidget);
  285. smalltalk.addMethod(
  286. smalltalk.method({
  287. selector: "currentLineOrSelection",
  288. category: 'accessing',
  289. fn: function (){
  290. var self=this;
  291. return smalltalk.withContext(function($ctx1) {
  292. var $2,$1;
  293. $2=_st(self["@editor"])._somethingSelected();
  294. if(smalltalk.assert($2)){
  295. $1=_st(self)._selection();
  296. } else {
  297. $1=_st(self)._currentLine();
  298. };
  299. return $1;
  300. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},smalltalk.HLCodeWidget)})},
  301. args: [],
  302. source: "currentLineOrSelection\x0a ^editor somethingSelected\x0a\x09\x09ifFalse: [ self currentLine ]\x0a\x09\x09ifTrue: [ self selection ]",
  303. messageSends: ["ifFalse:ifTrue:", "currentLine", "selection", "somethingSelected"],
  304. referencedClasses: []
  305. }),
  306. smalltalk.HLCodeWidget);
  307. smalltalk.addMethod(
  308. smalltalk.method({
  309. selector: "doIt",
  310. category: 'actions',
  311. fn: function (){
  312. var self=this;
  313. var result;
  314. function $HLDoItRequested(){return smalltalk.HLDoItRequested||(typeof HLDoItRequested=="undefined"?nil:HLDoItRequested)}
  315. function $HLDoItExecuted(){return smalltalk.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
  316. return smalltalk.withContext(function($ctx1) {
  317. var $1;
  318. _st(_st(self)._announcer())._announce_(_st($HLDoItRequested())._on_(self["@model"]));
  319. result=_st(self["@model"])._doIt_(_st(self)._currentLineOrSelection());
  320. _st(_st(self)._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
  321. $1=result;
  322. return $1;
  323. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},smalltalk.HLCodeWidget)})},
  324. args: [],
  325. source: "doIt\x0a\x09| result |\x0a\x0a\x09self announcer announce: (HLDoItRequested on: model).\x0a\x0a\x09result:= model doIt: self currentLineOrSelection.\x0a\x0a\x09self announcer announce: (HLDoItExecuted on: model).\x0a\x0a\x09^ result ",
  326. messageSends: ["announce:", "on:", "announcer", "doIt:", "currentLineOrSelection"],
  327. referencedClasses: ["HLDoItRequested", "HLDoItExecuted"]
  328. }),
  329. smalltalk.HLCodeWidget);
  330. smalltalk.addMethod(
  331. smalltalk.method({
  332. selector: "editor",
  333. category: 'actions',
  334. fn: function (){
  335. var self=this;
  336. return smalltalk.withContext(function($ctx1) {
  337. var $1;
  338. $1=self["@editor"];
  339. return $1;
  340. }, function($ctx1) {$ctx1.fill(self,"editor",{},smalltalk.HLCodeWidget)})},
  341. args: [],
  342. source: "editor\x0a\x09^editor",
  343. messageSends: [],
  344. referencedClasses: []
  345. }),
  346. smalltalk.HLCodeWidget);
  347. smalltalk.addMethod(
  348. smalltalk.method({
  349. selector: "focus",
  350. category: 'actions',
  351. fn: function (){
  352. var self=this;
  353. return smalltalk.withContext(function($ctx1) {
  354. _st(self["@editor"])._focus();
  355. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLCodeWidget)})},
  356. args: [],
  357. source: "focus\x0a\x09editor focus",
  358. messageSends: ["focus"],
  359. referencedClasses: []
  360. }),
  361. smalltalk.HLCodeWidget);
  362. smalltalk.addMethod(
  363. smalltalk.method({
  364. selector: "hasFocus",
  365. category: 'testing',
  366. fn: function (){
  367. var self=this;
  368. return smalltalk.withContext(function($ctx1) {
  369. var $1;
  370. $1=_st(_st(self["@code"])._asJQuery())._is_(":active");
  371. return $1;
  372. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLCodeWidget)})},
  373. args: [],
  374. source: "hasFocus\x0a\x09^ code asJQuery is: ':active'",
  375. messageSends: ["is:", "asJQuery"],
  376. referencedClasses: []
  377. }),
  378. smalltalk.HLCodeWidget);
  379. smalltalk.addMethod(
  380. smalltalk.method({
  381. selector: "inspectIt",
  382. category: 'actions',
  383. fn: function (){
  384. var self=this;
  385. var newInspector;
  386. function $HLInspectItRequested(){return smalltalk.HLInspectItRequested||(typeof HLInspectItRequested=="undefined"?nil:HLInspectItRequested)}
  387. return smalltalk.withContext(function($ctx1) {
  388. _st(_st(self)._announcer())._announce_(_st($HLInspectItRequested())._on_(self["@model"]));
  389. newInspector=_st(self)._makeInspectorOn_(_st(self)._doIt());
  390. _st(newInspector)._open();
  391. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},smalltalk.HLCodeWidget)})},
  392. args: [],
  393. source: "inspectIt\x0a\x09| newInspector |\x0a \x0a\x09self announcer announce: (HLInspectItRequested on: model).\x0a\x09newInspector := self makeInspectorOn: self doIt.\x0a\x09newInspector open",
  394. messageSends: ["announce:", "on:", "announcer", "makeInspectorOn:", "doIt", "open"],
  395. referencedClasses: ["HLInspectItRequested"]
  396. }),
  397. smalltalk.HLCodeWidget);
  398. smalltalk.addMethod(
  399. smalltalk.method({
  400. selector: "makeInspectorOn:",
  401. category: 'actions',
  402. fn: function (anObject){
  403. var self=this;
  404. function $HLInspector(){return smalltalk.HLInspector||(typeof HLInspector=="undefined"?nil:HLInspector)}
  405. return smalltalk.withContext(function($ctx1) {
  406. var $2,$3,$1;
  407. $2=_st($HLInspector())._new();
  408. _st($2)._inspect_(anObject);
  409. $3=_st($2)._yourself();
  410. $1=$3;
  411. return $1;
  412. }, function($ctx1) {$ctx1.fill(self,"makeInspectorOn:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  413. args: ["anObject"],
  414. source: "makeInspectorOn: anObject\x0a\x0a\x09^ HLInspector new \x0a\x09\x09inspect: anObject;\x0a\x09\x09yourself",
  415. messageSends: ["inspect:", "new", "yourself"],
  416. referencedClasses: ["HLInspector"]
  417. }),
  418. smalltalk.HLCodeWidget);
  419. smalltalk.addMethod(
  420. smalltalk.method({
  421. selector: "messageHintFor:token:",
  422. category: 'hints',
  423. fn: function (anEditor,aToken){
  424. var self=this;
  425. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  426. return smalltalk.withContext(function($ctx1) {
  427. var $1;
  428. $1=_st(_st(_st(_st(_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value())._asSet())._asArray())._select_((function(each){
  429. return smalltalk.withContext(function($ctx2) {
  430. return _st(each)._includesSubString_(_st(aToken)._string());
  431. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  432. return smalltalk.withContext(function($ctx2) {
  433. return _st(each).__eq(_st(aToken)._string());
  434. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  435. return $1;
  436. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget)})},
  437. args: ["anEditor", "aToken"],
  438. 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 ]",
  439. messageSends: ["reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", "value", "at:", "current"],
  440. referencedClasses: ["Smalltalk"]
  441. }),
  442. smalltalk.HLCodeWidget);
  443. smalltalk.addMethod(
  444. smalltalk.method({
  445. selector: "model",
  446. category: 'accessing',
  447. fn: function (){
  448. var self=this;
  449. function $HLCodeModel(){return smalltalk.HLCodeModel||(typeof HLCodeModel=="undefined"?nil:HLCodeModel)}
  450. return smalltalk.withContext(function($ctx1) {
  451. var $2,$1;
  452. $2=self["@model"];
  453. if(($receiver = $2) == nil || $receiver == undefined){
  454. self["@model"]=_st($HLCodeModel())._new();
  455. $1=self["@model"];
  456. } else {
  457. $1=$2;
  458. };
  459. return $1;
  460. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLCodeWidget)})},
  461. args: [],
  462. source: "model\x0a\x09^ model ifNil: [ model := HLCodeModel new ]",
  463. messageSends: ["ifNil:", "new"],
  464. referencedClasses: ["HLCodeModel"]
  465. }),
  466. smalltalk.HLCodeWidget);
  467. smalltalk.addMethod(
  468. smalltalk.method({
  469. selector: "model:",
  470. category: 'accessing',
  471. fn: function (aModel){
  472. var self=this;
  473. return smalltalk.withContext(function($ctx1) {
  474. self["@model"]=aModel;
  475. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLCodeWidget)})},
  476. args: ["aModel"],
  477. source: "model: aModel\x0a\x09model := aModel",
  478. messageSends: [],
  479. referencedClasses: []
  480. }),
  481. smalltalk.HLCodeWidget);
  482. smalltalk.addMethod(
  483. smalltalk.method({
  484. selector: "onDoIt",
  485. category: 'reactions',
  486. fn: function (){
  487. var self=this;
  488. return smalltalk.withContext(function($ctx1) {
  489. _st(self)._doIt();
  490. return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{},smalltalk.HLCodeWidget)})},
  491. args: [],
  492. source: "onDoIt\x0a\x09\x0a self doIt",
  493. messageSends: ["doIt"],
  494. referencedClasses: []
  495. }),
  496. smalltalk.HLCodeWidget);
  497. smalltalk.addMethod(
  498. smalltalk.method({
  499. selector: "onInspectIt",
  500. category: 'reactions',
  501. fn: function (){
  502. var self=this;
  503. return smalltalk.withContext(function($ctx1) {
  504. _st(self)._inspectIt();
  505. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},smalltalk.HLCodeWidget)})},
  506. args: [],
  507. source: "onInspectIt\x0a\x0a\x09self inspectIt",
  508. messageSends: ["inspectIt"],
  509. referencedClasses: []
  510. }),
  511. smalltalk.HLCodeWidget);
  512. smalltalk.addMethod(
  513. smalltalk.method({
  514. selector: "onPrintIt",
  515. category: 'reactions',
  516. fn: function (){
  517. var self=this;
  518. return smalltalk.withContext(function($ctx1) {
  519. _st(self)._printIt();
  520. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},smalltalk.HLCodeWidget)})},
  521. args: [],
  522. source: "onPrintIt\x0a\x0a\x09self printIt",
  523. messageSends: ["printIt"],
  524. referencedClasses: []
  525. }),
  526. smalltalk.HLCodeWidget);
  527. smalltalk.addMethod(
  528. smalltalk.method({
  529. selector: "onSaveIt",
  530. category: 'reactions',
  531. fn: function (){
  532. var self=this;
  533. return smalltalk.withContext(function($ctx1) {
  534. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLCodeWidget)})},
  535. args: [],
  536. source: "onSaveIt\x0a\x09\x22I do not do anything\x22",
  537. messageSends: [],
  538. referencedClasses: []
  539. }),
  540. smalltalk.HLCodeWidget);
  541. smalltalk.addMethod(
  542. smalltalk.method({
  543. selector: "print:",
  544. category: 'actions',
  545. fn: function (aString){
  546. var self=this;
  547. var start,stop,currentLine;
  548. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  549. return smalltalk.withContext(function($ctx1) {
  550. currentLine=_st(_st(self["@editor"])._getCursor_(false))._line();
  551. start=_st($HashedCollection())._new();
  552. _st(start)._at_put_("line",currentLine);
  553. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getCursor_(false))._ch());
  554. _st(_st(self["@editor"])._getSelection())._ifEmpty_((function(){
  555. return smalltalk.withContext(function($ctx2) {
  556. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getLine_(currentLine))._size());
  557. return _st(self["@editor"])._setSelection_end_(smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(currentLine),_st("ch").__minus_gt((0))]),start);
  558. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  559. stop=_st($HashedCollection())._new();
  560. _st(stop)._at_put_("line",currentLine);
  561. _st(stop)._at_put_("ch",_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2)));
  562. _st(self["@editor"])._replaceSelection_(_st(_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString)).__comma(" "));
  563. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  564. _st(self["@editor"])._setSelection_end_(stop,start);
  565. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},smalltalk.HLCodeWidget)})},
  566. args: ["aString"],
  567. 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",
  568. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "size", "getLine:", "setSelection:end:", "->", "getSelection", "+", "at:", "replaceSelection:", ",", "setCursor:"],
  569. referencedClasses: ["HashedCollection"]
  570. }),
  571. smalltalk.HLCodeWidget);
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "printIt",
  575. category: 'actions',
  576. fn: function (){
  577. var self=this;
  578. var result;
  579. function $HLPrintItRequested(){return smalltalk.HLPrintItRequested||(typeof HLPrintItRequested=="undefined"?nil:HLPrintItRequested)}
  580. return smalltalk.withContext(function($ctx1) {
  581. result=_st(self)._doIt();
  582. _st(_st(self)._announcer())._announce_(_st($HLPrintItRequested())._on_(self["@model"]));
  583. _st(self)._print_(_st(result)._printString());
  584. _st(self)._focus();
  585. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{result:result},smalltalk.HLCodeWidget)})},
  586. args: [],
  587. source: "printIt\x0a\x09| result |\x0a\x0a\x09result:= self doIt.\x0a \x0a\x09self announcer announce: (HLPrintItRequested on: model).\x0a\x0a self print: result printString.\x0a\x09self focus.",
  588. messageSends: ["doIt", "announce:", "on:", "announcer", "print:", "printString", "focus"],
  589. referencedClasses: ["HLPrintItRequested"]
  590. }),
  591. smalltalk.HLCodeWidget);
  592. smalltalk.addMethod(
  593. smalltalk.method({
  594. selector: "receiver",
  595. category: 'accessing',
  596. fn: function (){
  597. var self=this;
  598. return smalltalk.withContext(function($ctx1) {
  599. var $1;
  600. $1=_st(_st(self)._model())._receiver();
  601. return $1;
  602. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeWidget)})},
  603. args: [],
  604. source: "receiver\x0a\x09^ self model receiver",
  605. messageSends: ["receiver", "model"],
  606. referencedClasses: []
  607. }),
  608. smalltalk.HLCodeWidget);
  609. smalltalk.addMethod(
  610. smalltalk.method({
  611. selector: "receiver:",
  612. category: 'accessing',
  613. fn: function (anObject){
  614. var self=this;
  615. return smalltalk.withContext(function($ctx1) {
  616. _st(_st(self)._model())._receiver_(anObject);
  617. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  618. args: ["anObject"],
  619. source: "receiver: anObject\x0a\x09self model receiver: anObject",
  620. messageSends: ["receiver:", "model"],
  621. referencedClasses: []
  622. }),
  623. smalltalk.HLCodeWidget);
  624. smalltalk.addMethod(
  625. smalltalk.method({
  626. selector: "renderContentOn:",
  627. category: 'rendering',
  628. fn: function (html){
  629. var self=this;
  630. return smalltalk.withContext(function($ctx1) {
  631. self["@code"]=_st(html)._textarea();
  632. _st(self)._setEditorOn_(_st(self["@code"])._element());
  633. _st(self)._configureEditor();
  634. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLCodeWidget)})},
  635. args: ["html"],
  636. source: "renderContentOn: html\x0a code := html textarea.\x0a self setEditorOn: code element.\x0a self configureEditor",
  637. messageSends: ["textarea", "setEditorOn:", "element", "configureEditor"],
  638. referencedClasses: []
  639. }),
  640. smalltalk.HLCodeWidget);
  641. smalltalk.addMethod(
  642. smalltalk.method({
  643. selector: "saveIt",
  644. category: 'actions',
  645. fn: function (){
  646. var self=this;
  647. return smalltalk.withContext(function($ctx1) {
  648. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLCodeWidget)})},
  649. args: [],
  650. source: "saveIt\x0a\x09\x22I do not do anything\x22",
  651. messageSends: [],
  652. referencedClasses: []
  653. }),
  654. smalltalk.HLCodeWidget);
  655. smalltalk.addMethod(
  656. smalltalk.method({
  657. selector: "selection",
  658. category: 'accessing',
  659. fn: function (){
  660. var self=this;
  661. return smalltalk.withContext(function($ctx1) {
  662. var $1;
  663. $1=_st(self["@editor"])._getSelection();
  664. return $1;
  665. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.HLCodeWidget)})},
  666. args: [],
  667. source: "selection\x0a\x09^editor getSelection",
  668. messageSends: ["getSelection"],
  669. referencedClasses: []
  670. }),
  671. smalltalk.HLCodeWidget);
  672. smalltalk.addMethod(
  673. smalltalk.method({
  674. selector: "selectionEnd",
  675. category: 'accessing',
  676. fn: function (){
  677. var self=this;
  678. return smalltalk.withContext(function($ctx1) {
  679. var $1;
  680. $1=_st(_st(self["@code"])._element())._selectionEnd();
  681. return $1;
  682. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},smalltalk.HLCodeWidget)})},
  683. args: [],
  684. source: "selectionEnd\x0a ^code element selectionEnd",
  685. messageSends: ["selectionEnd", "element"],
  686. referencedClasses: []
  687. }),
  688. smalltalk.HLCodeWidget);
  689. smalltalk.addMethod(
  690. smalltalk.method({
  691. selector: "selectionEnd:",
  692. category: 'accessing',
  693. fn: function (anInteger){
  694. var self=this;
  695. return smalltalk.withContext(function($ctx1) {
  696. _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  697. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  698. args: ["anInteger"],
  699. source: "selectionEnd: anInteger\x0a code element selectionEnd: anInteger",
  700. messageSends: ["selectionEnd:", "element"],
  701. referencedClasses: []
  702. }),
  703. smalltalk.HLCodeWidget);
  704. smalltalk.addMethod(
  705. smalltalk.method({
  706. selector: "selectionStart",
  707. category: 'accessing',
  708. fn: function (){
  709. var self=this;
  710. return smalltalk.withContext(function($ctx1) {
  711. var $1;
  712. $1=_st(_st(self["@code"])._element())._selectionStart();
  713. return $1;
  714. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},smalltalk.HLCodeWidget)})},
  715. args: [],
  716. source: "selectionStart\x0a ^code element selectionStart",
  717. messageSends: ["selectionStart", "element"],
  718. referencedClasses: []
  719. }),
  720. smalltalk.HLCodeWidget);
  721. smalltalk.addMethod(
  722. smalltalk.method({
  723. selector: "selectionStart:",
  724. category: 'accessing',
  725. fn: function (anInteger){
  726. var self=this;
  727. return smalltalk.withContext(function($ctx1) {
  728. _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  729. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  730. args: ["anInteger"],
  731. source: "selectionStart: anInteger\x0a code element selectionStart: anInteger",
  732. messageSends: ["selectionStart:", "element"],
  733. referencedClasses: []
  734. }),
  735. smalltalk.HLCodeWidget);
  736. smalltalk.addMethod(
  737. smalltalk.method({
  738. selector: "setEditorOn:",
  739. category: 'actions',
  740. fn: function (aTextarea){
  741. var self=this;
  742. return smalltalk.withContext(function($ctx1) {
  743. self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
  744. theme: 'amber',
  745. lineNumbers: true,
  746. enterMode: 'flat',
  747. indentWithTabs: true,
  748. indentUnit: 4,
  749. matchBrackets: true,
  750. electricChars: false,
  751. keyMap: 'Amber',
  752. extraKeys: {"Shift-Space": "autocomplete"}
  753. });
  754. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},smalltalk.HLCodeWidget)})},
  755. args: ["aTextarea"],
  756. 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: false,\x0a\x09\x09\x09\x09keyMap: 'Amber',\x0a\x09\x09\x09\x09extraKeys: {\x22Shift-Space\x22: \x22autocomplete\x22}\x0a\x09})>",
  757. messageSends: [],
  758. referencedClasses: []
  759. }),
  760. smalltalk.HLCodeWidget);
  761. smalltalk.addMethod(
  762. smalltalk.method({
  763. selector: "variableHintFor:token:",
  764. category: 'hints',
  765. fn: function (anEditor,aToken){
  766. var self=this;
  767. var variables,classNames,pseudoVariables;
  768. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  769. return smalltalk.withContext(function($ctx1) {
  770. var $1;
  771. variables=_st(_st(_st(_st(window)._jQuery_(_st(_st(anEditor)._display())._wrapper()))._find_("span.cm-variable"))._get())._collect_((function(each){
  772. return smalltalk.withContext(function($ctx2) {
  773. return _st(_st(window)._jQuery_(each))._html();
  774. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  775. classNames=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  776. return smalltalk.withContext(function($ctx2) {
  777. return _st(each)._name();
  778. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  779. pseudoVariables=_st(_st($Smalltalk())._current())._pseudoVariableNames();
  780. $1=_st(_st(_st(_st(_st(_st(variables).__comma(classNames)).__comma(pseudoVariables))._asSet())._asArray())._select_((function(each){
  781. return smalltalk.withContext(function($ctx2) {
  782. return _st(each)._includesSubString_(_st(aToken)._string());
  783. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  784. return smalltalk.withContext(function($ctx2) {
  785. return _st(each).__eq(_st(aToken)._string());
  786. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  787. return $1;
  788. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},smalltalk.HLCodeWidget)})},
  789. args: ["anEditor", "aToken"],
  790. 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 ]",
  791. messageSends: ["collect:", "html", "jQuery:", "get", "find:", "wrapper", "display", "name", "classes", "current", "pseudoVariableNames", "reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", ","],
  792. referencedClasses: ["Smalltalk"]
  793. }),
  794. smalltalk.HLCodeWidget);
  795. smalltalk.addMethod(
  796. smalltalk.method({
  797. selector: "canBeOpenAsTab",
  798. category: 'testing',
  799. fn: function (){
  800. var self=this;
  801. return smalltalk.withContext(function($ctx1) {
  802. return true;
  803. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLCodeWidget.klass)})},
  804. args: [],
  805. source: "canBeOpenAsTab\x0a\x09^ true",
  806. messageSends: [],
  807. referencedClasses: []
  808. }),
  809. smalltalk.HLCodeWidget.klass);
  810. smalltalk.addMethod(
  811. smalltalk.method({
  812. selector: "hintFor:options:",
  813. category: 'hints',
  814. fn: function (anEditor,options){
  815. var self=this;
  816. var cursor,token,completions;
  817. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  818. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  819. return smalltalk.withContext(function($ctx1) {
  820. var $1,$2;
  821. cursor=_st(anEditor)._getCursor();
  822. token=_st(anEditor)._getTokenAt_(cursor);
  823. _st(token)._at_put_("state",_st(_st(_st($CodeMirror())._basicAt_("innerMode"))._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state")))._state());
  824. $1=_st(_st(token)._type()).__eq("variable");
  825. if(smalltalk.assert($1)){
  826. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  827. } else {
  828. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  829. };
  830. $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()))]);
  831. return $2;
  832. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},smalltalk.HLCodeWidget.klass)})},
  833. args: ["anEditor", "options"],
  834. 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}",
  835. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "getMode", "at:", "basicAt:", "ifTrue:ifFalse:", "variableHintFor:token:", "messageHintFor:token:", "=", "type", "->", "line", "end", "start"],
  836. referencedClasses: ["CodeMirror", "HLCodeWidget"]
  837. }),
  838. smalltalk.HLCodeWidget.klass);
  839. smalltalk.addMethod(
  840. smalltalk.method({
  841. selector: "initialize",
  842. category: 'initialization',
  843. fn: function (){
  844. var self=this;
  845. return smalltalk.withContext(function($ctx1) {
  846. var $1,$2;
  847. smalltalk.HLWidget.klass.fn.prototype._initialize.apply(_st(self), []);
  848. $1=self;
  849. _st($1)._setupCodeMirror();
  850. _st($1)._setupCommands();
  851. $2=_st($1)._setupKeyMaps();
  852. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLCodeWidget.klass)})},
  853. args: [],
  854. source: "initialize\x0a\x09super initialize.\x0a\x09self \x0a\x09\x09setupCodeMirror;\x0a\x09\x09setupCommands;\x0a\x09\x09setupKeyMaps.",
  855. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"],
  856. referencedClasses: []
  857. }),
  858. smalltalk.HLCodeWidget.klass);
  859. smalltalk.addMethod(
  860. smalltalk.method({
  861. selector: "keyMap",
  862. category: 'accessing',
  863. fn: function (){
  864. var self=this;
  865. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  866. return smalltalk.withContext(function($ctx1) {
  867. var $2,$1;
  868. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  869. if(smalltalk.assert($2)){
  870. $1=_st(self)._macKeyMap();
  871. } else {
  872. $1=_st(self)._pcKeyMap();
  873. };
  874. return $1;
  875. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},smalltalk.HLCodeWidget.klass)})},
  876. args: [],
  877. source: "keyMap\x0a\x09^ HLManager current keyBinder systemIsMac\x0a\x09\x09ifTrue: [ self macKeyMap ]\x0a\x09\x09ifFalse: [ self pcKeyMap ]",
  878. messageSends: ["ifTrue:ifFalse:", "macKeyMap", "pcKeyMap", "systemIsMac", "keyBinder", "current"],
  879. referencedClasses: ["HLManager"]
  880. }),
  881. smalltalk.HLCodeWidget.klass);
  882. smalltalk.addMethod(
  883. smalltalk.method({
  884. selector: "macKeyMap",
  885. category: 'accessing',
  886. fn: function (){
  887. var self=this;
  888. return smalltalk.withContext(function($ctx1) {
  889. var $1;
  890. $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"])]);
  891. return $1;
  892. }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  893. args: [],
  894. 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 }",
  895. messageSends: ["->"],
  896. referencedClasses: []
  897. }),
  898. smalltalk.HLCodeWidget.klass);
  899. smalltalk.addMethod(
  900. smalltalk.method({
  901. selector: "messageHintFor:token:",
  902. category: 'hints',
  903. fn: function (anEditor,aToken){
  904. var self=this;
  905. return smalltalk.withContext(function($ctx1) {
  906. var $1;
  907. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  908. return $1;
  909. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  910. args: ["anEditor", "aToken"],
  911. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09messageHintFor: anEditor token: aToken",
  912. messageSends: ["messageHintFor:token:", "at:"],
  913. referencedClasses: []
  914. }),
  915. smalltalk.HLCodeWidget.klass);
  916. smalltalk.addMethod(
  917. smalltalk.method({
  918. selector: "pcKeyMap",
  919. category: 'accessing',
  920. fn: function (){
  921. var self=this;
  922. return smalltalk.withContext(function($ctx1) {
  923. var $1;
  924. $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"])];
  925. return $1;
  926. }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  927. args: [],
  928. 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}",
  929. messageSends: ["->"],
  930. referencedClasses: []
  931. }),
  932. smalltalk.HLCodeWidget.klass);
  933. smalltalk.addMethod(
  934. smalltalk.method({
  935. selector: "setupCodeMirror",
  936. category: 'initialization',
  937. fn: function (){
  938. var self=this;
  939. return smalltalk.withContext(function($ctx1) {
  940. CodeMirror.keyMap.default.fallthrough = ["basic"];
  941. CodeMirror.commands.autocomplete = function(cm) {
  942. CodeMirror.showHint(cm, self._hintFor_options_);
  943. }
  944. ;
  945. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.HLCodeWidget.klass)})},
  946. args: [],
  947. 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>",
  948. messageSends: [],
  949. referencedClasses: []
  950. }),
  951. smalltalk.HLCodeWidget.klass);
  952. smalltalk.addMethod(
  953. smalltalk.method({
  954. selector: "setupCommands",
  955. category: 'initialization',
  956. fn: function (){
  957. var self=this;
  958. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  959. return smalltalk.withContext(function($ctx1) {
  960. var $1,$2;
  961. $1=_st($CodeMirror())._basicAt_("commands");
  962. _st($1)._at_put_("doIt",(function(cm){
  963. return smalltalk.withContext(function($ctx2) {
  964. return _st(_st(cm)._amberCodeWidget())._doIt();
  965. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  966. _st($1)._at_put_("inspectIt",(function(cm){
  967. return smalltalk.withContext(function($ctx2) {
  968. return _st(_st(cm)._amberCodeWidget())._inspectIt();
  969. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  970. _st($1)._at_put_("printIt",(function(cm){
  971. return smalltalk.withContext(function($ctx2) {
  972. return _st(_st(cm)._amberCodeWidget())._printIt();
  973. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  974. $2=_st($1)._at_put_("saveIt",(function(cm){
  975. return smalltalk.withContext(function($ctx2) {
  976. return _st(_st(cm)._amberCodeWidget())._saveIt();
  977. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  978. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},smalltalk.HLCodeWidget.klass)})},
  979. args: [],
  980. 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 ]",
  981. messageSends: ["at:put:", "doIt", "amberCodeWidget", "basicAt:", "inspectIt", "printIt", "saveIt"],
  982. referencedClasses: ["CodeMirror"]
  983. }),
  984. smalltalk.HLCodeWidget.klass);
  985. smalltalk.addMethod(
  986. smalltalk.method({
  987. selector: "setupKeyMaps",
  988. category: 'initialization',
  989. fn: function (){
  990. var self=this;
  991. return smalltalk.withContext(function($ctx1) {
  992. CodeMirror.keyMap['Amber'] = self._keyMap();
  993. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},smalltalk.HLCodeWidget.klass)})},
  994. args: [],
  995. source: "setupKeyMaps\x0a\x09<CodeMirror.keyMap['Amber'] = self._keyMap()>",
  996. messageSends: [],
  997. referencedClasses: []
  998. }),
  999. smalltalk.HLCodeWidget.klass);
  1000. smalltalk.addMethod(
  1001. smalltalk.method({
  1002. selector: "tabLabel",
  1003. category: 'accessing',
  1004. fn: function (){
  1005. var self=this;
  1006. return smalltalk.withContext(function($ctx1) {
  1007. return "Workspace";
  1008. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLCodeWidget.klass)})},
  1009. args: [],
  1010. source: "tabLabel\x0a\x09^ 'Workspace'",
  1011. messageSends: [],
  1012. referencedClasses: []
  1013. }),
  1014. smalltalk.HLCodeWidget.klass);
  1015. smalltalk.addMethod(
  1016. smalltalk.method({
  1017. selector: "tabPriority",
  1018. category: 'accessing',
  1019. fn: function (){
  1020. var self=this;
  1021. return smalltalk.withContext(function($ctx1) {
  1022. var $1;
  1023. $1=(10);
  1024. return $1;
  1025. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLCodeWidget.klass)})},
  1026. args: [],
  1027. source: "tabPriority\x0a\x09^ 10",
  1028. messageSends: [],
  1029. referencedClasses: []
  1030. }),
  1031. smalltalk.HLCodeWidget.klass);
  1032. smalltalk.addMethod(
  1033. smalltalk.method({
  1034. selector: "variableHintFor:token:",
  1035. category: 'hints',
  1036. fn: function (anEditor,aToken){
  1037. var self=this;
  1038. return smalltalk.withContext(function($ctx1) {
  1039. var $1;
  1040. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  1041. return $1;
  1042. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  1043. args: ["anEditor", "aToken"],
  1044. source: "variableHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09variableHintFor: anEditor token: aToken",
  1045. messageSends: ["variableHintFor:token:", "at:"],
  1046. referencedClasses: []
  1047. }),
  1048. smalltalk.HLCodeWidget.klass);
  1049. smalltalk.addClass('HLSourceCodeWidget', smalltalk.HLCodeWidget, ['browserModel', 'methodContents'], 'Helios-Workspace');
  1050. smalltalk.addMethod(
  1051. smalltalk.method({
  1052. selector: "browserModel",
  1053. category: 'accessing',
  1054. fn: function (){
  1055. var self=this;
  1056. return smalltalk.withContext(function($ctx1) {
  1057. var $1;
  1058. $1=self["@browserModel"];
  1059. return $1;
  1060. }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLSourceCodeWidget)})},
  1061. args: [],
  1062. source: "browserModel\x0a\x09^ browserModel",
  1063. messageSends: [],
  1064. referencedClasses: []
  1065. }),
  1066. smalltalk.HLSourceCodeWidget);
  1067. smalltalk.addMethod(
  1068. smalltalk.method({
  1069. selector: "browserModel:",
  1070. category: 'accessing',
  1071. fn: function (aBrowserModel){
  1072. var self=this;
  1073. return smalltalk.withContext(function($ctx1) {
  1074. var $1,$2;
  1075. self["@browserModel"]=aBrowserModel;
  1076. $1=self;
  1077. _st($1)._observeSystem();
  1078. $2=_st($1)._observeBrowserModel();
  1079. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget)})},
  1080. args: ["aBrowserModel"],
  1081. source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x09self \x0a\x09\x09observeSystem;\x0a\x09\x09observeBrowserModel",
  1082. messageSends: ["observeSystem", "observeBrowserModel"],
  1083. referencedClasses: []
  1084. }),
  1085. smalltalk.HLSourceCodeWidget);
  1086. smalltalk.addMethod(
  1087. smalltalk.method({
  1088. selector: "hasModification",
  1089. category: 'testing',
  1090. fn: function (){
  1091. var self=this;
  1092. return smalltalk.withContext(function($ctx1) {
  1093. var $1;
  1094. $1=_st(_st(_st(self)._methodContents()).__eq(_st(self)._contents()))._not();
  1095. return $1;
  1096. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLSourceCodeWidget)})},
  1097. args: [],
  1098. source: "hasModification\x0a\x09^ (self methodContents = self contents) not",
  1099. messageSends: ["not", "=", "contents", "methodContents"],
  1100. referencedClasses: []
  1101. }),
  1102. smalltalk.HLSourceCodeWidget);
  1103. smalltalk.addMethod(
  1104. smalltalk.method({
  1105. selector: "methodContents",
  1106. category: 'accessing',
  1107. fn: function (){
  1108. var self=this;
  1109. return smalltalk.withContext(function($ctx1) {
  1110. var $1;
  1111. $1=self["@methodContents"];
  1112. return $1;
  1113. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},smalltalk.HLSourceCodeWidget)})},
  1114. args: [],
  1115. source: "methodContents\x0a\x09^ methodContents",
  1116. messageSends: [],
  1117. referencedClasses: []
  1118. }),
  1119. smalltalk.HLSourceCodeWidget);
  1120. smalltalk.addMethod(
  1121. smalltalk.method({
  1122. selector: "methodContents:",
  1123. category: 'accessing',
  1124. fn: function (aString){
  1125. var self=this;
  1126. return smalltalk.withContext(function($ctx1) {
  1127. self["@methodContents"]=aString;
  1128. return self}, function($ctx1) {$ctx1.fill(self,"methodContents:",{aString:aString},smalltalk.HLSourceCodeWidget)})},
  1129. args: ["aString"],
  1130. source: "methodContents: aString\x0a\x09methodContents := aString",
  1131. messageSends: [],
  1132. referencedClasses: []
  1133. }),
  1134. smalltalk.HLSourceCodeWidget);
  1135. smalltalk.addMethod(
  1136. smalltalk.method({
  1137. selector: "observeBrowserModel",
  1138. category: 'actions',
  1139. fn: function (){
  1140. var self=this;
  1141. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  1142. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  1143. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  1144. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  1145. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  1146. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1147. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1148. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1149. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1150. return smalltalk.withContext(function($ctx1) {
  1151. var $1,$2;
  1152. $1=_st(_st(self)._browserModel())._announcer();
  1153. _st($1)._on_do_($HLSaveSourceCode(),(function(ann){
  1154. return smalltalk.withContext(function($ctx2) {
  1155. return _st(self)._onSaveIt();
  1156. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1157. _st($1)._on_do_($HLParseErrorRaised(),(function(ann){
  1158. return smalltalk.withContext(function($ctx2) {
  1159. return _st(self)._onParseError_(ann);
  1160. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1161. _st($1)._on_do_($HLCompileErrorRaised(),(function(ann){
  1162. return smalltalk.withContext(function($ctx2) {
  1163. return _st(self)._onCompileError_(_st(ann)._error());
  1164. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1165. _st($1)._on_do_($HLUnknownVariableErrorRaised(),(function(ann){
  1166. return smalltalk.withContext(function($ctx2) {
  1167. return _st(self)._onUnknownVariableError_(_st(ann)._error());
  1168. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1169. _st($1)._on_do_($HLInstVarAdded(),(function(ann){
  1170. return smalltalk.withContext(function($ctx2) {
  1171. return _st(self)._onInstVarAdded();
  1172. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1173. _st($1)._on_do_($HLMethodSelected(),(function(ann){
  1174. return smalltalk.withContext(function($ctx2) {
  1175. return _st(self)._onMethodSelected_(_st(ann)._item());
  1176. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1177. _st($1)._on_do_($HLClassSelected(),(function(ann){
  1178. return smalltalk.withContext(function($ctx2) {
  1179. return _st(self)._onClassSelected_(_st(ann)._item());
  1180. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1181. _st($1)._on_do_($HLProtocolSelected(),(function(ann){
  1182. return smalltalk.withContext(function($ctx2) {
  1183. return _st(self)._onProtocolSelected_(_st(ann)._item());
  1184. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1185. $2=_st($1)._on_do_($HLSourceCodeFocusRequested(),(function(ann){
  1186. return smalltalk.withContext(function($ctx2) {
  1187. return _st(self)._onSourceCodeFocusRequested();
  1188. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1189. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLSourceCodeWidget)})},
  1190. args: [],
  1191. source: "observeBrowserModel\x0a\x09self browserModel announcer\x0a\x09\x09on: HLSaveSourceCode\x0a\x09\x09do: [ :ann | self onSaveIt ];\x0a\x09\x09on: HLParseErrorRaised\x0a\x09\x09do: [ :ann | self onParseError: ann ];\x0a\x09\x09on: HLCompileErrorRaised\x0a\x09\x09do: [ :ann | self onCompileError: ann error ];\x0a\x09\x09on: HLUnknownVariableErrorRaised\x0a\x09\x09do: [ :ann | self onUnknownVariableError: ann error ];\x0a\x09\x09on: HLInstVarAdded \x0a\x09\x09do: [ :ann | self onInstVarAdded ];\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09do: [ :ann | self onMethodSelected: ann item ];\x0a \x09on: HLClassSelected \x0a\x09\x09do: [ :ann | self onClassSelected: ann item ];\x0a \x09on: HLProtocolSelected \x0a\x09\x09do: [ :ann | self onProtocolSelected: ann item ];\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09do: [ :ann | self onSourceCodeFocusRequested ]",
  1192. messageSends: ["on:do:", "onSaveIt", "announcer", "browserModel", "onParseError:", "onCompileError:", "error", "onUnknownVariableError:", "onInstVarAdded", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"],
  1193. referencedClasses: ["HLSaveSourceCode", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
  1194. }),
  1195. smalltalk.HLSourceCodeWidget);
  1196. smalltalk.addMethod(
  1197. smalltalk.method({
  1198. selector: "observeSystem",
  1199. category: 'actions',
  1200. fn: function (){
  1201. var self=this;
  1202. function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  1203. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1204. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1205. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1206. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1207. return smalltalk.withContext(function($ctx1) {
  1208. var $1,$2;
  1209. $1=_st(_st(self)._browserModel())._systemAnnouncer();
  1210. _st($1)._on_do_($MethodModified(),(function(ann){
  1211. return smalltalk.withContext(function($ctx2) {
  1212. return _st(self)._onMethodModified_(_st(ann)._method());
  1213. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1214. _st($1)._on_do_($HLMethodSelected(),(function(ann){
  1215. return smalltalk.withContext(function($ctx2) {
  1216. return _st(self)._onMethodSelected_(_st(ann)._item());
  1217. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1218. _st($1)._on_do_($HLClassSelected(),(function(ann){
  1219. return smalltalk.withContext(function($ctx2) {
  1220. return _st(self)._onClassSelected_(_st(ann)._item());
  1221. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1222. _st($1)._on_do_($HLProtocolSelected(),(function(ann){
  1223. return smalltalk.withContext(function($ctx2) {
  1224. return _st(self)._onProtocolSelected_(_st(ann)._item());
  1225. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1226. $2=_st($1)._on_do_($HLSourceCodeFocusRequested(),(function(ann){
  1227. return smalltalk.withContext(function($ctx2) {
  1228. return _st(self)._onSourceCodeFocusRequested();
  1229. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1230. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLSourceCodeWidget)})},
  1231. args: [],
  1232. source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a \x09on: MethodModified\x0a do: [ :ann | self onMethodModified: ann method ];\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09do: [ :ann | self onMethodSelected: ann item ];\x0a \x09on: HLClassSelected \x0a\x09\x09do: [ :ann | self onClassSelected: ann item ];\x0a \x09on: HLProtocolSelected \x0a\x09\x09do: [ :ann | self onProtocolSelected: ann item ];\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09do: [ :ann | self onSourceCodeFocusRequested ]",
  1233. messageSends: ["on:do:", "onMethodModified:", "method", "systemAnnouncer", "browserModel", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"],
  1234. referencedClasses: ["MethodModified", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
  1235. }),
  1236. smalltalk.HLSourceCodeWidget);
  1237. smalltalk.addMethod(
  1238. smalltalk.method({
  1239. selector: "onClassSelected:",
  1240. category: 'reactions',
  1241. fn: function (aClass){
  1242. var self=this;
  1243. return smalltalk.withContext(function($ctx1) {
  1244. var $1,$2;
  1245. $1=aClass;
  1246. if(($receiver = $1) == nil || $receiver == undefined){
  1247. $2=_st(self)._contents_("");
  1248. return $2;
  1249. } else {
  1250. $1;
  1251. };
  1252. _st(self)._contents_(_st(aClass)._definition());
  1253. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{aClass:aClass},smalltalk.HLSourceCodeWidget)})},
  1254. args: ["aClass"],
  1255. source: "onClassSelected: aClass\x0a\x09aClass ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: aClass definition",
  1256. messageSends: ["ifNil:", "contents:", "definition"],
  1257. referencedClasses: []
  1258. }),
  1259. smalltalk.HLSourceCodeWidget);
  1260. smalltalk.addMethod(
  1261. smalltalk.method({
  1262. selector: "onCompileError:",
  1263. category: 'reactions',
  1264. fn: function (anError){
  1265. var self=this;
  1266. return smalltalk.withContext(function($ctx1) {
  1267. _st(self)._alert_(_st(anError)._messageText());
  1268. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anError:anError},smalltalk.HLSourceCodeWidget)})},
  1269. args: ["anError"],
  1270. source: "onCompileError: anError\x0a\x09self alert: anError messageText",
  1271. messageSends: ["alert:", "messageText"],
  1272. referencedClasses: []
  1273. }),
  1274. smalltalk.HLSourceCodeWidget);
  1275. smalltalk.addMethod(
  1276. smalltalk.method({
  1277. selector: "onInstVarAdded",
  1278. category: 'reactions',
  1279. fn: function (){
  1280. var self=this;
  1281. return smalltalk.withContext(function($ctx1) {
  1282. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1283. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLSourceCodeWidget)})},
  1284. args: [],
  1285. source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
  1286. messageSends: ["save:", "contents", "browserModel"],
  1287. referencedClasses: []
  1288. }),
  1289. smalltalk.HLSourceCodeWidget);
  1290. smalltalk.addMethod(
  1291. smalltalk.method({
  1292. selector: "onMethodModified:",
  1293. category: 'reactions',
  1294. fn: function (aMethod){
  1295. var self=this;
  1296. return smalltalk.withContext(function($ctx1) {
  1297. var $1,$2,$3,$4,$5,$6;
  1298. $1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(aMethod)._methodClass());
  1299. if(! smalltalk.assert($1)){
  1300. $2=self;
  1301. return $2;
  1302. };
  1303. $3=_st(_st(self)._browserModel())._selectedMethod();
  1304. if(($receiver = $3) == nil || $receiver == undefined){
  1305. $4=self;
  1306. return $4;
  1307. } else {
  1308. $3;
  1309. };
  1310. $5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(aMethod)._selector());
  1311. if(! smalltalk.assert($5)){
  1312. $6=self;
  1313. return $6;
  1314. };
  1315. _st(self)._refresh();
  1316. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{aMethod:aMethod},smalltalk.HLSourceCodeWidget)})},
  1317. args: ["aMethod"],
  1318. source: "onMethodModified: aMethod\x0a\x09self browserModel selectedClass = aMethod methodClass ifFalse: [ ^ self ].\x0a\x09self browserModel selectedMethod ifNil: [ ^ self ].\x0a self browserModel selectedMethod selector = aMethod selector ifFalse: [ ^ self ].\x0a\x0a self refresh",
  1319. messageSends: ["ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"],
  1320. referencedClasses: []
  1321. }),
  1322. smalltalk.HLSourceCodeWidget);
  1323. smalltalk.addMethod(
  1324. smalltalk.method({
  1325. selector: "onMethodSelected:",
  1326. category: 'reactions',
  1327. fn: function (aCompiledMethod){
  1328. var self=this;
  1329. return smalltalk.withContext(function($ctx1) {
  1330. var $1,$2;
  1331. $1=aCompiledMethod;
  1332. if(($receiver = $1) == nil || $receiver == undefined){
  1333. $2=_st(self)._contents_("");
  1334. return $2;
  1335. } else {
  1336. $1;
  1337. };
  1338. _st(self)._contents_(_st(aCompiledMethod)._source());
  1339. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{aCompiledMethod:aCompiledMethod},smalltalk.HLSourceCodeWidget)})},
  1340. args: ["aCompiledMethod"],
  1341. source: "onMethodSelected: aCompiledMethod\x0a\x09aCompiledMethod ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: aCompiledMethod source",
  1342. messageSends: ["ifNil:", "contents:", "source"],
  1343. referencedClasses: []
  1344. }),
  1345. smalltalk.HLSourceCodeWidget);
  1346. smalltalk.addMethod(
  1347. smalltalk.method({
  1348. selector: "onParseError:",
  1349. category: 'reactions',
  1350. fn: function (anAnnouncement){
  1351. var self=this;
  1352. var lineIndex,newContents;
  1353. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1354. return smalltalk.withContext(function($ctx1) {
  1355. var $1,$2,$3;
  1356. lineIndex=(1);
  1357. _st(self)._contents_(_st($String())._streamContents_((function(stream){
  1358. return smalltalk.withContext(function($ctx2) {
  1359. return _st(_st(self)._contents())._linesDo_((function(each){
  1360. return smalltalk.withContext(function($ctx3) {
  1361. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1362. if(smalltalk.assert($1)){
  1363. $2=stream;
  1364. _st($2)._nextPutAll_(_st(each)._copyFrom_to_((1),_st(anAnnouncement)._column()));
  1365. _st($2)._nextPutAll_("<- ");
  1366. _st($2)._nextPutAll_(_st(anAnnouncement)._message());
  1367. _st($2)._nextPutAll_(" ");
  1368. $3=_st($2)._nextPutAll_(_st(each)._copyFrom_to_(_st(_st(anAnnouncement)._column()).__plus((1)),_st(each)._size()));
  1369. $3;
  1370. } else {
  1371. _st(stream)._nextPutAll_(each);
  1372. };
  1373. _st(stream)._nextPutAll_(_st($String())._cr());
  1374. lineIndex=_st(lineIndex).__plus((1));
  1375. return lineIndex;
  1376. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1377. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1378. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
  1379. args: ["anAnnouncement"],
  1380. 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 ] ])",
  1381. messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"],
  1382. referencedClasses: ["String"]
  1383. }),
  1384. smalltalk.HLSourceCodeWidget);
  1385. smalltalk.addMethod(
  1386. smalltalk.method({
  1387. selector: "onProtocolSelected:",
  1388. category: 'reactions',
  1389. fn: function (aString){
  1390. var self=this;
  1391. return smalltalk.withContext(function($ctx1) {
  1392. var $1,$2;
  1393. $1=_st(_st(self)._browserModel())._selectedClass();
  1394. if(($receiver = $1) == nil || $receiver == undefined){
  1395. $2=_st(self)._contents_("");
  1396. return $2;
  1397. } else {
  1398. $1;
  1399. };
  1400. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1401. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{aString:aString},smalltalk.HLSourceCodeWidget)})},
  1402. args: ["aString"],
  1403. source: "onProtocolSelected: aString\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: self browserModel selectedClass definition",
  1404. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
  1405. referencedClasses: []
  1406. }),
  1407. smalltalk.HLSourceCodeWidget);
  1408. smalltalk.addMethod(
  1409. smalltalk.method({
  1410. selector: "onSaveIt",
  1411. category: 'reactions',
  1412. fn: function (){
  1413. var self=this;
  1414. return smalltalk.withContext(function($ctx1) {
  1415. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1416. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
  1417. args: [],
  1418. source: "onSaveIt\x0a\x09self browserModel save: self contents",
  1419. messageSends: ["save:", "contents", "browserModel"],
  1420. referencedClasses: []
  1421. }),
  1422. smalltalk.HLSourceCodeWidget);
  1423. smalltalk.addMethod(
  1424. smalltalk.method({
  1425. selector: "onSourceCodeFocusRequested",
  1426. category: 'reactions',
  1427. fn: function (){
  1428. var self=this;
  1429. return smalltalk.withContext(function($ctx1) {
  1430. _st(self)._focus();
  1431. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLSourceCodeWidget)})},
  1432. args: [],
  1433. source: "onSourceCodeFocusRequested\x0a\x09self focus",
  1434. messageSends: ["focus"],
  1435. referencedClasses: []
  1436. }),
  1437. smalltalk.HLSourceCodeWidget);
  1438. smalltalk.addMethod(
  1439. smalltalk.method({
  1440. selector: "onUnknownVariableError:",
  1441. category: 'reactions',
  1442. fn: function (anError){
  1443. var self=this;
  1444. var confirm;
  1445. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1446. return smalltalk.withContext(function($ctx1) {
  1447. var $1,$2,$3,$4;
  1448. confirm=_st(self)._confirm_(_st($String())._streamContents_((function(stream){
  1449. return smalltalk.withContext(function($ctx2) {
  1450. $1=stream;
  1451. _st($1)._nextPutAll_(_st(anError)._messageText());
  1452. _st($1)._nextPutAll_(_st($String())._cr());
  1453. $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
  1454. return $2;
  1455. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1456. $3=confirm;
  1457. if(! smalltalk.assert($3)){
  1458. $4=self;
  1459. return $4;
  1460. };
  1461. _st(_st(self)._browserModel())._addInstVarNamed_(_st(anError)._variableName());
  1462. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anError:anError,confirm:confirm},smalltalk.HLSourceCodeWidget)})},
  1463. args: ["anError"],
  1464. source: "onUnknownVariableError: anError\x0a\x09| confirm |\x0a\x0a\x09confirm := self confirm: (String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09\x09\x09nextPutAll: anError messageText;\x0a\x09\x09\x09nextPutAll: String cr;\x0a\x09\x09\x09nextPutAll: 'Would you like to define an instance variable?' ]).\x0a\x09\x09\x09\x0a\x09confirm ifFalse: [ ^ self ].\x0a\x09\x0a\x09self browserModel addInstVarNamed: anError variableName",
  1465. messageSends: ["confirm:", "streamContents:", "nextPutAll:", "messageText", "cr", "ifFalse:", "addInstVarNamed:", "variableName", "browserModel"],
  1466. referencedClasses: ["String"]
  1467. }),
  1468. smalltalk.HLSourceCodeWidget);
  1469. smalltalk.addMethod(
  1470. smalltalk.method({
  1471. selector: "previous",
  1472. category: 'accessing',
  1473. fn: function (){
  1474. var self=this;
  1475. return smalltalk.withContext(function($ctx1) {
  1476. return self}, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLSourceCodeWidget)})},
  1477. args: [],
  1478. source: "previous\x0a\x09\x22for browser lists widget\x22",
  1479. messageSends: [],
  1480. referencedClasses: []
  1481. }),
  1482. smalltalk.HLSourceCodeWidget);
  1483. smalltalk.addMethod(
  1484. smalltalk.method({
  1485. selector: "previous:",
  1486. category: 'accessing',
  1487. fn: function (aWidget){
  1488. var self=this;
  1489. return smalltalk.withContext(function($ctx1) {
  1490. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLSourceCodeWidget)})},
  1491. args: ["aWidget"],
  1492. source: "previous: aWidget\x0a\x09\x22for browser lists widget\x22",
  1493. messageSends: [],
  1494. referencedClasses: []
  1495. }),
  1496. smalltalk.HLSourceCodeWidget);
  1497. smalltalk.addMethod(
  1498. smalltalk.method({
  1499. selector: "refresh",
  1500. category: 'actions',
  1501. fn: function (){
  1502. var self=this;
  1503. return smalltalk.withContext(function($ctx1) {
  1504. var $1,$2,$3,$4;
  1505. $1=_st(self)._hasModification();
  1506. if(smalltalk.assert($1)){
  1507. $2=self;
  1508. return $2;
  1509. };
  1510. $3=_st(self)._hasFocus();
  1511. if(smalltalk.assert($3)){
  1512. $4=self;
  1513. return $4;
  1514. };
  1515. _st(self)._contents_(_st(_st(_st(self)._model())._selectedMethod())._source());
  1516. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLSourceCodeWidget)})},
  1517. args: [],
  1518. source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self model selectedMethod source",
  1519. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "model"],
  1520. referencedClasses: []
  1521. }),
  1522. smalltalk.HLSourceCodeWidget);
  1523. smalltalk.addMethod(
  1524. smalltalk.method({
  1525. selector: "saveIt",
  1526. category: 'actions',
  1527. fn: function (){
  1528. var self=this;
  1529. return smalltalk.withContext(function($ctx1) {
  1530. _st(_st(self)._browserModel())._saveSourceCode();
  1531. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
  1532. args: [],
  1533. source: "saveIt\x0a\x09self browserModel saveSourceCode",
  1534. messageSends: ["saveSourceCode", "browserModel"],
  1535. referencedClasses: []
  1536. }),
  1537. smalltalk.HLSourceCodeWidget);
  1538. smalltalk.addMethod(
  1539. smalltalk.method({
  1540. selector: "canBeOpenAsTab",
  1541. category: 'testing',
  1542. fn: function (){
  1543. var self=this;
  1544. return smalltalk.withContext(function($ctx1) {
  1545. return false;
  1546. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
  1547. args: [],
  1548. source: "canBeOpenAsTab\x0a\x09^ false",
  1549. messageSends: [],
  1550. referencedClasses: []
  1551. }),
  1552. smalltalk.HLSourceCodeWidget.klass);
  1553. smalltalk.addMethod(
  1554. smalltalk.method({
  1555. selector: "on:",
  1556. category: 'instance creation',
  1557. fn: function (aBrowserModel){
  1558. var self=this;
  1559. return smalltalk.withContext(function($ctx1) {
  1560. var $2,$3,$1;
  1561. $2=_st(self)._new();
  1562. _st($2)._browserModel_(aBrowserModel);
  1563. $3=_st($2)._yourself();
  1564. $1=$3;
  1565. return $1;
  1566. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
  1567. args: ["aBrowserModel"],
  1568. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1569. messageSends: ["browserModel:", "new", "yourself"],
  1570. referencedClasses: []
  1571. }),
  1572. smalltalk.HLSourceCodeWidget.klass);