2
0

Helios-Workspace.js 87 KB

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