Helios-Workspace.js 83 KB

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