1
0

Helios-Workspace.js 88 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374
  1. define("amber_core/Helios-Workspace", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_core/Kernel-Objects", "amber_core/Helios-Core"], function(smalltalk,nil,_st){
  2. smalltalk.addPackage('Helios-Workspace');
  3. smalltalk.packages["Helios-Workspace"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "announcer",
  8. category: 'accessing',
  9. fn: function (){
  10. var self=this;
  11. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  12. return smalltalk.withContext(function($ctx1) {
  13. var $2,$1;
  14. $2=self["@announcer"];
  15. if(($receiver = $2) == nil || $receiver == null){
  16. self["@announcer"]=_st($Announcer())._new();
  17. $1=self["@announcer"];
  18. } else {
  19. $1=$2;
  20. };
  21. return $1;
  22. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeModel)})},
  23. args: [],
  24. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  25. messageSends: ["ifNil:", "new"],
  26. referencedClasses: ["Announcer"]
  27. }),
  28. smalltalk.HLCodeModel);
  29. smalltalk.addMethod(
  30. smalltalk.method({
  31. selector: "defaultReceiver",
  32. category: 'defaults',
  33. fn: function (){
  34. var self=this;
  35. return smalltalk.withContext(function($ctx1) {
  36. var $1;
  37. $1=_st(self._environment())._doItReceiver();
  38. return $1;
  39. }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{},smalltalk.HLCodeModel)})},
  40. args: [],
  41. source: "defaultReceiver\x0a\x09^ self environment doItReceiver",
  42. messageSends: ["doItReceiver", "environment"],
  43. referencedClasses: []
  44. }),
  45. smalltalk.HLCodeModel);
  46. smalltalk.addMethod(
  47. smalltalk.method({
  48. selector: "doIt:",
  49. category: 'actions',
  50. fn: function (aString){
  51. var self=this;
  52. return smalltalk.withContext(function($ctx1) {
  53. var $1;
  54. $1=_st(self._environment())._eval_on_(aString,self._receiver());
  55. return $1;
  56. }, function($ctx1) {$ctx1.fill(self,"doIt:",{aString:aString},smalltalk.HLCodeModel)})},
  57. args: ["aString"],
  58. source: "doIt: aString\x0a\x0a\x09^ self environment eval: aString on: self receiver",
  59. messageSends: ["eval:on:", "environment", "receiver"],
  60. referencedClasses: []
  61. }),
  62. smalltalk.HLCodeModel);
  63. smalltalk.addMethod(
  64. smalltalk.method({
  65. selector: "environment",
  66. category: 'accessing',
  67. fn: function (){
  68. var self=this;
  69. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  70. return smalltalk.withContext(function($ctx1) {
  71. var $2,$1;
  72. $2=self["@environment"];
  73. if(($receiver = $2) == nil || $receiver == null){
  74. $1=_st(_st($HLManager())._current())._environment();
  75. } else {
  76. $1=$2;
  77. };
  78. return $1;
  79. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLCodeModel)})},
  80. args: [],
  81. source: "environment\x0a\x09^ environment ifNil: [ HLManager current environment ]",
  82. messageSends: ["ifNil:", "environment", "current"],
  83. referencedClasses: ["HLManager"]
  84. }),
  85. smalltalk.HLCodeModel);
  86. smalltalk.addMethod(
  87. smalltalk.method({
  88. selector: "environment:",
  89. category: 'accessing',
  90. fn: function (anEnvironment){
  91. var self=this;
  92. return smalltalk.withContext(function($ctx1) {
  93. self["@environment"]=anEnvironment;
  94. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel)})},
  95. args: ["anEnvironment"],
  96. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  97. messageSends: [],
  98. referencedClasses: []
  99. }),
  100. smalltalk.HLCodeModel);
  101. smalltalk.addMethod(
  102. smalltalk.method({
  103. selector: "inspect:",
  104. category: 'actions',
  105. fn: function (anObject){
  106. var self=this;
  107. return smalltalk.withContext(function($ctx1) {
  108. _st(self._environment())._inspect_(anObject);
  109. return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},smalltalk.HLCodeModel)})},
  110. args: ["anObject"],
  111. source: "inspect: anObject\x0a\x09self environment inspect: anObject",
  112. messageSends: ["inspect:", "environment"],
  113. referencedClasses: []
  114. }),
  115. smalltalk.HLCodeModel);
  116. smalltalk.addMethod(
  117. smalltalk.method({
  118. selector: "receiver",
  119. category: 'accessing',
  120. fn: function (){
  121. var self=this;
  122. return smalltalk.withContext(function($ctx1) {
  123. var $2,$1;
  124. $2=self["@receiver"];
  125. if(($receiver = $2) == nil || $receiver == null){
  126. self["@receiver"]=self._defaultReceiver();
  127. $1=self["@receiver"];
  128. } else {
  129. $1=$2;
  130. };
  131. return $1;
  132. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeModel)})},
  133. args: [],
  134. source: "receiver\x0a\x09^ receiver ifNil: [ receiver := self defaultReceiver ]",
  135. messageSends: ["ifNil:", "defaultReceiver"],
  136. referencedClasses: []
  137. }),
  138. smalltalk.HLCodeModel);
  139. smalltalk.addMethod(
  140. smalltalk.method({
  141. selector: "receiver:",
  142. category: 'accessing',
  143. fn: function (anObject){
  144. var self=this;
  145. return smalltalk.withContext(function($ctx1) {
  146. self["@receiver"]=anObject;
  147. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeModel)})},
  148. args: ["anObject"],
  149. source: "receiver: anObject\x0a\x09receiver := anObject",
  150. messageSends: [],
  151. referencedClasses: []
  152. }),
  153. smalltalk.HLCodeModel);
  154. smalltalk.addMethod(
  155. smalltalk.method({
  156. selector: "on:",
  157. category: 'actions',
  158. fn: function (anEnvironment){
  159. var self=this;
  160. return smalltalk.withContext(function($ctx1) {
  161. var $2,$3,$1;
  162. $2=self._new();
  163. _st($2)._environment_(anEnvironment);
  164. $3=_st($2)._yourself();
  165. $1=$3;
  166. return $1;
  167. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel.klass)})},
  168. args: ["anEnvironment"],
  169. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  170. messageSends: ["environment:", "new", "yourself"],
  171. referencedClasses: []
  172. }),
  173. smalltalk.HLCodeModel.klass);
  174. smalltalk.addClass('HLCodeWidget', smalltalk.HLWidget, ['model', 'wrapper', 'code', 'editor', 'state'], 'Helios-Workspace');
  175. smalltalk.addMethod(
  176. smalltalk.method({
  177. selector: "announcer",
  178. category: 'accessing',
  179. fn: function (){
  180. var self=this;
  181. return smalltalk.withContext(function($ctx1) {
  182. var $1;
  183. $1=_st(self._model())._announcer();
  184. return $1;
  185. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeWidget)})},
  186. args: [],
  187. source: "announcer\x0a\x09^ self model announcer",
  188. messageSends: ["announcer", "model"],
  189. referencedClasses: []
  190. }),
  191. smalltalk.HLCodeWidget);
  192. smalltalk.addMethod(
  193. smalltalk.method({
  194. selector: "canHaveFocus",
  195. category: 'testing',
  196. fn: function (){
  197. var self=this;
  198. return smalltalk.withContext(function($ctx1) {
  199. return true;
  200. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLCodeWidget)})},
  201. args: [],
  202. source: "canHaveFocus\x0a\x09^ true",
  203. messageSends: [],
  204. referencedClasses: []
  205. }),
  206. smalltalk.HLCodeWidget);
  207. smalltalk.addMethod(
  208. smalltalk.method({
  209. selector: "clear",
  210. category: 'actions',
  211. fn: function (){
  212. var self=this;
  213. return smalltalk.withContext(function($ctx1) {
  214. self._contents_("");
  215. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLCodeWidget)})},
  216. args: [],
  217. source: "clear\x0a\x09self contents: ''",
  218. messageSends: ["contents:"],
  219. referencedClasses: []
  220. }),
  221. smalltalk.HLCodeWidget);
  222. smalltalk.addMethod(
  223. smalltalk.method({
  224. selector: "configureEditor",
  225. category: 'actions',
  226. fn: function (){
  227. var self=this;
  228. return smalltalk.withContext(function($ctx1) {
  229. var $1;
  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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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(_st($Smalltalk())._current())._at_("allSelectors"))._value())._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 current at: 'allSelectors') value asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
  495. messageSends: ["reject:", "select:", "asArray", "value", "at:", "current", "includesSubString:", "string", "="],
  496. referencedClasses: ["Smalltalk"]
  497. }),
  498. smalltalk.HLCodeWidget);
  499. smalltalk.addMethod(
  500. smalltalk.method({
  501. selector: "model",
  502. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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. category: '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,$5,$4,$10,$9,$8,$11,$7,$6;
  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. $5=_st($Smalltalk())._current();
  960. $ctx1.sendIdx["current"]=1;
  961. $4=_st($5)._classes();
  962. classNames=_st($4)._collect_((function(each){
  963. return smalltalk.withContext(function($ctx2) {
  964. return _st(each)._name();
  965. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  966. pseudoVariables=_st(_st($Smalltalk())._current())._pseudoVariableNames();
  967. $10=_st(_st(variables).__comma(classNames)).__comma(pseudoVariables);
  968. $ctx1.sendIdx[","]=1;
  969. $9=_st($10)._asSet();
  970. $8=_st($9)._asArray();
  971. $7=_st($8)._select_((function(each){
  972. return smalltalk.withContext(function($ctx2) {
  973. $11=_st(aToken)._string();
  974. $ctx2.sendIdx["string"]=1;
  975. return _st(each)._includesSubString_($11);
  976. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})}));
  977. $6=_st($7)._reject_((function(each){
  978. return smalltalk.withContext(function($ctx2) {
  979. return _st(each).__eq(_st(aToken)._string());
  980. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
  981. return $6;
  982. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},smalltalk.HLCodeWidget)})},
  983. args: ["anEditor", "aToken"],
  984. source: "variableHintFor: anEditor token: aToken\x0a\x09| variables classNames pseudoVariables |\x0a\x09\x0a\x09variables := (anEditor display wrapper asJQuery find: 'span.cm-variable') get\x0a\x09\x09collect: [ :each | each asJQuery html ].\x0a\x09\x0a\x09classNames := Smalltalk current classes collect: [ :each | each name ].\x0a\x09pseudoVariables := Smalltalk current pseudoVariableNames.\x0a\x09\x0a\x09^ ((variables, classNames, pseudoVariables) asSet asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
  985. messageSends: ["collect:", "get", "find:", "asJQuery", "wrapper", "display", "html", "classes", "current", "name", "pseudoVariableNames", "reject:", "select:", "asArray", "asSet", ",", "includesSubString:", "string", "="],
  986. referencedClasses: ["Smalltalk"]
  987. }),
  988. smalltalk.HLCodeWidget);
  989. smalltalk.addMethod(
  990. smalltalk.method({
  991. selector: "hintFor:options:",
  992. category: 'hints',
  993. fn: function (anEditor,options){
  994. var self=this;
  995. var cursor,token,completions;
  996. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  997. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  998. return smalltalk.withContext(function($ctx1) {
  999. var $1,$4,$3,$2,$5,$7,$10,$11,$9,$8,$6;
  1000. cursor=_st(anEditor)._getCursor();
  1001. token=_st(anEditor)._getTokenAt_(cursor);
  1002. $1=token;
  1003. $4=_st($CodeMirror())._basicAt_("innerMode");
  1004. $ctx1.sendIdx["basicAt:"]=1;
  1005. $3=_st($4)._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state"));
  1006. $ctx1.sendIdx["value:value:"]=1;
  1007. $2=_st($3)._state();
  1008. _st($1)._at_put_("state",$2);
  1009. $5=_st(_st(token)._type()).__eq("variable");
  1010. if(smalltalk.assert($5)){
  1011. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  1012. } else {
  1013. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  1014. };
  1015. $7="list".__minus_gt(completions);
  1016. $ctx1.sendIdx["->"]=1;
  1017. $10=_st($CodeMirror())._basicAt_("Pos");
  1018. $ctx1.sendIdx["basicAt:"]=2;
  1019. $11=_st(cursor)._line();
  1020. $ctx1.sendIdx["line"]=1;
  1021. $9=_st($10)._value_value_($11,_st(token)._end());
  1022. $ctx1.sendIdx["value:value:"]=2;
  1023. $8="from".__minus_gt($9);
  1024. $ctx1.sendIdx["->"]=2;
  1025. $6=smalltalk.HashedCollection._from_([$7,$8,"to".__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._start()))]);
  1026. return $6;
  1027. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},smalltalk.HLCodeWidget.klass)})},
  1028. args: ["anEditor", "options"],
  1029. 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}",
  1030. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "basicAt:", "getMode", "at:", "ifTrue:ifFalse:", "=", "type", "variableHintFor:token:", "messageHintFor:token:", "->", "line", "end", "start"],
  1031. referencedClasses: ["CodeMirror", "HLCodeWidget"]
  1032. }),
  1033. smalltalk.HLCodeWidget.klass);
  1034. smalltalk.addMethod(
  1035. smalltalk.method({
  1036. selector: "initialize",
  1037. category: 'initialization',
  1038. fn: function (){
  1039. var self=this;
  1040. return smalltalk.withContext(function($ctx1) {
  1041. var $1;
  1042. smalltalk.HLCodeWidget.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1043. self._setupCodeMirror();
  1044. self._setupCommands();
  1045. $1=self._setupKeyMaps();
  1046. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLCodeWidget.klass)})},
  1047. args: [],
  1048. source: "initialize\x0a\x09super initialize.\x0a\x09self \x0a\x09\x09setupCodeMirror;\x0a\x09\x09setupCommands;\x0a\x09\x09setupKeyMaps.",
  1049. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"],
  1050. referencedClasses: []
  1051. }),
  1052. smalltalk.HLCodeWidget.klass);
  1053. smalltalk.addMethod(
  1054. smalltalk.method({
  1055. selector: "keyMap",
  1056. category: 'accessing',
  1057. fn: function (){
  1058. var self=this;
  1059. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1060. return smalltalk.withContext(function($ctx1) {
  1061. var $2,$1;
  1062. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  1063. if(smalltalk.assert($2)){
  1064. $1=self._macKeyMap();
  1065. } else {
  1066. $1=self._pcKeyMap();
  1067. };
  1068. return $1;
  1069. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},smalltalk.HLCodeWidget.klass)})},
  1070. args: [],
  1071. source: "keyMap\x0a\x09^ HLManager current keyBinder systemIsMac\x0a\x09\x09ifTrue: [ self macKeyMap ]\x0a\x09\x09ifFalse: [ self pcKeyMap ]",
  1072. messageSends: ["ifTrue:ifFalse:", "systemIsMac", "keyBinder", "current", "macKeyMap", "pcKeyMap"],
  1073. referencedClasses: ["HLManager"]
  1074. }),
  1075. smalltalk.HLCodeWidget.klass);
  1076. smalltalk.addMethod(
  1077. smalltalk.method({
  1078. selector: "macKeyMap",
  1079. category: 'accessing',
  1080. fn: function (){
  1081. var self=this;
  1082. return smalltalk.withContext(function($ctx1) {
  1083. 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;
  1084. $2="Alt-Backspace".__minus_gt("delWordBefore");
  1085. $ctx1.sendIdx["->"]=1;
  1086. $3="Alt-Delete".__minus_gt("delWordAfter");
  1087. $ctx1.sendIdx["->"]=2;
  1088. $4="Alt-Left".__minus_gt("goWordBoundaryLeft");
  1089. $ctx1.sendIdx["->"]=3;
  1090. $5="Alt-Right".__minus_gt("goWordBoundaryRight");
  1091. $ctx1.sendIdx["->"]=4;
  1092. $6="Cmd-A".__minus_gt("selectAll");
  1093. $ctx1.sendIdx["->"]=5;
  1094. $7="Cmd-Alt-F".__minus_gt("replace");
  1095. $ctx1.sendIdx["->"]=6;
  1096. $8="Cmd-D".__minus_gt("doIt");
  1097. $ctx1.sendIdx["->"]=7;
  1098. $9="Cmd-Down".__minus_gt("goDocEnd");
  1099. $ctx1.sendIdx["->"]=8;
  1100. $10="Cmd-End".__minus_gt("goDocEnd");
  1101. $ctx1.sendIdx["->"]=9;
  1102. $11="Cmd-F".__minus_gt("find");
  1103. $ctx1.sendIdx["->"]=10;
  1104. $12="Cmd-G".__minus_gt("findNext");
  1105. $ctx1.sendIdx["->"]=11;
  1106. $13="Cmd-I".__minus_gt("inspectIt");
  1107. $ctx1.sendIdx["->"]=12;
  1108. $14="Cmd-Left".__minus_gt("goLineStart");
  1109. $ctx1.sendIdx["->"]=13;
  1110. $15="Cmd-P".__minus_gt("printIt");
  1111. $ctx1.sendIdx["->"]=14;
  1112. $16="Cmd-Right".__minus_gt("goLineEnd");
  1113. $ctx1.sendIdx["->"]=15;
  1114. $17="Cmd-S".__minus_gt("saveIt");
  1115. $ctx1.sendIdx["->"]=16;
  1116. $18="Cmd-Up".__minus_gt("goDocStart");
  1117. $ctx1.sendIdx["->"]=17;
  1118. $19="Cmd-Y".__minus_gt("redo");
  1119. $ctx1.sendIdx["->"]=18;
  1120. $20="Cmd-Z".__minus_gt("undo");
  1121. $ctx1.sendIdx["->"]=19;
  1122. $21="Cmd-[".__minus_gt("indentLess");
  1123. $ctx1.sendIdx["->"]=20;
  1124. $22="Cmd-]".__minus_gt("indentMore");
  1125. $ctx1.sendIdx["->"]=21;
  1126. $23="Ctrl-Alt-Backspace".__minus_gt("delWordAfter");
  1127. $ctx1.sendIdx["->"]=22;
  1128. $24="Shift-Cmd-Alt-F".__minus_gt("replaceAll");
  1129. $ctx1.sendIdx["->"]=23;
  1130. $25="Shift-Cmd-G".__minus_gt("findPrev");
  1131. $ctx1.sendIdx["->"]=24;
  1132. $26="Shift-Cmd-Z".__minus_gt("redo");
  1133. $ctx1.sendIdx["->"]=25;
  1134. $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"])]);
  1135. return $1;
  1136. }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  1137. args: [],
  1138. 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 }",
  1139. messageSends: ["->"],
  1140. referencedClasses: []
  1141. }),
  1142. smalltalk.HLCodeWidget.klass);
  1143. smalltalk.addMethod(
  1144. smalltalk.method({
  1145. selector: "messageHintFor:token:",
  1146. category: 'hints',
  1147. fn: function (anEditor,aToken){
  1148. var self=this;
  1149. return smalltalk.withContext(function($ctx1) {
  1150. var $1;
  1151. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  1152. return $1;
  1153. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  1154. args: ["anEditor", "aToken"],
  1155. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09messageHintFor: anEditor token: aToken",
  1156. messageSends: ["messageHintFor:token:", "at:"],
  1157. referencedClasses: []
  1158. }),
  1159. smalltalk.HLCodeWidget.klass);
  1160. smalltalk.addMethod(
  1161. smalltalk.method({
  1162. selector: "pcKeyMap",
  1163. category: 'accessing',
  1164. fn: function (){
  1165. var self=this;
  1166. return smalltalk.withContext(function($ctx1) {
  1167. 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;
  1168. $2="Alt-Left".__minus_gt("goLineStart");
  1169. $ctx1.sendIdx["->"]=1;
  1170. $3="Alt-Right".__minus_gt("goLineEnd");
  1171. $ctx1.sendIdx["->"]=2;
  1172. $4="Alt-Up".__minus_gt("goDocStart");
  1173. $ctx1.sendIdx["->"]=3;
  1174. $5="Ctrl-A".__minus_gt("selectAll");
  1175. $ctx1.sendIdx["->"]=4;
  1176. $6="Ctrl-Backspace".__minus_gt("delWordBefore");
  1177. $ctx1.sendIdx["->"]=5;
  1178. $7="Ctrl-D".__minus_gt("doIt");
  1179. $ctx1.sendIdx["->"]=6;
  1180. $8="Ctrl-Delete".__minus_gt("delWordAfter");
  1181. $ctx1.sendIdx["->"]=7;
  1182. $9="Ctrl-Down".__minus_gt("goDocEnd");
  1183. $ctx1.sendIdx["->"]=8;
  1184. $10="Ctrl-End".__minus_gt("goDocEnd");
  1185. $ctx1.sendIdx["->"]=9;
  1186. $11="Ctrl-F".__minus_gt("find");
  1187. $ctx1.sendIdx["->"]=10;
  1188. $12="Ctrl-G".__minus_gt("findNext");
  1189. $ctx1.sendIdx["->"]=11;
  1190. $13="Ctrl-I".__minus_gt("inspectIt");
  1191. $ctx1.sendIdx["->"]=12;
  1192. $14="Ctrl-Home".__minus_gt("goDocStart");
  1193. $ctx1.sendIdx["->"]=13;
  1194. $15="Ctrl-Left".__minus_gt("goWordBoundaryLeft");
  1195. $ctx1.sendIdx["->"]=14;
  1196. $16="Ctrl-P".__minus_gt("printIt");
  1197. $ctx1.sendIdx["->"]=15;
  1198. $17="Ctrl-Right".__minus_gt("goWordBoundaryRight");
  1199. $ctx1.sendIdx["->"]=16;
  1200. $18="Ctrl-S".__minus_gt("saveIt");
  1201. $ctx1.sendIdx["->"]=17;
  1202. $19="Ctrl-Y".__minus_gt("redo");
  1203. $ctx1.sendIdx["->"]=18;
  1204. $20="Ctrl-Z".__minus_gt("undo");
  1205. $ctx1.sendIdx["->"]=19;
  1206. $21="Ctrl-[".__minus_gt("indentLess");
  1207. $ctx1.sendIdx["->"]=20;
  1208. $22="Ctrl-]".__minus_gt("indentMore");
  1209. $ctx1.sendIdx["->"]=21;
  1210. $23="Shift-Ctrl-F".__minus_gt("replace");
  1211. $ctx1.sendIdx["->"]=22;
  1212. $24="Shift-Ctrl-G".__minus_gt("findPrev");
  1213. $ctx1.sendIdx["->"]=23;
  1214. $25="Shift-Ctrl-R".__minus_gt("replaceAll");
  1215. $ctx1.sendIdx["->"]=24;
  1216. $26="Shift-Ctrl-Z".__minus_gt("redo");
  1217. $ctx1.sendIdx["->"]=25;
  1218. $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"])]);
  1219. return $1;
  1220. }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  1221. args: [],
  1222. 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}",
  1223. messageSends: ["->"],
  1224. referencedClasses: []
  1225. }),
  1226. smalltalk.HLCodeWidget.klass);
  1227. smalltalk.addMethod(
  1228. smalltalk.method({
  1229. selector: "setupCodeMirror",
  1230. category: 'initialization',
  1231. fn: function (){
  1232. var self=this;
  1233. return smalltalk.withContext(function($ctx1) {
  1234. CodeMirror.keyMap.default.fallthrough = ["basic"];
  1235. CodeMirror.commands.autocomplete = function(cm) {
  1236. CodeMirror.showHint(cm, self._hintFor_options_);
  1237. }
  1238. ;
  1239. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.HLCodeWidget.klass)})},
  1240. args: [],
  1241. 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>",
  1242. messageSends: [],
  1243. referencedClasses: []
  1244. }),
  1245. smalltalk.HLCodeWidget.klass);
  1246. smalltalk.addMethod(
  1247. smalltalk.method({
  1248. selector: "setupCommands",
  1249. category: 'initialization',
  1250. fn: function (){
  1251. var self=this;
  1252. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  1253. return smalltalk.withContext(function($ctx1) {
  1254. var $1,$2,$3,$4,$5;
  1255. $1=_st($CodeMirror())._basicAt_("commands");
  1256. _st($1)._at_put_("doIt",(function(cm){
  1257. return smalltalk.withContext(function($ctx2) {
  1258. $2=_st(cm)._amberCodeWidget();
  1259. $ctx2.sendIdx["amberCodeWidget"]=1;
  1260. return _st($2)._doIt();
  1261. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,1)})}));
  1262. $ctx1.sendIdx["at:put:"]=1;
  1263. _st($1)._at_put_("inspectIt",(function(cm){
  1264. return smalltalk.withContext(function($ctx2) {
  1265. $3=_st(cm)._amberCodeWidget();
  1266. $ctx2.sendIdx["amberCodeWidget"]=2;
  1267. return _st($3)._inspectIt();
  1268. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,2)})}));
  1269. $ctx1.sendIdx["at:put:"]=2;
  1270. _st($1)._at_put_("printIt",(function(cm){
  1271. return smalltalk.withContext(function($ctx2) {
  1272. $4=_st(cm)._amberCodeWidget();
  1273. $ctx2.sendIdx["amberCodeWidget"]=3;
  1274. return _st($4)._printIt();
  1275. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,3)})}));
  1276. $ctx1.sendIdx["at:put:"]=3;
  1277. $5=_st($1)._at_put_("saveIt",(function(cm){
  1278. return smalltalk.withContext(function($ctx2) {
  1279. return _st(_st(cm)._amberCodeWidget())._saveIt();
  1280. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,4)})}));
  1281. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},smalltalk.HLCodeWidget.klass)})},
  1282. args: [],
  1283. 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 ]",
  1284. messageSends: ["at:put:", "basicAt:", "doIt", "amberCodeWidget", "inspectIt", "printIt", "saveIt"],
  1285. referencedClasses: ["CodeMirror"]
  1286. }),
  1287. smalltalk.HLCodeWidget.klass);
  1288. smalltalk.addMethod(
  1289. smalltalk.method({
  1290. selector: "setupKeyMaps",
  1291. category: 'initialization',
  1292. fn: function (){
  1293. var self=this;
  1294. return smalltalk.withContext(function($ctx1) {
  1295. CodeMirror.keyMap['Amber'] = self._keyMap();
  1296. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},smalltalk.HLCodeWidget.klass)})},
  1297. args: [],
  1298. source: "setupKeyMaps\x0a\x09<CodeMirror.keyMap['Amber'] = self._keyMap()>",
  1299. messageSends: [],
  1300. referencedClasses: []
  1301. }),
  1302. smalltalk.HLCodeWidget.klass);
  1303. smalltalk.addMethod(
  1304. smalltalk.method({
  1305. selector: "variableHintFor:token:",
  1306. category: 'hints',
  1307. fn: function (anEditor,aToken){
  1308. var self=this;
  1309. return smalltalk.withContext(function($ctx1) {
  1310. var $1;
  1311. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  1312. return $1;
  1313. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  1314. args: ["anEditor", "aToken"],
  1315. source: "variableHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09variableHintFor: anEditor token: aToken",
  1316. messageSends: ["variableHintFor:token:", "at:"],
  1317. referencedClasses: []
  1318. }),
  1319. smalltalk.HLCodeWidget.klass);
  1320. smalltalk.addClass('HLNavigationCodeWidget', smalltalk.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
  1321. smalltalk.addMethod(
  1322. smalltalk.method({
  1323. selector: "configureEditor",
  1324. category: 'accessing',
  1325. fn: function (){
  1326. var self=this;
  1327. return smalltalk.withContext(function($ctx1) {
  1328. smalltalk.HLNavigationCodeWidget.superclass.fn.prototype._configureEditor.apply(_st(self), []);
  1329. self._contents_(self._methodContents());
  1330. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLNavigationCodeWidget)})},
  1331. args: [],
  1332. source: "configureEditor\x0a\x09super configureEditor.\x0a\x09self contents: self methodContents",
  1333. messageSends: ["configureEditor", "contents:", "methodContents"],
  1334. referencedClasses: []
  1335. }),
  1336. smalltalk.HLNavigationCodeWidget);
  1337. smalltalk.addMethod(
  1338. smalltalk.method({
  1339. selector: "contents:",
  1340. category: 'accessing',
  1341. fn: function (aString){
  1342. var self=this;
  1343. return smalltalk.withContext(function($ctx1) {
  1344. self._methodContents_(aString);
  1345. smalltalk.HLNavigationCodeWidget.superclass.fn.prototype._contents_.apply(_st(self), [aString]);
  1346. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  1347. args: ["aString"],
  1348. source: "contents: aString\x0a\x09self methodContents: aString.\x0a\x09super contents: aString",
  1349. messageSends: ["methodContents:", "contents:"],
  1350. referencedClasses: []
  1351. }),
  1352. smalltalk.HLNavigationCodeWidget);
  1353. smalltalk.addMethod(
  1354. smalltalk.method({
  1355. selector: "hasModification",
  1356. category: 'testing',
  1357. fn: function (){
  1358. var self=this;
  1359. return smalltalk.withContext(function($ctx1) {
  1360. var $1;
  1361. $1=_st(_st(self._methodContents()).__eq(self._contents()))._not();
  1362. return $1;
  1363. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLNavigationCodeWidget)})},
  1364. args: [],
  1365. source: "hasModification\x0a\x09^ (self methodContents = self contents) not",
  1366. messageSends: ["not", "=", "methodContents", "contents"],
  1367. referencedClasses: []
  1368. }),
  1369. smalltalk.HLNavigationCodeWidget);
  1370. smalltalk.addMethod(
  1371. smalltalk.method({
  1372. selector: "methodContents",
  1373. category: 'accessing',
  1374. fn: function (){
  1375. var self=this;
  1376. return smalltalk.withContext(function($ctx1) {
  1377. var $2,$1;
  1378. $2=self["@methodContents"];
  1379. if(($receiver = $2) == nil || $receiver == null){
  1380. $1="";
  1381. } else {
  1382. $1=$2;
  1383. };
  1384. return $1;
  1385. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},smalltalk.HLNavigationCodeWidget)})},
  1386. args: [],
  1387. source: "methodContents\x0a\x09^ methodContents ifNil: [ '' ]",
  1388. messageSends: ["ifNil:"],
  1389. referencedClasses: []
  1390. }),
  1391. smalltalk.HLNavigationCodeWidget);
  1392. smalltalk.addMethod(
  1393. smalltalk.method({
  1394. selector: "methodContents:",
  1395. category: 'accessing',
  1396. fn: function (aString){
  1397. var self=this;
  1398. return smalltalk.withContext(function($ctx1) {
  1399. var $1;
  1400. self["@methodContents"]=aString;
  1401. $1=self["@methodContents"];
  1402. return $1;
  1403. }, function($ctx1) {$ctx1.fill(self,"methodContents:",{aString:aString},smalltalk.HLNavigationCodeWidget)})},
  1404. args: ["aString"],
  1405. source: "methodContents: aString\x0a\x09^ methodContents := aString",
  1406. messageSends: [],
  1407. referencedClasses: []
  1408. }),
  1409. smalltalk.HLNavigationCodeWidget);
  1410. smalltalk.addMethod(
  1411. smalltalk.method({
  1412. selector: "previous",
  1413. category: 'accessing',
  1414. fn: function (){
  1415. var self=this;
  1416. return smalltalk.withContext(function($ctx1) {
  1417. return self}, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLNavigationCodeWidget)})},
  1418. args: [],
  1419. source: "previous\x0a\x09\x22for browser lists widget\x22",
  1420. messageSends: [],
  1421. referencedClasses: []
  1422. }),
  1423. smalltalk.HLNavigationCodeWidget);
  1424. smalltalk.addMethod(
  1425. smalltalk.method({
  1426. selector: "previous:",
  1427. category: 'accessing',
  1428. fn: function (aWidget){
  1429. var self=this;
  1430. return smalltalk.withContext(function($ctx1) {
  1431. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLNavigationCodeWidget)})},
  1432. args: ["aWidget"],
  1433. source: "previous: aWidget\x0a\x09\x22for browser lists widget\x22",
  1434. messageSends: [],
  1435. referencedClasses: []
  1436. }),
  1437. smalltalk.HLNavigationCodeWidget);
  1438. smalltalk.addMethod(
  1439. smalltalk.method({
  1440. selector: "canBeOpenAsTab",
  1441. category: 'testing',
  1442. fn: function (){
  1443. var self=this;
  1444. return smalltalk.withContext(function($ctx1) {
  1445. return false;
  1446. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLNavigationCodeWidget.klass)})},
  1447. args: [],
  1448. source: "canBeOpenAsTab\x0a\x09^ false",
  1449. messageSends: [],
  1450. referencedClasses: []
  1451. }),
  1452. smalltalk.HLNavigationCodeWidget.klass);
  1453. smalltalk.addMethod(
  1454. smalltalk.method({
  1455. selector: "on:",
  1456. category: 'instance creation',
  1457. fn: function (aBrowserModel){
  1458. var self=this;
  1459. return smalltalk.withContext(function($ctx1) {
  1460. var $2,$3,$1;
  1461. $2=self._new();
  1462. _st($2)._browserModel_(aBrowserModel);
  1463. $3=_st($2)._yourself();
  1464. $1=$3;
  1465. return $1;
  1466. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLNavigationCodeWidget.klass)})},
  1467. args: ["aBrowserModel"],
  1468. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1469. messageSends: ["browserModel:", "new", "yourself"],
  1470. referencedClasses: []
  1471. }),
  1472. smalltalk.HLNavigationCodeWidget.klass);
  1473. smalltalk.addClass('HLBrowserCodeWidget', smalltalk.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  1474. smalltalk.addMethod(
  1475. smalltalk.method({
  1476. selector: "browserModel",
  1477. category: 'accessing',
  1478. fn: function (){
  1479. var self=this;
  1480. return smalltalk.withContext(function($ctx1) {
  1481. var $1;
  1482. $1=self["@browserModel"];
  1483. return $1;
  1484. }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLBrowserCodeWidget)})},
  1485. args: [],
  1486. source: "browserModel\x0a\x09^ browserModel",
  1487. messageSends: [],
  1488. referencedClasses: []
  1489. }),
  1490. smalltalk.HLBrowserCodeWidget);
  1491. smalltalk.addMethod(
  1492. smalltalk.method({
  1493. selector: "browserModel:",
  1494. category: 'accessing',
  1495. fn: function (aBrowserModel){
  1496. var self=this;
  1497. return smalltalk.withContext(function($ctx1) {
  1498. var $1;
  1499. self["@browserModel"]=aBrowserModel;
  1500. self._observeSystem();
  1501. $1=self._observeBrowserModel();
  1502. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLBrowserCodeWidget)})},
  1503. args: ["aBrowserModel"],
  1504. source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x09self \x0a\x09\x09observeSystem;\x0a\x09\x09observeBrowserModel",
  1505. messageSends: ["observeSystem", "observeBrowserModel"],
  1506. referencedClasses: []
  1507. }),
  1508. smalltalk.HLBrowserCodeWidget);
  1509. smalltalk.addMethod(
  1510. smalltalk.method({
  1511. selector: "observeBrowserModel",
  1512. category: 'actions',
  1513. fn: function (){
  1514. var self=this;
  1515. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  1516. function $HLShowInstanceToggled(){return smalltalk.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
  1517. function $HLSourceCodeSaved(){return smalltalk.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  1518. function $HLAboutToChange(){return smalltalk.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  1519. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  1520. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  1521. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  1522. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  1523. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1524. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1525. function $HLPackageSelected(){return smalltalk.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  1526. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1527. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1528. return smalltalk.withContext(function($ctx1) {
  1529. var $1,$2;
  1530. $1=_st(self._browserModel())._announcer();
  1531. _st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
  1532. $ctx1.sendIdx["on:send:to:"]=1;
  1533. _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
  1534. $ctx1.sendIdx["on:send:to:"]=2;
  1535. _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
  1536. $ctx1.sendIdx["on:send:to:"]=3;
  1537. _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
  1538. $ctx1.sendIdx["on:send:to:"]=4;
  1539. _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
  1540. $ctx1.sendIdx["on:send:to:"]=5;
  1541. _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
  1542. $ctx1.sendIdx["on:send:to:"]=6;
  1543. _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
  1544. $ctx1.sendIdx["on:send:to:"]=7;
  1545. _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
  1546. $ctx1.sendIdx["on:send:to:"]=8;
  1547. _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
  1548. $ctx1.sendIdx["on:send:to:"]=9;
  1549. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  1550. $ctx1.sendIdx["on:send:to:"]=10;
  1551. _st($1)._on_send_to_($HLPackageSelected(),"onPackageSelected:",self);
  1552. $ctx1.sendIdx["on:send:to:"]=11;
  1553. _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
  1554. $ctx1.sendIdx["on:send:to:"]=12;
  1555. $2=_st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
  1556. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLBrowserCodeWidget)})},
  1557. args: [],
  1558. 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",
  1559. messageSends: ["on:send:to:", "announcer", "browserModel"],
  1560. referencedClasses: ["HLSaveSourceCode", "HLShowInstanceToggled", "HLSourceCodeSaved", "HLAboutToChange", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLPackageSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
  1561. }),
  1562. smalltalk.HLBrowserCodeWidget);
  1563. smalltalk.addMethod(
  1564. smalltalk.method({
  1565. selector: "observeSystem",
  1566. category: 'actions',
  1567. fn: function (){
  1568. var self=this;
  1569. function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  1570. return smalltalk.withContext(function($ctx1) {
  1571. _st(_st(self._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
  1572. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLBrowserCodeWidget)})},
  1573. args: [],
  1574. source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a \x09on: MethodModified\x0a send: #onMethodModified:\x0a\x09\x09to: self",
  1575. messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"],
  1576. referencedClasses: ["MethodModified"]
  1577. }),
  1578. smalltalk.HLBrowserCodeWidget);
  1579. smalltalk.addMethod(
  1580. smalltalk.method({
  1581. selector: "onBrowserAboutToChange:",
  1582. category: 'reactions',
  1583. fn: function (anAnnouncement){
  1584. var self=this;
  1585. var block;
  1586. function $HLChangeForbidden(){return smalltalk.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  1587. return smalltalk.withContext(function($ctx1) {
  1588. var $1;
  1589. block=_st(anAnnouncement)._actionBlock();
  1590. $1=self._hasModification();
  1591. if(smalltalk.assert($1)){
  1592. self._confirm_ifTrue_("Changes have not been saved. Do you want to discard these changes?",(function(){
  1593. return smalltalk.withContext(function($ctx2) {
  1594. self._methodContents_(self._contents());
  1595. return _st(block)._value();
  1596. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1597. _st($HLChangeForbidden())._signal();
  1598. };
  1599. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},smalltalk.HLBrowserCodeWidget)})},
  1600. args: ["anAnnouncement"],
  1601. 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 ]",
  1602. messageSends: ["actionBlock", "ifTrue:", "hasModification", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal"],
  1603. referencedClasses: ["HLChangeForbidden"]
  1604. }),
  1605. smalltalk.HLBrowserCodeWidget);
  1606. smalltalk.addMethod(
  1607. smalltalk.method({
  1608. selector: "onClassSelected:",
  1609. category: 'reactions',
  1610. fn: function (anAnnouncement){
  1611. var self=this;
  1612. var class_;
  1613. return smalltalk.withContext(function($ctx1) {
  1614. var $1,$2;
  1615. class_=_st(anAnnouncement)._item();
  1616. $1=class_;
  1617. if(($receiver = $1) == nil || $receiver == null){
  1618. $2=self._contents_("");
  1619. $ctx1.sendIdx["contents:"]=1;
  1620. return $2;
  1621. } else {
  1622. $1;
  1623. };
  1624. self._contents_(_st(class_)._definition());
  1625. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},smalltalk.HLBrowserCodeWidget)})},
  1626. args: ["anAnnouncement"],
  1627. source: "onClassSelected: anAnnouncement\x0a\x09| class |\x0a\x09\x0a\x09class:= anAnnouncement item.\x0a\x09\x0a\x09class ifNil: [ ^ self contents: '' ].\x0a\x09self contents: class definition",
  1628. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1629. referencedClasses: []
  1630. }),
  1631. smalltalk.HLBrowserCodeWidget);
  1632. smalltalk.addMethod(
  1633. smalltalk.method({
  1634. selector: "onCompileError:",
  1635. category: 'reactions',
  1636. fn: function (anAnnouncement){
  1637. var self=this;
  1638. return smalltalk.withContext(function($ctx1) {
  1639. self._alert_(_st(_st(anAnnouncement)._error())._messageText());
  1640. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1641. args: ["anAnnouncement"],
  1642. source: "onCompileError: anAnnouncement\x0a\x09self alert: anAnnouncement error messageText",
  1643. messageSends: ["alert:", "messageText", "error"],
  1644. referencedClasses: []
  1645. }),
  1646. smalltalk.HLBrowserCodeWidget);
  1647. smalltalk.addMethod(
  1648. smalltalk.method({
  1649. selector: "onInstVarAdded",
  1650. category: 'reactions',
  1651. fn: function (){
  1652. var self=this;
  1653. return smalltalk.withContext(function($ctx1) {
  1654. _st(self._browserModel())._save_(self._contents());
  1655. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLBrowserCodeWidget)})},
  1656. args: [],
  1657. source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
  1658. messageSends: ["save:", "browserModel", "contents"],
  1659. referencedClasses: []
  1660. }),
  1661. smalltalk.HLBrowserCodeWidget);
  1662. smalltalk.addMethod(
  1663. smalltalk.method({
  1664. selector: "onMethodModified:",
  1665. category: 'reactions',
  1666. fn: function (anAnnouncement){
  1667. var self=this;
  1668. var method;
  1669. return smalltalk.withContext(function($ctx1) {
  1670. var $3,$2,$1,$5,$4,$7,$6;
  1671. method=_st(anAnnouncement)._method();
  1672. $3=self._browserModel();
  1673. $ctx1.sendIdx["browserModel"]=1;
  1674. $2=_st($3)._selectedClass();
  1675. $1=_st($2).__eq(_st(method)._methodClass());
  1676. $ctx1.sendIdx["="]=1;
  1677. if(! smalltalk.assert($1)){
  1678. return self;
  1679. };
  1680. $5=self._browserModel();
  1681. $ctx1.sendIdx["browserModel"]=2;
  1682. $4=_st($5)._selectedMethod();
  1683. $ctx1.sendIdx["selectedMethod"]=1;
  1684. if(($receiver = $4) == nil || $receiver == null){
  1685. return self;
  1686. } else {
  1687. $4;
  1688. };
  1689. $7=_st(_st(self._browserModel())._selectedMethod())._selector();
  1690. $ctx1.sendIdx["selector"]=1;
  1691. $6=_st($7).__eq(_st(method)._selector());
  1692. if(! smalltalk.assert($6)){
  1693. return self;
  1694. };
  1695. self._refresh();
  1696. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1697. args: ["anAnnouncement"],
  1698. 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",
  1699. messageSends: ["method", "ifFalse:", "=", "selectedClass", "browserModel", "methodClass", "ifNil:", "selectedMethod", "selector", "refresh"],
  1700. referencedClasses: []
  1701. }),
  1702. smalltalk.HLBrowserCodeWidget);
  1703. smalltalk.addMethod(
  1704. smalltalk.method({
  1705. selector: "onMethodSelected:",
  1706. category: 'reactions',
  1707. fn: function (anAnnouncement){
  1708. var self=this;
  1709. var method;
  1710. return smalltalk.withContext(function($ctx1) {
  1711. var $1,$2;
  1712. method=_st(anAnnouncement)._item();
  1713. $1=method;
  1714. if(($receiver = $1) == nil || $receiver == null){
  1715. $2=self._contents_("");
  1716. $ctx1.sendIdx["contents:"]=1;
  1717. return $2;
  1718. } else {
  1719. $1;
  1720. };
  1721. self._contents_(_st(method)._source());
  1722. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},smalltalk.HLBrowserCodeWidget)})},
  1723. args: ["anAnnouncement"],
  1724. source: "onMethodSelected: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement item.\x0a\x09\x0a\x09method ifNil: [ ^ self contents: '' ].\x0a\x09self contents: method source",
  1725. messageSends: ["item", "ifNil:", "contents:", "source"],
  1726. referencedClasses: []
  1727. }),
  1728. smalltalk.HLBrowserCodeWidget);
  1729. smalltalk.addMethod(
  1730. smalltalk.method({
  1731. selector: "onPackageSelected:",
  1732. category: 'reactions',
  1733. fn: function (anAnnouncement){
  1734. var self=this;
  1735. var package_;
  1736. return smalltalk.withContext(function($ctx1) {
  1737. var $1,$2;
  1738. package_=_st(anAnnouncement)._item();
  1739. $1=package_;
  1740. if(($receiver = $1) == nil || $receiver == null){
  1741. $2=self._contents_("");
  1742. $ctx1.sendIdx["contents:"]=1;
  1743. return $2;
  1744. } else {
  1745. $1;
  1746. };
  1747. self._contents_(_st(package_)._definition());
  1748. return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{anAnnouncement:anAnnouncement,package_:package_},smalltalk.HLBrowserCodeWidget)})},
  1749. args: ["anAnnouncement"],
  1750. source: "onPackageSelected: anAnnouncement\x0a\x09| package |\x0a\x09\x0a\x09package := anAnnouncement item.\x0a\x09\x0a\x09package ifNil: [ ^ self contents: '' ].\x0a\x09self contents: package definition",
  1751. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1752. referencedClasses: []
  1753. }),
  1754. smalltalk.HLBrowserCodeWidget);
  1755. smalltalk.addMethod(
  1756. smalltalk.method({
  1757. selector: "onParseError:",
  1758. category: 'reactions',
  1759. fn: function (anAnnouncement){
  1760. var self=this;
  1761. var lineIndex,newContents;
  1762. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1763. return smalltalk.withContext(function($ctx1) {
  1764. var $1,$3,$2,$6,$5,$4;
  1765. lineIndex=(1);
  1766. self._contents_(_st($String())._streamContents_((function(stream){
  1767. return smalltalk.withContext(function($ctx2) {
  1768. return _st(self._contents())._linesDo_((function(each){
  1769. return smalltalk.withContext(function($ctx3) {
  1770. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1771. if(smalltalk.assert($1)){
  1772. $3=_st(anAnnouncement)._column();
  1773. $ctx3.sendIdx["column"]=1;
  1774. $2=_st(each)._copyFrom_to_((1),$3);
  1775. $ctx3.sendIdx["copyFrom:to:"]=1;
  1776. _st(stream)._nextPutAll_($2);
  1777. $ctx3.sendIdx["nextPutAll:"]=1;
  1778. _st(stream)._nextPutAll_("<- ");
  1779. $ctx3.sendIdx["nextPutAll:"]=2;
  1780. _st(stream)._nextPutAll_(_st(anAnnouncement)._message());
  1781. $ctx3.sendIdx["nextPutAll:"]=3;
  1782. _st(stream)._nextPutAll_(" ");
  1783. $ctx3.sendIdx["nextPutAll:"]=4;
  1784. $6=_st(_st(anAnnouncement)._column()).__plus((1));
  1785. $ctx3.sendIdx["+"]=1;
  1786. $5=_st(each)._copyFrom_to_($6,_st(each)._size());
  1787. $4=_st(stream)._nextPutAll_($5);
  1788. $ctx3.sendIdx["nextPutAll:"]=5;
  1789. $4;
  1790. } else {
  1791. _st(stream)._nextPutAll_(each);
  1792. $ctx3.sendIdx["nextPutAll:"]=6;
  1793. };
  1794. _st(stream)._nextPutAll_(_st($String())._cr());
  1795. lineIndex=_st(lineIndex).__plus((1));
  1796. return lineIndex;
  1797. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  1798. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})));
  1799. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLBrowserCodeWidget)})},
  1800. args: ["anAnnouncement"],
  1801. 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 ] ])",
  1802. messageSends: ["contents:", "streamContents:", "linesDo:", "contents", "ifTrue:ifFalse:", "=", "line", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "cr"],
  1803. referencedClasses: ["String"]
  1804. }),
  1805. smalltalk.HLBrowserCodeWidget);
  1806. smalltalk.addMethod(
  1807. smalltalk.method({
  1808. selector: "onProtocolSelected:",
  1809. category: 'reactions',
  1810. fn: function (anAnnouncement){
  1811. var self=this;
  1812. return smalltalk.withContext(function($ctx1) {
  1813. var $2,$1,$3;
  1814. $2=self._browserModel();
  1815. $ctx1.sendIdx["browserModel"]=1;
  1816. $1=_st($2)._selectedClass();
  1817. $ctx1.sendIdx["selectedClass"]=1;
  1818. if(($receiver = $1) == nil || $receiver == null){
  1819. $3=self._contents_("");
  1820. $ctx1.sendIdx["contents:"]=1;
  1821. return $3;
  1822. } else {
  1823. $1;
  1824. };
  1825. self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
  1826. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},smalltalk.HLBrowserCodeWidget)})},
  1827. args: ["anAnnouncement"],
  1828. source: "onProtocolSelected: anAnnouncement\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a\x09self contents: self browserModel selectedClass definition",
  1829. messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
  1830. referencedClasses: []
  1831. }),
  1832. smalltalk.HLBrowserCodeWidget);
  1833. smalltalk.addMethod(
  1834. smalltalk.method({
  1835. selector: "onSaveIt",
  1836. category: 'reactions',
  1837. fn: function (){
  1838. var self=this;
  1839. return smalltalk.withContext(function($ctx1) {
  1840. _st(self._browserModel())._save_(self._contents());
  1841. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLBrowserCodeWidget)})},
  1842. args: [],
  1843. source: "onSaveIt\x0a\x09self browserModel save: self contents",
  1844. messageSends: ["save:", "browserModel", "contents"],
  1845. referencedClasses: []
  1846. }),
  1847. smalltalk.HLBrowserCodeWidget);
  1848. smalltalk.addMethod(
  1849. smalltalk.method({
  1850. selector: "onShowInstanceToggled",
  1851. category: 'reactions',
  1852. fn: function (){
  1853. var self=this;
  1854. return smalltalk.withContext(function($ctx1) {
  1855. var $2,$1,$3;
  1856. $2=self._browserModel();
  1857. $ctx1.sendIdx["browserModel"]=1;
  1858. $1=_st($2)._selectedClass();
  1859. $ctx1.sendIdx["selectedClass"]=1;
  1860. if(($receiver = $1) == nil || $receiver == null){
  1861. $3=self._contents_("");
  1862. $ctx1.sendIdx["contents:"]=1;
  1863. return $3;
  1864. } else {
  1865. $1;
  1866. };
  1867. self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
  1868. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},smalltalk.HLBrowserCodeWidget)})},
  1869. args: [],
  1870. source: "onShowInstanceToggled\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a\x09self contents: self browserModel selectedClass definition",
  1871. messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
  1872. referencedClasses: []
  1873. }),
  1874. smalltalk.HLBrowserCodeWidget);
  1875. smalltalk.addMethod(
  1876. smalltalk.method({
  1877. selector: "onSourceCodeFocusRequested",
  1878. category: 'reactions',
  1879. fn: function (){
  1880. var self=this;
  1881. return smalltalk.withContext(function($ctx1) {
  1882. self._focus();
  1883. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLBrowserCodeWidget)})},
  1884. args: [],
  1885. source: "onSourceCodeFocusRequested\x0a\x09self focus",
  1886. messageSends: ["focus"],
  1887. referencedClasses: []
  1888. }),
  1889. smalltalk.HLBrowserCodeWidget);
  1890. smalltalk.addMethod(
  1891. smalltalk.method({
  1892. selector: "onSourceCodeSaved",
  1893. category: 'reactions',
  1894. fn: function (){
  1895. var self=this;
  1896. return smalltalk.withContext(function($ctx1) {
  1897. self._methodContents_(self._contents());
  1898. self._updateState();
  1899. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},smalltalk.HLBrowserCodeWidget)})},
  1900. args: [],
  1901. source: "onSourceCodeSaved\x0a\x09self methodContents: self contents.\x0a\x09self updateState",
  1902. messageSends: ["methodContents:", "contents", "updateState"],
  1903. referencedClasses: []
  1904. }),
  1905. smalltalk.HLBrowserCodeWidget);
  1906. smalltalk.addMethod(
  1907. smalltalk.method({
  1908. selector: "onUnknownVariableError:",
  1909. category: 'reactions',
  1910. fn: function (anAnnouncement){
  1911. var self=this;
  1912. var error;
  1913. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1914. return smalltalk.withContext(function($ctx1) {
  1915. var $1;
  1916. error=_st(anAnnouncement)._error();
  1917. self._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1918. return smalltalk.withContext(function($ctx2) {
  1919. _st(stream)._nextPutAll_(_st(error)._messageText());
  1920. $ctx2.sendIdx["nextPutAll:"]=1;
  1921. _st(stream)._nextPutAll_(_st($String())._cr());
  1922. $ctx2.sendIdx["nextPutAll:"]=2;
  1923. $1=_st(stream)._nextPutAll_("Would you like to define an instance variable?");
  1924. return $1;
  1925. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})),(function(){
  1926. return smalltalk.withContext(function($ctx2) {
  1927. return _st(self._browserModel())._addInstVarNamed_(_st(error)._variableName());
  1928. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1929. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},smalltalk.HLBrowserCodeWidget)})},
  1930. args: ["anAnnouncement"],
  1931. 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 ]",
  1932. messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "browserModel", "variableName"],
  1933. referencedClasses: ["String"]
  1934. }),
  1935. smalltalk.HLBrowserCodeWidget);
  1936. smalltalk.addMethod(
  1937. smalltalk.method({
  1938. selector: "refresh",
  1939. category: 'actions',
  1940. fn: function (){
  1941. var self=this;
  1942. return smalltalk.withContext(function($ctx1) {
  1943. var $1,$2;
  1944. $1=self._hasModification();
  1945. if(smalltalk.assert($1)){
  1946. return self;
  1947. };
  1948. $2=self._hasFocus();
  1949. if(smalltalk.assert($2)){
  1950. return self;
  1951. };
  1952. self._contents_(_st(_st(self._browserModel())._selectedMethod())._source());
  1953. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLBrowserCodeWidget)})},
  1954. args: [],
  1955. source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self browserModel selectedMethod source",
  1956. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"],
  1957. referencedClasses: []
  1958. }),
  1959. smalltalk.HLBrowserCodeWidget);
  1960. smalltalk.addMethod(
  1961. smalltalk.method({
  1962. selector: "renderButtonsOn:",
  1963. category: 'actions',
  1964. fn: function (html){
  1965. var self=this;
  1966. return smalltalk.withContext(function($ctx1) {
  1967. var $1,$2;
  1968. $1=_st(html)._button();
  1969. _st($1)._class_("button");
  1970. _st($1)._with_("SaveIt");
  1971. $2=_st($1)._onClick_((function(){
  1972. return smalltalk.withContext(function($ctx2) {
  1973. return self._saveIt();
  1974. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1975. smalltalk.HLBrowserCodeWidget.superclass.fn.prototype._renderButtonsOn_.apply(_st(self), [html]);
  1976. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},smalltalk.HLBrowserCodeWidget)})},
  1977. args: ["html"],
  1978. source: "renderButtonsOn: html\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'SaveIt';\x0a\x09\x09onClick: [ self saveIt ].\x0a\x09super renderButtonsOn: html",
  1979. messageSends: ["class:", "button", "with:", "onClick:", "saveIt", "renderButtonsOn:"],
  1980. referencedClasses: []
  1981. }),
  1982. smalltalk.HLBrowserCodeWidget);
  1983. smalltalk.addMethod(
  1984. smalltalk.method({
  1985. selector: "saveIt",
  1986. category: 'actions',
  1987. fn: function (){
  1988. var self=this;
  1989. return smalltalk.withContext(function($ctx1) {
  1990. _st(self._browserModel())._saveSourceCode();
  1991. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLBrowserCodeWidget)})},
  1992. args: [],
  1993. source: "saveIt\x0a\x09self browserModel saveSourceCode",
  1994. messageSends: ["saveSourceCode", "browserModel"],
  1995. referencedClasses: []
  1996. }),
  1997. smalltalk.HLBrowserCodeWidget);
  1998. smalltalk.addMethod(
  1999. smalltalk.method({
  2000. selector: "unregister",
  2001. category: 'actions',
  2002. fn: function (){
  2003. var self=this;
  2004. return smalltalk.withContext(function($ctx1) {
  2005. var $2,$1;
  2006. smalltalk.HLBrowserCodeWidget.superclass.fn.prototype._unregsiter.apply(_st(self), []);
  2007. $2=self._browserModel();
  2008. $ctx1.sendIdx["browserModel"]=1;
  2009. $1=_st($2)._announcer();
  2010. _st($1)._unsubscribe_(self);
  2011. $ctx1.sendIdx["unsubscribe:"]=1;
  2012. _st(_st(self._browserModel())._systemAnnouncer())._unsubscribe_(self);
  2013. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLBrowserCodeWidget)})},
  2014. args: [],
  2015. source: "unregister\x0a\x09super unregsiter.\x0a\x09\x0a\x09self browserModel announcer unsubscribe: self.\x0a\x09self browserModel systemAnnouncer unsubscribe: self",
  2016. messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"],
  2017. referencedClasses: []
  2018. }),
  2019. smalltalk.HLBrowserCodeWidget);
  2020. smalltalk.addMethod(
  2021. smalltalk.method({
  2022. selector: "canBeOpenAsTab",
  2023. category: 'testing',
  2024. fn: function (){
  2025. var self=this;
  2026. return smalltalk.withContext(function($ctx1) {
  2027. return false;
  2028. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLBrowserCodeWidget.klass)})},
  2029. args: [],
  2030. source: "canBeOpenAsTab\x0a\x09^ false",
  2031. messageSends: [],
  2032. referencedClasses: []
  2033. }),
  2034. smalltalk.HLBrowserCodeWidget.klass);
  2035. smalltalk.addMethod(
  2036. smalltalk.method({
  2037. selector: "on:",
  2038. category: 'instance creation',
  2039. fn: function (aBrowserModel){
  2040. var self=this;
  2041. return smalltalk.withContext(function($ctx1) {
  2042. var $2,$3,$1;
  2043. $2=self._new();
  2044. _st($2)._browserModel_(aBrowserModel);
  2045. $3=_st($2)._yourself();
  2046. $1=$3;
  2047. return $1;
  2048. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLBrowserCodeWidget.klass)})},
  2049. args: ["aBrowserModel"],
  2050. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  2051. messageSends: ["browserModel:", "new", "yourself"],
  2052. referencedClasses: []
  2053. }),
  2054. smalltalk.HLBrowserCodeWidget.klass);
  2055. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget', 'transcript'], 'Helios-Workspace');
  2056. smalltalk.addMethod(
  2057. smalltalk.method({
  2058. selector: "canHaveFocus",
  2059. category: 'testing',
  2060. fn: function (){
  2061. var self=this;
  2062. return smalltalk.withContext(function($ctx1) {
  2063. return true;
  2064. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
  2065. args: [],
  2066. source: "canHaveFocus\x0a\x09^ true",
  2067. messageSends: [],
  2068. referencedClasses: []
  2069. }),
  2070. smalltalk.HLWorkspace);
  2071. smalltalk.addMethod(
  2072. smalltalk.method({
  2073. selector: "codeWidget",
  2074. category: 'accessing',
  2075. fn: function (){
  2076. var self=this;
  2077. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  2078. return smalltalk.withContext(function($ctx1) {
  2079. var $2,$1;
  2080. $2=self["@codeWidget"];
  2081. if(($receiver = $2) == nil || $receiver == null){
  2082. self["@codeWidget"]=_st($HLCodeWidget())._new();
  2083. $1=self["@codeWidget"];
  2084. } else {
  2085. $1=$2;
  2086. };
  2087. return $1;
  2088. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
  2089. args: [],
  2090. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
  2091. messageSends: ["ifNil:", "new"],
  2092. referencedClasses: ["HLCodeWidget"]
  2093. }),
  2094. smalltalk.HLWorkspace);
  2095. smalltalk.addMethod(
  2096. smalltalk.method({
  2097. selector: "focus",
  2098. category: 'actions',
  2099. fn: function (){
  2100. var self=this;
  2101. return smalltalk.withContext(function($ctx1) {
  2102. var $1;
  2103. $1=_st(self._codeWidget())._focus();
  2104. return $1;
  2105. }, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
  2106. args: [],
  2107. source: "focus\x0a\x09^ self codeWidget focus",
  2108. messageSends: ["focus", "codeWidget"],
  2109. referencedClasses: []
  2110. }),
  2111. smalltalk.HLWorkspace);
  2112. smalltalk.addMethod(
  2113. smalltalk.method({
  2114. selector: "renderContentOn:",
  2115. category: 'rendering',
  2116. fn: function (html){
  2117. var self=this;
  2118. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  2119. function $HLHorizontalSplitter(){return smalltalk.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  2120. return smalltalk.withContext(function($ctx1) {
  2121. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._codeWidget(),(function(canvas){
  2122. return smalltalk.withContext(function($ctx2) {
  2123. return self._renderTranscriptOn_(canvas);
  2124. }, function($ctx2) {$ctx2.fillBlock({canvas:canvas},$ctx1,1)})}))));
  2125. $ctx1.sendIdx["with:"]=1;
  2126. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
  2127. args: ["html"],
  2128. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter\x0a\x09\x09with: self codeWidget\x0a\x09\x09with: [ :canvas | self renderTranscriptOn: canvas ]))",
  2129. messageSends: ["with:", "with:with:", "codeWidget", "renderTranscriptOn:"],
  2130. referencedClasses: ["HLContainer", "HLHorizontalSplitter"]
  2131. }),
  2132. smalltalk.HLWorkspace);
  2133. smalltalk.addMethod(
  2134. smalltalk.method({
  2135. selector: "renderTranscriptOn:",
  2136. category: 'rendering',
  2137. fn: function (html){
  2138. var self=this;
  2139. return smalltalk.withContext(function($ctx1) {
  2140. var $1,$3,$4,$2;
  2141. $1=_st(html)._div();
  2142. $ctx1.sendIdx["div"]=1;
  2143. _st($1)._class_("transcript-container");
  2144. $ctx1.sendIdx["class:"]=1;
  2145. $2=_st($1)._with_((function(){
  2146. return smalltalk.withContext(function($ctx2) {
  2147. $3=_st(html)._div();
  2148. _st($3)._class_("list-label");
  2149. $4=_st($3)._with_("Transcript");
  2150. $4;
  2151. return _st(self._transcript())._renderOn_(html);
  2152. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2153. $ctx1.sendIdx["with:"]=1;
  2154. return self}, function($ctx1) {$ctx1.fill(self,"renderTranscriptOn:",{html:html},smalltalk.HLWorkspace)})},
  2155. args: ["html"],
  2156. 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 ]",
  2157. messageSends: ["class:", "div", "with:", "renderOn:", "transcript"],
  2158. referencedClasses: []
  2159. }),
  2160. smalltalk.HLWorkspace);
  2161. smalltalk.addMethod(
  2162. smalltalk.method({
  2163. selector: "transcript",
  2164. category: 'accessing',
  2165. fn: function (){
  2166. var self=this;
  2167. function $HLTranscript(){return smalltalk.HLTranscript||(typeof HLTranscript=="undefined"?nil:HLTranscript)}
  2168. return smalltalk.withContext(function($ctx1) {
  2169. var $2,$1;
  2170. $2=self["@transcript"];
  2171. if(($receiver = $2) == nil || $receiver == null){
  2172. self["@transcript"]=_st($HLTranscript())._new();
  2173. $1=self["@transcript"];
  2174. } else {
  2175. $1=$2;
  2176. };
  2177. return $1;
  2178. }, function($ctx1) {$ctx1.fill(self,"transcript",{},smalltalk.HLWorkspace)})},
  2179. args: [],
  2180. source: "transcript\x0a\x09^ transcript ifNil: [ transcript := HLTranscript new ]",
  2181. messageSends: ["ifNil:", "new"],
  2182. referencedClasses: ["HLTranscript"]
  2183. }),
  2184. smalltalk.HLWorkspace);
  2185. smalltalk.addMethod(
  2186. smalltalk.method({
  2187. selector: "unregister",
  2188. category: 'actions',
  2189. fn: function (){
  2190. var self=this;
  2191. return smalltalk.withContext(function($ctx1) {
  2192. smalltalk.HLWorkspace.superclass.fn.prototype._unregister.apply(_st(self), []);
  2193. $ctx1.sendIdx["unregister"]=1;
  2194. _st(self._transcript())._unregister();
  2195. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},smalltalk.HLWorkspace)})},
  2196. args: [],
  2197. source: "unregister\x0a\x09super unregister.\x0a\x09self transcript unregister",
  2198. messageSends: ["unregister", "transcript"],
  2199. referencedClasses: []
  2200. }),
  2201. smalltalk.HLWorkspace);
  2202. smalltalk.addMethod(
  2203. smalltalk.method({
  2204. selector: "canBeOpenAsTab",
  2205. category: 'testing',
  2206. fn: function (){
  2207. var self=this;
  2208. return smalltalk.withContext(function($ctx1) {
  2209. return true;
  2210. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
  2211. args: [],
  2212. source: "canBeOpenAsTab\x0a\x09^ true",
  2213. messageSends: [],
  2214. referencedClasses: []
  2215. }),
  2216. smalltalk.HLWorkspace.klass);
  2217. smalltalk.addMethod(
  2218. smalltalk.method({
  2219. selector: "tabClass",
  2220. category: 'accessing',
  2221. fn: function (){
  2222. var self=this;
  2223. return smalltalk.withContext(function($ctx1) {
  2224. return "workspace";
  2225. }, function($ctx1) {$ctx1.fill(self,"tabClass",{},smalltalk.HLWorkspace.klass)})},
  2226. args: [],
  2227. source: "tabClass\x0a\x09^ 'workspace'",
  2228. messageSends: [],
  2229. referencedClasses: []
  2230. }),
  2231. smalltalk.HLWorkspace.klass);
  2232. smalltalk.addMethod(
  2233. smalltalk.method({
  2234. selector: "tabLabel",
  2235. category: 'accessing',
  2236. fn: function (){
  2237. var self=this;
  2238. return smalltalk.withContext(function($ctx1) {
  2239. return "Workspace";
  2240. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
  2241. args: [],
  2242. source: "tabLabel\x0a\x09^ 'Workspace'",
  2243. messageSends: [],
  2244. referencedClasses: []
  2245. }),
  2246. smalltalk.HLWorkspace.klass);
  2247. smalltalk.addMethod(
  2248. smalltalk.method({
  2249. selector: "tabPriority",
  2250. category: 'accessing',
  2251. fn: function (){
  2252. var self=this;
  2253. return smalltalk.withContext(function($ctx1) {
  2254. return (10);
  2255. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
  2256. args: [],
  2257. source: "tabPriority\x0a\x09^ 10",
  2258. messageSends: [],
  2259. referencedClasses: []
  2260. }),
  2261. smalltalk.HLWorkspace.klass);
  2262. });