Helios-Workspace.js 88 KB

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