2
0

Helios-Workspace.js 88 KB

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