Helios-Workspace.js 85 KB

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