Helios-Workspace.js 85 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355
  1. define("amber_core/Helios-Workspace", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Kernel-Objects", "amber_core/Helios-Core"], function(smalltalk,nil,_st, globals){
  2. smalltalk.addPackage('Helios-Workspace');
  3. smalltalk.packages["Helios-Workspace"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('HLCodeModel', globals.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "announcer",
  8. protocol: 'accessing',
  9. fn: function (){
  10. var self=this;
  11. function $Announcer(){return globals.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  12. return smalltalk.withContext(function($ctx1) {
  13. var $2,$1;
  14. $2=self["@announcer"];
  15. if(($receiver = $2) == nil || $receiver == null){
  16. self["@announcer"]=_st($Announcer())._new();
  17. $1=self["@announcer"];
  18. } else {
  19. $1=$2;
  20. };
  21. return $1;
  22. }, function($ctx1) {$ctx1.fill(self,"announcer",{},globals.HLCodeModel)})},
  23. args: [],
  24. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  25. messageSends: ["ifNil:", "new"],
  26. referencedClasses: ["Announcer"]
  27. }),
  28. globals.HLCodeModel);
  29. smalltalk.addMethod(
  30. smalltalk.method({
  31. selector: "defaultReceiver",
  32. protocol: 'defaults',
  33. fn: function (){
  34. var self=this;
  35. return smalltalk.withContext(function($ctx1) {
  36. var $1;
  37. $1=_st(self._environment())._doItReceiver();
  38. return $1;
  39. }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{},globals.HLCodeModel)})},
  40. args: [],
  41. source: "defaultReceiver\x0a\x09^ self environment doItReceiver",
  42. messageSends: ["doItReceiver", "environment"],
  43. referencedClasses: []
  44. }),
  45. globals.HLCodeModel);
  46. smalltalk.addMethod(
  47. smalltalk.method({
  48. selector: "doIt:",
  49. protocol: 'actions',
  50. fn: function (aString){
  51. var self=this;
  52. return smalltalk.withContext(function($ctx1) {
  53. var $1;
  54. $1=_st(self._environment())._eval_on_(aString,self._receiver());
  55. return $1;
  56. }, function($ctx1) {$ctx1.fill(self,"doIt:",{aString:aString},globals.HLCodeModel)})},
  57. args: ["aString"],
  58. source: "doIt: aString\x0a\x0a\x09^ self environment eval: aString on: self receiver",
  59. messageSends: ["eval:on:", "environment", "receiver"],
  60. referencedClasses: []
  61. }),
  62. globals.HLCodeModel);
  63. smalltalk.addMethod(
  64. smalltalk.method({
  65. selector: "environment",
  66. protocol: 'accessing',
  67. fn: function (){
  68. var self=this;
  69. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  70. return smalltalk.withContext(function($ctx1) {
  71. var $2,$1;
  72. $2=self["@environment"];
  73. if(($receiver = $2) == nil || $receiver == null){
  74. $1=_st(_st($HLManager())._current())._environment();
  75. } else {
  76. $1=$2;
  77. };
  78. return $1;
  79. }, function($ctx1) {$ctx1.fill(self,"environment",{},globals.HLCodeModel)})},
  80. args: [],
  81. source: "environment\x0a\x09^ environment ifNil: [ HLManager current environment ]",
  82. messageSends: ["ifNil:", "environment", "current"],
  83. referencedClasses: ["HLManager"]
  84. }),
  85. globals.HLCodeModel);
  86. smalltalk.addMethod(
  87. smalltalk.method({
  88. selector: "environment:",
  89. protocol: 'accessing',
  90. fn: function (anEnvironment){
  91. var self=this;
  92. self["@environment"]=anEnvironment;
  93. return self},
  94. args: ["anEnvironment"],
  95. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  96. messageSends: [],
  97. referencedClasses: []
  98. }),
  99. globals.HLCodeModel);
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "inspect:",
  103. protocol: 'actions',
  104. fn: function (anObject){
  105. var self=this;
  106. return smalltalk.withContext(function($ctx1) {
  107. _st(self._environment())._inspect_(anObject);
  108. return self}, function($ctx1) {$ctx1.fill(self,"inspect:",{anObject:anObject},globals.HLCodeModel)})},
  109. args: ["anObject"],
  110. source: "inspect: anObject\x0a\x09self environment inspect: anObject",
  111. messageSends: ["inspect:", "environment"],
  112. referencedClasses: []
  113. }),
  114. globals.HLCodeModel);
  115. smalltalk.addMethod(
  116. smalltalk.method({
  117. selector: "receiver",
  118. protocol: 'accessing',
  119. fn: function (){
  120. var self=this;
  121. return smalltalk.withContext(function($ctx1) {
  122. var $2,$1;
  123. $2=self["@receiver"];
  124. if(($receiver = $2) == nil || $receiver == null){
  125. self["@receiver"]=self._defaultReceiver();
  126. $1=self["@receiver"];
  127. } else {
  128. $1=$2;
  129. };
  130. return $1;
  131. }, function($ctx1) {$ctx1.fill(self,"receiver",{},globals.HLCodeModel)})},
  132. args: [],
  133. source: "receiver\x0a\x09^ receiver ifNil: [ receiver := self defaultReceiver ]",
  134. messageSends: ["ifNil:", "defaultReceiver"],
  135. referencedClasses: []
  136. }),
  137. globals.HLCodeModel);
  138. smalltalk.addMethod(
  139. smalltalk.method({
  140. selector: "receiver:",
  141. protocol: 'accessing',
  142. fn: function (anObject){
  143. var self=this;
  144. self["@receiver"]=anObject;
  145. return self},
  146. args: ["anObject"],
  147. source: "receiver: anObject\x0a\x09receiver := anObject",
  148. messageSends: [],
  149. referencedClasses: []
  150. }),
  151. globals.HLCodeModel);
  152. smalltalk.addMethod(
  153. smalltalk.method({
  154. selector: "on:",
  155. protocol: 'actions',
  156. fn: function (anEnvironment){
  157. var self=this;
  158. return smalltalk.withContext(function($ctx1) {
  159. var $2,$3,$1;
  160. $2=self._new();
  161. _st($2)._environment_(anEnvironment);
  162. $3=_st($2)._yourself();
  163. $1=$3;
  164. return $1;
  165. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},globals.HLCodeModel.klass)})},
  166. args: ["anEnvironment"],
  167. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  168. messageSends: ["environment:", "new", "yourself"],
  169. referencedClasses: []
  170. }),
  171. globals.HLCodeModel.klass);
  172. smalltalk.addClass('HLCodeWidget', globals.HLWidget, ['model', 'wrapper', 'code', 'editor', 'state'], 'Helios-Workspace');
  173. smalltalk.addMethod(
  174. smalltalk.method({
  175. selector: "announcer",
  176. protocol: 'accessing',
  177. fn: function (){
  178. var self=this;
  179. return smalltalk.withContext(function($ctx1) {
  180. var $1;
  181. $1=_st(self._model())._announcer();
  182. return $1;
  183. }, function($ctx1) {$ctx1.fill(self,"announcer",{},globals.HLCodeWidget)})},
  184. args: [],
  185. source: "announcer\x0a\x09^ self model announcer",
  186. messageSends: ["announcer", "model"],
  187. referencedClasses: []
  188. }),
  189. globals.HLCodeWidget);
  190. smalltalk.addMethod(
  191. smalltalk.method({
  192. selector: "canHaveFocus",
  193. protocol: 'testing',
  194. fn: function (){
  195. var self=this;
  196. return true;
  197. },
  198. args: [],
  199. source: "canHaveFocus\x0a\x09^ true",
  200. messageSends: [],
  201. referencedClasses: []
  202. }),
  203. globals.HLCodeWidget);
  204. smalltalk.addMethod(
  205. smalltalk.method({
  206. selector: "clear",
  207. protocol: 'actions',
  208. fn: function (){
  209. var self=this;
  210. return smalltalk.withContext(function($ctx1) {
  211. self._contents_("");
  212. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},globals.HLCodeWidget)})},
  213. args: [],
  214. source: "clear\x0a\x09self contents: ''",
  215. messageSends: ["contents:"],
  216. referencedClasses: []
  217. }),
  218. globals.HLCodeWidget);
  219. smalltalk.addMethod(
  220. smalltalk.method({
  221. selector: "configureEditor",
  222. protocol: 'actions',
  223. fn: function (){
  224. var self=this;
  225. return smalltalk.withContext(function($ctx1) {
  226. var $1;
  227. $1=self._editor();
  228. $ctx1.sendIdx["editor"]=1;
  229. _st($1)._at_put_("amberCodeWidget",self);
  230. _st(self._editor())._on_do_("change",(function(){
  231. return smalltalk.withContext(function($ctx2) {
  232. return self._onChange();
  233. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  234. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},globals.HLCodeWidget)})},
  235. args: [],
  236. source: "configureEditor\x0a\x09self editor at: 'amberCodeWidget' put: self.\x0a\x09self editor on: 'change' do: [ self onChange ]",
  237. messageSends: ["at:put:", "editor", "on:do:", "onChange"],
  238. referencedClasses: []
  239. }),
  240. globals.HLCodeWidget);
  241. smalltalk.addMethod(
  242. smalltalk.method({
  243. selector: "contents",
  244. protocol: 'accessing',
  245. fn: function (){
  246. var self=this;
  247. return smalltalk.withContext(function($ctx1) {
  248. var $1;
  249. $1=_st(self["@editor"])._getValue();
  250. return $1;
  251. }, function($ctx1) {$ctx1.fill(self,"contents",{},globals.HLCodeWidget)})},
  252. args: [],
  253. source: "contents\x0a\x09^ editor getValue",
  254. messageSends: ["getValue"],
  255. referencedClasses: []
  256. }),
  257. globals.HLCodeWidget);
  258. smalltalk.addMethod(
  259. smalltalk.method({
  260. selector: "contents:",
  261. protocol: 'accessing',
  262. fn: function (aString){
  263. var self=this;
  264. return smalltalk.withContext(function($ctx1) {
  265. var $1;
  266. _st(self["@editor"])._setValue_(aString);
  267. $1=self["@state"];
  268. if(($receiver = $1) == nil || $receiver == null){
  269. $1;
  270. } else {
  271. self._updateState();
  272. };
  273. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},globals.HLCodeWidget)})},
  274. args: ["aString"],
  275. source: "contents: aString\x0a\x09editor setValue: aString.\x0a\x09state ifNotNil: [ self updateState ]",
  276. messageSends: ["setValue:", "ifNotNil:", "updateState"],
  277. referencedClasses: []
  278. }),
  279. globals.HLCodeWidget);
  280. smalltalk.addMethod(
  281. smalltalk.method({
  282. selector: "currentLine",
  283. protocol: 'accessing',
  284. fn: function (){
  285. var self=this;
  286. return smalltalk.withContext(function($ctx1) {
  287. var $1;
  288. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  289. return $1;
  290. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},globals.HLCodeWidget)})},
  291. args: [],
  292. source: "currentLine\x0a ^editor getLine: (editor getCursor line)",
  293. messageSends: ["getLine:", "line", "getCursor"],
  294. referencedClasses: []
  295. }),
  296. globals.HLCodeWidget);
  297. smalltalk.addMethod(
  298. smalltalk.method({
  299. selector: "currentLineOrSelection",
  300. protocol: 'accessing',
  301. fn: function (){
  302. var self=this;
  303. return smalltalk.withContext(function($ctx1) {
  304. var $2,$1;
  305. $2=_st(self["@editor"])._somethingSelected();
  306. if(smalltalk.assert($2)){
  307. $1=self._selection();
  308. } else {
  309. $1=self._currentLine();
  310. };
  311. return $1;
  312. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},globals.HLCodeWidget)})},
  313. args: [],
  314. source: "currentLineOrSelection\x0a ^editor somethingSelected\x0a\x09\x09ifFalse: [ self currentLine ]\x0a\x09\x09ifTrue: [ self selection ]",
  315. messageSends: ["ifFalse:ifTrue:", "somethingSelected", "currentLine", "selection"],
  316. referencedClasses: []
  317. }),
  318. globals.HLCodeWidget);
  319. smalltalk.addMethod(
  320. smalltalk.method({
  321. selector: "doIt",
  322. protocol: 'actions',
  323. fn: function (){
  324. var self=this;
  325. var result;
  326. function $HLDoItRequested(){return globals.HLDoItRequested||(typeof HLDoItRequested=="undefined"?nil:HLDoItRequested)}
  327. function $HLDoItExecuted(){return globals.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
  328. return smalltalk.withContext(function($ctx1) {
  329. var $2,$1,$3,$4;
  330. $2=self._model();
  331. $ctx1.sendIdx["model"]=1;
  332. $1=_st($2)._announcer();
  333. $ctx1.sendIdx["announcer"]=1;
  334. $3=_st($HLDoItRequested())._on_(self["@model"]);
  335. $ctx1.sendIdx["on:"]=1;
  336. _st($1)._announce_($3);
  337. $ctx1.sendIdx["announce:"]=1;
  338. result=_st(self["@model"])._doIt_(self._currentLineOrSelection());
  339. _st(_st(self._model())._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
  340. $4=result;
  341. return $4;
  342. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},globals.HLCodeWidget)})},
  343. args: [],
  344. source: "doIt\x0a\x09| result |\x0a\x0a\x09self model announcer announce: (HLDoItRequested on: model).\x0a\x09result := model doIt: self currentLineOrSelection.\x0a\x09self model announcer announce: (HLDoItExecuted on: model).\x0a\x0a\x09^ result",
  345. messageSends: ["announce:", "announcer", "model", "on:", "doIt:", "currentLineOrSelection"],
  346. referencedClasses: ["HLDoItRequested", "HLDoItExecuted"]
  347. }),
  348. globals.HLCodeWidget);
  349. smalltalk.addMethod(
  350. smalltalk.method({
  351. selector: "editor",
  352. protocol: 'actions',
  353. fn: function (){
  354. var self=this;
  355. var $1;
  356. $1=self["@editor"];
  357. return $1;
  358. },
  359. args: [],
  360. source: "editor\x0a\x09^ editor",
  361. messageSends: [],
  362. referencedClasses: []
  363. }),
  364. globals.HLCodeWidget);
  365. smalltalk.addMethod(
  366. smalltalk.method({
  367. selector: "editorOptions",
  368. protocol: 'accessing',
  369. fn: function (){
  370. var self=this;
  371. 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(globals.HashedCollection._from_(["Shift-Space".__minus_gt("autocomplete")]));
  392. $ctx1.sendIdx["->"]=10;
  393. $1=globals.HashedCollection._from_([$2,$3,$4,$5,$6,$7,$8,$9,$10,$11]);
  394. return $1;
  395. }, function($ctx1) {$ctx1.fill(self,"editorOptions",{},globals.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. globals.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",{},globals.HLCodeWidget)})},
  411. args: [],
  412. source: "focus\x0a\x09editor focus",
  413. messageSends: ["focus"],
  414. referencedClasses: []
  415. }),
  416. globals.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",{},globals.HLCodeWidget)})},
  428. args: [],
  429. source: "hasFocus\x0a\x09^ code asJQuery is: ':active'",
  430. messageSends: ["is:", "asJQuery"],
  431. referencedClasses: []
  432. }),
  433. globals.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. globals.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 globals.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},globals.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. globals.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 globals.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},globals.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. globals.HLCodeWidget);
  496. smalltalk.addMethod(
  497. smalltalk.method({
  498. selector: "model",
  499. protocol: 'accessing',
  500. fn: function (){
  501. var self=this;
  502. function $HLCodeModel(){return globals.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",{},globals.HLCodeWidget)})},
  514. args: [],
  515. source: "model\x0a\x09^ model ifNil: [ model := HLCodeModel new ]",
  516. messageSends: ["ifNil:", "new"],
  517. referencedClasses: ["HLCodeModel"]
  518. }),
  519. globals.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. globals.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",{},globals.HLCodeWidget)})},
  543. args: [],
  544. source: "onChange\x0a\x09self updateState",
  545. messageSends: ["updateState"],
  546. referencedClasses: []
  547. }),
  548. globals.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",{},globals.HLCodeWidget)})},
  558. args: [],
  559. source: "onDoIt\x0a\x09\x0a\x09self doIt",
  560. messageSends: ["doIt"],
  561. referencedClasses: []
  562. }),
  563. globals.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",{},globals.HLCodeWidget)})},
  573. args: [],
  574. source: "onInspectIt\x0a\x0a\x09self inspectIt",
  575. messageSends: ["inspectIt"],
  576. referencedClasses: []
  577. }),
  578. globals.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",{},globals.HLCodeWidget)})},
  588. args: [],
  589. source: "onPrintIt\x0a\x0a\x09self printIt",
  590. messageSends: ["printIt"],
  591. referencedClasses: []
  592. }),
  593. globals.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. globals.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 globals.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=globals.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},globals.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. globals.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 globals.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},globals.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. globals.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",{},globals.HLCodeWidget)})},
  699. args: [],
  700. source: "receiver\x0a\x09^ self model receiver",
  701. messageSends: ["receiver", "model"],
  702. referencedClasses: []
  703. }),
  704. globals.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},globals.HLCodeWidget)})},
  714. args: ["anObject"],
  715. source: "receiver: anObject\x0a\x09self model receiver: anObject",
  716. messageSends: ["receiver:", "model"],
  717. referencedClasses: []
  718. }),
  719. globals.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},globals.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. globals.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},globals.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. globals.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. globals.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",{},globals.HLCodeWidget)})},
  826. args: [],
  827. source: "selection\x0a\x09^editor getSelection",
  828. messageSends: ["getSelection"],
  829. referencedClasses: []
  830. }),
  831. globals.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",{},globals.HLCodeWidget)})},
  843. args: [],
  844. source: "selectionEnd\x0a ^code element selectionEnd",
  845. messageSends: ["selectionEnd", "element"],
  846. referencedClasses: []
  847. }),
  848. globals.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},globals.HLCodeWidget)})},
  858. args: ["anInteger"],
  859. source: "selectionEnd: anInteger\x0a code element selectionEnd: anInteger",
  860. messageSends: ["selectionEnd:", "element"],
  861. referencedClasses: []
  862. }),
  863. globals.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",{},globals.HLCodeWidget)})},
  875. args: [],
  876. source: "selectionStart\x0a ^code element selectionStart",
  877. messageSends: ["selectionStart", "element"],
  878. referencedClasses: []
  879. }),
  880. globals.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},globals.HLCodeWidget)})},
  890. args: ["anInteger"],
  891. source: "selectionStart: anInteger\x0a code element selectionStart: anInteger",
  892. messageSends: ["selectionStart:", "element"],
  893. referencedClasses: []
  894. }),
  895. globals.HLCodeWidget);
  896. smalltalk.addMethod(
  897. smalltalk.method({
  898. selector: "setEditorOn:",
  899. protocol: 'actions',
  900. fn: function (aTextarea){
  901. var self=this;
  902. return smalltalk.withContext(function($ctx1) {
  903. self['@editor'] = CodeMirror.fromTextArea(aTextarea, self._editorOptions());
  904. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},globals.HLCodeWidget)})},
  905. args: ["aTextarea"],
  906. source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, self._editorOptions())>",
  907. messageSends: [],
  908. referencedClasses: []
  909. }),
  910. globals.HLCodeWidget);
  911. smalltalk.addMethod(
  912. smalltalk.method({
  913. selector: "updateState",
  914. protocol: 'updating',
  915. fn: function (){
  916. var self=this;
  917. return smalltalk.withContext(function($ctx1) {
  918. var $1,$2;
  919. $1=self._hasModification();
  920. if(smalltalk.assert($1)){
  921. $2=_st(self["@state"])._asJQuery();
  922. $ctx1.sendIdx["asJQuery"]=1;
  923. _st($2)._addClass_("modified");
  924. } else {
  925. _st(_st(self["@state"])._asJQuery())._removeClass_("modified");
  926. };
  927. return self}, function($ctx1) {$ctx1.fill(self,"updateState",{},globals.HLCodeWidget)})},
  928. args: [],
  929. source: "updateState\x0a\x09self hasModification \x0a\x09\x09ifTrue: [ state asJQuery addClass: 'modified' ]\x0a\x09\x09ifFalse: [ state asJQuery removeClass: 'modified' ]",
  930. messageSends: ["ifTrue:ifFalse:", "hasModification", "addClass:", "asJQuery", "removeClass:"],
  931. referencedClasses: []
  932. }),
  933. globals.HLCodeWidget);
  934. smalltalk.addMethod(
  935. smalltalk.method({
  936. selector: "variableHintFor:token:",
  937. protocol: 'hints',
  938. fn: function (anEditor,aToken){
  939. var self=this;
  940. var variables,classNames,pseudoVariables;
  941. function $Smalltalk(){return globals.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  942. return smalltalk.withContext(function($ctx1) {
  943. var $3,$2,$1,$9,$8,$7,$6,$10,$5,$4;
  944. $3=_st(_st(_st(anEditor)._display())._wrapper())._asJQuery();
  945. $ctx1.sendIdx["asJQuery"]=1;
  946. $2=_st($3)._find_("span.cm-variable");
  947. $1=_st($2)._get();
  948. variables=_st($1)._collect_((function(each){
  949. return smalltalk.withContext(function($ctx2) {
  950. return _st(_st(each)._asJQuery())._html();
  951. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,1)})}));
  952. $ctx1.sendIdx["collect:"]=1;
  953. classNames=_st(_st($Smalltalk())._classes())._collect_((function(each){
  954. return smalltalk.withContext(function($ctx2) {
  955. return _st(each)._name();
  956. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,2)})}));
  957. pseudoVariables=_st($Smalltalk())._pseudoVariableNames();
  958. $9=_st(_st(variables).__comma(classNames)).__comma(pseudoVariables);
  959. $ctx1.sendIdx[","]=1;
  960. $8=_st($9)._asSet();
  961. $7=_st($8)._asArray();
  962. $6=_st($7)._sort();
  963. $5=_st($6)._select_((function(each){
  964. return smalltalk.withContext(function($ctx2) {
  965. $10=_st(aToken)._string();
  966. $ctx2.sendIdx["string"]=1;
  967. return _st(each)._includesSubString_($10);
  968. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,3)})}));
  969. $4=_st($5)._reject_((function(each){
  970. return smalltalk.withContext(function($ctx2) {
  971. return _st(each).__eq(_st(aToken)._string());
  972. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1,4)})}));
  973. return $4;
  974. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},globals.HLCodeWidget)})},
  975. args: ["anEditor", "aToken"],
  976. 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 ]",
  977. messageSends: ["collect:", "get", "find:", "asJQuery", "wrapper", "display", "html", "classes", "name", "pseudoVariableNames", "reject:", "select:", "sort", "asArray", "asSet", ",", "includesSubString:", "string", "="],
  978. referencedClasses: ["Smalltalk"]
  979. }),
  980. globals.HLCodeWidget);
  981. smalltalk.addMethod(
  982. smalltalk.method({
  983. selector: "hintFor:options:",
  984. protocol: 'hints',
  985. fn: function (anEditor,options){
  986. var self=this;
  987. var cursor,token,completions;
  988. function $CodeMirror(){return globals.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  989. function $HLCodeWidget(){return globals.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  990. return smalltalk.withContext(function($ctx1) {
  991. var $1,$4,$3,$2,$5,$7,$10,$11,$9,$8,$6;
  992. cursor=_st(anEditor)._getCursor();
  993. token=_st(anEditor)._getTokenAt_(cursor);
  994. $1=token;
  995. $4=_st($CodeMirror())._basicAt_("innerMode");
  996. $ctx1.sendIdx["basicAt:"]=1;
  997. $3=_st($4)._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state"));
  998. $ctx1.sendIdx["value:value:"]=1;
  999. $2=_st($3)._state();
  1000. _st($1)._at_put_("state",$2);
  1001. $5=_st(_st(token)._type()).__eq("variable");
  1002. if(smalltalk.assert($5)){
  1003. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  1004. } else {
  1005. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  1006. };
  1007. $7="list".__minus_gt(completions);
  1008. $ctx1.sendIdx["->"]=1;
  1009. $10=_st($CodeMirror())._basicAt_("Pos");
  1010. $ctx1.sendIdx["basicAt:"]=2;
  1011. $11=_st(cursor)._line();
  1012. $ctx1.sendIdx["line"]=1;
  1013. $9=_st($10)._value_value_($11,_st(token)._end());
  1014. $ctx1.sendIdx["value:value:"]=2;
  1015. $8="from".__minus_gt($9);
  1016. $ctx1.sendIdx["->"]=2;
  1017. $6=globals.HashedCollection._from_([$7,$8,"to".__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._start()))]);
  1018. return $6;
  1019. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},globals.HLCodeWidget.klass)})},
  1020. args: ["anEditor", "options"],
  1021. 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}",
  1022. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "basicAt:", "getMode", "at:", "ifTrue:ifFalse:", "=", "type", "variableHintFor:token:", "messageHintFor:token:", "->", "line", "end", "start"],
  1023. referencedClasses: ["CodeMirror", "HLCodeWidget"]
  1024. }),
  1025. globals.HLCodeWidget.klass);
  1026. smalltalk.addMethod(
  1027. smalltalk.method({
  1028. selector: "initialize",
  1029. protocol: 'initialization',
  1030. fn: function (){
  1031. var self=this;
  1032. return smalltalk.withContext(function($ctx1) {
  1033. var $1;
  1034. globals.HLCodeWidget.klass.superclass.fn.prototype._initialize.apply(_st(self), []);
  1035. self._setupCodeMirror();
  1036. self._setupCommands();
  1037. $1=self._setupKeyMaps();
  1038. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},globals.HLCodeWidget.klass)})},
  1039. args: [],
  1040. source: "initialize\x0a\x09super initialize.\x0a\x09self \x0a\x09\x09setupCodeMirror;\x0a\x09\x09setupCommands;\x0a\x09\x09setupKeyMaps.",
  1041. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"],
  1042. referencedClasses: []
  1043. }),
  1044. globals.HLCodeWidget.klass);
  1045. smalltalk.addMethod(
  1046. smalltalk.method({
  1047. selector: "keyMap",
  1048. protocol: 'accessing',
  1049. fn: function (){
  1050. var self=this;
  1051. function $HLManager(){return globals.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  1052. return smalltalk.withContext(function($ctx1) {
  1053. var $2,$1;
  1054. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  1055. if(smalltalk.assert($2)){
  1056. $1=self._macKeyMap();
  1057. } else {
  1058. $1=self._pcKeyMap();
  1059. };
  1060. return $1;
  1061. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},globals.HLCodeWidget.klass)})},
  1062. args: [],
  1063. source: "keyMap\x0a\x09^ HLManager current keyBinder systemIsMac\x0a\x09\x09ifTrue: [ self macKeyMap ]\x0a\x09\x09ifFalse: [ self pcKeyMap ]",
  1064. messageSends: ["ifTrue:ifFalse:", "systemIsMac", "keyBinder", "current", "macKeyMap", "pcKeyMap"],
  1065. referencedClasses: ["HLManager"]
  1066. }),
  1067. globals.HLCodeWidget.klass);
  1068. smalltalk.addMethod(
  1069. smalltalk.method({
  1070. selector: "macKeyMap",
  1071. protocol: 'accessing',
  1072. fn: function (){
  1073. var self=this;
  1074. return smalltalk.withContext(function($ctx1) {
  1075. 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;
  1076. $2="Alt-Backspace".__minus_gt("delWordBefore");
  1077. $ctx1.sendIdx["->"]=1;
  1078. $3="Alt-Delete".__minus_gt("delWordAfter");
  1079. $ctx1.sendIdx["->"]=2;
  1080. $4="Alt-Left".__minus_gt("goWordBoundaryLeft");
  1081. $ctx1.sendIdx["->"]=3;
  1082. $5="Alt-Right".__minus_gt("goWordBoundaryRight");
  1083. $ctx1.sendIdx["->"]=4;
  1084. $6="Cmd-A".__minus_gt("selectAll");
  1085. $ctx1.sendIdx["->"]=5;
  1086. $7="Cmd-Alt-F".__minus_gt("replace");
  1087. $ctx1.sendIdx["->"]=6;
  1088. $8="Cmd-D".__minus_gt("doIt");
  1089. $ctx1.sendIdx["->"]=7;
  1090. $9="Cmd-Down".__minus_gt("goDocEnd");
  1091. $ctx1.sendIdx["->"]=8;
  1092. $10="Cmd-End".__minus_gt("goDocEnd");
  1093. $ctx1.sendIdx["->"]=9;
  1094. $11="Cmd-F".__minus_gt("find");
  1095. $ctx1.sendIdx["->"]=10;
  1096. $12="Cmd-G".__minus_gt("findNext");
  1097. $ctx1.sendIdx["->"]=11;
  1098. $13="Cmd-I".__minus_gt("inspectIt");
  1099. $ctx1.sendIdx["->"]=12;
  1100. $14="Cmd-Left".__minus_gt("goLineStart");
  1101. $ctx1.sendIdx["->"]=13;
  1102. $15="Cmd-P".__minus_gt("printIt");
  1103. $ctx1.sendIdx["->"]=14;
  1104. $16="Cmd-Right".__minus_gt("goLineEnd");
  1105. $ctx1.sendIdx["->"]=15;
  1106. $17="Cmd-S".__minus_gt("saveIt");
  1107. $ctx1.sendIdx["->"]=16;
  1108. $18="Cmd-Up".__minus_gt("goDocStart");
  1109. $ctx1.sendIdx["->"]=17;
  1110. $19="Cmd-Y".__minus_gt("redo");
  1111. $ctx1.sendIdx["->"]=18;
  1112. $20="Cmd-Z".__minus_gt("undo");
  1113. $ctx1.sendIdx["->"]=19;
  1114. $21="Cmd-[".__minus_gt("indentLess");
  1115. $ctx1.sendIdx["->"]=20;
  1116. $22="Cmd-]".__minus_gt("indentMore");
  1117. $ctx1.sendIdx["->"]=21;
  1118. $23="Ctrl-Alt-Backspace".__minus_gt("delWordAfter");
  1119. $ctx1.sendIdx["->"]=22;
  1120. $24="Shift-Cmd-Alt-F".__minus_gt("replaceAll");
  1121. $ctx1.sendIdx["->"]=23;
  1122. $25="Shift-Cmd-G".__minus_gt("findPrev");
  1123. $ctx1.sendIdx["->"]=24;
  1124. $26="Shift-Cmd-Z".__minus_gt("redo");
  1125. $ctx1.sendIdx["->"]=25;
  1126. $1=globals.HashedCollection._from_([$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,"fallthrough".__minus_gt(["basic","emacsy"])]);
  1127. return $1;
  1128. }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},globals.HLCodeWidget.klass)})},
  1129. args: [],
  1130. 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 }",
  1131. messageSends: ["->"],
  1132. referencedClasses: []
  1133. }),
  1134. globals.HLCodeWidget.klass);
  1135. smalltalk.addMethod(
  1136. smalltalk.method({
  1137. selector: "messageHintFor:token:",
  1138. protocol: 'hints',
  1139. fn: function (anEditor,aToken){
  1140. var self=this;
  1141. return smalltalk.withContext(function($ctx1) {
  1142. var $1;
  1143. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  1144. return $1;
  1145. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},globals.HLCodeWidget.klass)})},
  1146. args: ["anEditor", "aToken"],
  1147. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09messageHintFor: anEditor token: aToken",
  1148. messageSends: ["messageHintFor:token:", "at:"],
  1149. referencedClasses: []
  1150. }),
  1151. globals.HLCodeWidget.klass);
  1152. smalltalk.addMethod(
  1153. smalltalk.method({
  1154. selector: "pcKeyMap",
  1155. protocol: 'accessing',
  1156. fn: function (){
  1157. var self=this;
  1158. return smalltalk.withContext(function($ctx1) {
  1159. 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;
  1160. $2="Alt-Left".__minus_gt("goLineStart");
  1161. $ctx1.sendIdx["->"]=1;
  1162. $3="Alt-Right".__minus_gt("goLineEnd");
  1163. $ctx1.sendIdx["->"]=2;
  1164. $4="Alt-Up".__minus_gt("goDocStart");
  1165. $ctx1.sendIdx["->"]=3;
  1166. $5="Ctrl-A".__minus_gt("selectAll");
  1167. $ctx1.sendIdx["->"]=4;
  1168. $6="Ctrl-Backspace".__minus_gt("delWordBefore");
  1169. $ctx1.sendIdx["->"]=5;
  1170. $7="Ctrl-D".__minus_gt("doIt");
  1171. $ctx1.sendIdx["->"]=6;
  1172. $8="Ctrl-Delete".__minus_gt("delWordAfter");
  1173. $ctx1.sendIdx["->"]=7;
  1174. $9="Ctrl-Down".__minus_gt("goDocEnd");
  1175. $ctx1.sendIdx["->"]=8;
  1176. $10="Ctrl-End".__minus_gt("goDocEnd");
  1177. $ctx1.sendIdx["->"]=9;
  1178. $11="Ctrl-F".__minus_gt("find");
  1179. $ctx1.sendIdx["->"]=10;
  1180. $12="Ctrl-G".__minus_gt("findNext");
  1181. $ctx1.sendIdx["->"]=11;
  1182. $13="Ctrl-I".__minus_gt("inspectIt");
  1183. $ctx1.sendIdx["->"]=12;
  1184. $14="Ctrl-Home".__minus_gt("goDocStart");
  1185. $ctx1.sendIdx["->"]=13;
  1186. $15="Ctrl-Left".__minus_gt("goWordBoundaryLeft");
  1187. $ctx1.sendIdx["->"]=14;
  1188. $16="Ctrl-P".__minus_gt("printIt");
  1189. $ctx1.sendIdx["->"]=15;
  1190. $17="Ctrl-Right".__minus_gt("goWordBoundaryRight");
  1191. $ctx1.sendIdx["->"]=16;
  1192. $18="Ctrl-S".__minus_gt("saveIt");
  1193. $ctx1.sendIdx["->"]=17;
  1194. $19="Ctrl-Y".__minus_gt("redo");
  1195. $ctx1.sendIdx["->"]=18;
  1196. $20="Ctrl-Z".__minus_gt("undo");
  1197. $ctx1.sendIdx["->"]=19;
  1198. $21="Ctrl-[".__minus_gt("indentLess");
  1199. $ctx1.sendIdx["->"]=20;
  1200. $22="Ctrl-]".__minus_gt("indentMore");
  1201. $ctx1.sendIdx["->"]=21;
  1202. $23="Shift-Ctrl-F".__minus_gt("replace");
  1203. $ctx1.sendIdx["->"]=22;
  1204. $24="Shift-Ctrl-G".__minus_gt("findPrev");
  1205. $ctx1.sendIdx["->"]=23;
  1206. $25="Shift-Ctrl-R".__minus_gt("replaceAll");
  1207. $ctx1.sendIdx["->"]=24;
  1208. $26="Shift-Ctrl-Z".__minus_gt("redo");
  1209. $ctx1.sendIdx["->"]=25;
  1210. $1=globals.HashedCollection._from_([$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,"fallthrough".__minus_gt(["basic"])]);
  1211. return $1;
  1212. }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},globals.HLCodeWidget.klass)})},
  1213. args: [],
  1214. 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}",
  1215. messageSends: ["->"],
  1216. referencedClasses: []
  1217. }),
  1218. globals.HLCodeWidget.klass);
  1219. smalltalk.addMethod(
  1220. smalltalk.method({
  1221. selector: "setupCodeMirror",
  1222. protocol: 'initialization',
  1223. fn: function (){
  1224. var self=this;
  1225. return smalltalk.withContext(function($ctx1) {
  1226. CodeMirror.keyMap.default.fallthrough = ["basic"];
  1227. CodeMirror.commands.autocomplete = function(cm) {
  1228. CodeMirror.showHint(cm, self._hintFor_options_);
  1229. }
  1230. ;
  1231. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},globals.HLCodeWidget.klass)})},
  1232. args: [],
  1233. 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>",
  1234. messageSends: [],
  1235. referencedClasses: []
  1236. }),
  1237. globals.HLCodeWidget.klass);
  1238. smalltalk.addMethod(
  1239. smalltalk.method({
  1240. selector: "setupCommands",
  1241. protocol: 'initialization',
  1242. fn: function (){
  1243. var self=this;
  1244. function $CodeMirror(){return globals.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  1245. return smalltalk.withContext(function($ctx1) {
  1246. var $1,$2,$3,$4,$5;
  1247. $1=_st($CodeMirror())._basicAt_("commands");
  1248. _st($1)._at_put_("doIt",(function(cm){
  1249. return smalltalk.withContext(function($ctx2) {
  1250. $2=_st(cm)._amberCodeWidget();
  1251. $ctx2.sendIdx["amberCodeWidget"]=1;
  1252. return _st($2)._doIt();
  1253. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,1)})}));
  1254. $ctx1.sendIdx["at:put:"]=1;
  1255. _st($1)._at_put_("inspectIt",(function(cm){
  1256. return smalltalk.withContext(function($ctx2) {
  1257. $3=_st(cm)._amberCodeWidget();
  1258. $ctx2.sendIdx["amberCodeWidget"]=2;
  1259. return _st($3)._inspectIt();
  1260. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,2)})}));
  1261. $ctx1.sendIdx["at:put:"]=2;
  1262. _st($1)._at_put_("printIt",(function(cm){
  1263. return smalltalk.withContext(function($ctx2) {
  1264. $4=_st(cm)._amberCodeWidget();
  1265. $ctx2.sendIdx["amberCodeWidget"]=3;
  1266. return _st($4)._printIt();
  1267. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,3)})}));
  1268. $ctx1.sendIdx["at:put:"]=3;
  1269. $5=_st($1)._at_put_("saveIt",(function(cm){
  1270. return smalltalk.withContext(function($ctx2) {
  1271. return _st(_st(cm)._amberCodeWidget())._saveIt();
  1272. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1,4)})}));
  1273. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},globals.HLCodeWidget.klass)})},
  1274. args: [],
  1275. 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 ]",
  1276. messageSends: ["at:put:", "basicAt:", "doIt", "amberCodeWidget", "inspectIt", "printIt", "saveIt"],
  1277. referencedClasses: ["CodeMirror"]
  1278. }),
  1279. globals.HLCodeWidget.klass);
  1280. smalltalk.addMethod(
  1281. smalltalk.method({
  1282. selector: "setupKeyMaps",
  1283. protocol: 'initialization',
  1284. fn: function (){
  1285. var self=this;
  1286. return smalltalk.withContext(function($ctx1) {
  1287. CodeMirror.keyMap['Amber'] = self._keyMap();
  1288. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},globals.HLCodeWidget.klass)})},
  1289. args: [],
  1290. source: "setupKeyMaps\x0a\x09<CodeMirror.keyMap['Amber'] = self._keyMap()>",
  1291. messageSends: [],
  1292. referencedClasses: []
  1293. }),
  1294. globals.HLCodeWidget.klass);
  1295. smalltalk.addMethod(
  1296. smalltalk.method({
  1297. selector: "variableHintFor:token:",
  1298. protocol: 'hints',
  1299. fn: function (anEditor,aToken){
  1300. var self=this;
  1301. return smalltalk.withContext(function($ctx1) {
  1302. var $1;
  1303. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  1304. return $1;
  1305. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},globals.HLCodeWidget.klass)})},
  1306. args: ["anEditor", "aToken"],
  1307. source: "variableHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09variableHintFor: anEditor token: aToken",
  1308. messageSends: ["variableHintFor:token:", "at:"],
  1309. referencedClasses: []
  1310. }),
  1311. globals.HLCodeWidget.klass);
  1312. smalltalk.addClass('HLNavigationCodeWidget', globals.HLCodeWidget, ['methodContents'], 'Helios-Workspace');
  1313. smalltalk.addMethod(
  1314. smalltalk.method({
  1315. selector: "configureEditor",
  1316. protocol: 'accessing',
  1317. fn: function (){
  1318. var self=this;
  1319. return smalltalk.withContext(function($ctx1) {
  1320. globals.HLNavigationCodeWidget.superclass.fn.prototype._configureEditor.apply(_st(self), []);
  1321. self._contents_(self._methodContents());
  1322. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},globals.HLNavigationCodeWidget)})},
  1323. args: [],
  1324. source: "configureEditor\x0a\x09super configureEditor.\x0a\x09self contents: self methodContents",
  1325. messageSends: ["configureEditor", "contents:", "methodContents"],
  1326. referencedClasses: []
  1327. }),
  1328. globals.HLNavigationCodeWidget);
  1329. smalltalk.addMethod(
  1330. smalltalk.method({
  1331. selector: "contents:",
  1332. protocol: 'accessing',
  1333. fn: function (aString){
  1334. var self=this;
  1335. return smalltalk.withContext(function($ctx1) {
  1336. self._methodContents_(aString);
  1337. globals.HLNavigationCodeWidget.superclass.fn.prototype._contents_.apply(_st(self), [aString]);
  1338. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},globals.HLNavigationCodeWidget)})},
  1339. args: ["aString"],
  1340. source: "contents: aString\x0a\x09self methodContents: aString.\x0a\x09super contents: aString",
  1341. messageSends: ["methodContents:", "contents:"],
  1342. referencedClasses: []
  1343. }),
  1344. globals.HLNavigationCodeWidget);
  1345. smalltalk.addMethod(
  1346. smalltalk.method({
  1347. selector: "hasModification",
  1348. protocol: 'testing',
  1349. fn: function (){
  1350. var self=this;
  1351. return smalltalk.withContext(function($ctx1) {
  1352. var $1;
  1353. $1=_st(_st(self._methodContents()).__eq(self._contents()))._not();
  1354. return $1;
  1355. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},globals.HLNavigationCodeWidget)})},
  1356. args: [],
  1357. source: "hasModification\x0a\x09^ (self methodContents = self contents) not",
  1358. messageSends: ["not", "=", "methodContents", "contents"],
  1359. referencedClasses: []
  1360. }),
  1361. globals.HLNavigationCodeWidget);
  1362. smalltalk.addMethod(
  1363. smalltalk.method({
  1364. selector: "methodContents",
  1365. protocol: 'accessing',
  1366. fn: function (){
  1367. var self=this;
  1368. return smalltalk.withContext(function($ctx1) {
  1369. var $2,$1;
  1370. $2=self["@methodContents"];
  1371. if(($receiver = $2) == nil || $receiver == null){
  1372. $1="";
  1373. } else {
  1374. $1=$2;
  1375. };
  1376. return $1;
  1377. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},globals.HLNavigationCodeWidget)})},
  1378. args: [],
  1379. source: "methodContents\x0a\x09^ methodContents ifNil: [ '' ]",
  1380. messageSends: ["ifNil:"],
  1381. referencedClasses: []
  1382. }),
  1383. globals.HLNavigationCodeWidget);
  1384. smalltalk.addMethod(
  1385. smalltalk.method({
  1386. selector: "methodContents:",
  1387. protocol: 'accessing',
  1388. fn: function (aString){
  1389. var self=this;
  1390. var $1;
  1391. self["@methodContents"]=aString;
  1392. $1=self["@methodContents"];
  1393. return $1;
  1394. },
  1395. args: ["aString"],
  1396. source: "methodContents: aString\x0a\x09^ methodContents := aString",
  1397. messageSends: [],
  1398. referencedClasses: []
  1399. }),
  1400. globals.HLNavigationCodeWidget);
  1401. smalltalk.addMethod(
  1402. smalltalk.method({
  1403. selector: "previous",
  1404. protocol: 'accessing',
  1405. fn: function (){
  1406. var self=this;
  1407. return self},
  1408. args: [],
  1409. source: "previous\x0a\x09\x22for browser lists widget\x22",
  1410. messageSends: [],
  1411. referencedClasses: []
  1412. }),
  1413. globals.HLNavigationCodeWidget);
  1414. smalltalk.addMethod(
  1415. smalltalk.method({
  1416. selector: "previous:",
  1417. protocol: 'accessing',
  1418. fn: function (aWidget){
  1419. var self=this;
  1420. return self},
  1421. args: ["aWidget"],
  1422. source: "previous: aWidget\x0a\x09\x22for browser lists widget\x22",
  1423. messageSends: [],
  1424. referencedClasses: []
  1425. }),
  1426. globals.HLNavigationCodeWidget);
  1427. smalltalk.addMethod(
  1428. smalltalk.method({
  1429. selector: "canBeOpenAsTab",
  1430. protocol: 'testing',
  1431. fn: function (){
  1432. var self=this;
  1433. return false;
  1434. },
  1435. args: [],
  1436. source: "canBeOpenAsTab\x0a\x09^ false",
  1437. messageSends: [],
  1438. referencedClasses: []
  1439. }),
  1440. globals.HLNavigationCodeWidget.klass);
  1441. smalltalk.addMethod(
  1442. smalltalk.method({
  1443. selector: "on:",
  1444. protocol: 'instance creation',
  1445. fn: function (aBrowserModel){
  1446. var self=this;
  1447. return smalltalk.withContext(function($ctx1) {
  1448. var $2,$3,$1;
  1449. $2=self._new();
  1450. _st($2)._browserModel_(aBrowserModel);
  1451. $3=_st($2)._yourself();
  1452. $1=$3;
  1453. return $1;
  1454. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},globals.HLNavigationCodeWidget.klass)})},
  1455. args: ["aBrowserModel"],
  1456. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1457. messageSends: ["browserModel:", "new", "yourself"],
  1458. referencedClasses: []
  1459. }),
  1460. globals.HLNavigationCodeWidget.klass);
  1461. smalltalk.addClass('HLBrowserCodeWidget', globals.HLNavigationCodeWidget, ['browserModel'], 'Helios-Workspace');
  1462. smalltalk.addMethod(
  1463. smalltalk.method({
  1464. selector: "browserModel",
  1465. protocol: 'accessing',
  1466. fn: function (){
  1467. var self=this;
  1468. var $1;
  1469. $1=self["@browserModel"];
  1470. return $1;
  1471. },
  1472. args: [],
  1473. source: "browserModel\x0a\x09^ browserModel",
  1474. messageSends: [],
  1475. referencedClasses: []
  1476. }),
  1477. globals.HLBrowserCodeWidget);
  1478. smalltalk.addMethod(
  1479. smalltalk.method({
  1480. selector: "browserModel:",
  1481. protocol: 'accessing',
  1482. fn: function (aBrowserModel){
  1483. var self=this;
  1484. return smalltalk.withContext(function($ctx1) {
  1485. var $1;
  1486. self["@browserModel"]=aBrowserModel;
  1487. self._observeSystem();
  1488. $1=self._observeBrowserModel();
  1489. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},globals.HLBrowserCodeWidget)})},
  1490. args: ["aBrowserModel"],
  1491. source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x09self \x0a\x09\x09observeSystem;\x0a\x09\x09observeBrowserModel",
  1492. messageSends: ["observeSystem", "observeBrowserModel"],
  1493. referencedClasses: []
  1494. }),
  1495. globals.HLBrowserCodeWidget);
  1496. smalltalk.addMethod(
  1497. smalltalk.method({
  1498. selector: "observeBrowserModel",
  1499. protocol: 'actions',
  1500. fn: function (){
  1501. var self=this;
  1502. function $HLSaveSourceCode(){return globals.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  1503. function $HLShowInstanceToggled(){return globals.HLShowInstanceToggled||(typeof HLShowInstanceToggled=="undefined"?nil:HLShowInstanceToggled)}
  1504. function $HLSourceCodeSaved(){return globals.HLSourceCodeSaved||(typeof HLSourceCodeSaved=="undefined"?nil:HLSourceCodeSaved)}
  1505. function $HLAboutToChange(){return globals.HLAboutToChange||(typeof HLAboutToChange=="undefined"?nil:HLAboutToChange)}
  1506. function $HLParseErrorRaised(){return globals.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  1507. function $HLCompileErrorRaised(){return globals.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  1508. function $HLUnknownVariableErrorRaised(){return globals.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  1509. function $HLInstVarAdded(){return globals.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  1510. function $HLMethodSelected(){return globals.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1511. function $HLClassSelected(){return globals.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1512. function $HLPackageSelected(){return globals.HLPackageSelected||(typeof HLPackageSelected=="undefined"?nil:HLPackageSelected)}
  1513. function $HLProtocolSelected(){return globals.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1514. function $HLSourceCodeFocusRequested(){return globals.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1515. return smalltalk.withContext(function($ctx1) {
  1516. var $1,$2;
  1517. $1=_st(self._browserModel())._announcer();
  1518. _st($1)._on_send_to_($HLSaveSourceCode(),"onSaveIt",self);
  1519. $ctx1.sendIdx["on:send:to:"]=1;
  1520. _st($1)._on_send_to_($HLShowInstanceToggled(),"onShowInstanceToggled",self);
  1521. $ctx1.sendIdx["on:send:to:"]=2;
  1522. _st($1)._on_send_to_($HLSourceCodeSaved(),"onSourceCodeSaved",self);
  1523. $ctx1.sendIdx["on:send:to:"]=3;
  1524. _st($1)._on_send_to_($HLAboutToChange(),"onBrowserAboutToChange:",self);
  1525. $ctx1.sendIdx["on:send:to:"]=4;
  1526. _st($1)._on_send_to_($HLParseErrorRaised(),"onParseError:",self);
  1527. $ctx1.sendIdx["on:send:to:"]=5;
  1528. _st($1)._on_send_to_($HLCompileErrorRaised(),"onCompileError:",self);
  1529. $ctx1.sendIdx["on:send:to:"]=6;
  1530. _st($1)._on_send_to_($HLUnknownVariableErrorRaised(),"onUnknownVariableError:",self);
  1531. $ctx1.sendIdx["on:send:to:"]=7;
  1532. _st($1)._on_send_to_($HLInstVarAdded(),"onInstVarAdded",self);
  1533. $ctx1.sendIdx["on:send:to:"]=8;
  1534. _st($1)._on_send_to_($HLMethodSelected(),"onMethodSelected:",self);
  1535. $ctx1.sendIdx["on:send:to:"]=9;
  1536. _st($1)._on_send_to_($HLClassSelected(),"onClassSelected:",self);
  1537. $ctx1.sendIdx["on:send:to:"]=10;
  1538. _st($1)._on_send_to_($HLPackageSelected(),"onPackageSelected:",self);
  1539. $ctx1.sendIdx["on:send:to:"]=11;
  1540. _st($1)._on_send_to_($HLProtocolSelected(),"onProtocolSelected:",self);
  1541. $ctx1.sendIdx["on:send:to:"]=12;
  1542. $2=_st($1)._on_send_to_($HLSourceCodeFocusRequested(),"onSourceCodeFocusRequested",self);
  1543. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},globals.HLBrowserCodeWidget)})},
  1544. args: [],
  1545. 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",
  1546. messageSends: ["on:send:to:", "announcer", "browserModel"],
  1547. referencedClasses: ["HLSaveSourceCode", "HLShowInstanceToggled", "HLSourceCodeSaved", "HLAboutToChange", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLPackageSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
  1548. }),
  1549. globals.HLBrowserCodeWidget);
  1550. smalltalk.addMethod(
  1551. smalltalk.method({
  1552. selector: "observeSystem",
  1553. protocol: 'actions',
  1554. fn: function (){
  1555. var self=this;
  1556. function $MethodModified(){return globals.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  1557. return smalltalk.withContext(function($ctx1) {
  1558. _st(_st(self._browserModel())._systemAnnouncer())._on_send_to_($MethodModified(),"onMethodModified:",self);
  1559. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},globals.HLBrowserCodeWidget)})},
  1560. args: [],
  1561. source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a \x09on: MethodModified\x0a send: #onMethodModified:\x0a\x09\x09to: self",
  1562. messageSends: ["on:send:to:", "systemAnnouncer", "browserModel"],
  1563. referencedClasses: ["MethodModified"]
  1564. }),
  1565. globals.HLBrowserCodeWidget);
  1566. smalltalk.addMethod(
  1567. smalltalk.method({
  1568. selector: "onBrowserAboutToChange:",
  1569. protocol: 'reactions',
  1570. fn: function (anAnnouncement){
  1571. var self=this;
  1572. var block;
  1573. function $HLChangeForbidden(){return globals.HLChangeForbidden||(typeof HLChangeForbidden=="undefined"?nil:HLChangeForbidden)}
  1574. return smalltalk.withContext(function($ctx1) {
  1575. var $1;
  1576. block=_st(anAnnouncement)._actionBlock();
  1577. $1=self._hasModification();
  1578. if(smalltalk.assert($1)){
  1579. self._confirm_ifTrue_("Changes have not been saved. Do you want to discard these changes?",(function(){
  1580. return smalltalk.withContext(function($ctx2) {
  1581. self._methodContents_(self._contents());
  1582. return _st(block)._value();
  1583. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1584. _st($HLChangeForbidden())._signal();
  1585. };
  1586. return self}, function($ctx1) {$ctx1.fill(self,"onBrowserAboutToChange:",{anAnnouncement:anAnnouncement,block:block},globals.HLBrowserCodeWidget)})},
  1587. args: ["anAnnouncement"],
  1588. 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 ]",
  1589. messageSends: ["actionBlock", "ifTrue:", "hasModification", "confirm:ifTrue:", "methodContents:", "contents", "value", "signal"],
  1590. referencedClasses: ["HLChangeForbidden"]
  1591. }),
  1592. globals.HLBrowserCodeWidget);
  1593. smalltalk.addMethod(
  1594. smalltalk.method({
  1595. selector: "onClassSelected:",
  1596. protocol: 'reactions',
  1597. fn: function (anAnnouncement){
  1598. var self=this;
  1599. var class_;
  1600. return smalltalk.withContext(function($ctx1) {
  1601. var $1,$2;
  1602. class_=_st(anAnnouncement)._item();
  1603. $1=class_;
  1604. if(($receiver = $1) == nil || $receiver == null){
  1605. $2=self._contents_("");
  1606. $ctx1.sendIdx["contents:"]=1;
  1607. return $2;
  1608. } else {
  1609. $1;
  1610. };
  1611. self._contents_(_st(class_)._definition());
  1612. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{anAnnouncement:anAnnouncement,class_:class_},globals.HLBrowserCodeWidget)})},
  1613. args: ["anAnnouncement"],
  1614. source: "onClassSelected: anAnnouncement\x0a\x09| class |\x0a\x09\x0a\x09class:= anAnnouncement item.\x0a\x09\x0a\x09class ifNil: [ ^ self contents: '' ].\x0a\x09self contents: class definition",
  1615. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1616. referencedClasses: []
  1617. }),
  1618. globals.HLBrowserCodeWidget);
  1619. smalltalk.addMethod(
  1620. smalltalk.method({
  1621. selector: "onCompileError:",
  1622. protocol: 'reactions',
  1623. fn: function (anAnnouncement){
  1624. var self=this;
  1625. return smalltalk.withContext(function($ctx1) {
  1626. self._alert_(_st(_st(anAnnouncement)._error())._messageText());
  1627. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1628. args: ["anAnnouncement"],
  1629. source: "onCompileError: anAnnouncement\x0a\x09self alert: anAnnouncement error messageText",
  1630. messageSends: ["alert:", "messageText", "error"],
  1631. referencedClasses: []
  1632. }),
  1633. globals.HLBrowserCodeWidget);
  1634. smalltalk.addMethod(
  1635. smalltalk.method({
  1636. selector: "onInstVarAdded",
  1637. protocol: 'reactions',
  1638. fn: function (){
  1639. var self=this;
  1640. return smalltalk.withContext(function($ctx1) {
  1641. _st(self._browserModel())._save_(self._contents());
  1642. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},globals.HLBrowserCodeWidget)})},
  1643. args: [],
  1644. source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
  1645. messageSends: ["save:", "browserModel", "contents"],
  1646. referencedClasses: []
  1647. }),
  1648. globals.HLBrowserCodeWidget);
  1649. smalltalk.addMethod(
  1650. smalltalk.method({
  1651. selector: "onMethodModified:",
  1652. protocol: 'reactions',
  1653. fn: function (anAnnouncement){
  1654. var self=this;
  1655. var method;
  1656. return smalltalk.withContext(function($ctx1) {
  1657. var $3,$2,$1,$5,$4,$7,$6;
  1658. method=_st(anAnnouncement)._method();
  1659. $3=self._browserModel();
  1660. $ctx1.sendIdx["browserModel"]=1;
  1661. $2=_st($3)._selectedClass();
  1662. $1=_st($2).__eq(_st(method)._methodClass());
  1663. $ctx1.sendIdx["="]=1;
  1664. if(! smalltalk.assert($1)){
  1665. return self;
  1666. };
  1667. $5=self._browserModel();
  1668. $ctx1.sendIdx["browserModel"]=2;
  1669. $4=_st($5)._selectedMethod();
  1670. $ctx1.sendIdx["selectedMethod"]=1;
  1671. if(($receiver = $4) == nil || $receiver == null){
  1672. return self;
  1673. } else {
  1674. $4;
  1675. };
  1676. $7=_st(_st(self._browserModel())._selectedMethod())._selector();
  1677. $ctx1.sendIdx["selector"]=1;
  1678. $6=_st($7).__eq(_st(method)._selector());
  1679. if(! smalltalk.assert($6)){
  1680. return self;
  1681. };
  1682. self._refresh();
  1683. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{anAnnouncement:anAnnouncement,method:method},globals.HLBrowserCodeWidget)})},
  1684. args: ["anAnnouncement"],
  1685. 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",
  1686. messageSends: ["method", "ifFalse:", "=", "selectedClass", "browserModel", "methodClass", "ifNil:", "selectedMethod", "selector", "refresh"],
  1687. referencedClasses: []
  1688. }),
  1689. globals.HLBrowserCodeWidget);
  1690. smalltalk.addMethod(
  1691. smalltalk.method({
  1692. selector: "onMethodSelected:",
  1693. protocol: 'reactions',
  1694. fn: function (anAnnouncement){
  1695. var self=this;
  1696. var method;
  1697. return smalltalk.withContext(function($ctx1) {
  1698. var $1,$2;
  1699. method=_st(anAnnouncement)._item();
  1700. $1=method;
  1701. if(($receiver = $1) == nil || $receiver == null){
  1702. $2=self._contents_("");
  1703. $ctx1.sendIdx["contents:"]=1;
  1704. return $2;
  1705. } else {
  1706. $1;
  1707. };
  1708. self._contents_(_st(method)._source());
  1709. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{anAnnouncement:anAnnouncement,method:method},globals.HLBrowserCodeWidget)})},
  1710. args: ["anAnnouncement"],
  1711. source: "onMethodSelected: anAnnouncement\x0a\x09| method |\x0a\x09\x0a\x09method := anAnnouncement item.\x0a\x09\x0a\x09method ifNil: [ ^ self contents: '' ].\x0a\x09self contents: method source",
  1712. messageSends: ["item", "ifNil:", "contents:", "source"],
  1713. referencedClasses: []
  1714. }),
  1715. globals.HLBrowserCodeWidget);
  1716. smalltalk.addMethod(
  1717. smalltalk.method({
  1718. selector: "onPackageSelected:",
  1719. protocol: 'reactions',
  1720. fn: function (anAnnouncement){
  1721. var self=this;
  1722. var package_;
  1723. return smalltalk.withContext(function($ctx1) {
  1724. var $1,$2;
  1725. package_=_st(anAnnouncement)._item();
  1726. $1=package_;
  1727. if(($receiver = $1) == nil || $receiver == null){
  1728. $2=self._contents_("");
  1729. $ctx1.sendIdx["contents:"]=1;
  1730. return $2;
  1731. } else {
  1732. $1;
  1733. };
  1734. self._contents_(_st(package_)._definition());
  1735. return self}, function($ctx1) {$ctx1.fill(self,"onPackageSelected:",{anAnnouncement:anAnnouncement,package_:package_},globals.HLBrowserCodeWidget)})},
  1736. args: ["anAnnouncement"],
  1737. source: "onPackageSelected: anAnnouncement\x0a\x09| package |\x0a\x09\x0a\x09package := anAnnouncement item.\x0a\x09\x0a\x09package ifNil: [ ^ self contents: '' ].\x0a\x09self contents: package definition",
  1738. messageSends: ["item", "ifNil:", "contents:", "definition"],
  1739. referencedClasses: []
  1740. }),
  1741. globals.HLBrowserCodeWidget);
  1742. smalltalk.addMethod(
  1743. smalltalk.method({
  1744. selector: "onParseError:",
  1745. protocol: 'reactions',
  1746. fn: function (anAnnouncement){
  1747. var self=this;
  1748. var lineIndex,newContents;
  1749. function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
  1750. return smalltalk.withContext(function($ctx1) {
  1751. var $1,$3,$2,$6,$5,$4;
  1752. lineIndex=(1);
  1753. self._contents_(_st($String())._streamContents_((function(stream){
  1754. return smalltalk.withContext(function($ctx2) {
  1755. return _st(self._contents())._linesDo_((function(each){
  1756. return smalltalk.withContext(function($ctx3) {
  1757. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1758. if(smalltalk.assert($1)){
  1759. $3=_st(anAnnouncement)._column();
  1760. $ctx3.sendIdx["column"]=1;
  1761. $2=_st(each)._copyFrom_to_((1),$3);
  1762. $ctx3.sendIdx["copyFrom:to:"]=1;
  1763. _st(stream)._nextPutAll_($2);
  1764. $ctx3.sendIdx["nextPutAll:"]=1;
  1765. _st(stream)._nextPutAll_("<- ");
  1766. $ctx3.sendIdx["nextPutAll:"]=2;
  1767. _st(stream)._nextPutAll_(_st(anAnnouncement)._message());
  1768. $ctx3.sendIdx["nextPutAll:"]=3;
  1769. _st(stream)._nextPutAll_(" ");
  1770. $ctx3.sendIdx["nextPutAll:"]=4;
  1771. $6=_st(_st(anAnnouncement)._column()).__plus((1));
  1772. $ctx3.sendIdx["+"]=1;
  1773. $5=_st(each)._copyFrom_to_($6,_st(each)._size());
  1774. $4=_st(stream)._nextPutAll_($5);
  1775. $ctx3.sendIdx["nextPutAll:"]=5;
  1776. $4;
  1777. } else {
  1778. _st(stream)._nextPutAll_(each);
  1779. $ctx3.sendIdx["nextPutAll:"]=6;
  1780. };
  1781. _st(stream)._nextPutAll_(_st($String())._cr());
  1782. lineIndex=_st(lineIndex).__plus((1));
  1783. return lineIndex;
  1784. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx2,2)})}));
  1785. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})));
  1786. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},globals.HLBrowserCodeWidget)})},
  1787. args: ["anAnnouncement"],
  1788. 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 ] ])",
  1789. messageSends: ["contents:", "streamContents:", "linesDo:", "contents", "ifTrue:ifFalse:", "=", "line", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "cr"],
  1790. referencedClasses: ["String"]
  1791. }),
  1792. globals.HLBrowserCodeWidget);
  1793. smalltalk.addMethod(
  1794. smalltalk.method({
  1795. selector: "onProtocolSelected:",
  1796. protocol: 'reactions',
  1797. fn: function (anAnnouncement){
  1798. var self=this;
  1799. return smalltalk.withContext(function($ctx1) {
  1800. var $2,$1,$3;
  1801. $2=self._browserModel();
  1802. $ctx1.sendIdx["browserModel"]=1;
  1803. $1=_st($2)._selectedClass();
  1804. $ctx1.sendIdx["selectedClass"]=1;
  1805. if(($receiver = $1) == nil || $receiver == null){
  1806. $3=self._contents_("");
  1807. $ctx1.sendIdx["contents:"]=1;
  1808. return $3;
  1809. } else {
  1810. $1;
  1811. };
  1812. self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
  1813. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{anAnnouncement:anAnnouncement},globals.HLBrowserCodeWidget)})},
  1814. args: ["anAnnouncement"],
  1815. source: "onProtocolSelected: anAnnouncement\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a\x09self contents: self browserModel selectedClass definition",
  1816. messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
  1817. referencedClasses: []
  1818. }),
  1819. globals.HLBrowserCodeWidget);
  1820. smalltalk.addMethod(
  1821. smalltalk.method({
  1822. selector: "onSaveIt",
  1823. protocol: 'reactions',
  1824. fn: function (){
  1825. var self=this;
  1826. return smalltalk.withContext(function($ctx1) {
  1827. _st(self._browserModel())._save_(self._contents());
  1828. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},globals.HLBrowserCodeWidget)})},
  1829. args: [],
  1830. source: "onSaveIt\x0a\x09self browserModel save: self contents",
  1831. messageSends: ["save:", "browserModel", "contents"],
  1832. referencedClasses: []
  1833. }),
  1834. globals.HLBrowserCodeWidget);
  1835. smalltalk.addMethod(
  1836. smalltalk.method({
  1837. selector: "onShowInstanceToggled",
  1838. protocol: 'reactions',
  1839. fn: function (){
  1840. var self=this;
  1841. return smalltalk.withContext(function($ctx1) {
  1842. var $2,$1,$3;
  1843. $2=self._browserModel();
  1844. $ctx1.sendIdx["browserModel"]=1;
  1845. $1=_st($2)._selectedClass();
  1846. $ctx1.sendIdx["selectedClass"]=1;
  1847. if(($receiver = $1) == nil || $receiver == null){
  1848. $3=self._contents_("");
  1849. $ctx1.sendIdx["contents:"]=1;
  1850. return $3;
  1851. } else {
  1852. $1;
  1853. };
  1854. self._contents_(_st(_st(self._browserModel())._selectedClass())._definition());
  1855. return self}, function($ctx1) {$ctx1.fill(self,"onShowInstanceToggled",{},globals.HLBrowserCodeWidget)})},
  1856. args: [],
  1857. source: "onShowInstanceToggled\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a\x09self contents: self browserModel selectedClass definition",
  1858. messageSends: ["ifNil:", "selectedClass", "browserModel", "contents:", "definition"],
  1859. referencedClasses: []
  1860. }),
  1861. globals.HLBrowserCodeWidget);
  1862. smalltalk.addMethod(
  1863. smalltalk.method({
  1864. selector: "onSourceCodeFocusRequested",
  1865. protocol: 'reactions',
  1866. fn: function (){
  1867. var self=this;
  1868. return smalltalk.withContext(function($ctx1) {
  1869. self._focus();
  1870. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},globals.HLBrowserCodeWidget)})},
  1871. args: [],
  1872. source: "onSourceCodeFocusRequested\x0a\x09self focus",
  1873. messageSends: ["focus"],
  1874. referencedClasses: []
  1875. }),
  1876. globals.HLBrowserCodeWidget);
  1877. smalltalk.addMethod(
  1878. smalltalk.method({
  1879. selector: "onSourceCodeSaved",
  1880. protocol: 'reactions',
  1881. fn: function (){
  1882. var self=this;
  1883. return smalltalk.withContext(function($ctx1) {
  1884. self._methodContents_(self._contents());
  1885. self._updateState();
  1886. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeSaved",{},globals.HLBrowserCodeWidget)})},
  1887. args: [],
  1888. source: "onSourceCodeSaved\x0a\x09self methodContents: self contents.\x0a\x09self updateState",
  1889. messageSends: ["methodContents:", "contents", "updateState"],
  1890. referencedClasses: []
  1891. }),
  1892. globals.HLBrowserCodeWidget);
  1893. smalltalk.addMethod(
  1894. smalltalk.method({
  1895. selector: "onUnknownVariableError:",
  1896. protocol: 'reactions',
  1897. fn: function (anAnnouncement){
  1898. var self=this;
  1899. var error;
  1900. function $String(){return globals.String||(typeof String=="undefined"?nil:String)}
  1901. return smalltalk.withContext(function($ctx1) {
  1902. var $1;
  1903. error=_st(anAnnouncement)._error();
  1904. self._confirm_ifTrue_(_st($String())._streamContents_((function(stream){
  1905. return smalltalk.withContext(function($ctx2) {
  1906. _st(stream)._nextPutAll_(_st(error)._messageText());
  1907. $ctx2.sendIdx["nextPutAll:"]=1;
  1908. _st(stream)._nextPutAll_(_st($String())._cr());
  1909. $ctx2.sendIdx["nextPutAll:"]=2;
  1910. $1=_st(stream)._nextPutAll_("Would you like to define an instance variable?");
  1911. return $1;
  1912. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1,1)})})),(function(){
  1913. return smalltalk.withContext(function($ctx2) {
  1914. return _st(self._browserModel())._addInstVarNamed_(_st(error)._variableName());
  1915. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,2)})}));
  1916. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anAnnouncement:anAnnouncement,error:error},globals.HLBrowserCodeWidget)})},
  1917. args: ["anAnnouncement"],
  1918. 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 ]",
  1919. messageSends: ["error", "confirm:ifTrue:", "streamContents:", "nextPutAll:", "messageText", "cr", "addInstVarNamed:", "browserModel", "variableName"],
  1920. referencedClasses: ["String"]
  1921. }),
  1922. globals.HLBrowserCodeWidget);
  1923. smalltalk.addMethod(
  1924. smalltalk.method({
  1925. selector: "refresh",
  1926. protocol: 'actions',
  1927. fn: function (){
  1928. var self=this;
  1929. return smalltalk.withContext(function($ctx1) {
  1930. var $1,$2;
  1931. $1=self._hasModification();
  1932. if(smalltalk.assert($1)){
  1933. return self;
  1934. };
  1935. $2=self._hasFocus();
  1936. if(smalltalk.assert($2)){
  1937. return self;
  1938. };
  1939. self._contents_(_st(_st(self._browserModel())._selectedMethod())._source());
  1940. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},globals.HLBrowserCodeWidget)})},
  1941. args: [],
  1942. source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self browserModel selectedMethod source",
  1943. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "browserModel"],
  1944. referencedClasses: []
  1945. }),
  1946. globals.HLBrowserCodeWidget);
  1947. smalltalk.addMethod(
  1948. smalltalk.method({
  1949. selector: "renderButtonsOn:",
  1950. protocol: 'actions',
  1951. fn: function (html){
  1952. var self=this;
  1953. return smalltalk.withContext(function($ctx1) {
  1954. var $1,$2;
  1955. $1=_st(html)._button();
  1956. _st($1)._class_("button");
  1957. _st($1)._with_("SaveIt");
  1958. $2=_st($1)._onClick_((function(){
  1959. return smalltalk.withContext(function($ctx2) {
  1960. return self._saveIt();
  1961. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  1962. globals.HLBrowserCodeWidget.superclass.fn.prototype._renderButtonsOn_.apply(_st(self), [html]);
  1963. return self}, function($ctx1) {$ctx1.fill(self,"renderButtonsOn:",{html:html},globals.HLBrowserCodeWidget)})},
  1964. args: ["html"],
  1965. source: "renderButtonsOn: html\x0a\x09html button \x0a\x09\x09class: 'button';\x0a\x09\x09with: 'SaveIt';\x0a\x09\x09onClick: [ self saveIt ].\x0a\x09super renderButtonsOn: html",
  1966. messageSends: ["class:", "button", "with:", "onClick:", "saveIt", "renderButtonsOn:"],
  1967. referencedClasses: []
  1968. }),
  1969. globals.HLBrowserCodeWidget);
  1970. smalltalk.addMethod(
  1971. smalltalk.method({
  1972. selector: "saveIt",
  1973. protocol: 'actions',
  1974. fn: function (){
  1975. var self=this;
  1976. return smalltalk.withContext(function($ctx1) {
  1977. _st(self._browserModel())._saveSourceCode();
  1978. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},globals.HLBrowserCodeWidget)})},
  1979. args: [],
  1980. source: "saveIt\x0a\x09self browserModel saveSourceCode",
  1981. messageSends: ["saveSourceCode", "browserModel"],
  1982. referencedClasses: []
  1983. }),
  1984. globals.HLBrowserCodeWidget);
  1985. smalltalk.addMethod(
  1986. smalltalk.method({
  1987. selector: "unregister",
  1988. protocol: 'actions',
  1989. fn: function (){
  1990. var self=this;
  1991. return smalltalk.withContext(function($ctx1) {
  1992. var $2,$1;
  1993. globals.HLBrowserCodeWidget.superclass.fn.prototype._unregsiter.apply(_st(self), []);
  1994. $2=self._browserModel();
  1995. $ctx1.sendIdx["browserModel"]=1;
  1996. $1=_st($2)._announcer();
  1997. _st($1)._unsubscribe_(self);
  1998. $ctx1.sendIdx["unsubscribe:"]=1;
  1999. _st(_st(self._browserModel())._systemAnnouncer())._unsubscribe_(self);
  2000. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLBrowserCodeWidget)})},
  2001. args: [],
  2002. source: "unregister\x0a\x09super unregsiter.\x0a\x09\x0a\x09self browserModel announcer unsubscribe: self.\x0a\x09self browserModel systemAnnouncer unsubscribe: self",
  2003. messageSends: ["unregsiter", "unsubscribe:", "announcer", "browserModel", "systemAnnouncer"],
  2004. referencedClasses: []
  2005. }),
  2006. globals.HLBrowserCodeWidget);
  2007. smalltalk.addMethod(
  2008. smalltalk.method({
  2009. selector: "canBeOpenAsTab",
  2010. protocol: 'testing',
  2011. fn: function (){
  2012. var self=this;
  2013. return false;
  2014. },
  2015. args: [],
  2016. source: "canBeOpenAsTab\x0a\x09^ false",
  2017. messageSends: [],
  2018. referencedClasses: []
  2019. }),
  2020. globals.HLBrowserCodeWidget.klass);
  2021. smalltalk.addMethod(
  2022. smalltalk.method({
  2023. selector: "on:",
  2024. protocol: 'instance creation',
  2025. fn: function (aBrowserModel){
  2026. var self=this;
  2027. return smalltalk.withContext(function($ctx1) {
  2028. var $2,$3,$1;
  2029. $2=self._new();
  2030. _st($2)._browserModel_(aBrowserModel);
  2031. $3=_st($2)._yourself();
  2032. $1=$3;
  2033. return $1;
  2034. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},globals.HLBrowserCodeWidget.klass)})},
  2035. args: ["aBrowserModel"],
  2036. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  2037. messageSends: ["browserModel:", "new", "yourself"],
  2038. referencedClasses: []
  2039. }),
  2040. globals.HLBrowserCodeWidget.klass);
  2041. smalltalk.addClass('HLWorkspace', globals.HLWidget, ['codeWidget', 'transcript'], 'Helios-Workspace');
  2042. smalltalk.addMethod(
  2043. smalltalk.method({
  2044. selector: "canHaveFocus",
  2045. protocol: 'testing',
  2046. fn: function (){
  2047. var self=this;
  2048. return true;
  2049. },
  2050. args: [],
  2051. source: "canHaveFocus\x0a\x09^ true",
  2052. messageSends: [],
  2053. referencedClasses: []
  2054. }),
  2055. globals.HLWorkspace);
  2056. smalltalk.addMethod(
  2057. smalltalk.method({
  2058. selector: "codeWidget",
  2059. protocol: 'accessing',
  2060. fn: function (){
  2061. var self=this;
  2062. function $HLCodeWidget(){return globals.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  2063. return smalltalk.withContext(function($ctx1) {
  2064. var $2,$1;
  2065. $2=self["@codeWidget"];
  2066. if(($receiver = $2) == nil || $receiver == null){
  2067. self["@codeWidget"]=_st($HLCodeWidget())._new();
  2068. $1=self["@codeWidget"];
  2069. } else {
  2070. $1=$2;
  2071. };
  2072. return $1;
  2073. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},globals.HLWorkspace)})},
  2074. args: [],
  2075. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
  2076. messageSends: ["ifNil:", "new"],
  2077. referencedClasses: ["HLCodeWidget"]
  2078. }),
  2079. globals.HLWorkspace);
  2080. smalltalk.addMethod(
  2081. smalltalk.method({
  2082. selector: "focus",
  2083. protocol: 'actions',
  2084. fn: function (){
  2085. var self=this;
  2086. return smalltalk.withContext(function($ctx1) {
  2087. var $1;
  2088. $1=_st(self._codeWidget())._focus();
  2089. return $1;
  2090. }, function($ctx1) {$ctx1.fill(self,"focus",{},globals.HLWorkspace)})},
  2091. args: [],
  2092. source: "focus\x0a\x09^ self codeWidget focus",
  2093. messageSends: ["focus", "codeWidget"],
  2094. referencedClasses: []
  2095. }),
  2096. globals.HLWorkspace);
  2097. smalltalk.addMethod(
  2098. smalltalk.method({
  2099. selector: "renderContentOn:",
  2100. protocol: 'rendering',
  2101. fn: function (html){
  2102. var self=this;
  2103. function $HLContainer(){return globals.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  2104. function $HLHorizontalSplitter(){return globals.HLHorizontalSplitter||(typeof HLHorizontalSplitter=="undefined"?nil:HLHorizontalSplitter)}
  2105. return smalltalk.withContext(function($ctx1) {
  2106. _st(html)._with_(_st($HLContainer())._with_(_st($HLHorizontalSplitter())._with_with_(self._codeWidget(),(function(canvas){
  2107. return smalltalk.withContext(function($ctx2) {
  2108. return self._renderTranscriptOn_(canvas);
  2109. }, function($ctx2) {$ctx2.fillBlock({canvas:canvas},$ctx1,1)})}))));
  2110. $ctx1.sendIdx["with:"]=1;
  2111. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},globals.HLWorkspace)})},
  2112. args: ["html"],
  2113. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: (HLHorizontalSplitter\x0a\x09\x09with: self codeWidget\x0a\x09\x09with: [ :canvas | self renderTranscriptOn: canvas ]))",
  2114. messageSends: ["with:", "with:with:", "codeWidget", "renderTranscriptOn:"],
  2115. referencedClasses: ["HLContainer", "HLHorizontalSplitter"]
  2116. }),
  2117. globals.HLWorkspace);
  2118. smalltalk.addMethod(
  2119. smalltalk.method({
  2120. selector: "renderTranscriptOn:",
  2121. protocol: 'rendering',
  2122. fn: function (html){
  2123. var self=this;
  2124. return smalltalk.withContext(function($ctx1) {
  2125. var $1,$3,$4,$2;
  2126. $1=_st(html)._div();
  2127. $ctx1.sendIdx["div"]=1;
  2128. _st($1)._class_("transcript-container");
  2129. $ctx1.sendIdx["class:"]=1;
  2130. $2=_st($1)._with_((function(){
  2131. return smalltalk.withContext(function($ctx2) {
  2132. $3=_st(html)._div();
  2133. _st($3)._class_("list-label");
  2134. $4=_st($3)._with_("Transcript");
  2135. $4;
  2136. return _st(self._transcript())._renderOn_(html);
  2137. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  2138. $ctx1.sendIdx["with:"]=1;
  2139. return self}, function($ctx1) {$ctx1.fill(self,"renderTranscriptOn:",{html:html},globals.HLWorkspace)})},
  2140. args: ["html"],
  2141. 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 ]",
  2142. messageSends: ["class:", "div", "with:", "renderOn:", "transcript"],
  2143. referencedClasses: []
  2144. }),
  2145. globals.HLWorkspace);
  2146. smalltalk.addMethod(
  2147. smalltalk.method({
  2148. selector: "transcript",
  2149. protocol: 'accessing',
  2150. fn: function (){
  2151. var self=this;
  2152. function $HLTranscript(){return globals.HLTranscript||(typeof HLTranscript=="undefined"?nil:HLTranscript)}
  2153. return smalltalk.withContext(function($ctx1) {
  2154. var $2,$1;
  2155. $2=self["@transcript"];
  2156. if(($receiver = $2) == nil || $receiver == null){
  2157. self["@transcript"]=_st($HLTranscript())._new();
  2158. $1=self["@transcript"];
  2159. } else {
  2160. $1=$2;
  2161. };
  2162. return $1;
  2163. }, function($ctx1) {$ctx1.fill(self,"transcript",{},globals.HLWorkspace)})},
  2164. args: [],
  2165. source: "transcript\x0a\x09^ transcript ifNil: [ transcript := HLTranscript new ]",
  2166. messageSends: ["ifNil:", "new"],
  2167. referencedClasses: ["HLTranscript"]
  2168. }),
  2169. globals.HLWorkspace);
  2170. smalltalk.addMethod(
  2171. smalltalk.method({
  2172. selector: "unregister",
  2173. protocol: 'actions',
  2174. fn: function (){
  2175. var self=this;
  2176. return smalltalk.withContext(function($ctx1) {
  2177. globals.HLWorkspace.superclass.fn.prototype._unregister.apply(_st(self), []);
  2178. $ctx1.sendIdx["unregister"]=1;
  2179. _st(self._transcript())._unregister();
  2180. return self}, function($ctx1) {$ctx1.fill(self,"unregister",{},globals.HLWorkspace)})},
  2181. args: [],
  2182. source: "unregister\x0a\x09super unregister.\x0a\x09self transcript unregister",
  2183. messageSends: ["unregister", "transcript"],
  2184. referencedClasses: []
  2185. }),
  2186. globals.HLWorkspace);
  2187. smalltalk.addMethod(
  2188. smalltalk.method({
  2189. selector: "canBeOpenAsTab",
  2190. protocol: 'testing',
  2191. fn: function (){
  2192. var self=this;
  2193. return true;
  2194. },
  2195. args: [],
  2196. source: "canBeOpenAsTab\x0a\x09^ true",
  2197. messageSends: [],
  2198. referencedClasses: []
  2199. }),
  2200. globals.HLWorkspace.klass);
  2201. smalltalk.addMethod(
  2202. smalltalk.method({
  2203. selector: "tabClass",
  2204. protocol: 'accessing',
  2205. fn: function (){
  2206. var self=this;
  2207. return "workspace";
  2208. },
  2209. args: [],
  2210. source: "tabClass\x0a\x09^ 'workspace'",
  2211. messageSends: [],
  2212. referencedClasses: []
  2213. }),
  2214. globals.HLWorkspace.klass);
  2215. smalltalk.addMethod(
  2216. smalltalk.method({
  2217. selector: "tabLabel",
  2218. protocol: 'accessing',
  2219. fn: function (){
  2220. var self=this;
  2221. return "Workspace";
  2222. },
  2223. args: [],
  2224. source: "tabLabel\x0a\x09^ 'Workspace'",
  2225. messageSends: [],
  2226. referencedClasses: []
  2227. }),
  2228. globals.HLWorkspace.klass);
  2229. smalltalk.addMethod(
  2230. smalltalk.method({
  2231. selector: "tabPriority",
  2232. protocol: 'accessing',
  2233. fn: function (){
  2234. var self=this;
  2235. return (10);
  2236. },
  2237. args: [],
  2238. source: "tabPriority\x0a\x09^ 10",
  2239. messageSends: [],
  2240. referencedClasses: []
  2241. }),
  2242. globals.HLWorkspace.klass);
  2243. });