Helios-Workspace.js 78 KB

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