Helios-Workspace.js 78 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958
  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. newInspector=_st(self)._makeInspectorOn_(_st(self)._doIt());
  401. _st(newInspector)._open();
  402. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},smalltalk.HLCodeWidget)})},
  403. args: [],
  404. source: "inspectIt\x0a\x09| newInspector |\x0a \x0a\x09self model announcer announce: (HLInspectItRequested on: model).\x0a\x09newInspector := self makeInspectorOn: self doIt.\x0a\x09newInspector open",
  405. messageSends: ["announce:", "on:", "announcer", "model", "makeInspectorOn:", "doIt", "open"],
  406. referencedClasses: ["HLInspectItRequested"]
  407. }),
  408. smalltalk.HLCodeWidget);
  409. smalltalk.addMethod(
  410. smalltalk.method({
  411. selector: "makeInspectorOn:",
  412. category: 'actions',
  413. fn: function (anObject){
  414. var self=this;
  415. function $HLInspector(){return smalltalk.HLInspector||(typeof HLInspector=="undefined"?nil:HLInspector)}
  416. return smalltalk.withContext(function($ctx1) {
  417. var $2,$3,$1;
  418. $2=_st($HLInspector())._new();
  419. _st($2)._inspect_(anObject);
  420. $3=_st($2)._yourself();
  421. $1=$3;
  422. return $1;
  423. }, function($ctx1) {$ctx1.fill(self,"makeInspectorOn:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  424. args: ["anObject"],
  425. source: "makeInspectorOn: anObject\x0a\x0a\x09^ HLInspector new \x0a\x09\x09inspect: anObject;\x0a\x09\x09yourself",
  426. messageSends: ["inspect:", "new", "yourself"],
  427. referencedClasses: ["HLInspector"]
  428. }),
  429. smalltalk.HLCodeWidget);
  430. smalltalk.addMethod(
  431. smalltalk.method({
  432. selector: "messageHintFor:token:",
  433. category: 'hints',
  434. fn: function (anEditor,aToken){
  435. var self=this;
  436. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  437. return smalltalk.withContext(function($ctx1) {
  438. var $1;
  439. $1=_st(_st(_st(_st(_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value())._asSet())._asArray())._select_((function(each){
  440. return smalltalk.withContext(function($ctx2) {
  441. return _st(each)._includesSubString_(_st(aToken)._string());
  442. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  443. return smalltalk.withContext(function($ctx2) {
  444. return _st(each).__eq(_st(aToken)._string());
  445. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  446. return $1;
  447. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget)})},
  448. args: ["anEditor", "aToken"],
  449. 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 ]",
  450. messageSends: ["reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", "value", "at:", "current"],
  451. referencedClasses: ["Smalltalk"]
  452. }),
  453. smalltalk.HLCodeWidget);
  454. smalltalk.addMethod(
  455. smalltalk.method({
  456. selector: "model",
  457. category: 'accessing',
  458. fn: function (){
  459. var self=this;
  460. function $HLCodeModel(){return smalltalk.HLCodeModel||(typeof HLCodeModel=="undefined"?nil:HLCodeModel)}
  461. return smalltalk.withContext(function($ctx1) {
  462. var $2,$1;
  463. $2=self["@model"];
  464. if(($receiver = $2) == nil || $receiver == undefined){
  465. self["@model"]=_st($HLCodeModel())._new();
  466. $1=self["@model"];
  467. } else {
  468. $1=$2;
  469. };
  470. return $1;
  471. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLCodeWidget)})},
  472. args: [],
  473. source: "model\x0a\x09^ model ifNil: [ model := HLCodeModel new ]",
  474. messageSends: ["ifNil:", "new"],
  475. referencedClasses: ["HLCodeModel"]
  476. }),
  477. smalltalk.HLCodeWidget);
  478. smalltalk.addMethod(
  479. smalltalk.method({
  480. selector: "model:",
  481. category: 'accessing',
  482. fn: function (aModel){
  483. var self=this;
  484. return smalltalk.withContext(function($ctx1) {
  485. self["@model"]=aModel;
  486. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLCodeWidget)})},
  487. args: ["aModel"],
  488. source: "model: aModel\x0a\x09model := aModel",
  489. messageSends: [],
  490. referencedClasses: []
  491. }),
  492. smalltalk.HLCodeWidget);
  493. smalltalk.addMethod(
  494. smalltalk.method({
  495. selector: "onChange",
  496. category: 'reactions',
  497. fn: function (){
  498. var self=this;
  499. return smalltalk.withContext(function($ctx1) {
  500. _st(self)._updateState();
  501. return self}, function($ctx1) {$ctx1.fill(self,"onChange",{},smalltalk.HLCodeWidget)})},
  502. args: [],
  503. source: "onChange\x0a\x09self updateState",
  504. messageSends: ["updateState"],
  505. referencedClasses: []
  506. }),
  507. smalltalk.HLCodeWidget);
  508. smalltalk.addMethod(
  509. smalltalk.method({
  510. selector: "onDoIt",
  511. category: 'reactions',
  512. fn: function (){
  513. var self=this;
  514. return smalltalk.withContext(function($ctx1) {
  515. _st(self)._doIt();
  516. return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{},smalltalk.HLCodeWidget)})},
  517. args: [],
  518. source: "onDoIt\x0a\x09\x0a self doIt",
  519. messageSends: ["doIt"],
  520. referencedClasses: []
  521. }),
  522. smalltalk.HLCodeWidget);
  523. smalltalk.addMethod(
  524. smalltalk.method({
  525. selector: "onInspectIt",
  526. category: 'reactions',
  527. fn: function (){
  528. var self=this;
  529. return smalltalk.withContext(function($ctx1) {
  530. _st(self)._inspectIt();
  531. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},smalltalk.HLCodeWidget)})},
  532. args: [],
  533. source: "onInspectIt\x0a\x0a\x09self inspectIt",
  534. messageSends: ["inspectIt"],
  535. referencedClasses: []
  536. }),
  537. smalltalk.HLCodeWidget);
  538. smalltalk.addMethod(
  539. smalltalk.method({
  540. selector: "onPrintIt",
  541. category: 'reactions',
  542. fn: function (){
  543. var self=this;
  544. return smalltalk.withContext(function($ctx1) {
  545. _st(self)._printIt();
  546. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},smalltalk.HLCodeWidget)})},
  547. args: [],
  548. source: "onPrintIt\x0a\x0a\x09self printIt",
  549. messageSends: ["printIt"],
  550. referencedClasses: []
  551. }),
  552. smalltalk.HLCodeWidget);
  553. smalltalk.addMethod(
  554. smalltalk.method({
  555. selector: "onSaveIt",
  556. category: 'reactions',
  557. fn: function (){
  558. var self=this;
  559. return smalltalk.withContext(function($ctx1) {
  560. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLCodeWidget)})},
  561. args: [],
  562. source: "onSaveIt\x0a\x09\x22I do not do anything\x22",
  563. messageSends: [],
  564. referencedClasses: []
  565. }),
  566. smalltalk.HLCodeWidget);
  567. smalltalk.addMethod(
  568. smalltalk.method({
  569. selector: "print:",
  570. category: 'actions',
  571. fn: function (aString){
  572. var self=this;
  573. var start,stop,currentLine;
  574. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  575. return smalltalk.withContext(function($ctx1) {
  576. currentLine=_st(_st(self["@editor"])._getCursor_(false))._line();
  577. start=_st($HashedCollection())._new();
  578. _st(start)._at_put_("line",currentLine);
  579. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getCursor_(false))._ch());
  580. _st(_st(self["@editor"])._getSelection())._ifEmpty_((function(){
  581. return smalltalk.withContext(function($ctx2) {
  582. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getLine_(currentLine))._size());
  583. return _st(self["@editor"])._setSelection_end_(smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(currentLine),_st("ch").__minus_gt((0))]),start);
  584. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  585. stop=_st($HashedCollection())._new();
  586. _st(stop)._at_put_("line",currentLine);
  587. _st(stop)._at_put_("ch",_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2)));
  588. _st(self["@editor"])._replaceSelection_(_st(_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString)).__comma(" "));
  589. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  590. _st(self["@editor"])._setSelection_end_(stop,start);
  591. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},smalltalk.HLCodeWidget)})},
  592. args: ["aString"],
  593. 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",
  594. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "size", "getLine:", "setSelection:end:", "->", "getSelection", "+", "at:", "replaceSelection:", ",", "setCursor:"],
  595. referencedClasses: ["HashedCollection"]
  596. }),
  597. smalltalk.HLCodeWidget);
  598. smalltalk.addMethod(
  599. smalltalk.method({
  600. selector: "printIt",
  601. category: 'actions',
  602. fn: function (){
  603. var self=this;
  604. var result;
  605. function $HLPrintItRequested(){return smalltalk.HLPrintItRequested||(typeof HLPrintItRequested=="undefined"?nil:HLPrintItRequested)}
  606. return smalltalk.withContext(function($ctx1) {
  607. result=_st(self)._doIt();
  608. _st(_st(_st(self)._model())._announcer())._announce_(_st($HLPrintItRequested())._on_(self["@model"]));
  609. _st(self)._print_(_st(result)._printString());
  610. _st(self)._focus();
  611. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{result:result},smalltalk.HLCodeWidget)})},
  612. args: [],
  613. 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.",
  614. messageSends: ["doIt", "announce:", "on:", "announcer", "model", "print:", "printString", "focus"],
  615. referencedClasses: ["HLPrintItRequested"]
  616. }),
  617. smalltalk.HLCodeWidget);
  618. smalltalk.addMethod(
  619. smalltalk.method({
  620. selector: "receiver",
  621. category: 'accessing',
  622. fn: function (){
  623. var self=this;
  624. return smalltalk.withContext(function($ctx1) {
  625. var $1;
  626. $1=_st(_st(self)._model())._receiver();
  627. return $1;
  628. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeWidget)})},
  629. args: [],
  630. source: "receiver\x0a\x09^ self model receiver",
  631. messageSends: ["receiver", "model"],
  632. referencedClasses: []
  633. }),
  634. smalltalk.HLCodeWidget);
  635. smalltalk.addMethod(
  636. smalltalk.method({
  637. selector: "receiver:",
  638. category: 'accessing',
  639. fn: function (anObject){
  640. var self=this;
  641. return smalltalk.withContext(function($ctx1) {
  642. _st(_st(self)._model())._receiver_(anObject);
  643. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  644. args: ["anObject"],
  645. source: "receiver: anObject\x0a\x09self model receiver: anObject",
  646. messageSends: ["receiver:", "model"],
  647. referencedClasses: []
  648. }),
  649. smalltalk.HLCodeWidget);
  650. smalltalk.addMethod(
  651. smalltalk.method({
  652. selector: "renderContentOn:",
  653. category: 'rendering',
  654. fn: function (html){
  655. var self=this;
  656. return smalltalk.withContext(function($ctx1) {
  657. var $1,$2;
  658. self["@code"]=_st(html)._textarea();
  659. self["@state"]=_st(_st(html)._div())._class_("state");
  660. $1=self;
  661. _st($1)._setEditorOn_(_st(self["@code"])._element());
  662. _st($1)._configureEditor();
  663. $2=_st($1)._updateState();
  664. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLCodeWidget)})},
  665. args: ["html"],
  666. source: "renderContentOn: html\x0a\x09code := html textarea.\x0a\x09state := html div class: 'state'.\x0a\x09self \x0a\x09\x09setEditorOn: code element;\x0a\x09\x09configureEditor;\x0a\x09\x09updateState",
  667. messageSends: ["textarea", "class:", "div", "setEditorOn:", "element", "configureEditor", "updateState"],
  668. referencedClasses: []
  669. }),
  670. smalltalk.HLCodeWidget);
  671. smalltalk.addMethod(
  672. smalltalk.method({
  673. selector: "saveIt",
  674. category: 'actions',
  675. fn: function (){
  676. var self=this;
  677. return smalltalk.withContext(function($ctx1) {
  678. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLCodeWidget)})},
  679. args: [],
  680. source: "saveIt\x0a\x09\x22I do not do anything\x22",
  681. messageSends: [],
  682. referencedClasses: []
  683. }),
  684. smalltalk.HLCodeWidget);
  685. smalltalk.addMethod(
  686. smalltalk.method({
  687. selector: "selection",
  688. category: 'accessing',
  689. fn: function (){
  690. var self=this;
  691. return smalltalk.withContext(function($ctx1) {
  692. var $1;
  693. $1=_st(self["@editor"])._getSelection();
  694. return $1;
  695. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.HLCodeWidget)})},
  696. args: [],
  697. source: "selection\x0a\x09^editor getSelection",
  698. messageSends: ["getSelection"],
  699. referencedClasses: []
  700. }),
  701. smalltalk.HLCodeWidget);
  702. smalltalk.addMethod(
  703. smalltalk.method({
  704. selector: "selectionEnd",
  705. category: 'accessing',
  706. fn: function (){
  707. var self=this;
  708. return smalltalk.withContext(function($ctx1) {
  709. var $1;
  710. $1=_st(_st(self["@code"])._element())._selectionEnd();
  711. return $1;
  712. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},smalltalk.HLCodeWidget)})},
  713. args: [],
  714. source: "selectionEnd\x0a ^code element selectionEnd",
  715. messageSends: ["selectionEnd", "element"],
  716. referencedClasses: []
  717. }),
  718. smalltalk.HLCodeWidget);
  719. smalltalk.addMethod(
  720. smalltalk.method({
  721. selector: "selectionEnd:",
  722. category: 'accessing',
  723. fn: function (anInteger){
  724. var self=this;
  725. return smalltalk.withContext(function($ctx1) {
  726. _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  727. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  728. args: ["anInteger"],
  729. source: "selectionEnd: anInteger\x0a code element selectionEnd: anInteger",
  730. messageSends: ["selectionEnd:", "element"],
  731. referencedClasses: []
  732. }),
  733. smalltalk.HLCodeWidget);
  734. smalltalk.addMethod(
  735. smalltalk.method({
  736. selector: "selectionStart",
  737. category: 'accessing',
  738. fn: function (){
  739. var self=this;
  740. return smalltalk.withContext(function($ctx1) {
  741. var $1;
  742. $1=_st(_st(self["@code"])._element())._selectionStart();
  743. return $1;
  744. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},smalltalk.HLCodeWidget)})},
  745. args: [],
  746. source: "selectionStart\x0a ^code element selectionStart",
  747. messageSends: ["selectionStart", "element"],
  748. referencedClasses: []
  749. }),
  750. smalltalk.HLCodeWidget);
  751. smalltalk.addMethod(
  752. smalltalk.method({
  753. selector: "selectionStart:",
  754. category: 'accessing',
  755. fn: function (anInteger){
  756. var self=this;
  757. return smalltalk.withContext(function($ctx1) {
  758. _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  759. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  760. args: ["anInteger"],
  761. source: "selectionStart: anInteger\x0a code element selectionStart: anInteger",
  762. messageSends: ["selectionStart:", "element"],
  763. referencedClasses: []
  764. }),
  765. smalltalk.HLCodeWidget);
  766. smalltalk.addMethod(
  767. smalltalk.method({
  768. selector: "setEditorOn:",
  769. category: 'actions',
  770. fn: function (aTextarea){
  771. var self=this;
  772. return smalltalk.withContext(function($ctx1) {
  773. self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
  774. theme: 'amber',
  775. lineNumbers: true,
  776. enterMode: 'flat',
  777. indentWithTabs: true,
  778. indentUnit: 4,
  779. matchBrackets: true,
  780. electricChars: true,
  781. keyMap: 'Amber',
  782. extraKeys: {"Shift-Space": "autocomplete"}
  783. });
  784. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},smalltalk.HLCodeWidget)})},
  785. args: ["aTextarea"],
  786. 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})>",
  787. messageSends: [],
  788. referencedClasses: []
  789. }),
  790. smalltalk.HLCodeWidget);
  791. smalltalk.addMethod(
  792. smalltalk.method({
  793. selector: "updateState",
  794. category: 'updating',
  795. fn: function (){
  796. var self=this;
  797. return smalltalk.withContext(function($ctx1) {
  798. var $1;
  799. $1=_st(self)._hasModification();
  800. if(smalltalk.assert($1)){
  801. _st(_st(self["@state"])._asJQuery())._addClass_("modified");
  802. } else {
  803. _st(_st(self["@state"])._asJQuery())._removeClass_("modified");
  804. };
  805. return self}, function($ctx1) {$ctx1.fill(self,"updateState",{},smalltalk.HLCodeWidget)})},
  806. args: [],
  807. source: "updateState\x0a\x09self hasModification \x0a\x09\x09ifTrue: [ state asJQuery addClass: 'modified' ]\x0a\x09\x09ifFalse: [ state asJQuery removeClass: 'modified' ]",
  808. messageSends: ["ifTrue:ifFalse:", "addClass:", "asJQuery", "removeClass:", "hasModification"],
  809. referencedClasses: []
  810. }),
  811. smalltalk.HLCodeWidget);
  812. smalltalk.addMethod(
  813. smalltalk.method({
  814. selector: "variableHintFor:token:",
  815. category: 'hints',
  816. fn: function (anEditor,aToken){
  817. var self=this;
  818. var variables,classNames,pseudoVariables;
  819. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  820. return smalltalk.withContext(function($ctx1) {
  821. var $1;
  822. variables=_st(_st(_st(_st(window)._jQuery_(_st(_st(anEditor)._display())._wrapper()))._find_("span.cm-variable"))._get())._collect_((function(each){
  823. return smalltalk.withContext(function($ctx2) {
  824. return _st(_st(window)._jQuery_(each))._html();
  825. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  826. classNames=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  827. return smalltalk.withContext(function($ctx2) {
  828. return _st(each)._name();
  829. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  830. pseudoVariables=_st(_st($Smalltalk())._current())._pseudoVariableNames();
  831. $1=_st(_st(_st(_st(_st(_st(variables).__comma(classNames)).__comma(pseudoVariables))._asSet())._asArray())._select_((function(each){
  832. return smalltalk.withContext(function($ctx2) {
  833. return _st(each)._includesSubString_(_st(aToken)._string());
  834. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  835. return smalltalk.withContext(function($ctx2) {
  836. return _st(each).__eq(_st(aToken)._string());
  837. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  838. return $1;
  839. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},smalltalk.HLCodeWidget)})},
  840. args: ["anEditor", "aToken"],
  841. 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 ]",
  842. messageSends: ["collect:", "html", "jQuery:", "get", "find:", "wrapper", "display", "name", "classes", "current", "pseudoVariableNames", "reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", ","],
  843. referencedClasses: ["Smalltalk"]
  844. }),
  845. smalltalk.HLCodeWidget);
  846. smalltalk.addMethod(
  847. smalltalk.method({
  848. selector: "hintFor:options:",
  849. category: 'hints',
  850. fn: function (anEditor,options){
  851. var self=this;
  852. var cursor,token,completions;
  853. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  854. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  855. return smalltalk.withContext(function($ctx1) {
  856. var $1,$2;
  857. cursor=_st(anEditor)._getCursor();
  858. token=_st(anEditor)._getTokenAt_(cursor);
  859. _st(token)._at_put_("state",_st(_st(_st($CodeMirror())._basicAt_("innerMode"))._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state")))._state());
  860. $1=_st(_st(token)._type()).__eq("variable");
  861. if(smalltalk.assert($1)){
  862. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  863. } else {
  864. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  865. };
  866. $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()))]);
  867. return $2;
  868. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},smalltalk.HLCodeWidget.klass)})},
  869. args: ["anEditor", "options"],
  870. 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}",
  871. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "getMode", "at:", "basicAt:", "ifTrue:ifFalse:", "variableHintFor:token:", "messageHintFor:token:", "=", "type", "->", "line", "end", "start"],
  872. referencedClasses: ["CodeMirror", "HLCodeWidget"]
  873. }),
  874. smalltalk.HLCodeWidget.klass);
  875. smalltalk.addMethod(
  876. smalltalk.method({
  877. selector: "initialize",
  878. category: 'initialization',
  879. fn: function (){
  880. var self=this;
  881. return smalltalk.withContext(function($ctx1) {
  882. var $1,$2;
  883. smalltalk.HLWidget.klass.fn.prototype._initialize.apply(_st(self), []);
  884. $1=self;
  885. _st($1)._setupCodeMirror();
  886. _st($1)._setupCommands();
  887. $2=_st($1)._setupKeyMaps();
  888. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLCodeWidget.klass)})},
  889. args: [],
  890. source: "initialize\x0a\x09super initialize.\x0a\x09self \x0a\x09\x09setupCodeMirror;\x0a\x09\x09setupCommands;\x0a\x09\x09setupKeyMaps.",
  891. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"],
  892. referencedClasses: []
  893. }),
  894. smalltalk.HLCodeWidget.klass);
  895. smalltalk.addMethod(
  896. smalltalk.method({
  897. selector: "keyMap",
  898. category: 'accessing',
  899. fn: function (){
  900. var self=this;
  901. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  902. return smalltalk.withContext(function($ctx1) {
  903. var $2,$1;
  904. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  905. if(smalltalk.assert($2)){
  906. $1=_st(self)._macKeyMap();
  907. } else {
  908. $1=_st(self)._pcKeyMap();
  909. };
  910. return $1;
  911. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},smalltalk.HLCodeWidget.klass)})},
  912. args: [],
  913. source: "keyMap\x0a\x09^ HLManager current keyBinder systemIsMac\x0a\x09\x09ifTrue: [ self macKeyMap ]\x0a\x09\x09ifFalse: [ self pcKeyMap ]",
  914. messageSends: ["ifTrue:ifFalse:", "macKeyMap", "pcKeyMap", "systemIsMac", "keyBinder", "current"],
  915. referencedClasses: ["HLManager"]
  916. }),
  917. smalltalk.HLCodeWidget.klass);
  918. smalltalk.addMethod(
  919. smalltalk.method({
  920. selector: "macKeyMap",
  921. category: 'accessing',
  922. fn: function (){
  923. var self=this;
  924. return smalltalk.withContext(function($ctx1) {
  925. var $1;
  926. $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"])]);
  927. return $1;
  928. }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  929. args: [],
  930. 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 }",
  931. messageSends: ["->"],
  932. referencedClasses: []
  933. }),
  934. smalltalk.HLCodeWidget.klass);
  935. smalltalk.addMethod(
  936. smalltalk.method({
  937. selector: "messageHintFor:token:",
  938. category: 'hints',
  939. fn: function (anEditor,aToken){
  940. var self=this;
  941. return smalltalk.withContext(function($ctx1) {
  942. var $1;
  943. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  944. return $1;
  945. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  946. args: ["anEditor", "aToken"],
  947. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09messageHintFor: anEditor token: aToken",
  948. messageSends: ["messageHintFor:token:", "at:"],
  949. referencedClasses: []
  950. }),
  951. smalltalk.HLCodeWidget.klass);
  952. smalltalk.addMethod(
  953. smalltalk.method({
  954. selector: "pcKeyMap",
  955. category: 'accessing',
  956. fn: function (){
  957. var self=this;
  958. return smalltalk.withContext(function($ctx1) {
  959. var $1;
  960. $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"])];
  961. return $1;
  962. }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  963. args: [],
  964. 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}",
  965. messageSends: ["->"],
  966. referencedClasses: []
  967. }),
  968. smalltalk.HLCodeWidget.klass);
  969. smalltalk.addMethod(
  970. smalltalk.method({
  971. selector: "setupCodeMirror",
  972. category: 'initialization',
  973. fn: function (){
  974. var self=this;
  975. return smalltalk.withContext(function($ctx1) {
  976. CodeMirror.keyMap.default.fallthrough = ["basic"];
  977. CodeMirror.commands.autocomplete = function(cm) {
  978. CodeMirror.showHint(cm, self._hintFor_options_);
  979. }
  980. ;
  981. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.HLCodeWidget.klass)})},
  982. args: [],
  983. 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>",
  984. messageSends: [],
  985. referencedClasses: []
  986. }),
  987. smalltalk.HLCodeWidget.klass);
  988. smalltalk.addMethod(
  989. smalltalk.method({
  990. selector: "setupCommands",
  991. category: 'initialization',
  992. fn: function (){
  993. var self=this;
  994. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  995. return smalltalk.withContext(function($ctx1) {
  996. var $1,$2;
  997. $1=_st($CodeMirror())._basicAt_("commands");
  998. _st($1)._at_put_("doIt",(function(cm){
  999. return smalltalk.withContext(function($ctx2) {
  1000. return _st(_st(cm)._amberCodeWidget())._doIt();
  1001. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  1002. _st($1)._at_put_("inspectIt",(function(cm){
  1003. return smalltalk.withContext(function($ctx2) {
  1004. return _st(_st(cm)._amberCodeWidget())._inspectIt();
  1005. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  1006. _st($1)._at_put_("printIt",(function(cm){
  1007. return smalltalk.withContext(function($ctx2) {
  1008. return _st(_st(cm)._amberCodeWidget())._printIt();
  1009. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  1010. $2=_st($1)._at_put_("saveIt",(function(cm){
  1011. return smalltalk.withContext(function($ctx2) {
  1012. return _st(_st(cm)._amberCodeWidget())._saveIt();
  1013. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  1014. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},smalltalk.HLCodeWidget.klass)})},
  1015. args: [],
  1016. 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 ]",
  1017. messageSends: ["at:put:", "doIt", "amberCodeWidget", "basicAt:", "inspectIt", "printIt", "saveIt"],
  1018. referencedClasses: ["CodeMirror"]
  1019. }),
  1020. smalltalk.HLCodeWidget.klass);
  1021. smalltalk.addMethod(
  1022. smalltalk.method({
  1023. selector: "setupKeyMaps",
  1024. category: 'initialization',
  1025. fn: function (){
  1026. var self=this;
  1027. return smalltalk.withContext(function($ctx1) {
  1028. CodeMirror.keyMap['Amber'] = self._keyMap();
  1029. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},smalltalk.HLCodeWidget.klass)})},
  1030. args: [],
  1031. source: "setupKeyMaps\x0a\x09<CodeMirror.keyMap['Amber'] = self._keyMap()>",
  1032. messageSends: [],
  1033. referencedClasses: []
  1034. }),
  1035. smalltalk.HLCodeWidget.klass);
  1036. smalltalk.addMethod(
  1037. smalltalk.method({
  1038. selector: "variableHintFor:token:",
  1039. category: 'hints',
  1040. fn: function (anEditor,aToken){
  1041. var self=this;
  1042. return smalltalk.withContext(function($ctx1) {
  1043. var $1;
  1044. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  1045. return $1;
  1046. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  1047. args: ["anEditor", "aToken"],
  1048. source: "variableHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09variableHintFor: anEditor token: aToken",
  1049. messageSends: ["variableHintFor:token:", "at:"],
  1050. referencedClasses: []
  1051. }),
  1052. smalltalk.HLCodeWidget.klass);
  1053. smalltalk.addClass('HLNavigationCodeWidget', smalltalk.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
  1054. smalltalk.addMethod(
  1055. smalltalk.method({
  1056. selector: "contents:",
  1057. category: 'accessing',
  1058. fn: function (aString){
  1059. var self=this;
  1060. return smalltalk.withContext(function($ctx1) {
  1061. _st(self)._methodContents_(aString);
  1062. smalltalk.HLCodeWidget.fn.prototype._contents_.apply(_st(self), [aString]);
  1063. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  1064. args: ["aString"],
  1065. source: "contents: aString\x0a\x09self methodContents: aString.\x0a\x09super contents: aString",
  1066. messageSends: ["methodContents:", "contents:"],
  1067. referencedClasses: []
  1068. }),
  1069. smalltalk.HLNavigationCodeWidget);
  1070. smalltalk.addMethod(
  1071. smalltalk.method({
  1072. selector: "hasModification",
  1073. category: 'testing',
  1074. fn: function (){
  1075. var self=this;
  1076. return smalltalk.withContext(function($ctx1) {
  1077. var $1;
  1078. $1=_st(_st(_st(self)._methodContents()).__eq(_st(self)._contents()))._not();
  1079. return $1;
  1080. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLNavigationCodeWidget)})},
  1081. args: [],
  1082. source: "hasModification\x0a\x09^ (self methodContents = self contents) not",
  1083. messageSends: ["not", "=", "contents", "methodContents"],
  1084. referencedClasses: []
  1085. }),
  1086. smalltalk.HLNavigationCodeWidget);
  1087. smalltalk.addMethod(
  1088. smalltalk.method({
  1089. selector: "methodContents",
  1090. category: 'accessing',
  1091. fn: function (){
  1092. var self=this;
  1093. return smalltalk.withContext(function($ctx1) {
  1094. var $2,$1;
  1095. $2=self["@methodContents"];
  1096. if(($receiver = $2) == nil || $receiver == undefined){
  1097. $1="";
  1098. } else {
  1099. $1=$2;
  1100. };
  1101. return $1;
  1102. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},smalltalk.HLNavigationCodeWidget)})},
  1103. args: [],
  1104. source: "methodContents\x0a\x09^ methodContents ifNil: [ '' ]",
  1105. messageSends: ["ifNil:"],
  1106. referencedClasses: []
  1107. }),
  1108. smalltalk.HLNavigationCodeWidget);
  1109. smalltalk.addMethod(
  1110. smalltalk.method({
  1111. selector: "methodContents:",
  1112. category: 'accessing',
  1113. fn: function (aString){
  1114. var self=this;
  1115. return smalltalk.withContext(function($ctx1) {
  1116. var $1;
  1117. self["@methodContents"]=aString;
  1118. $1=self["@methodContents"];
  1119. return $1;
  1120. }, function($ctx1) {$ctx1.fill(self,"methodContents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  1121. args: ["aString"],
  1122. source: "methodContents: aString\x0a\x09^ methodContents := aString",
  1123. messageSends: [],
  1124. referencedClasses: []
  1125. }),
  1126. smalltalk.HLNavigationCodeWidget);
  1127. smalltalk.addMethod(
  1128. smalltalk.method({
  1129. selector: "previous",
  1130. category: 'accessing',
  1131. fn: function (){
  1132. var self=this;
  1133. return smalltalk.withContext(function($ctx1) {
  1134. return self}, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationCodeWidget)})},
  1135. args: [],
  1136. source: "previous\x0a\x09\x22for browser lists widget\x22",
  1137. messageSends: [],
  1138. referencedClasses: []
  1139. }),
  1140. smalltalk.HLNavigationCodeWidget);
  1141. smalltalk.addMethod(
  1142. smalltalk.method({
  1143. selector: "previous:",
  1144. category: 'accessing',
  1145. fn: function (aWidget){
  1146. var self=this;
  1147. return smalltalk.withContext(function($ctx1) {
  1148. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationCodeWidget)})},
  1149. args: ["aWidget"],
  1150. source: "previous: aWidget\x0a\x09\x22for browser lists widget\x22",
  1151. messageSends: [],
  1152. referencedClasses: []
  1153. }),
  1154. smalltalk.HLNavigationCodeWidget);
  1155. smalltalk.addMethod(
  1156. smalltalk.method({
  1157. selector: "canBeOpenAsTab",
  1158. category: 'testing',
  1159. fn: function (){
  1160. var self=this;
  1161. return smalltalk.withContext(function($ctx1) {
  1162. return false;
  1163. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLNavigationCodeWidget.klass)})},
  1164. args: [],
  1165. source: "canBeOpenAsTab\x0a\x09^ false",
  1166. messageSends: [],
  1167. referencedClasses: []
  1168. }),
  1169. smalltalk.HLNavigationCodeWidget.klass);
  1170. smalltalk.addMethod(
  1171. smalltalk.method({
  1172. selector: "on:",
  1173. category: 'instance creation',
  1174. fn: function (aBrowserModel){
  1175. var self=this;
  1176. return smalltalk.withContext(function($ctx1) {
  1177. var $2,$3,$1;
  1178. $2=_st(self)._new();
  1179. _st($2)._browserModel_(aBrowserModel);
  1180. $3=_st($2)._yourself();
  1181. $1=$3;
  1182. return $1;
  1183. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLNavigationCodeWidget.klass)})},
  1184. args: ["aBrowserModel"],
  1185. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1186. messageSends: ["browserModel:", "new", "yourself"],
  1187. referencedClasses: []
  1188. }),
  1189. smalltalk.HLNavigationCodeWidget.klass);
  1190. smalltalk.addClass('HLBrowserCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  1191. smalltalk.addMethod(
  1192. smalltalk.method({
  1193. selector: "browserModel",
  1194. category: 'accessing',
  1195. fn: function (){
  1196. var self=this;
  1197. return smalltalk.withContext(function($ctx1) {
  1198. var $1;
  1199. $1=self["@browserModel"];
  1200. return $1;
  1201. }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLSourceCodeWidget)})},
  1202. args: [],
  1203. source: "browserModel\x0a\x09^ browserModel",
  1204. messageSends: [],
  1205. referencedClasses: []
  1206. }),
  1207. smalltalk.HLBrowserCodeWidget);
  1208. smalltalk.addMethod(
  1209. smalltalk.method({
  1210. selector: "browserModel:",
  1211. category: 'accessing',
  1212. fn: function (aBrowserModel){
  1213. var self=this;
  1214. return smalltalk.withContext(function($ctx1) {
  1215. var $1,$2;
  1216. self["@browserModel"]=aBrowserModel;
  1217. $1=self;
  1218. _st($1)._observeSystem();
  1219. $2=_st($1)._observeBrowserModel();
  1220. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget)})},
  1221. args: ["aBrowserModel"],
  1222. source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x09self \x0a\x09\x09observeSystem;\x0a\x09\x09observeBrowserModel",
  1223. messageSends: ["observeSystem", "observeBrowserModel"],
  1224. referencedClasses: []
  1225. }),
  1226. smalltalk.HLBrowserCodeWidget);
  1227. smalltalk.addMethod(
  1228. smalltalk.method({
  1229. selector: "observeBrowserModel",
  1230. category: 'actions',
  1231. fn: function (){
  1232. var self=this;
  1233. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  1234. function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
  1235. function $HLSourceCodeSaved(){return smalltalk.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  1236. function $HLAboutToChange(){return smalltalk.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  1237. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  1238. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  1239. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  1240. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  1241. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1242. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1243. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1244. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1245. return smalltalk.withContext(function($ctx1) {
  1246. var $1,$2;
  1247. $1=_st(_st(self)._browserModel())._announcer();
  1248. _st($1)._on_do_($HLSaveSourceCode(),(function(ann){
  1249. return smalltalk.withContext(function($ctx2) {
  1250. return _st(self)._onSaveIt();
  1251. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1252. _st($1)._on_do_($HLShowInstanceToggled(),(function(ann){
  1253. return smalltalk.withContext(function($ctx2) {
  1254. return _st(self)._onShowInstanceToggled();
  1255. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1256. _st($1)._on_do_($HLSourceCodeSaved(),(function(ann){
  1257. return smalltalk.withContext(function($ctx2) {
  1258. return _st(self)._onSourceCodeSaved();
  1259. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1260. _st($1)._on_do_($HLAboutToChange(),(function(ann){
  1261. return smalltalk.withContext(function($ctx2) {
  1262. return _st(self)._onBrowserAboutToChange_(_st(ann)._actionBlock());
  1263. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1264. _st($1)._on_do_($HLParseErrorRaised(),(function(ann){
  1265. return smalltalk.withContext(function($ctx2) {
  1266. return _st(self)._onParseError_(ann);
  1267. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1268. _st($1)._on_do_($HLCompileErrorRaised(),(function(ann){
  1269. return smalltalk.withContext(function($ctx2) {
  1270. return _st(self)._onCompileError_(_st(ann)._error());
  1271. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1272. _st($1)._on_do_($HLUnknownVariableErrorRaised(),(function(ann){
  1273. return smalltalk.withContext(function($ctx2) {
  1274. return _st(self)._onUnknownVariableError_(_st(ann)._error());
  1275. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1276. _st($1)._on_do_($HLInstVarAdded(),(function(ann){
  1277. return smalltalk.withContext(function($ctx2) {
  1278. return _st(self)._onInstVarAdded();
  1279. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1280. _st($1)._on_do_($HLMethodSelected(),(function(ann){
  1281. return smalltalk.withContext(function($ctx2) {
  1282. return _st(self)._onMethodSelected_(_st(ann)._item());
  1283. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1284. _st($1)._on_do_($HLClassSelected(),(function(ann){
  1285. return smalltalk.withContext(function($ctx2) {
  1286. return _st(self)._onClassSelected_(_st(ann)._item());
  1287. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1288. _st($1)._on_do_($HLProtocolSelected(),(function(ann){
  1289. return smalltalk.withContext(function($ctx2) {
  1290. return _st(self)._onProtocolSelected_(_st(ann)._item());
  1291. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1292. $2=_st($1)._on_do_($HLSourceCodeFocusRequested(),(function(ann){
  1293. return smalltalk.withContext(function($ctx2) {
  1294. return _st(self)._onSourceCodeFocusRequested();
  1295. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  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\x09do: [ :ann | self onSaveIt ];\x0a\x09\x09on: HLShowInstanceToggled\x0a\x09\x09do: [ :ann | self onShowInstanceToggled ];\x0a\x09\x09on: HLSourceCodeSaved\x0a\x09\x09do: [ :ann | self onSourceCodeSaved ];\x0a\x09\x09on: HLAboutToChange\x0a\x09\x09do: [ :ann | self onBrowserAboutToChange: ann actionBlock ];\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 ]",
  1299. messageSends: ["on:do:", "onSaveIt", "announcer", "browserModel", "onShowInstanceToggled", "onSourceCodeSaved", "onBrowserAboutToChange:", "actionBlock", "onParseError:", "onCompileError:", "error", "onUnknownVariableError:", "onInstVarAdded", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"],
  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. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1311. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1312. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1313. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1314. return smalltalk.withContext(function($ctx1) {
  1315. var $1,$2;
  1316. $1=_st(_st(self)._browserModel())._systemAnnouncer();
  1317. _st($1)._on_do_($MethodModified(),(function(ann){
  1318. return smalltalk.withContext(function($ctx2) {
  1319. return _st(self)._onMethodModified_(_st(ann)._method());
  1320. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1321. _st($1)._on_do_($HLMethodSelected(),(function(ann){
  1322. return smalltalk.withContext(function($ctx2) {
  1323. return _st(self)._onMethodSelected_(_st(ann)._item());
  1324. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1325. _st($1)._on_do_($HLClassSelected(),(function(ann){
  1326. return smalltalk.withContext(function($ctx2) {
  1327. return _st(self)._onClassSelected_(_st(ann)._item());
  1328. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1329. _st($1)._on_do_($HLProtocolSelected(),(function(ann){
  1330. return smalltalk.withContext(function($ctx2) {
  1331. return _st(self)._onProtocolSelected_(_st(ann)._item());
  1332. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1333. $2=_st($1)._on_do_($HLSourceCodeFocusRequested(),(function(ann){
  1334. return smalltalk.withContext(function($ctx2) {
  1335. return _st(self)._onSourceCodeFocusRequested();
  1336. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1337. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLSourceCodeWidget)})},
  1338. args: [],
  1339. 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 ]",
  1340. messageSends: ["on:do:", "onMethodModified:", "method", "systemAnnouncer", "browserModel", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"],
  1341. referencedClasses: ["MethodModified", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
  1342. }),
  1343. smalltalk.HLBrowserCodeWidget);
  1344. smalltalk.addMethod(
  1345. smalltalk.method({
  1346. selector: "onBrowserAboutToChange",
  1347. category: 'reactions',
  1348. fn: function (){
  1349. var self=this;
  1350. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  1351. return smalltalk.withContext(function($ctx1) {
  1352. var $1;
  1353. $1=_st(self)._hasModification();
  1354. if(smalltalk.assert($1)){
  1355. _st(self)._confirm_ifFalse_("Do you want to cancel changes?",(function(){
  1356. return smalltalk.withContext(function($ctx2) {
  1357. return _st($HLChangeForbidden())._signal();
  1358. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1359. _st(self)._methodContents_(_st(self)._contents());
  1360. };
  1361. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange",{},smalltalk.HLBrowserCodeWidget)})},
  1362. args: [],
  1363. source: "onBrowserAboutToChange\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\x09ifFalse: [ HLChangeForbidden signal ].\x0a\x09\x09\x09\x0a\x09\x09\x09\x22Don't ask twice\x22\x0a\x09\x09\x09self methodContents: self contents ]",
  1364. messageSends: ["ifTrue:", "confirm:ifFalse:", "signal", "methodContents:", "contents", "hasModification"],
  1365. referencedClasses: ["HLChangeForbidden"]
  1366. }),
  1367. smalltalk.HLBrowserCodeWidget);
  1368. smalltalk.addMethod(
  1369. smalltalk.method({
  1370. selector: "onBrowserAboutToChange:",
  1371. category: 'reactions',
  1372. fn: function (aBlock){
  1373. var self=this;
  1374. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  1375. return smalltalk.withContext(function($ctx1) {
  1376. var $1;
  1377. $1=_st(self)._hasModification();
  1378. if(smalltalk.assert($1)){
  1379. _st(self)._confirm_ifTrue_("Do you want to cancel changes?",(function(){
  1380. return smalltalk.withContext(function($ctx2) {
  1381. _st(self)._methodContents_(_st(self)._contents());
  1382. return _st(aBlock)._value();
  1383. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1384. _st($HLChangeForbidden())._signal();
  1385. };
  1386. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{aBlock:aBlock},smalltalk.HLBrowserCodeWidget)})},
  1387. args: ["aBlock"],
  1388. source: "onBrowserAboutToChange: aBlock\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\x09aBlock value ].\x0a\x09\x09\x09\x0a\x09\x09\x09\x0a\x09\x09\x09HLChangeForbidden signal ]",
  1389. messageSends: ["ifTrue:", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal", "hasModification"],
  1390. referencedClasses: ["HLChangeForbidden"]
  1391. }),
  1392. smalltalk.HLBrowserCodeWidget);
  1393. smalltalk.addMethod(
  1394. smalltalk.method({
  1395. selector: "onClassSelected:",
  1396. category: 'reactions',
  1397. fn: function (aClass){
  1398. var self=this;
  1399. return smalltalk.withContext(function($ctx1) {
  1400. var $1,$2;
  1401. $1=aClass;
  1402. if(($receiver = $1) == nil || $receiver == undefined){
  1403. $2=_st(self)._contents_("");
  1404. return $2;
  1405. } else {
  1406. $1;
  1407. };
  1408. _st(self)._contents_(_st(aClass)._definition());
  1409. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{aClass:aClass},smalltalk.HLSourceCodeWidget)})},
  1410. args: ["aClass"],
  1411. source: "onClassSelected: aClass\x0a\x09aClass ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: aClass definition",
  1412. messageSends: ["ifNil:", "contents:", "definition"],
  1413. referencedClasses: []
  1414. }),
  1415. smalltalk.HLBrowserCodeWidget);
  1416. smalltalk.addMethod(
  1417. smalltalk.method({
  1418. selector: "onCompileError:",
  1419. category: 'reactions',
  1420. fn: function (anError){
  1421. var self=this;
  1422. return smalltalk.withContext(function($ctx1) {
  1423. _st(self)._alert_(_st(anError)._messageText());
  1424. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anError:anError},smalltalk.HLSourceCodeWidget)})},
  1425. args: ["anError"],
  1426. source: "onCompileError: anError\x0a\x09self alert: anError messageText",
  1427. messageSends: ["alert:", "messageText"],
  1428. referencedClasses: []
  1429. }),
  1430. smalltalk.HLBrowserCodeWidget);
  1431. smalltalk.addMethod(
  1432. smalltalk.method({
  1433. selector: "onInstVarAdded",
  1434. category: 'reactions',
  1435. fn: function (){
  1436. var self=this;
  1437. return smalltalk.withContext(function($ctx1) {
  1438. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1439. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLBrowserCodeWidget)})},
  1440. args: [],
  1441. source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
  1442. messageSends: ["save:", "contents", "browserModel"],
  1443. referencedClasses: []
  1444. }),
  1445. smalltalk.HLBrowserCodeWidget);
  1446. smalltalk.addMethod(
  1447. smalltalk.method({
  1448. selector: "onMethodModified:",
  1449. category: 'reactions',
  1450. fn: function (aMethod){
  1451. var self=this;
  1452. return smalltalk.withContext(function($ctx1) {
  1453. var $1,$2,$3,$4,$5,$6;
  1454. $1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(aMethod)._methodClass());
  1455. if(! smalltalk.assert($1)){
  1456. $2=self;
  1457. return $2;
  1458. };
  1459. $3=_st(_st(self)._browserModel())._selectedMethod();
  1460. if(($receiver = $3) == nil || $receiver == undefined){
  1461. $4=self;
  1462. return $4;
  1463. } else {
  1464. $3;
  1465. };
  1466. $5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(aMethod)._selector());
  1467. if(! smalltalk.assert($5)){
  1468. $6=self;
  1469. return $6;
  1470. };
  1471. _st(self)._refresh();
  1472. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{aMethod:aMethod},smalltalk.HLBrowserCodeWidget)})},
  1473. args: ["aMethod"],
  1474. 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\x09self refresh",
  1475. messageSends: ["ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"],
  1476. referencedClasses: []
  1477. }),
  1478. smalltalk.HLBrowserCodeWidget);
  1479. smalltalk.addMethod(
  1480. smalltalk.method({
  1481. selector: "onMethodSelected:",
  1482. category: 'reactions',
  1483. fn: function (aCompiledMethod){
  1484. var self=this;
  1485. return smalltalk.withContext(function($ctx1) {
  1486. var $1,$2;
  1487. $1=aCompiledMethod;
  1488. if(($receiver = $1) == nil || $receiver == undefined){
  1489. $2=_st(self)._contents_("");
  1490. return $2;
  1491. } else {
  1492. $1;
  1493. };
  1494. _st(self)._contents_(_st(aCompiledMethod)._source());
  1495. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{aCompiledMethod:aCompiledMethod},smalltalk.HLSourceCodeWidget)})},
  1496. args: ["aCompiledMethod"],
  1497. source: "onMethodSelected: aCompiledMethod\x0a\x09aCompiledMethod ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: aCompiledMethod source",
  1498. messageSends: ["ifNil:", "contents:", "source"],
  1499. referencedClasses: []
  1500. }),
  1501. smalltalk.HLBrowserCodeWidget);
  1502. smalltalk.addMethod(
  1503. smalltalk.method({
  1504. selector: "onParseError:",
  1505. category: 'reactions',
  1506. fn: function (anAnnouncement){
  1507. var self=this;
  1508. var lineIndex,newContents;
  1509. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1510. return smalltalk.withContext(function($ctx1) {
  1511. var $1,$2,$3;
  1512. lineIndex=(1);
  1513. _st(self)._contents_(_st($String())._streamContents_((function(stream){
  1514. return smalltalk.withContext(function($ctx2) {
  1515. return _st(_st(self)._contents())._linesDo_((function(each){
  1516. return smalltalk.withContext(function($ctx3) {
  1517. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1518. if(smalltalk.assert($1)){
  1519. $2=stream;
  1520. _st($2)._nextPutAll_(_st(each)._copyFrom_to_((1),_st(anAnnouncement)._column()));
  1521. _st($2)._nextPutAll_("<- ");
  1522. _st($2)._nextPutAll_(_st(anAnnouncement)._message());
  1523. _st($2)._nextPutAll_(" ");
  1524. $3=_st($2)._nextPutAll_(_st(each)._copyFrom_to_(_st(_st(anAnnouncement)._column()).__plus((1)),_st(each)._size()));
  1525. $3;
  1526. } else {
  1527. _st(stream)._nextPutAll_(each);
  1528. };
  1529. _st(stream)._nextPutAll_(_st($String())._cr());
  1530. lineIndex=_st(lineIndex).__plus((1));
  1531. return lineIndex;
  1532. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1533. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1534. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
  1535. args: ["anAnnouncement"],
  1536. 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 ] ])",
  1537. messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"],
  1538. referencedClasses: ["String"]
  1539. }),
  1540. smalltalk.HLBrowserCodeWidget);
  1541. smalltalk.addMethod(
  1542. smalltalk.method({
  1543. selector: "onProtocolSelected:",
  1544. category: 'reactions',
  1545. fn: function (aString){
  1546. var self=this;
  1547. return smalltalk.withContext(function($ctx1) {
  1548. var $1,$2;
  1549. $1=_st(_st(self)._browserModel())._selectedClass();
  1550. if(($receiver = $1) == nil || $receiver == undefined){
  1551. $2=_st(self)._contents_("");
  1552. return $2;
  1553. } else {
  1554. $1;
  1555. };
  1556. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1557. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{aString:aString},smalltalk.HLSourceCodeWidget)})},
  1558. args: ["aString"],
  1559. source: "onProtocolSelected: aString\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: self browserModel selectedClass definition",
  1560. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
  1561. referencedClasses: []
  1562. }),
  1563. smalltalk.HLBrowserCodeWidget);
  1564. smalltalk.addMethod(
  1565. smalltalk.method({
  1566. selector: "onSaveIt",
  1567. category: 'reactions',
  1568. fn: function (){
  1569. var self=this;
  1570. return smalltalk.withContext(function($ctx1) {
  1571. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1572. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
  1573. args: [],
  1574. source: "onSaveIt\x0a\x09self browserModel save: self contents",
  1575. messageSends: ["save:", "contents", "browserModel"],
  1576. referencedClasses: []
  1577. }),
  1578. smalltalk.HLBrowserCodeWidget);
  1579. smalltalk.addMethod(
  1580. smalltalk.method({
  1581. selector: "onShowInstanceToggled",
  1582. category: 'reactions',
  1583. fn: function (){
  1584. var self=this;
  1585. return smalltalk.withContext(function($ctx1) {
  1586. var $1,$2;
  1587. $1=_st(_st(self)._browserModel())._selectedClass();
  1588. if(($receiver = $1) == nil || $receiver == undefined){
  1589. $2=_st(self)._contents_("");
  1590. return $2;
  1591. } else {
  1592. $1;
  1593. };
  1594. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1595. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},smalltalk.HLBrowserCodeWidget)})},
  1596. args: [],
  1597. source: "onShowInstanceToggled\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: self browserModel selectedClass definition",
  1598. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
  1599. referencedClasses: []
  1600. }),
  1601. smalltalk.HLBrowserCodeWidget);
  1602. smalltalk.addMethod(
  1603. smalltalk.method({
  1604. selector: "onSourceCodeFocusRequested",
  1605. category: 'reactions',
  1606. fn: function (){
  1607. var self=this;
  1608. return smalltalk.withContext(function($ctx1) {
  1609. _st(self)._focus();
  1610. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLSourceCodeWidget)})},
  1611. args: [],
  1612. source: "onSourceCodeFocusRequested\x0a\x09self focus",
  1613. messageSends: ["focus"],
  1614. referencedClasses: []
  1615. }),
  1616. smalltalk.HLBrowserCodeWidget);
  1617. smalltalk.addMethod(
  1618. smalltalk.method({
  1619. selector: "onSourceCodeSaved",
  1620. category: 'reactions',
  1621. fn: function (){
  1622. var self=this;
  1623. return smalltalk.withContext(function($ctx1) {
  1624. _st(self)._methodContents_(_st(self)._contents());
  1625. _st(self)._updateState();
  1626. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},smalltalk.HLBrowserCodeWidget)})},
  1627. args: [],
  1628. source: "onSourceCodeSaved\x0a\x09self methodContents: self contents.\x0a\x09self updateState",
  1629. messageSends: ["methodContents:", "contents", "updateState"],
  1630. referencedClasses: []
  1631. }),
  1632. smalltalk.HLBrowserCodeWidget);
  1633. smalltalk.addMethod(
  1634. smalltalk.method({
  1635. selector: "onUnknownVariableError:",
  1636. category: 'reactions',
  1637. fn: function (anError){
  1638. var self=this;
  1639. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1640. return smalltalk.withContext(function($ctx1) {
  1641. var $1,$2;
  1642. _st(self)._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1643. return smalltalk.withContext(function($ctx2) {
  1644. $1=stream;
  1645. _st($1)._nextPutAll_(_st(anError)._messageText());
  1646. _st($1)._nextPutAll_(_st($String())._cr());
  1647. $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
  1648. return $2;
  1649. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})),(function(){
  1650. return smalltalk.withContext(function($ctx2) {
  1651. return _st(_st(self)._browserModel())._addInstVarNamed_(_st(anError)._variableName());
  1652. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1653. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anError:anError},smalltalk.HLBrowserCodeWidget)})},
  1654. args: ["anError"],
  1655. source: "onUnknownVariableError: anError\x0a\x09self \x0a\x09\x09confirm: (String streamContents: [ :stream |\x0a\x09\x09\x09stream \x0a\x09\x09\x09\x09nextPutAll: anError 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: anError variableName ]",
  1656. messageSends: ["confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "variableName", "browserModel"],
  1657. referencedClasses: ["String"]
  1658. }),
  1659. smalltalk.HLBrowserCodeWidget);
  1660. smalltalk.addMethod(
  1661. smalltalk.method({
  1662. selector: "refresh",
  1663. category: 'actions',
  1664. fn: function (){
  1665. var self=this;
  1666. return smalltalk.withContext(function($ctx1) {
  1667. var $1,$2,$3,$4;
  1668. $1=_st(self)._hasModification();
  1669. if(smalltalk.assert($1)){
  1670. $2=self;
  1671. return $2;
  1672. };
  1673. $3=_st(self)._hasFocus();
  1674. if(smalltalk.assert($3)){
  1675. $4=self;
  1676. return $4;
  1677. };
  1678. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedMethod())._source());
  1679. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLBrowserCodeWidget)})},
  1680. args: [],
  1681. source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self browserModel selectedMethod source",
  1682. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"],
  1683. referencedClasses: []
  1684. }),
  1685. smalltalk.HLBrowserCodeWidget);
  1686. smalltalk.addMethod(
  1687. smalltalk.method({
  1688. selector: "saveIt",
  1689. category: 'actions',
  1690. fn: function (){
  1691. var self=this;
  1692. return smalltalk.withContext(function($ctx1) {
  1693. _st(_st(self)._browserModel())._saveSourceCode();
  1694. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
  1695. args: [],
  1696. source: "saveIt\x0a\x09self browserModel saveSourceCode",
  1697. messageSends: ["saveSourceCode", "browserModel"],
  1698. referencedClasses: []
  1699. }),
  1700. smalltalk.HLBrowserCodeWidget);
  1701. smalltalk.addMethod(
  1702. smalltalk.method({
  1703. selector: "canBeOpenAsTab",
  1704. category: 'testing',
  1705. fn: function (){
  1706. var self=this;
  1707. return smalltalk.withContext(function($ctx1) {
  1708. return false;
  1709. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
  1710. args: [],
  1711. source: "canBeOpenAsTab\x0a\x09^ false",
  1712. messageSends: [],
  1713. referencedClasses: []
  1714. }),
  1715. smalltalk.HLBrowserCodeWidget.klass);
  1716. smalltalk.addMethod(
  1717. smalltalk.method({
  1718. selector: "on:",
  1719. category: 'instance creation',
  1720. fn: function (aBrowserModel){
  1721. var self=this;
  1722. return smalltalk.withContext(function($ctx1) {
  1723. var $2,$3,$1;
  1724. $2=_st(self)._new();
  1725. _st($2)._browserModel_(aBrowserModel);
  1726. $3=_st($2)._yourself();
  1727. $1=$3;
  1728. return $1;
  1729. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
  1730. args: ["aBrowserModel"],
  1731. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1732. messageSends: ["browserModel:", "new", "yourself"],
  1733. referencedClasses: []
  1734. }),
  1735. smalltalk.HLBrowserCodeWidget.klass);
  1736. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget'], 'Helios-Workspace');
  1737. smalltalk.addMethod(
  1738. smalltalk.method({
  1739. selector: "canHaveFocus",
  1740. category: 'testing',
  1741. fn: function (){
  1742. var self=this;
  1743. return smalltalk.withContext(function($ctx1) {
  1744. return true;
  1745. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
  1746. args: [],
  1747. source: "canHaveFocus\x0a\x09^ true",
  1748. messageSends: [],
  1749. referencedClasses: []
  1750. }),
  1751. smalltalk.HLWorkspace);
  1752. smalltalk.addMethod(
  1753. smalltalk.method({
  1754. selector: "codeWidget",
  1755. category: 'accessing',
  1756. fn: function (){
  1757. var self=this;
  1758. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  1759. return smalltalk.withContext(function($ctx1) {
  1760. var $2,$1;
  1761. $2=self["@codeWidget"];
  1762. if(($receiver = $2) == nil || $receiver == undefined){
  1763. self["@codeWidget"]=_st($HLCodeWidget())._new();
  1764. $1=self["@codeWidget"];
  1765. } else {
  1766. $1=$2;
  1767. };
  1768. return $1;
  1769. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
  1770. args: [],
  1771. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
  1772. messageSends: ["ifNil:", "new"],
  1773. referencedClasses: ["HLCodeWidget"]
  1774. }),
  1775. smalltalk.HLWorkspace);
  1776. smalltalk.addMethod(
  1777. smalltalk.method({
  1778. selector: "focus",
  1779. category: 'actions',
  1780. fn: function (){
  1781. var self=this;
  1782. return smalltalk.withContext(function($ctx1) {
  1783. var $1;
  1784. $1=_st(_st(self)._codeWidget())._focus();
  1785. return $1;
  1786. }, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
  1787. args: [],
  1788. source: "focus\x0a\x09^ self codeWidget focus",
  1789. messageSends: ["focus", "codeWidget"],
  1790. referencedClasses: []
  1791. }),
  1792. smalltalk.HLWorkspace);
  1793. smalltalk.addMethod(
  1794. smalltalk.method({
  1795. selector: "renderContentOn:",
  1796. category: 'rendering',
  1797. fn: function (html){
  1798. var self=this;
  1799. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  1800. return smalltalk.withContext(function($ctx1) {
  1801. _st(html)._with_(_st($HLContainer())._with_(_st(self)._codeWidget()));
  1802. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
  1803. args: ["html"],
  1804. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: self codeWidget)",
  1805. messageSends: ["with:", "codeWidget"],
  1806. referencedClasses: ["HLContainer"]
  1807. }),
  1808. smalltalk.HLWorkspace);
  1809. smalltalk.addMethod(
  1810. smalltalk.method({
  1811. selector: "canBeOpenAsTab",
  1812. category: 'testing',
  1813. fn: function (){
  1814. var self=this;
  1815. return smalltalk.withContext(function($ctx1) {
  1816. return true;
  1817. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
  1818. args: [],
  1819. source: "canBeOpenAsTab\x0a\x09^ true",
  1820. messageSends: [],
  1821. referencedClasses: []
  1822. }),
  1823. smalltalk.HLWorkspace.klass);
  1824. smalltalk.addMethod(
  1825. smalltalk.method({
  1826. selector: "tabLabel",
  1827. category: 'accessing',
  1828. fn: function (){
  1829. var self=this;
  1830. return smalltalk.withContext(function($ctx1) {
  1831. return "Workspace";
  1832. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
  1833. args: [],
  1834. source: "tabLabel\x0a\x09^ 'Workspace'",
  1835. messageSends: [],
  1836. referencedClasses: []
  1837. }),
  1838. smalltalk.HLWorkspace.klass);
  1839. smalltalk.addMethod(
  1840. smalltalk.method({
  1841. selector: "tabPriority",
  1842. category: 'accessing',
  1843. fn: function (){
  1844. var self=this;
  1845. return smalltalk.withContext(function($ctx1) {
  1846. var $1;
  1847. $1=(10);
  1848. return $1;
  1849. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
  1850. args: [],
  1851. source: "tabPriority\x0a\x09^ 10",
  1852. messageSends: [],
  1853. referencedClasses: []
  1854. }),
  1855. smalltalk.HLWorkspace.klass);