1
0

Helios-Workspace.js 88 KB

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