Helios-Workspace.js 75 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900
  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_send_to_($HLSaveSourceCode(),"onSaveIt",self);
  1249. _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
  1250. _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
  1251. _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
  1252. _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
  1253. _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
  1254. _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
  1255. _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
  1256. _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
  1257. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  1258. _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
  1259. $2=_st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
  1260. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLBrowserCodeWidget)})},
  1261. args: [],
  1262. source: "observeBrowserModel\x0a\x09self browserModel announcer\x0a\x09\x09on: HLSaveSourceCode\x0a\x09\x09send: #onSaveIt\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLShowInstanceToggled\x0a\x09\x09send: #onShowInstanceToggled\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeSaved\x0a\x09\x09send: #onSourceCodeSaved\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLAboutToChange\x0a\x09\x09send: #onBrowserAboutToChange:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLParseErrorRaised\x0a\x09\x09send: #onParseError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLCompileErrorRaised\x0a\x09\x09send: #onCompileError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLUnknownVariableErrorRaised\x0a\x09\x09send: #onUnknownVariableError:\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLInstVarAdded \x0a\x09\x09send: #onInstVarAdded\x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09send: #onMethodSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a \x09on: HLClassSelected \x0a\x09\x09send: #onClassSelected:\x0a\x09\x09to: self;\x0a\x09\x09\x0a \x09on: HLProtocolSelected \x0a\x09\x09send: #onProtocolSelected: \x0a\x09\x09to: self;\x0a\x09\x09\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09send: #onSourceCodeFocusRequested\x0a\x09\x09to: self",
  1263. messageSends: ["on:send:to:", "announcer", "browserModel"],
  1264. referencedClasses: ["HLSaveSourceCode", "HLShowInstanceToggled", "HLSourceCodeSaved", "HLAboutToChange", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
  1265. }),
  1266. smalltalk.HLBrowserCodeWidget);
  1267. smalltalk.addMethod(
  1268. smalltalk.method({
  1269. selector: "observeSystem",
  1270. category: 'actions',
  1271. fn: function (){
  1272. var self=this;
  1273. function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  1274. return smalltalk.withContext(function($ctx1) {
  1275. _st(_st(_st(self)._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
  1276. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLBrowserCodeWidget)})},
  1277. args: [],
  1278. source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a \x09on: MethodModified\x0a send: #onMethodModified:\x0a\x09\x09to: self",
  1279. messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"],
  1280. referencedClasses: ["MethodModified"]
  1281. }),
  1282. smalltalk.HLBrowserCodeWidget);
  1283. smalltalk.addMethod(
  1284. smalltalk.method({
  1285. selector: "onBrowserAboutToChange:",
  1286. category: 'reactions',
  1287. fn: function (anAnnouncement){
  1288. var self=this;
  1289. var block;
  1290. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  1291. return smalltalk.withContext(function($ctx1) {
  1292. var $1;
  1293. block=_st(anAnnouncement)._actionBlock();
  1294. $1=_st(self)._hasModification();
  1295. if(smalltalk.assert($1)){
  1296. _st(self)._confirm_ifTrue_("Do you want to cancel changes?",(function(){
  1297. return smalltalk.withContext(function($ctx2) {
  1298. _st(self)._methodContents_(_st(self)._contents());
  1299. return _st(block)._value();
  1300. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1301. _st($HLChangeForbidden())._signal();
  1302. };
  1303. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},smalltalk.HLBrowserCodeWidget)})},
  1304. args: ["anAnnouncement"],
  1305. source: "onBrowserAboutToChange: anAnnouncement\x0a\x09| block |\x0a\x09\x0a\x09block := anAnnouncement actionBlock.\x0a\x09\x0a\x09self hasModification\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self \x0a\x09\x09\x09\x09confirm: 'Do you want to cancel changes?' \x0a\x09\x09\x09\x09ifTrue: [\x0a\x09\x09\x09\x09\x09\x22Don't ask twice\x22\x0a\x09\x09\x09\x09\x09self methodContents: self contents.\x0a\x09\x09\x09\x09\x09block value ].\x0a\x09\x09\x09\x0a\x09\x09\x09\x0a\x09\x09\x09HLChangeForbidden signal ]",
  1306. messageSends: ["actionBlock", "ifTrue:", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal", "hasModification"],
  1307. referencedClasses: ["HLChangeForbidden"]
  1308. }),
  1309. smalltalk.HLBrowserCodeWidget);
  1310. smalltalk.addMethod(
  1311. smalltalk.method({
  1312. selector: "onClassSelected:",
  1313. category: 'reactions',
  1314. fn: function (anAnnouncement){
  1315. var self=this;
  1316. var class_;
  1317. return smalltalk.withContext(function($ctx1) {
  1318. var $1,$2;
  1319. class_=_st(anAnnouncement)._item();
  1320. $1=class_;
  1321. if(($receiver = $1) == nil || $receiver == undefined){
  1322. $2=_st(self)._contents_("");
  1323. return $2;
  1324. } else {
  1325. $1;
  1326. };
  1327. _st(self)._contents_(_st(class_)._definition());
  1328. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLBrowserCodeWidget)})},
  1329. args: ["anAnnouncement"],
  1330. source: "onClassSelected: anAnnouncement\x0a\x09| class |\x0a\x09\x0a\x09class:= anAnnouncement item.\x0a\x09\x0a\x09class ifNil: [ ^ self contents: '' ].\x0a self contents: class definition",
  1331. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1332. referencedClasses: []
  1333. }),
  1334. smalltalk.HLBrowserCodeWidget);
  1335. smalltalk.addMethod(
  1336. smalltalk.method({
  1337. selector: "onCompileError:",
  1338. category: 'reactions',
  1339. fn: function (anAnnouncement){
  1340. var self=this;
  1341. return smalltalk.withContext(function($ctx1) {
  1342. _st(self)._alert_(_st(_st(anAnnouncement)._error())._messageText());
  1343. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1344. args: ["anAnnouncement"],
  1345. source: "onCompileError: anAnnouncement\x0a\x09self alert: anAnnouncement error messageText",
  1346. messageSends: ["alert:", "messageText", "error"],
  1347. referencedClasses: []
  1348. }),
  1349. smalltalk.HLBrowserCodeWidget);
  1350. smalltalk.addMethod(
  1351. smalltalk.method({
  1352. selector: "onInstVarAdded",
  1353. category: 'reactions',
  1354. fn: function (){
  1355. var self=this;
  1356. return smalltalk.withContext(function($ctx1) {
  1357. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1358. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLBrowserCodeWidget)})},
  1359. args: [],
  1360. source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
  1361. messageSends: ["save:", "contents", "browserModel"],
  1362. referencedClasses: []
  1363. }),
  1364. smalltalk.HLBrowserCodeWidget);
  1365. smalltalk.addMethod(
  1366. smalltalk.method({
  1367. selector: "onMethodModified:",
  1368. category: 'reactions',
  1369. fn: function (anAnnouncement){
  1370. var self=this;
  1371. var method;
  1372. return smalltalk.withContext(function($ctx1) {
  1373. var $1,$2,$3,$4,$5,$6;
  1374. method=_st(anAnnouncement)._method();
  1375. $1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(method)._methodClass());
  1376. if(! smalltalk.assert($1)){
  1377. $2=self;
  1378. return $2;
  1379. };
  1380. $3=_st(_st(self)._browserModel())._selectedMethod();
  1381. if(($receiver = $3) == nil || $receiver == undefined){
  1382. $4=self;
  1383. return $4;
  1384. } else {
  1385. $3;
  1386. };
  1387. $5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(method)._selector());
  1388. if(! smalltalk.assert($5)){
  1389. $6=self;
  1390. return $6;
  1391. };
  1392. _st(self)._refresh();
  1393. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1394. args: ["anAnnouncement"],
  1395. source: "onMethodModified: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement method.\x0a\x09\x0a\x09self browserModel selectedClass = method methodClass ifFalse: [ ^ self ].\x0a\x09self browserModel selectedMethod ifNil: [ ^ self ].\x0a self browserModel selectedMethod selector = method selector ifFalse: [ ^ self ].\x0a\x0a\x09self refresh",
  1396. messageSends: ["method", "ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"],
  1397. referencedClasses: []
  1398. }),
  1399. smalltalk.HLBrowserCodeWidget);
  1400. smalltalk.addMethod(
  1401. smalltalk.method({
  1402. selector: "onMethodSelected:",
  1403. category: 'reactions',
  1404. fn: function (anAnnouncement){
  1405. var self=this;
  1406. var method;
  1407. return smalltalk.withContext(function($ctx1) {
  1408. var $1,$2;
  1409. method=_st(anAnnouncement)._item();
  1410. $1=method;
  1411. if(($receiver = $1) == nil || $receiver == undefined){
  1412. $2=_st(self)._contents_("");
  1413. return $2;
  1414. } else {
  1415. $1;
  1416. };
  1417. _st(self)._contents_(_st(method)._source());
  1418. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1419. args: ["anAnnouncement"],
  1420. source: "onMethodSelected: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement item.\x0a\x09\x0a\x09method ifNil: [ ^ self contents: '' ].\x0a self contents: method source",
  1421. messageSends: ["item", "ifNil:", "contents:", "source"],
  1422. referencedClasses: []
  1423. }),
  1424. smalltalk.HLBrowserCodeWidget);
  1425. smalltalk.addMethod(
  1426. smalltalk.method({
  1427. selector: "onParseError:",
  1428. category: 'reactions',
  1429. fn: function (anAnnouncement){
  1430. var self=this;
  1431. var lineIndex,newContents;
  1432. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1433. return smalltalk.withContext(function($ctx1) {
  1434. var $1,$2,$3;
  1435. lineIndex=(1);
  1436. _st(self)._contents_(_st($String())._streamContents_((function(stream){
  1437. return smalltalk.withContext(function($ctx2) {
  1438. return _st(_st(self)._contents())._linesDo_((function(each){
  1439. return smalltalk.withContext(function($ctx3) {
  1440. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1441. if(smalltalk.assert($1)){
  1442. $2=stream;
  1443. _st($2)._nextPutAll_(_st(each)._copyFrom_to_((1),_st(anAnnouncement)._column()));
  1444. _st($2)._nextPutAll_("<- ");
  1445. _st($2)._nextPutAll_(_st(anAnnouncement)._message());
  1446. _st($2)._nextPutAll_(" ");
  1447. $3=_st($2)._nextPutAll_(_st(each)._copyFrom_to_(_st(_st(anAnnouncement)._column()).__plus((1)),_st(each)._size()));
  1448. $3;
  1449. } else {
  1450. _st(stream)._nextPutAll_(each);
  1451. };
  1452. _st(stream)._nextPutAll_(_st($String())._cr());
  1453. lineIndex=_st(lineIndex).__plus((1));
  1454. return lineIndex;
  1455. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1456. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1457. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
  1458. args: ["anAnnouncement"],
  1459. 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 ] ])",
  1460. messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"],
  1461. referencedClasses: ["String"]
  1462. }),
  1463. smalltalk.HLBrowserCodeWidget);
  1464. smalltalk.addMethod(
  1465. smalltalk.method({
  1466. selector: "onProtocolSelected:",
  1467. category: 'reactions',
  1468. fn: function (anAnnouncement){
  1469. var self=this;
  1470. return smalltalk.withContext(function($ctx1) {
  1471. var $1,$2;
  1472. $1=_st(_st(self)._browserModel())._selectedClass();
  1473. if(($receiver = $1) == nil || $receiver == undefined){
  1474. $2=_st(self)._contents_("");
  1475. return $2;
  1476. } else {
  1477. $1;
  1478. };
  1479. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1480. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1481. args: ["anAnnouncement"],
  1482. source: "onProtocolSelected: anAnnouncement\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a self contents: self browserModel selectedClass definition",
  1483. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
  1484. referencedClasses: []
  1485. }),
  1486. smalltalk.HLBrowserCodeWidget);
  1487. smalltalk.addMethod(
  1488. smalltalk.method({
  1489. selector: "onSaveIt",
  1490. category: 'reactions',
  1491. fn: function (){
  1492. var self=this;
  1493. return smalltalk.withContext(function($ctx1) {
  1494. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1495. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
  1496. args: [],
  1497. source: "onSaveIt\x0a\x09self browserModel save: self contents",
  1498. messageSends: ["save:", "contents", "browserModel"],
  1499. referencedClasses: []
  1500. }),
  1501. smalltalk.HLBrowserCodeWidget);
  1502. smalltalk.addMethod(
  1503. smalltalk.method({
  1504. selector: "onShowInstanceToggled",
  1505. category: 'reactions',
  1506. fn: function (){
  1507. var self=this;
  1508. return smalltalk.withContext(function($ctx1) {
  1509. var $1,$2;
  1510. $1=_st(_st(self)._browserModel())._selectedClass();
  1511. if(($receiver = $1) == nil || $receiver == undefined){
  1512. $2=_st(self)._contents_("");
  1513. return $2;
  1514. } else {
  1515. $1;
  1516. };
  1517. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1518. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},smalltalk.HLBrowserCodeWidget)})},
  1519. args: [],
  1520. source: "onShowInstanceToggled\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: self browserModel selectedClass definition",
  1521. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
  1522. referencedClasses: []
  1523. }),
  1524. smalltalk.HLBrowserCodeWidget);
  1525. smalltalk.addMethod(
  1526. smalltalk.method({
  1527. selector: "onSourceCodeFocusRequested",
  1528. category: 'reactions',
  1529. fn: function (){
  1530. var self=this;
  1531. return smalltalk.withContext(function($ctx1) {
  1532. _st(self)._focus();
  1533. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLSourceCodeWidget)})},
  1534. args: [],
  1535. source: "onSourceCodeFocusRequested\x0a\x09self focus",
  1536. messageSends: ["focus"],
  1537. referencedClasses: []
  1538. }),
  1539. smalltalk.HLBrowserCodeWidget);
  1540. smalltalk.addMethod(
  1541. smalltalk.method({
  1542. selector: "onSourceCodeSaved",
  1543. category: 'reactions',
  1544. fn: function (){
  1545. var self=this;
  1546. return smalltalk.withContext(function($ctx1) {
  1547. _st(self)._methodContents_(_st(self)._contents());
  1548. _st(self)._updateState();
  1549. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},smalltalk.HLBrowserCodeWidget)})},
  1550. args: [],
  1551. source: "onSourceCodeSaved\x0a\x09self methodContents: self contents.\x0a\x09self updateState",
  1552. messageSends: ["methodContents:", "contents", "updateState"],
  1553. referencedClasses: []
  1554. }),
  1555. smalltalk.HLBrowserCodeWidget);
  1556. smalltalk.addMethod(
  1557. smalltalk.method({
  1558. selector: "onUnknownVariableError:",
  1559. category: 'reactions',
  1560. fn: function (anAnnouncement){
  1561. var self=this;
  1562. var error;
  1563. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1564. return smalltalk.withContext(function($ctx1) {
  1565. var $1,$2;
  1566. error=_st(anAnnouncement)._error();
  1567. _st(self)._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1568. return smalltalk.withContext(function($ctx2) {
  1569. $1=stream;
  1570. _st($1)._nextPutAll_(_st(error)._messageText());
  1571. _st($1)._nextPutAll_(_st($String())._cr());
  1572. $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
  1573. return $2;
  1574. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})),(function(){
  1575. return smalltalk.withContext(function($ctx2) {
  1576. return _st(_st(self)._browserModel())._addInstVarNamed_(_st(error)._variableName());
  1577. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  1578. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},smalltalk.HLBrowserCodeWidget)})},
  1579. args: ["anAnnouncement"],
  1580. source: "onUnknownVariableError: anAnnouncement\x0a\x09| error |\x0a\x09\x0a\x09error := anAnnouncement error.\x0a\x09\x0a\x09self \x0a\x09\x09confirm: (String streamContents: [ :stream |\x0a\x09\x09\x09stream \x0a\x09\x09\x09\x09nextPutAll: error messageText;\x0a\x09\x09\x09\x09nextPutAll: String cr;\x0a\x09\x09\x09\x09nextPutAll: 'Would you like to define an instance variable?' ])\x0a\x09\x09ifTrue: [\x0a\x09\x09\x09self browserModel addInstVarNamed: error variableName ]",
  1581. messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "variableName", "browserModel"],
  1582. referencedClasses: ["String"]
  1583. }),
  1584. smalltalk.HLBrowserCodeWidget);
  1585. smalltalk.addMethod(
  1586. smalltalk.method({
  1587. selector: "refresh",
  1588. category: 'actions',
  1589. fn: function (){
  1590. var self=this;
  1591. return smalltalk.withContext(function($ctx1) {
  1592. var $1,$2,$3,$4;
  1593. $1=_st(self)._hasModification();
  1594. if(smalltalk.assert($1)){
  1595. $2=self;
  1596. return $2;
  1597. };
  1598. $3=_st(self)._hasFocus();
  1599. if(smalltalk.assert($3)){
  1600. $4=self;
  1601. return $4;
  1602. };
  1603. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedMethod())._source());
  1604. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLBrowserCodeWidget)})},
  1605. args: [],
  1606. source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self browserModel selectedMethod source",
  1607. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"],
  1608. referencedClasses: []
  1609. }),
  1610. smalltalk.HLBrowserCodeWidget);
  1611. smalltalk.addMethod(
  1612. smalltalk.method({
  1613. selector: "saveIt",
  1614. category: 'actions',
  1615. fn: function (){
  1616. var self=this;
  1617. return smalltalk.withContext(function($ctx1) {
  1618. _st(_st(self)._browserModel())._saveSourceCode();
  1619. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
  1620. args: [],
  1621. source: "saveIt\x0a\x09self browserModel saveSourceCode",
  1622. messageSends: ["saveSourceCode", "browserModel"],
  1623. referencedClasses: []
  1624. }),
  1625. smalltalk.HLBrowserCodeWidget);
  1626. smalltalk.addMethod(
  1627. smalltalk.method({
  1628. selector: "unregister",
  1629. category: 'actions',
  1630. fn: function (){
  1631. var self=this;
  1632. return smalltalk.withContext(function($ctx1) {
  1633. smalltalk.HLNavigationCodeWidget.fn.prototype._unregsiter.apply(_st(self), []);
  1634. _st(_st(_st(self)._browserModel())._announcer())._unsubscribe_(self);
  1635. _st(_st(_st(self)._browserModel())._systemAnnouncer())._unsubscribe_(self);
  1636. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLBrowserCodeWidget)})},
  1637. args: [],
  1638. source: "unregister\x0a\x09super unregsiter.\x0a\x09\x0a\x09self browserModel announcer unsubscribe: self.\x0a\x09self browserModel systemAnnouncer unsubscribe: self",
  1639. messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"],
  1640. referencedClasses: []
  1641. }),
  1642. smalltalk.HLBrowserCodeWidget);
  1643. smalltalk.addMethod(
  1644. smalltalk.method({
  1645. selector: "canBeOpenAsTab",
  1646. category: 'testing',
  1647. fn: function (){
  1648. var self=this;
  1649. return smalltalk.withContext(function($ctx1) {
  1650. return false;
  1651. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
  1652. args: [],
  1653. source: "canBeOpenAsTab\x0a\x09^ false",
  1654. messageSends: [],
  1655. referencedClasses: []
  1656. }),
  1657. smalltalk.HLBrowserCodeWidget.klass);
  1658. smalltalk.addMethod(
  1659. smalltalk.method({
  1660. selector: "on:",
  1661. category: 'instance creation',
  1662. fn: function (aBrowserModel){
  1663. var self=this;
  1664. return smalltalk.withContext(function($ctx1) {
  1665. var $2,$3,$1;
  1666. $2=_st(self)._new();
  1667. _st($2)._browserModel_(aBrowserModel);
  1668. $3=_st($2)._yourself();
  1669. $1=$3;
  1670. return $1;
  1671. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
  1672. args: ["aBrowserModel"],
  1673. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1674. messageSends: ["browserModel:", "new", "yourself"],
  1675. referencedClasses: []
  1676. }),
  1677. smalltalk.HLBrowserCodeWidget.klass);
  1678. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget'], 'Helios-Workspace');
  1679. smalltalk.addMethod(
  1680. smalltalk.method({
  1681. selector: "canHaveFocus",
  1682. category: 'testing',
  1683. fn: function (){
  1684. var self=this;
  1685. return smalltalk.withContext(function($ctx1) {
  1686. return true;
  1687. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
  1688. args: [],
  1689. source: "canHaveFocus\x0a\x09^ true",
  1690. messageSends: [],
  1691. referencedClasses: []
  1692. }),
  1693. smalltalk.HLWorkspace);
  1694. smalltalk.addMethod(
  1695. smalltalk.method({
  1696. selector: "codeWidget",
  1697. category: 'accessing',
  1698. fn: function (){
  1699. var self=this;
  1700. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  1701. return smalltalk.withContext(function($ctx1) {
  1702. var $2,$1;
  1703. $2=self["@codeWidget"];
  1704. if(($receiver = $2) == nil || $receiver == undefined){
  1705. self["@codeWidget"]=_st($HLCodeWidget())._new();
  1706. $1=self["@codeWidget"];
  1707. } else {
  1708. $1=$2;
  1709. };
  1710. return $1;
  1711. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
  1712. args: [],
  1713. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
  1714. messageSends: ["ifNil:", "new"],
  1715. referencedClasses: ["HLCodeWidget"]
  1716. }),
  1717. smalltalk.HLWorkspace);
  1718. smalltalk.addMethod(
  1719. smalltalk.method({
  1720. selector: "focus",
  1721. category: 'actions',
  1722. fn: function (){
  1723. var self=this;
  1724. return smalltalk.withContext(function($ctx1) {
  1725. var $1;
  1726. $1=_st(_st(self)._codeWidget())._focus();
  1727. return $1;
  1728. }, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
  1729. args: [],
  1730. source: "focus\x0a\x09^ self codeWidget focus",
  1731. messageSends: ["focus", "codeWidget"],
  1732. referencedClasses: []
  1733. }),
  1734. smalltalk.HLWorkspace);
  1735. smalltalk.addMethod(
  1736. smalltalk.method({
  1737. selector: "renderContentOn:",
  1738. category: 'rendering',
  1739. fn: function (html){
  1740. var self=this;
  1741. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  1742. return smalltalk.withContext(function($ctx1) {
  1743. _st(html)._with_(_st($HLContainer())._with_(_st(self)._codeWidget()));
  1744. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
  1745. args: ["html"],
  1746. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: self codeWidget)",
  1747. messageSends: ["with:", "codeWidget"],
  1748. referencedClasses: ["HLContainer"]
  1749. }),
  1750. smalltalk.HLWorkspace);
  1751. smalltalk.addMethod(
  1752. smalltalk.method({
  1753. selector: "canBeOpenAsTab",
  1754. category: 'testing',
  1755. fn: function (){
  1756. var self=this;
  1757. return smalltalk.withContext(function($ctx1) {
  1758. return true;
  1759. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
  1760. args: [],
  1761. source: "canBeOpenAsTab\x0a\x09^ true",
  1762. messageSends: [],
  1763. referencedClasses: []
  1764. }),
  1765. smalltalk.HLWorkspace.klass);
  1766. smalltalk.addMethod(
  1767. smalltalk.method({
  1768. selector: "tabLabel",
  1769. category: 'accessing',
  1770. fn: function (){
  1771. var self=this;
  1772. return smalltalk.withContext(function($ctx1) {
  1773. return "Workspace";
  1774. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
  1775. args: [],
  1776. source: "tabLabel\x0a\x09^ 'Workspace'",
  1777. messageSends: [],
  1778. referencedClasses: []
  1779. }),
  1780. smalltalk.HLWorkspace.klass);
  1781. smalltalk.addMethod(
  1782. smalltalk.method({
  1783. selector: "tabPriority",
  1784. category: 'accessing',
  1785. fn: function (){
  1786. var self=this;
  1787. return smalltalk.withContext(function($ctx1) {
  1788. var $1;
  1789. $1=(10);
  1790. return $1;
  1791. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
  1792. args: [],
  1793. source: "tabPriority\x0a\x09^ 10",
  1794. messageSends: [],
  1795. referencedClasses: []
  1796. }),
  1797. smalltalk.HLWorkspace.klass);