Helios-Workspace.js 87 KB

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