Helios-Workspace.js 85 KB

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