Helios-Workspace.js 69 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737
  1. smalltalk.addPackage('Helios-Workspace');
  2. smalltalk.addClass('HLCodeModel', smalltalk.Object, ['announcer', 'environment', 'receiver'], 'Helios-Workspace');
  3. smalltalk.addMethod(
  4. smalltalk.method({
  5. selector: "announcer",
  6. category: 'accessing',
  7. fn: function (){
  8. var self=this;
  9. function $Announcer(){return smalltalk.Announcer||(typeof Announcer=="undefined"?nil:Announcer)}
  10. return smalltalk.withContext(function($ctx1) {
  11. var $2,$1;
  12. $2=self["@announcer"];
  13. if(($receiver = $2) == nil || $receiver == undefined){
  14. self["@announcer"]=_st($Announcer())._new();
  15. $1=self["@announcer"];
  16. } else {
  17. $1=$2;
  18. };
  19. return $1;
  20. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeModel)})},
  21. args: [],
  22. source: "announcer\x0a\x09^ announcer ifNil: [ announcer := Announcer new ]",
  23. messageSends: ["ifNil:", "new"],
  24. referencedClasses: ["Announcer"]
  25. }),
  26. smalltalk.HLCodeModel);
  27. smalltalk.addMethod(
  28. smalltalk.method({
  29. selector: "defaultReceiver",
  30. category: 'defaults',
  31. fn: function (){
  32. var self=this;
  33. function $DoIt(){return smalltalk.DoIt||(typeof DoIt=="undefined"?nil:DoIt)}
  34. return smalltalk.withContext(function($ctx1) {
  35. var $1;
  36. $1=_st($DoIt())._new();
  37. return $1;
  38. }, function($ctx1) {$ctx1.fill(self,"defaultReceiver",{},smalltalk.HLCodeModel)})},
  39. args: [],
  40. source: "defaultReceiver\x0a\x09^ DoIt new",
  41. messageSends: ["new"],
  42. referencedClasses: ["DoIt"]
  43. }),
  44. smalltalk.HLCodeModel);
  45. smalltalk.addMethod(
  46. smalltalk.method({
  47. selector: "doIt:",
  48. category: 'actions',
  49. fn: function (someCode){
  50. var self=this;
  51. return smalltalk.withContext(function($ctx1) {
  52. var $1;
  53. $1=_st(_st(self)._environment())._eval_on_(someCode,_st(self)._receiver());
  54. return $1;
  55. }, function($ctx1) {$ctx1.fill(self,"doIt:",{someCode:someCode},smalltalk.HLCodeModel)})},
  56. args: ["someCode"],
  57. source: "doIt: someCode\x0a\x0a\x09^ self environment eval: someCode on: self receiver",
  58. messageSends: ["eval:on:", "receiver", "environment"],
  59. referencedClasses: []
  60. }),
  61. smalltalk.HLCodeModel);
  62. smalltalk.addMethod(
  63. smalltalk.method({
  64. selector: "environment",
  65. category: 'accessing',
  66. fn: function (){
  67. var self=this;
  68. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  69. return smalltalk.withContext(function($ctx1) {
  70. var $2,$1;
  71. $2=self["@environment"];
  72. if(($receiver = $2) == nil || $receiver == undefined){
  73. $1=_st(_st($HLManager())._current())._environment();
  74. } else {
  75. $1=$2;
  76. };
  77. return $1;
  78. }, function($ctx1) {$ctx1.fill(self,"environment",{},smalltalk.HLCodeModel)})},
  79. args: [],
  80. source: "environment\x0a\x09^ environment ifNil: [ HLManager current environment ]",
  81. messageSends: ["ifNil:", "environment", "current"],
  82. referencedClasses: ["HLManager"]
  83. }),
  84. smalltalk.HLCodeModel);
  85. smalltalk.addMethod(
  86. smalltalk.method({
  87. selector: "environment:",
  88. category: 'accessing',
  89. fn: function (anEnvironment){
  90. var self=this;
  91. return smalltalk.withContext(function($ctx1) {
  92. self["@environment"]=anEnvironment;
  93. return self}, function($ctx1) {$ctx1.fill(self,"environment:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel)})},
  94. args: ["anEnvironment"],
  95. source: "environment: anEnvironment\x0a\x09environment := anEnvironment",
  96. messageSends: [],
  97. referencedClasses: []
  98. }),
  99. smalltalk.HLCodeModel);
  100. smalltalk.addMethod(
  101. smalltalk.method({
  102. selector: "receiver",
  103. category: 'accessing',
  104. fn: function (){
  105. var self=this;
  106. return smalltalk.withContext(function($ctx1) {
  107. var $2,$1;
  108. $2=self["@receiver"];
  109. if(($receiver = $2) == nil || $receiver == undefined){
  110. self["@receiver"]=_st(self)._defaultReceiver();
  111. $1=self["@receiver"];
  112. } else {
  113. $1=$2;
  114. };
  115. return $1;
  116. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeModel)})},
  117. args: [],
  118. source: "receiver\x0a\x09^ receiver ifNil: [ receiver := self defaultReceiver ]",
  119. messageSends: ["ifNil:", "defaultReceiver"],
  120. referencedClasses: []
  121. }),
  122. smalltalk.HLCodeModel);
  123. smalltalk.addMethod(
  124. smalltalk.method({
  125. selector: "receiver:",
  126. category: 'accessing',
  127. fn: function (anObject){
  128. var self=this;
  129. return smalltalk.withContext(function($ctx1) {
  130. self["@receiver"]=anObject;
  131. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeModel)})},
  132. args: ["anObject"],
  133. source: "receiver: anObject\x0a\x09receiver := anObject",
  134. messageSends: [],
  135. referencedClasses: []
  136. }),
  137. smalltalk.HLCodeModel);
  138. smalltalk.addMethod(
  139. smalltalk.method({
  140. selector: "subscribe:",
  141. category: 'actions',
  142. fn: function (aWidget){
  143. var self=this;
  144. return smalltalk.withContext(function($ctx1) {
  145. _st(aWidget)._subscribeTo_(_st(self)._announcer());
  146. return self}, function($ctx1) {$ctx1.fill(self,"subscribe:",{aWidget:aWidget},smalltalk.HLCodeModel)})},
  147. args: ["aWidget"],
  148. source: "subscribe: aWidget\x0a\x09aWidget subscribeTo: self announcer",
  149. messageSends: ["subscribeTo:", "announcer"],
  150. referencedClasses: []
  151. }),
  152. smalltalk.HLCodeModel);
  153. smalltalk.addMethod(
  154. smalltalk.method({
  155. selector: "on:",
  156. category: 'actions',
  157. fn: function (anEnvironment){
  158. var self=this;
  159. return smalltalk.withContext(function($ctx1) {
  160. var $2,$3,$1;
  161. $2=_st(self)._new();
  162. _st($2)._environment_(anEnvironment);
  163. $3=_st($2)._yourself();
  164. $1=$3;
  165. return $1;
  166. }, function($ctx1) {$ctx1.fill(self,"on:",{anEnvironment:anEnvironment},smalltalk.HLCodeModel.klass)})},
  167. args: ["anEnvironment"],
  168. source: "on: anEnvironment\x0a\x0a\x09^ self new\x0a \x09environment: anEnvironment;\x0a yourself",
  169. messageSends: ["environment:", "new", "yourself"],
  170. referencedClasses: []
  171. }),
  172. smalltalk.HLCodeModel.klass);
  173. smalltalk.addClass('HLCodeWidget', smalltalk.HLWidget, ['model', 'wrapper', 'code', 'editor'], 'Helios-Workspace');
  174. smalltalk.addMethod(
  175. smalltalk.method({
  176. selector: "announcer",
  177. category: 'accessing',
  178. fn: function (){
  179. var self=this;
  180. return smalltalk.withContext(function($ctx1) {
  181. var $1;
  182. $1=_st(_st(self)._model())._announcer();
  183. return $1;
  184. }, function($ctx1) {$ctx1.fill(self,"announcer",{},smalltalk.HLCodeWidget)})},
  185. args: [],
  186. source: "announcer\x0a\x09^ self model announcer",
  187. messageSends: ["announcer", "model"],
  188. referencedClasses: []
  189. }),
  190. smalltalk.HLCodeWidget);
  191. smalltalk.addMethod(
  192. smalltalk.method({
  193. selector: "canHaveFocus",
  194. category: 'testing',
  195. fn: function (){
  196. var self=this;
  197. return smalltalk.withContext(function($ctx1) {
  198. return true;
  199. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLCodeWidget)})},
  200. args: [],
  201. source: "canHaveFocus\x0a\x09^ true",
  202. messageSends: [],
  203. referencedClasses: []
  204. }),
  205. smalltalk.HLCodeWidget);
  206. smalltalk.addMethod(
  207. smalltalk.method({
  208. selector: "clear",
  209. category: 'actions',
  210. fn: function (){
  211. var self=this;
  212. return smalltalk.withContext(function($ctx1) {
  213. _st(self)._contents_("");
  214. return self}, function($ctx1) {$ctx1.fill(self,"clear",{},smalltalk.HLCodeWidget)})},
  215. args: [],
  216. source: "clear\x0a self contents: ''",
  217. messageSends: ["contents:"],
  218. referencedClasses: []
  219. }),
  220. smalltalk.HLCodeWidget);
  221. smalltalk.addMethod(
  222. smalltalk.method({
  223. selector: "configureEditor",
  224. category: 'actions',
  225. fn: function (){
  226. var self=this;
  227. return smalltalk.withContext(function($ctx1) {
  228. _st(_st(self)._editor())._at_put_("amberCodeWidget",self);
  229. return self}, function($ctx1) {$ctx1.fill(self,"configureEditor",{},smalltalk.HLCodeWidget)})},
  230. args: [],
  231. source: "configureEditor\x0a\x09self editor at: 'amberCodeWidget' put: self",
  232. messageSends: ["at:put:", "editor"],
  233. referencedClasses: []
  234. }),
  235. smalltalk.HLCodeWidget);
  236. smalltalk.addMethod(
  237. smalltalk.method({
  238. selector: "contents",
  239. category: 'accessing',
  240. fn: function (){
  241. var self=this;
  242. return smalltalk.withContext(function($ctx1) {
  243. var $1;
  244. $1=_st(self["@editor"])._getValue();
  245. return $1;
  246. }, function($ctx1) {$ctx1.fill(self,"contents",{},smalltalk.HLCodeWidget)})},
  247. args: [],
  248. source: "contents\x0a\x09^ editor getValue",
  249. messageSends: ["getValue"],
  250. referencedClasses: []
  251. }),
  252. smalltalk.HLCodeWidget);
  253. smalltalk.addMethod(
  254. smalltalk.method({
  255. selector: "contents:",
  256. category: 'accessing',
  257. fn: function (aString){
  258. var self=this;
  259. return smalltalk.withContext(function($ctx1) {
  260. _st(self["@editor"])._setValue_(aString);
  261. return self}, function($ctx1) {$ctx1.fill(self,"contents:",{aString:aString},smalltalk.HLCodeWidget)})},
  262. args: ["aString"],
  263. source: "contents: aString\x0a\x09editor setValue: aString",
  264. messageSends: ["setValue:"],
  265. referencedClasses: []
  266. }),
  267. smalltalk.HLCodeWidget);
  268. smalltalk.addMethod(
  269. smalltalk.method({
  270. selector: "currentLine",
  271. category: 'accessing',
  272. fn: function (){
  273. var self=this;
  274. return smalltalk.withContext(function($ctx1) {
  275. var $1;
  276. $1=_st(self["@editor"])._getLine_(_st(_st(self["@editor"])._getCursor())._line());
  277. return $1;
  278. }, function($ctx1) {$ctx1.fill(self,"currentLine",{},smalltalk.HLCodeWidget)})},
  279. args: [],
  280. source: "currentLine\x0a ^editor getLine: (editor getCursor line)",
  281. messageSends: ["getLine:", "line", "getCursor"],
  282. referencedClasses: []
  283. }),
  284. smalltalk.HLCodeWidget);
  285. smalltalk.addMethod(
  286. smalltalk.method({
  287. selector: "currentLineOrSelection",
  288. category: 'accessing',
  289. fn: function (){
  290. var self=this;
  291. return smalltalk.withContext(function($ctx1) {
  292. var $2,$1;
  293. $2=_st(self["@editor"])._somethingSelected();
  294. if(smalltalk.assert($2)){
  295. $1=_st(self)._selection();
  296. } else {
  297. $1=_st(self)._currentLine();
  298. };
  299. return $1;
  300. }, function($ctx1) {$ctx1.fill(self,"currentLineOrSelection",{},smalltalk.HLCodeWidget)})},
  301. args: [],
  302. source: "currentLineOrSelection\x0a ^editor somethingSelected\x0a\x09\x09ifFalse: [ self currentLine ]\x0a\x09\x09ifTrue: [ self selection ]",
  303. messageSends: ["ifFalse:ifTrue:", "currentLine", "selection", "somethingSelected"],
  304. referencedClasses: []
  305. }),
  306. smalltalk.HLCodeWidget);
  307. smalltalk.addMethod(
  308. smalltalk.method({
  309. selector: "doIt",
  310. category: 'actions',
  311. fn: function (){
  312. var self=this;
  313. var result;
  314. function $HLDoItRequested(){return smalltalk.HLDoItRequested||(typeof HLDoItRequested=="undefined"?nil:HLDoItRequested)}
  315. function $HLDoItExecuted(){return smalltalk.HLDoItExecuted||(typeof HLDoItExecuted=="undefined"?nil:HLDoItExecuted)}
  316. return smalltalk.withContext(function($ctx1) {
  317. var $1;
  318. _st(_st(self)._announcer())._announce_(_st($HLDoItRequested())._on_(self["@model"]));
  319. result=_st(self["@model"])._doIt_(_st(self)._currentLineOrSelection());
  320. _st(_st(self)._announcer())._announce_(_st($HLDoItExecuted())._on_(self["@model"]));
  321. $1=result;
  322. return $1;
  323. }, function($ctx1) {$ctx1.fill(self,"doIt",{result:result},smalltalk.HLCodeWidget)})},
  324. args: [],
  325. source: "doIt\x0a\x09| result |\x0a\x0a\x09self announcer announce: (HLDoItRequested on: model).\x0a\x0a\x09result:= model doIt: self currentLineOrSelection.\x0a\x0a\x09self announcer announce: (HLDoItExecuted on: model).\x0a\x0a\x09^ result ",
  326. messageSends: ["announce:", "on:", "announcer", "doIt:", "currentLineOrSelection"],
  327. referencedClasses: ["HLDoItRequested", "HLDoItExecuted"]
  328. }),
  329. smalltalk.HLCodeWidget);
  330. smalltalk.addMethod(
  331. smalltalk.method({
  332. selector: "editor",
  333. category: 'actions',
  334. fn: function (){
  335. var self=this;
  336. return smalltalk.withContext(function($ctx1) {
  337. var $1;
  338. $1=self["@editor"];
  339. return $1;
  340. }, function($ctx1) {$ctx1.fill(self,"editor",{},smalltalk.HLCodeWidget)})},
  341. args: [],
  342. source: "editor\x0a\x09^editor",
  343. messageSends: [],
  344. referencedClasses: []
  345. }),
  346. smalltalk.HLCodeWidget);
  347. smalltalk.addMethod(
  348. smalltalk.method({
  349. selector: "focus",
  350. category: 'actions',
  351. fn: function (){
  352. var self=this;
  353. return smalltalk.withContext(function($ctx1) {
  354. _st(self["@editor"])._focus();
  355. return self}, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLCodeWidget)})},
  356. args: [],
  357. source: "focus\x0a\x09editor focus",
  358. messageSends: ["focus"],
  359. referencedClasses: []
  360. }),
  361. smalltalk.HLCodeWidget);
  362. smalltalk.addMethod(
  363. smalltalk.method({
  364. selector: "hasFocus",
  365. category: 'testing',
  366. fn: function (){
  367. var self=this;
  368. return smalltalk.withContext(function($ctx1) {
  369. var $1;
  370. $1=_st(_st(self["@code"])._asJQuery())._is_(":active");
  371. return $1;
  372. }, function($ctx1) {$ctx1.fill(self,"hasFocus",{},smalltalk.HLCodeWidget)})},
  373. args: [],
  374. source: "hasFocus\x0a\x09^ code asJQuery is: ':active'",
  375. messageSends: ["is:", "asJQuery"],
  376. referencedClasses: []
  377. }),
  378. smalltalk.HLCodeWidget);
  379. smalltalk.addMethod(
  380. smalltalk.method({
  381. selector: "inspectIt",
  382. category: 'actions',
  383. fn: function (){
  384. var self=this;
  385. var newInspector;
  386. function $HLInspectItRequested(){return smalltalk.HLInspectItRequested||(typeof HLInspectItRequested=="undefined"?nil:HLInspectItRequested)}
  387. return smalltalk.withContext(function($ctx1) {
  388. _st(_st(self)._announcer())._announce_(_st($HLInspectItRequested())._on_(self["@model"]));
  389. newInspector=_st(self)._makeInspectorOn_(_st(self)._doIt());
  390. _st(newInspector)._open();
  391. return self}, function($ctx1) {$ctx1.fill(self,"inspectIt",{newInspector:newInspector},smalltalk.HLCodeWidget)})},
  392. args: [],
  393. source: "inspectIt\x0a\x09| newInspector |\x0a \x0a\x09self announcer announce: (HLInspectItRequested on: model).\x0a\x09newInspector := self makeInspectorOn: self doIt.\x0a\x09newInspector open",
  394. messageSends: ["announce:", "on:", "announcer", "makeInspectorOn:", "doIt", "open"],
  395. referencedClasses: ["HLInspectItRequested"]
  396. }),
  397. smalltalk.HLCodeWidget);
  398. smalltalk.addMethod(
  399. smalltalk.method({
  400. selector: "makeInspectorOn:",
  401. category: 'actions',
  402. fn: function (anObject){
  403. var self=this;
  404. function $HLInspector(){return smalltalk.HLInspector||(typeof HLInspector=="undefined"?nil:HLInspector)}
  405. return smalltalk.withContext(function($ctx1) {
  406. var $2,$3,$1;
  407. $2=_st($HLInspector())._new();
  408. _st($2)._inspect_(anObject);
  409. $3=_st($2)._yourself();
  410. $1=$3;
  411. return $1;
  412. }, function($ctx1) {$ctx1.fill(self,"makeInspectorOn:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  413. args: ["anObject"],
  414. source: "makeInspectorOn: anObject\x0a\x0a\x09^ HLInspector new \x0a\x09\x09inspect: anObject;\x0a\x09\x09yourself",
  415. messageSends: ["inspect:", "new", "yourself"],
  416. referencedClasses: ["HLInspector"]
  417. }),
  418. smalltalk.HLCodeWidget);
  419. smalltalk.addMethod(
  420. smalltalk.method({
  421. selector: "messageHintFor:token:",
  422. category: 'hints',
  423. fn: function (anEditor,aToken){
  424. var self=this;
  425. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  426. return smalltalk.withContext(function($ctx1) {
  427. var $1;
  428. $1=_st(_st(_st(_st(_st(_st(_st($Smalltalk())._current())._at_("allSelectors"))._value())._asSet())._asArray())._select_((function(each){
  429. return smalltalk.withContext(function($ctx2) {
  430. return _st(each)._includesSubString_(_st(aToken)._string());
  431. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  432. return smalltalk.withContext(function($ctx2) {
  433. return _st(each).__eq(_st(aToken)._string());
  434. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  435. return $1;
  436. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget)})},
  437. args: ["anEditor", "aToken"],
  438. source: "messageHintFor: anEditor token: aToken\x0a\x09^ ((Smalltalk current at: 'allSelectors') value asSet asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
  439. messageSends: ["reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", "value", "at:", "current"],
  440. referencedClasses: ["Smalltalk"]
  441. }),
  442. smalltalk.HLCodeWidget);
  443. smalltalk.addMethod(
  444. smalltalk.method({
  445. selector: "model",
  446. category: 'accessing',
  447. fn: function (){
  448. var self=this;
  449. function $HLCodeModel(){return smalltalk.HLCodeModel||(typeof HLCodeModel=="undefined"?nil:HLCodeModel)}
  450. return smalltalk.withContext(function($ctx1) {
  451. var $2,$1;
  452. $2=self["@model"];
  453. if(($receiver = $2) == nil || $receiver == undefined){
  454. self["@model"]=_st($HLCodeModel())._new();
  455. $1=self["@model"];
  456. } else {
  457. $1=$2;
  458. };
  459. return $1;
  460. }, function($ctx1) {$ctx1.fill(self,"model",{},smalltalk.HLCodeWidget)})},
  461. args: [],
  462. source: "model\x0a\x09^ model ifNil: [ model := HLCodeModel new ]",
  463. messageSends: ["ifNil:", "new"],
  464. referencedClasses: ["HLCodeModel"]
  465. }),
  466. smalltalk.HLCodeWidget);
  467. smalltalk.addMethod(
  468. smalltalk.method({
  469. selector: "model:",
  470. category: 'accessing',
  471. fn: function (aModel){
  472. var self=this;
  473. return smalltalk.withContext(function($ctx1) {
  474. self["@model"]=aModel;
  475. return self}, function($ctx1) {$ctx1.fill(self,"model:",{aModel:aModel},smalltalk.HLCodeWidget)})},
  476. args: ["aModel"],
  477. source: "model: aModel\x0a\x09model := aModel",
  478. messageSends: [],
  479. referencedClasses: []
  480. }),
  481. smalltalk.HLCodeWidget);
  482. smalltalk.addMethod(
  483. smalltalk.method({
  484. selector: "onDoIt",
  485. category: 'reactions',
  486. fn: function (){
  487. var self=this;
  488. return smalltalk.withContext(function($ctx1) {
  489. _st(self)._doIt();
  490. return self}, function($ctx1) {$ctx1.fill(self,"onDoIt",{},smalltalk.HLCodeWidget)})},
  491. args: [],
  492. source: "onDoIt\x0a\x09\x0a self doIt",
  493. messageSends: ["doIt"],
  494. referencedClasses: []
  495. }),
  496. smalltalk.HLCodeWidget);
  497. smalltalk.addMethod(
  498. smalltalk.method({
  499. selector: "onInspectIt",
  500. category: 'reactions',
  501. fn: function (){
  502. var self=this;
  503. return smalltalk.withContext(function($ctx1) {
  504. _st(self)._inspectIt();
  505. return self}, function($ctx1) {$ctx1.fill(self,"onInspectIt",{},smalltalk.HLCodeWidget)})},
  506. args: [],
  507. source: "onInspectIt\x0a\x0a\x09self inspectIt",
  508. messageSends: ["inspectIt"],
  509. referencedClasses: []
  510. }),
  511. smalltalk.HLCodeWidget);
  512. smalltalk.addMethod(
  513. smalltalk.method({
  514. selector: "onPrintIt",
  515. category: 'reactions',
  516. fn: function (){
  517. var self=this;
  518. return smalltalk.withContext(function($ctx1) {
  519. _st(self)._printIt();
  520. return self}, function($ctx1) {$ctx1.fill(self,"onPrintIt",{},smalltalk.HLCodeWidget)})},
  521. args: [],
  522. source: "onPrintIt\x0a\x0a\x09self printIt",
  523. messageSends: ["printIt"],
  524. referencedClasses: []
  525. }),
  526. smalltalk.HLCodeWidget);
  527. smalltalk.addMethod(
  528. smalltalk.method({
  529. selector: "onSaveIt",
  530. category: 'reactions',
  531. fn: function (){
  532. var self=this;
  533. return smalltalk.withContext(function($ctx1) {
  534. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLCodeWidget)})},
  535. args: [],
  536. source: "onSaveIt\x0a\x09\x22I do not do anything\x22",
  537. messageSends: [],
  538. referencedClasses: []
  539. }),
  540. smalltalk.HLCodeWidget);
  541. smalltalk.addMethod(
  542. smalltalk.method({
  543. selector: "print:",
  544. category: 'actions',
  545. fn: function (aString){
  546. var self=this;
  547. var start,stop,currentLine;
  548. function $HashedCollection(){return smalltalk.HashedCollection||(typeof HashedCollection=="undefined"?nil:HashedCollection)}
  549. return smalltalk.withContext(function($ctx1) {
  550. currentLine=_st(_st(self["@editor"])._getCursor_(false))._line();
  551. start=_st($HashedCollection())._new();
  552. _st(start)._at_put_("line",currentLine);
  553. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getCursor_(false))._ch());
  554. _st(_st(self["@editor"])._getSelection())._ifEmpty_((function(){
  555. return smalltalk.withContext(function($ctx2) {
  556. _st(start)._at_put_("ch",_st(_st(self["@editor"])._getLine_(currentLine))._size());
  557. return _st(self["@editor"])._setSelection_end_(smalltalk.HashedCollection._fromPairs_([_st("line").__minus_gt(currentLine),_st("ch").__minus_gt((0))]),start);
  558. }, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}));
  559. stop=_st($HashedCollection())._new();
  560. _st(stop)._at_put_("line",currentLine);
  561. _st(stop)._at_put_("ch",_st(_st(_st(start)._at_("ch")).__plus(_st(aString)._size())).__plus((2)));
  562. _st(self["@editor"])._replaceSelection_(_st(_st(_st(_st(self["@editor"])._getSelection()).__comma(" ")).__comma(aString)).__comma(" "));
  563. _st(self["@editor"])._setCursor_(_st(self["@editor"])._getCursor_(true));
  564. _st(self["@editor"])._setSelection_end_(stop,start);
  565. return self}, function($ctx1) {$ctx1.fill(self,"print:",{aString:aString,start:start,stop:stop,currentLine:currentLine},smalltalk.HLCodeWidget)})},
  566. args: ["aString"],
  567. 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",
  568. messageSends: ["line", "getCursor:", "new", "at:put:", "ch", "ifEmpty:", "size", "getLine:", "setSelection:end:", "->", "getSelection", "+", "at:", "replaceSelection:", ",", "setCursor:"],
  569. referencedClasses: ["HashedCollection"]
  570. }),
  571. smalltalk.HLCodeWidget);
  572. smalltalk.addMethod(
  573. smalltalk.method({
  574. selector: "printIt",
  575. category: 'actions',
  576. fn: function (){
  577. var self=this;
  578. var result;
  579. function $HLPrintItRequested(){return smalltalk.HLPrintItRequested||(typeof HLPrintItRequested=="undefined"?nil:HLPrintItRequested)}
  580. return smalltalk.withContext(function($ctx1) {
  581. result=_st(self)._doIt();
  582. _st(_st(self)._announcer())._announce_(_st($HLPrintItRequested())._on_(self["@model"]));
  583. _st(self)._print_(_st(result)._printString());
  584. _st(self)._focus();
  585. return self}, function($ctx1) {$ctx1.fill(self,"printIt",{result:result},smalltalk.HLCodeWidget)})},
  586. args: [],
  587. source: "printIt\x0a\x09| result |\x0a\x0a\x09result:= self doIt.\x0a \x0a\x09self announcer announce: (HLPrintItRequested on: model).\x0a\x0a self print: result printString.\x0a\x09self focus.",
  588. messageSends: ["doIt", "announce:", "on:", "announcer", "print:", "printString", "focus"],
  589. referencedClasses: ["HLPrintItRequested"]
  590. }),
  591. smalltalk.HLCodeWidget);
  592. smalltalk.addMethod(
  593. smalltalk.method({
  594. selector: "receiver",
  595. category: 'accessing',
  596. fn: function (){
  597. var self=this;
  598. return smalltalk.withContext(function($ctx1) {
  599. var $1;
  600. $1=_st(_st(self)._model())._receiver();
  601. return $1;
  602. }, function($ctx1) {$ctx1.fill(self,"receiver",{},smalltalk.HLCodeWidget)})},
  603. args: [],
  604. source: "receiver\x0a\x09^ self model receiver",
  605. messageSends: ["receiver", "model"],
  606. referencedClasses: []
  607. }),
  608. smalltalk.HLCodeWidget);
  609. smalltalk.addMethod(
  610. smalltalk.method({
  611. selector: "receiver:",
  612. category: 'accessing',
  613. fn: function (anObject){
  614. var self=this;
  615. return smalltalk.withContext(function($ctx1) {
  616. _st(_st(self)._model())._receiver_(anObject);
  617. return self}, function($ctx1) {$ctx1.fill(self,"receiver:",{anObject:anObject},smalltalk.HLCodeWidget)})},
  618. args: ["anObject"],
  619. source: "receiver: anObject\x0a\x09self model receiver: anObject",
  620. messageSends: ["receiver:", "model"],
  621. referencedClasses: []
  622. }),
  623. smalltalk.HLCodeWidget);
  624. smalltalk.addMethod(
  625. smalltalk.method({
  626. selector: "renderContentOn:",
  627. category: 'rendering',
  628. fn: function (html){
  629. var self=this;
  630. return smalltalk.withContext(function($ctx1) {
  631. self["@code"]=_st(html)._textarea();
  632. _st(self)._setEditorOn_(_st(self["@code"])._element());
  633. _st(self)._configureEditor();
  634. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLCodeWidget)})},
  635. args: ["html"],
  636. source: "renderContentOn: html\x0a code := html textarea.\x0a self setEditorOn: code element.\x0a self configureEditor",
  637. messageSends: ["textarea", "setEditorOn:", "element", "configureEditor"],
  638. referencedClasses: []
  639. }),
  640. smalltalk.HLCodeWidget);
  641. smalltalk.addMethod(
  642. smalltalk.method({
  643. selector: "saveIt",
  644. category: 'actions',
  645. fn: function (){
  646. var self=this;
  647. return smalltalk.withContext(function($ctx1) {
  648. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLCodeWidget)})},
  649. args: [],
  650. source: "saveIt\x0a\x09\x22I do not do anything\x22",
  651. messageSends: [],
  652. referencedClasses: []
  653. }),
  654. smalltalk.HLCodeWidget);
  655. smalltalk.addMethod(
  656. smalltalk.method({
  657. selector: "selection",
  658. category: 'accessing',
  659. fn: function (){
  660. var self=this;
  661. return smalltalk.withContext(function($ctx1) {
  662. var $1;
  663. $1=_st(self["@editor"])._getSelection();
  664. return $1;
  665. }, function($ctx1) {$ctx1.fill(self,"selection",{},smalltalk.HLCodeWidget)})},
  666. args: [],
  667. source: "selection\x0a\x09^editor getSelection",
  668. messageSends: ["getSelection"],
  669. referencedClasses: []
  670. }),
  671. smalltalk.HLCodeWidget);
  672. smalltalk.addMethod(
  673. smalltalk.method({
  674. selector: "selectionEnd",
  675. category: 'accessing',
  676. fn: function (){
  677. var self=this;
  678. return smalltalk.withContext(function($ctx1) {
  679. var $1;
  680. $1=_st(_st(self["@code"])._element())._selectionEnd();
  681. return $1;
  682. }, function($ctx1) {$ctx1.fill(self,"selectionEnd",{},smalltalk.HLCodeWidget)})},
  683. args: [],
  684. source: "selectionEnd\x0a ^code element selectionEnd",
  685. messageSends: ["selectionEnd", "element"],
  686. referencedClasses: []
  687. }),
  688. smalltalk.HLCodeWidget);
  689. smalltalk.addMethod(
  690. smalltalk.method({
  691. selector: "selectionEnd:",
  692. category: 'accessing',
  693. fn: function (anInteger){
  694. var self=this;
  695. return smalltalk.withContext(function($ctx1) {
  696. _st(_st(self["@code"])._element())._selectionEnd_(anInteger);
  697. return self}, function($ctx1) {$ctx1.fill(self,"selectionEnd:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  698. args: ["anInteger"],
  699. source: "selectionEnd: anInteger\x0a code element selectionEnd: anInteger",
  700. messageSends: ["selectionEnd:", "element"],
  701. referencedClasses: []
  702. }),
  703. smalltalk.HLCodeWidget);
  704. smalltalk.addMethod(
  705. smalltalk.method({
  706. selector: "selectionStart",
  707. category: 'accessing',
  708. fn: function (){
  709. var self=this;
  710. return smalltalk.withContext(function($ctx1) {
  711. var $1;
  712. $1=_st(_st(self["@code"])._element())._selectionStart();
  713. return $1;
  714. }, function($ctx1) {$ctx1.fill(self,"selectionStart",{},smalltalk.HLCodeWidget)})},
  715. args: [],
  716. source: "selectionStart\x0a ^code element selectionStart",
  717. messageSends: ["selectionStart", "element"],
  718. referencedClasses: []
  719. }),
  720. smalltalk.HLCodeWidget);
  721. smalltalk.addMethod(
  722. smalltalk.method({
  723. selector: "selectionStart:",
  724. category: 'accessing',
  725. fn: function (anInteger){
  726. var self=this;
  727. return smalltalk.withContext(function($ctx1) {
  728. _st(_st(self["@code"])._element())._selectionStart_(anInteger);
  729. return self}, function($ctx1) {$ctx1.fill(self,"selectionStart:",{anInteger:anInteger},smalltalk.HLCodeWidget)})},
  730. args: ["anInteger"],
  731. source: "selectionStart: anInteger\x0a code element selectionStart: anInteger",
  732. messageSends: ["selectionStart:", "element"],
  733. referencedClasses: []
  734. }),
  735. smalltalk.HLCodeWidget);
  736. smalltalk.addMethod(
  737. smalltalk.method({
  738. selector: "setEditorOn:",
  739. category: 'actions',
  740. fn: function (aTextarea){
  741. var self=this;
  742. return smalltalk.withContext(function($ctx1) {
  743. self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
  744. theme: 'amber',
  745. lineNumbers: true,
  746. enterMode: 'flat',
  747. indentWithTabs: true,
  748. indentUnit: 4,
  749. matchBrackets: true,
  750. electricChars: false,
  751. keyMap: 'Amber',
  752. extraKeys: {"Shift-Space": "autocomplete"}
  753. });
  754. return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},smalltalk.HLCodeWidget)})},
  755. args: ["aTextarea"],
  756. source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {\x0a\x09\x09theme: 'amber',\x0a lineNumbers: true,\x0a enterMode: 'flat',\x0a indentWithTabs: true,\x0a\x09\x09\x09\x09indentUnit: 4,\x0a matchBrackets: true,\x0a electricChars: false,\x0a\x09\x09\x09\x09keyMap: 'Amber',\x0a\x09\x09\x09\x09extraKeys: {\x22Shift-Space\x22: \x22autocomplete\x22}\x0a\x09})>",
  757. messageSends: [],
  758. referencedClasses: []
  759. }),
  760. smalltalk.HLCodeWidget);
  761. smalltalk.addMethod(
  762. smalltalk.method({
  763. selector: "variableHintFor:token:",
  764. category: 'hints',
  765. fn: function (anEditor,aToken){
  766. var self=this;
  767. var variables,classNames,pseudoVariables;
  768. function $Smalltalk(){return smalltalk.Smalltalk||(typeof Smalltalk=="undefined"?nil:Smalltalk)}
  769. return smalltalk.withContext(function($ctx1) {
  770. var $1;
  771. variables=_st(_st(_st(_st(window)._jQuery_(_st(_st(anEditor)._display())._wrapper()))._find_("span.cm-variable"))._get())._collect_((function(each){
  772. return smalltalk.withContext(function($ctx2) {
  773. return _st(_st(window)._jQuery_(each))._html();
  774. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  775. classNames=_st(_st(_st($Smalltalk())._current())._classes())._collect_((function(each){
  776. return smalltalk.withContext(function($ctx2) {
  777. return _st(each)._name();
  778. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  779. pseudoVariables=_st(_st($Smalltalk())._current())._pseudoVariableNames();
  780. $1=_st(_st(_st(_st(_st(_st(variables).__comma(classNames)).__comma(pseudoVariables))._asSet())._asArray())._select_((function(each){
  781. return smalltalk.withContext(function($ctx2) {
  782. return _st(each)._includesSubString_(_st(aToken)._string());
  783. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})})))._reject_((function(each){
  784. return smalltalk.withContext(function($ctx2) {
  785. return _st(each).__eq(_st(aToken)._string());
  786. }, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
  787. return $1;
  788. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken,variables:variables,classNames:classNames,pseudoVariables:pseudoVariables},smalltalk.HLCodeWidget)})},
  789. args: ["anEditor", "aToken"],
  790. source: "variableHintFor: anEditor token: aToken\x0a\x09| variables classNames pseudoVariables |\x0a\x09\x0a\x09variables := ((window jQuery: anEditor display wrapper) find: 'span.cm-variable') get\x0a\x09\x09collect: [ :each | (window jQuery: each) html ].\x0a\x09\x0a\x09classNames := Smalltalk current classes collect: [ :each | each name ].\x0a\x09pseudoVariables := Smalltalk current pseudoVariableNames.\x0a\x09\x0a\x09^ ((variables, classNames, pseudoVariables) asSet asArray \x0a\x09\x09select: [ :each | each includesSubString: aToken string ])\x0a\x09\x09reject: [ :each | each = aToken string ]",
  791. messageSends: ["collect:", "html", "jQuery:", "get", "find:", "wrapper", "display", "name", "classes", "current", "pseudoVariableNames", "reject:", "=", "string", "select:", "includesSubString:", "asArray", "asSet", ","],
  792. referencedClasses: ["Smalltalk"]
  793. }),
  794. smalltalk.HLCodeWidget);
  795. smalltalk.addMethod(
  796. smalltalk.method({
  797. selector: "hintFor:options:",
  798. category: 'hints',
  799. fn: function (anEditor,options){
  800. var self=this;
  801. var cursor,token,completions;
  802. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  803. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  804. return smalltalk.withContext(function($ctx1) {
  805. var $1,$2;
  806. cursor=_st(anEditor)._getCursor();
  807. token=_st(anEditor)._getTokenAt_(cursor);
  808. _st(token)._at_put_("state",_st(_st(_st($CodeMirror())._basicAt_("innerMode"))._value_value_(_st(anEditor)._getMode(),_st(token)._at_("state")))._state());
  809. $1=_st(_st(token)._type()).__eq("variable");
  810. if(smalltalk.assert($1)){
  811. completions=_st($HLCodeWidget())._variableHintFor_token_(anEditor,token);
  812. } else {
  813. completions=_st($HLCodeWidget())._messageHintFor_token_(anEditor,token);
  814. };
  815. $2=smalltalk.HashedCollection._fromPairs_([_st("list").__minus_gt(completions),_st("from").__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._end())),_st("to").__minus_gt(_st(_st($CodeMirror())._basicAt_("Pos"))._value_value_(_st(cursor)._line(),_st(token)._start()))]);
  816. return $2;
  817. }, function($ctx1) {$ctx1.fill(self,"hintFor:options:",{anEditor:anEditor,options:options,cursor:cursor,token:token,completions:completions},smalltalk.HLCodeWidget.klass)})},
  818. args: ["anEditor", "options"],
  819. 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}",
  820. messageSends: ["getCursor", "getTokenAt:", "at:put:", "state", "value:value:", "getMode", "at:", "basicAt:", "ifTrue:ifFalse:", "variableHintFor:token:", "messageHintFor:token:", "=", "type", "->", "line", "end", "start"],
  821. referencedClasses: ["CodeMirror", "HLCodeWidget"]
  822. }),
  823. smalltalk.HLCodeWidget.klass);
  824. smalltalk.addMethod(
  825. smalltalk.method({
  826. selector: "initialize",
  827. category: 'initialization',
  828. fn: function (){
  829. var self=this;
  830. return smalltalk.withContext(function($ctx1) {
  831. var $1,$2;
  832. smalltalk.HLWidget.klass.fn.prototype._initialize.apply(_st(self), []);
  833. $1=self;
  834. _st($1)._setupCodeMirror();
  835. _st($1)._setupCommands();
  836. $2=_st($1)._setupKeyMaps();
  837. return self}, function($ctx1) {$ctx1.fill(self,"initialize",{},smalltalk.HLCodeWidget.klass)})},
  838. args: [],
  839. source: "initialize\x0a\x09super initialize.\x0a\x09self \x0a\x09\x09setupCodeMirror;\x0a\x09\x09setupCommands;\x0a\x09\x09setupKeyMaps.",
  840. messageSends: ["initialize", "setupCodeMirror", "setupCommands", "setupKeyMaps"],
  841. referencedClasses: []
  842. }),
  843. smalltalk.HLCodeWidget.klass);
  844. smalltalk.addMethod(
  845. smalltalk.method({
  846. selector: "keyMap",
  847. category: 'accessing',
  848. fn: function (){
  849. var self=this;
  850. function $HLManager(){return smalltalk.HLManager||(typeof HLManager=="undefined"?nil:HLManager)}
  851. return smalltalk.withContext(function($ctx1) {
  852. var $2,$1;
  853. $2=_st(_st(_st($HLManager())._current())._keyBinder())._systemIsMac();
  854. if(smalltalk.assert($2)){
  855. $1=_st(self)._macKeyMap();
  856. } else {
  857. $1=_st(self)._pcKeyMap();
  858. };
  859. return $1;
  860. }, function($ctx1) {$ctx1.fill(self,"keyMap",{},smalltalk.HLCodeWidget.klass)})},
  861. args: [],
  862. source: "keyMap\x0a\x09^ HLManager current keyBinder systemIsMac\x0a\x09\x09ifTrue: [ self macKeyMap ]\x0a\x09\x09ifFalse: [ self pcKeyMap ]",
  863. messageSends: ["ifTrue:ifFalse:", "macKeyMap", "pcKeyMap", "systemIsMac", "keyBinder", "current"],
  864. referencedClasses: ["HLManager"]
  865. }),
  866. smalltalk.HLCodeWidget.klass);
  867. smalltalk.addMethod(
  868. smalltalk.method({
  869. selector: "macKeyMap",
  870. category: 'accessing',
  871. fn: function (){
  872. var self=this;
  873. return smalltalk.withContext(function($ctx1) {
  874. var $1;
  875. $1=smalltalk.HashedCollection._fromPairs_([_st("Alt-Backspace").__minus_gt("delWordBefore"),_st("Alt-Delete").__minus_gt("delWordAfter"),_st("Alt-Left").__minus_gt("goWordBoundaryLeft"),_st("Alt-Right").__minus_gt("goWordBoundaryRight"),_st("Cmd-A").__minus_gt("selectAll"),_st("Cmd-Alt-F").__minus_gt("replace"),_st("Cmd-D").__minus_gt("doIt"),_st("Cmd-Down").__minus_gt("goDocEnd"),_st("Cmd-End").__minus_gt("goDocEnd"),_st("Cmd-F").__minus_gt("find"),_st("Cmd-G").__minus_gt("findNext"),_st("Cmd-I").__minus_gt("inspectIt"),_st("Cmd-Left").__minus_gt("goLineStart"),_st("Cmd-P").__minus_gt("printIt"),_st("Cmd-Right").__minus_gt("goLineEnd"),_st("Cmd-S").__minus_gt("saveIt"),_st("Cmd-Up").__minus_gt("goDocStart"),_st("Cmd-Y").__minus_gt("redo"),_st("Cmd-Z").__minus_gt("undo"),_st("Cmd-[").__minus_gt("indentLess"),_st("Cmd-]").__minus_gt("indentMore"),_st("Ctrl-Alt-Backspace").__minus_gt("delWordAfter"),_st("Shift-Cmd-Alt-F").__minus_gt("replaceAll"),_st("Shift-Cmd-G").__minus_gt("findPrev"),_st("Shift-Cmd-Z").__minus_gt("redo"),_st("fallthrough").__minus_gt(["basic","emacsy"])]);
  876. return $1;
  877. }, function($ctx1) {$ctx1.fill(self,"macKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  878. args: [],
  879. 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 }",
  880. messageSends: ["->"],
  881. referencedClasses: []
  882. }),
  883. smalltalk.HLCodeWidget.klass);
  884. smalltalk.addMethod(
  885. smalltalk.method({
  886. selector: "messageHintFor:token:",
  887. category: 'hints',
  888. fn: function (anEditor,aToken){
  889. var self=this;
  890. return smalltalk.withContext(function($ctx1) {
  891. var $1;
  892. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._messageHintFor_token_(anEditor,aToken);
  893. return $1;
  894. }, function($ctx1) {$ctx1.fill(self,"messageHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  895. args: ["anEditor", "aToken"],
  896. source: "messageHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09messageHintFor: anEditor token: aToken",
  897. messageSends: ["messageHintFor:token:", "at:"],
  898. referencedClasses: []
  899. }),
  900. smalltalk.HLCodeWidget.klass);
  901. smalltalk.addMethod(
  902. smalltalk.method({
  903. selector: "pcKeyMap",
  904. category: 'accessing',
  905. fn: function (){
  906. var self=this;
  907. return smalltalk.withContext(function($ctx1) {
  908. var $1;
  909. $1=[_st("Alt-Left").__minus_gt("goLineStart"),_st("Alt-Right").__minus_gt("goLineEnd"),_st("Alt-Up").__minus_gt("goDocStart"),_st("Ctrl-A").__minus_gt("selectAll"),_st("Ctrl-Backspace").__minus_gt("delWordBefore"),_st("Ctrl-D").__minus_gt("doIt"),_st("Ctrl-Delete").__minus_gt("delWordAfter"),_st("Ctrl-Down").__minus_gt("goDocEnd"),_st("Ctrl-End").__minus_gt("goDocEnd"),_st("Ctrl-F").__minus_gt("find"),_st("Ctrl-G").__minus_gt("findNext"),_st("Ctrl-I").__minus_gt("inspectIt"),_st("Ctrl-Home").__minus_gt("goDocStart"),_st("Ctrl-Left").__minus_gt("goWordBoundaryLeft"),_st("Ctrl-P").__minus_gt("printIt"),_st("Ctrl-Right").__minus_gt("goWordBoundaryRight"),_st("Ctrl-S").__minus_gt("saveIt"),_st("Ctrl-Y").__minus_gt("redo"),_st("Ctrl-Z").__minus_gt("undo"),_st("Ctrl-[").__minus_gt("indentLess"),_st("Ctrl-]").__minus_gt("indentMore"),_st("Shift-Ctrl-F").__minus_gt("replace"),_st("Shift-Ctrl-G").__minus_gt("findPrev"),_st("Shift-Ctrl-R").__minus_gt("replaceAll"),_st("Shift-Ctrl-Z").__minus_gt("redo"),_st("fallthrough").__minus_gt(["basic"])];
  910. return $1;
  911. }, function($ctx1) {$ctx1.fill(self,"pcKeyMap",{},smalltalk.HLCodeWidget.klass)})},
  912. args: [],
  913. 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}",
  914. messageSends: ["->"],
  915. referencedClasses: []
  916. }),
  917. smalltalk.HLCodeWidget.klass);
  918. smalltalk.addMethod(
  919. smalltalk.method({
  920. selector: "setupCodeMirror",
  921. category: 'initialization',
  922. fn: function (){
  923. var self=this;
  924. return smalltalk.withContext(function($ctx1) {
  925. CodeMirror.keyMap.default.fallthrough = ["basic"];
  926. CodeMirror.commands.autocomplete = function(cm) {
  927. CodeMirror.showHint(cm, self._hintFor_options_);
  928. }
  929. ;
  930. return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{},smalltalk.HLCodeWidget.klass)})},
  931. args: [],
  932. source: "setupCodeMirror\x0a\x09< \x0a\x09\x09CodeMirror.keyMap.default.fallthrough = [\x22basic\x22];\x0a\x09\x09CodeMirror.commands.autocomplete = function(cm) {\x0a \x09CodeMirror.showHint(cm, self._hintFor_options_);\x0a \x09}\x0a\x09>",
  933. messageSends: [],
  934. referencedClasses: []
  935. }),
  936. smalltalk.HLCodeWidget.klass);
  937. smalltalk.addMethod(
  938. smalltalk.method({
  939. selector: "setupCommands",
  940. category: 'initialization',
  941. fn: function (){
  942. var self=this;
  943. function $CodeMirror(){return smalltalk.CodeMirror||(typeof CodeMirror=="undefined"?nil:CodeMirror)}
  944. return smalltalk.withContext(function($ctx1) {
  945. var $1,$2;
  946. $1=_st($CodeMirror())._basicAt_("commands");
  947. _st($1)._at_put_("doIt",(function(cm){
  948. return smalltalk.withContext(function($ctx2) {
  949. return _st(_st(cm)._amberCodeWidget())._doIt();
  950. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  951. _st($1)._at_put_("inspectIt",(function(cm){
  952. return smalltalk.withContext(function($ctx2) {
  953. return _st(_st(cm)._amberCodeWidget())._inspectIt();
  954. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  955. _st($1)._at_put_("printIt",(function(cm){
  956. return smalltalk.withContext(function($ctx2) {
  957. return _st(_st(cm)._amberCodeWidget())._printIt();
  958. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  959. $2=_st($1)._at_put_("saveIt",(function(cm){
  960. return smalltalk.withContext(function($ctx2) {
  961. return _st(_st(cm)._amberCodeWidget())._saveIt();
  962. }, function($ctx2) {$ctx2.fillBlock({cm:cm},$ctx1)})}));
  963. return self}, function($ctx1) {$ctx1.fill(self,"setupCommands",{},smalltalk.HLCodeWidget.klass)})},
  964. args: [],
  965. 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 ]",
  966. messageSends: ["at:put:", "doIt", "amberCodeWidget", "basicAt:", "inspectIt", "printIt", "saveIt"],
  967. referencedClasses: ["CodeMirror"]
  968. }),
  969. smalltalk.HLCodeWidget.klass);
  970. smalltalk.addMethod(
  971. smalltalk.method({
  972. selector: "setupKeyMaps",
  973. category: 'initialization',
  974. fn: function (){
  975. var self=this;
  976. return smalltalk.withContext(function($ctx1) {
  977. CodeMirror.keyMap['Amber'] = self._keyMap();
  978. return self}, function($ctx1) {$ctx1.fill(self,"setupKeyMaps",{},smalltalk.HLCodeWidget.klass)})},
  979. args: [],
  980. source: "setupKeyMaps\x0a\x09<CodeMirror.keyMap['Amber'] = self._keyMap()>",
  981. messageSends: [],
  982. referencedClasses: []
  983. }),
  984. smalltalk.HLCodeWidget.klass);
  985. smalltalk.addMethod(
  986. smalltalk.method({
  987. selector: "variableHintFor:token:",
  988. category: 'hints',
  989. fn: function (anEditor,aToken){
  990. var self=this;
  991. return smalltalk.withContext(function($ctx1) {
  992. var $1;
  993. $1=_st(_st(anEditor)._at_("amberCodeWidget"))._variableHintFor_token_(anEditor,aToken);
  994. return $1;
  995. }, function($ctx1) {$ctx1.fill(self,"variableHintFor:token:",{anEditor:anEditor,aToken:aToken},smalltalk.HLCodeWidget.klass)})},
  996. args: ["anEditor", "aToken"],
  997. source: "variableHintFor: anEditor token: aToken\x0a\x09^ (anEditor at: 'amberCodeWidget')\x0a\x09\x09variableHintFor: anEditor token: aToken",
  998. messageSends: ["variableHintFor:token:", "at:"],
  999. referencedClasses: []
  1000. }),
  1001. smalltalk.HLCodeWidget.klass);
  1002. smalltalk.addClass('HLSourceCodeWidget', smalltalk.HLCodeWidget, ['browserModel', 'methodContents'], 'Helios-Workspace');
  1003. smalltalk.addMethod(
  1004. smalltalk.method({
  1005. selector: "browserModel",
  1006. category: 'accessing',
  1007. fn: function (){
  1008. var self=this;
  1009. return smalltalk.withContext(function($ctx1) {
  1010. var $1;
  1011. $1=self["@browserModel"];
  1012. return $1;
  1013. }, function($ctx1) {$ctx1.fill(self,"browserModel",{},smalltalk.HLSourceCodeWidget)})},
  1014. args: [],
  1015. source: "browserModel\x0a\x09^ browserModel",
  1016. messageSends: [],
  1017. referencedClasses: []
  1018. }),
  1019. smalltalk.HLSourceCodeWidget);
  1020. smalltalk.addMethod(
  1021. smalltalk.method({
  1022. selector: "browserModel:",
  1023. category: 'accessing',
  1024. fn: function (aBrowserModel){
  1025. var self=this;
  1026. return smalltalk.withContext(function($ctx1) {
  1027. var $1,$2;
  1028. self["@browserModel"]=aBrowserModel;
  1029. $1=self;
  1030. _st($1)._observeSystem();
  1031. $2=_st($1)._observeBrowserModel();
  1032. return self}, function($ctx1) {$ctx1.fill(self,"browserModel:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget)})},
  1033. args: ["aBrowserModel"],
  1034. source: "browserModel: aBrowserModel\x0a\x09browserModel := aBrowserModel.\x0a\x09self \x0a\x09\x09observeSystem;\x0a\x09\x09observeBrowserModel",
  1035. messageSends: ["observeSystem", "observeBrowserModel"],
  1036. referencedClasses: []
  1037. }),
  1038. smalltalk.HLSourceCodeWidget);
  1039. smalltalk.addMethod(
  1040. smalltalk.method({
  1041. selector: "hasModification",
  1042. category: 'testing',
  1043. fn: function (){
  1044. var self=this;
  1045. return smalltalk.withContext(function($ctx1) {
  1046. var $1;
  1047. $1=_st(_st(_st(self)._methodContents()).__eq(_st(self)._contents()))._not();
  1048. return $1;
  1049. }, function($ctx1) {$ctx1.fill(self,"hasModification",{},smalltalk.HLSourceCodeWidget)})},
  1050. args: [],
  1051. source: "hasModification\x0a\x09^ (self methodContents = self contents) not",
  1052. messageSends: ["not", "=", "contents", "methodContents"],
  1053. referencedClasses: []
  1054. }),
  1055. smalltalk.HLSourceCodeWidget);
  1056. smalltalk.addMethod(
  1057. smalltalk.method({
  1058. selector: "methodContents",
  1059. category: 'accessing',
  1060. fn: function (){
  1061. var self=this;
  1062. return smalltalk.withContext(function($ctx1) {
  1063. var $1;
  1064. $1=self["@methodContents"];
  1065. return $1;
  1066. }, function($ctx1) {$ctx1.fill(self,"methodContents",{},smalltalk.HLSourceCodeWidget)})},
  1067. args: [],
  1068. source: "methodContents\x0a\x09^ methodContents",
  1069. messageSends: [],
  1070. referencedClasses: []
  1071. }),
  1072. smalltalk.HLSourceCodeWidget);
  1073. smalltalk.addMethod(
  1074. smalltalk.method({
  1075. selector: "methodContents:",
  1076. category: 'accessing',
  1077. fn: function (aString){
  1078. var self=this;
  1079. return smalltalk.withContext(function($ctx1) {
  1080. self["@methodContents"]=aString;
  1081. return self}, function($ctx1) {$ctx1.fill(self,"methodContents:",{aString:aString},smalltalk.HLSourceCodeWidget)})},
  1082. args: ["aString"],
  1083. source: "methodContents: aString\x0a\x09methodContents := aString",
  1084. messageSends: [],
  1085. referencedClasses: []
  1086. }),
  1087. smalltalk.HLSourceCodeWidget);
  1088. smalltalk.addMethod(
  1089. smalltalk.method({
  1090. selector: "observeBrowserModel",
  1091. category: 'actions',
  1092. fn: function (){
  1093. var self=this;
  1094. function $HLSaveSourceCode(){return smalltalk.HLSaveSourceCode||(typeof HLSaveSourceCode=="undefined"?nil:HLSaveSourceCode)}
  1095. function $HLParseErrorRaised(){return smalltalk.HLParseErrorRaised||(typeof HLParseErrorRaised=="undefined"?nil:HLParseErrorRaised)}
  1096. function $HLCompileErrorRaised(){return smalltalk.HLCompileErrorRaised||(typeof HLCompileErrorRaised=="undefined"?nil:HLCompileErrorRaised)}
  1097. function $HLUnknownVariableErrorRaised(){return smalltalk.HLUnknownVariableErrorRaised||(typeof HLUnknownVariableErrorRaised=="undefined"?nil:HLUnknownVariableErrorRaised)}
  1098. function $HLInstVarAdded(){return smalltalk.HLInstVarAdded||(typeof HLInstVarAdded=="undefined"?nil:HLInstVarAdded)}
  1099. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1100. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1101. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1102. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1103. return smalltalk.withContext(function($ctx1) {
  1104. var $1,$2;
  1105. $1=_st(_st(self)._browserModel())._announcer();
  1106. _st($1)._on_do_($HLSaveSourceCode(),(function(ann){
  1107. return smalltalk.withContext(function($ctx2) {
  1108. return _st(self)._onSaveIt();
  1109. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1110. _st($1)._on_do_($HLParseErrorRaised(),(function(ann){
  1111. return smalltalk.withContext(function($ctx2) {
  1112. return _st(self)._onParseError_(ann);
  1113. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1114. _st($1)._on_do_($HLCompileErrorRaised(),(function(ann){
  1115. return smalltalk.withContext(function($ctx2) {
  1116. return _st(self)._onCompileError_(_st(ann)._error());
  1117. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1118. _st($1)._on_do_($HLUnknownVariableErrorRaised(),(function(ann){
  1119. return smalltalk.withContext(function($ctx2) {
  1120. return _st(self)._onUnknownVariableError_(_st(ann)._error());
  1121. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1122. _st($1)._on_do_($HLInstVarAdded(),(function(ann){
  1123. return smalltalk.withContext(function($ctx2) {
  1124. return _st(self)._onInstVarAdded();
  1125. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1126. _st($1)._on_do_($HLMethodSelected(),(function(ann){
  1127. return smalltalk.withContext(function($ctx2) {
  1128. return _st(self)._onMethodSelected_(_st(ann)._item());
  1129. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1130. _st($1)._on_do_($HLClassSelected(),(function(ann){
  1131. return smalltalk.withContext(function($ctx2) {
  1132. return _st(self)._onClassSelected_(_st(ann)._item());
  1133. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1134. _st($1)._on_do_($HLProtocolSelected(),(function(ann){
  1135. return smalltalk.withContext(function($ctx2) {
  1136. return _st(self)._onProtocolSelected_(_st(ann)._item());
  1137. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1138. $2=_st($1)._on_do_($HLSourceCodeFocusRequested(),(function(ann){
  1139. return smalltalk.withContext(function($ctx2) {
  1140. return _st(self)._onSourceCodeFocusRequested();
  1141. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1142. return self}, function($ctx1) {$ctx1.fill(self,"observeBrowserModel",{},smalltalk.HLSourceCodeWidget)})},
  1143. args: [],
  1144. source: "observeBrowserModel\x0a\x09self browserModel announcer\x0a\x09\x09on: HLSaveSourceCode\x0a\x09\x09do: [ :ann | self onSaveIt ];\x0a\x09\x09on: HLParseErrorRaised\x0a\x09\x09do: [ :ann | self onParseError: ann ];\x0a\x09\x09on: HLCompileErrorRaised\x0a\x09\x09do: [ :ann | self onCompileError: ann error ];\x0a\x09\x09on: HLUnknownVariableErrorRaised\x0a\x09\x09do: [ :ann | self onUnknownVariableError: ann error ];\x0a\x09\x09on: HLInstVarAdded \x0a\x09\x09do: [ :ann | self onInstVarAdded ];\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09do: [ :ann | self onMethodSelected: ann item ];\x0a \x09on: HLClassSelected \x0a\x09\x09do: [ :ann | self onClassSelected: ann item ];\x0a \x09on: HLProtocolSelected \x0a\x09\x09do: [ :ann | self onProtocolSelected: ann item ];\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09do: [ :ann | self onSourceCodeFocusRequested ]",
  1145. messageSends: ["on:do:", "onSaveIt", "announcer", "browserModel", "onParseError:", "onCompileError:", "error", "onUnknownVariableError:", "onInstVarAdded", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"],
  1146. referencedClasses: ["HLSaveSourceCode", "HLParseErrorRaised", "HLCompileErrorRaised", "HLUnknownVariableErrorRaised", "HLInstVarAdded", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
  1147. }),
  1148. smalltalk.HLSourceCodeWidget);
  1149. smalltalk.addMethod(
  1150. smalltalk.method({
  1151. selector: "observeSystem",
  1152. category: 'actions',
  1153. fn: function (){
  1154. var self=this;
  1155. function $MethodModified(){return smalltalk.MethodModified||(typeof MethodModified=="undefined"?nil:MethodModified)}
  1156. function $HLMethodSelected(){return smalltalk.HLMethodSelected||(typeof HLMethodSelected=="undefined"?nil:HLMethodSelected)}
  1157. function $HLClassSelected(){return smalltalk.HLClassSelected||(typeof HLClassSelected=="undefined"?nil:HLClassSelected)}
  1158. function $HLProtocolSelected(){return smalltalk.HLProtocolSelected||(typeof HLProtocolSelected=="undefined"?nil:HLProtocolSelected)}
  1159. function $HLSourceCodeFocusRequested(){return smalltalk.HLSourceCodeFocusRequested||(typeof HLSourceCodeFocusRequested=="undefined"?nil:HLSourceCodeFocusRequested)}
  1160. return smalltalk.withContext(function($ctx1) {
  1161. var $1,$2;
  1162. $1=_st(_st(self)._browserModel())._systemAnnouncer();
  1163. _st($1)._on_do_($MethodModified(),(function(ann){
  1164. return smalltalk.withContext(function($ctx2) {
  1165. return _st(self)._onMethodModified_(_st(ann)._method());
  1166. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1167. _st($1)._on_do_($HLMethodSelected(),(function(ann){
  1168. return smalltalk.withContext(function($ctx2) {
  1169. return _st(self)._onMethodSelected_(_st(ann)._item());
  1170. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1171. _st($1)._on_do_($HLClassSelected(),(function(ann){
  1172. return smalltalk.withContext(function($ctx2) {
  1173. return _st(self)._onClassSelected_(_st(ann)._item());
  1174. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1175. _st($1)._on_do_($HLProtocolSelected(),(function(ann){
  1176. return smalltalk.withContext(function($ctx2) {
  1177. return _st(self)._onProtocolSelected_(_st(ann)._item());
  1178. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1179. $2=_st($1)._on_do_($HLSourceCodeFocusRequested(),(function(ann){
  1180. return smalltalk.withContext(function($ctx2) {
  1181. return _st(self)._onSourceCodeFocusRequested();
  1182. }, function($ctx2) {$ctx2.fillBlock({ann:ann},$ctx1)})}));
  1183. return self}, function($ctx1) {$ctx1.fill(self,"observeSystem",{},smalltalk.HLSourceCodeWidget)})},
  1184. args: [],
  1185. source: "observeSystem\x0a\x09self browserModel systemAnnouncer\x0a \x09on: MethodModified\x0a do: [ :ann | self onMethodModified: ann method ];\x0a\x09\x09on: HLMethodSelected \x0a\x09\x09do: [ :ann | self onMethodSelected: ann item ];\x0a \x09on: HLClassSelected \x0a\x09\x09do: [ :ann | self onClassSelected: ann item ];\x0a \x09on: HLProtocolSelected \x0a\x09\x09do: [ :ann | self onProtocolSelected: ann item ];\x0a\x09\x09on: HLSourceCodeFocusRequested \x0a\x09\x09do: [ :ann | self onSourceCodeFocusRequested ]",
  1186. messageSends: ["on:do:", "onMethodModified:", "method", "systemAnnouncer", "browserModel", "onMethodSelected:", "item", "onClassSelected:", "onProtocolSelected:", "onSourceCodeFocusRequested"],
  1187. referencedClasses: ["MethodModified", "HLMethodSelected", "HLClassSelected", "HLProtocolSelected", "HLSourceCodeFocusRequested"]
  1188. }),
  1189. smalltalk.HLSourceCodeWidget);
  1190. smalltalk.addMethod(
  1191. smalltalk.method({
  1192. selector: "onClassSelected:",
  1193. category: 'reactions',
  1194. fn: function (aClass){
  1195. var self=this;
  1196. return smalltalk.withContext(function($ctx1) {
  1197. var $1,$2;
  1198. $1=aClass;
  1199. if(($receiver = $1) == nil || $receiver == undefined){
  1200. $2=_st(self)._contents_("");
  1201. return $2;
  1202. } else {
  1203. $1;
  1204. };
  1205. _st(self)._contents_(_st(aClass)._definition());
  1206. return self}, function($ctx1) {$ctx1.fill(self,"onClassSelected:",{aClass:aClass},smalltalk.HLSourceCodeWidget)})},
  1207. args: ["aClass"],
  1208. source: "onClassSelected: aClass\x0a\x09aClass ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: aClass definition",
  1209. messageSends: ["ifNil:", "contents:", "definition"],
  1210. referencedClasses: []
  1211. }),
  1212. smalltalk.HLSourceCodeWidget);
  1213. smalltalk.addMethod(
  1214. smalltalk.method({
  1215. selector: "onCompileError:",
  1216. category: 'reactions',
  1217. fn: function (anError){
  1218. var self=this;
  1219. return smalltalk.withContext(function($ctx1) {
  1220. _st(self)._alert_(_st(anError)._messageText());
  1221. return self}, function($ctx1) {$ctx1.fill(self,"onCompileError:",{anError:anError},smalltalk.HLSourceCodeWidget)})},
  1222. args: ["anError"],
  1223. source: "onCompileError: anError\x0a\x09self alert: anError messageText",
  1224. messageSends: ["alert:", "messageText"],
  1225. referencedClasses: []
  1226. }),
  1227. smalltalk.HLSourceCodeWidget);
  1228. smalltalk.addMethod(
  1229. smalltalk.method({
  1230. selector: "onInstVarAdded",
  1231. category: 'reactions',
  1232. fn: function (){
  1233. var self=this;
  1234. return smalltalk.withContext(function($ctx1) {
  1235. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1236. return self}, function($ctx1) {$ctx1.fill(self,"onInstVarAdded",{},smalltalk.HLSourceCodeWidget)})},
  1237. args: [],
  1238. source: "onInstVarAdded\x0a\x09self browserModel save: self contents",
  1239. messageSends: ["save:", "contents", "browserModel"],
  1240. referencedClasses: []
  1241. }),
  1242. smalltalk.HLSourceCodeWidget);
  1243. smalltalk.addMethod(
  1244. smalltalk.method({
  1245. selector: "onMethodModified:",
  1246. category: 'reactions',
  1247. fn: function (aMethod){
  1248. var self=this;
  1249. return smalltalk.withContext(function($ctx1) {
  1250. var $1,$2,$3,$4,$5,$6;
  1251. $1=_st(_st(_st(self)._browserModel())._selectedClass()).__eq(_st(aMethod)._methodClass());
  1252. if(! smalltalk.assert($1)){
  1253. $2=self;
  1254. return $2;
  1255. };
  1256. $3=_st(_st(self)._browserModel())._selectedMethod();
  1257. if(($receiver = $3) == nil || $receiver == undefined){
  1258. $4=self;
  1259. return $4;
  1260. } else {
  1261. $3;
  1262. };
  1263. $5=_st(_st(_st(_st(self)._browserModel())._selectedMethod())._selector()).__eq(_st(aMethod)._selector());
  1264. if(! smalltalk.assert($5)){
  1265. $6=self;
  1266. return $6;
  1267. };
  1268. _st(self)._refresh();
  1269. return self}, function($ctx1) {$ctx1.fill(self,"onMethodModified:",{aMethod:aMethod},smalltalk.HLSourceCodeWidget)})},
  1270. args: ["aMethod"],
  1271. source: "onMethodModified: aMethod\x0a\x09self browserModel selectedClass = aMethod methodClass ifFalse: [ ^ self ].\x0a\x09self browserModel selectedMethod ifNil: [ ^ self ].\x0a self browserModel selectedMethod selector = aMethod selector ifFalse: [ ^ self ].\x0a\x0a self refresh",
  1272. messageSends: ["ifFalse:", "=", "methodClass", "selectedClass", "browserModel", "ifNil:", "selectedMethod", "selector", "refresh"],
  1273. referencedClasses: []
  1274. }),
  1275. smalltalk.HLSourceCodeWidget);
  1276. smalltalk.addMethod(
  1277. smalltalk.method({
  1278. selector: "onMethodSelected:",
  1279. category: 'reactions',
  1280. fn: function (aCompiledMethod){
  1281. var self=this;
  1282. return smalltalk.withContext(function($ctx1) {
  1283. var $1,$2;
  1284. $1=aCompiledMethod;
  1285. if(($receiver = $1) == nil || $receiver == undefined){
  1286. $2=_st(self)._contents_("");
  1287. return $2;
  1288. } else {
  1289. $1;
  1290. };
  1291. _st(self)._contents_(_st(aCompiledMethod)._source());
  1292. return self}, function($ctx1) {$ctx1.fill(self,"onMethodSelected:",{aCompiledMethod:aCompiledMethod},smalltalk.HLSourceCodeWidget)})},
  1293. args: ["aCompiledMethod"],
  1294. source: "onMethodSelected: aCompiledMethod\x0a\x09aCompiledMethod ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: aCompiledMethod source",
  1295. messageSends: ["ifNil:", "contents:", "source"],
  1296. referencedClasses: []
  1297. }),
  1298. smalltalk.HLSourceCodeWidget);
  1299. smalltalk.addMethod(
  1300. smalltalk.method({
  1301. selector: "onParseError:",
  1302. category: 'reactions',
  1303. fn: function (anAnnouncement){
  1304. var self=this;
  1305. var lineIndex,newContents;
  1306. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1307. return smalltalk.withContext(function($ctx1) {
  1308. var $1,$2,$3;
  1309. lineIndex=(1);
  1310. _st(self)._contents_(_st($String())._streamContents_((function(stream){
  1311. return smalltalk.withContext(function($ctx2) {
  1312. return _st(_st(self)._contents())._linesDo_((function(each){
  1313. return smalltalk.withContext(function($ctx3) {
  1314. $1=_st(lineIndex).__eq(_st(anAnnouncement)._line());
  1315. if(smalltalk.assert($1)){
  1316. $2=stream;
  1317. _st($2)._nextPutAll_(_st(each)._copyFrom_to_((1),_st(anAnnouncement)._column()));
  1318. _st($2)._nextPutAll_("<- ");
  1319. _st($2)._nextPutAll_(_st(anAnnouncement)._message());
  1320. _st($2)._nextPutAll_(" ");
  1321. $3=_st($2)._nextPutAll_(_st(each)._copyFrom_to_(_st(_st(anAnnouncement)._column()).__plus((1)),_st(each)._size()));
  1322. $3;
  1323. } else {
  1324. _st(stream)._nextPutAll_(each);
  1325. };
  1326. _st(stream)._nextPutAll_(_st($String())._cr());
  1327. lineIndex=_st(lineIndex).__plus((1));
  1328. return lineIndex;
  1329. }, function($ctx3) {$ctx3.fillBlock({each:each},$ctx1)})}));
  1330. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1331. return self}, function($ctx1) {$ctx1.fill(self,"onParseError:",{anAnnouncement:anAnnouncement,lineIndex:lineIndex,newContents:newContents},smalltalk.HLSourceCodeWidget)})},
  1332. args: ["anAnnouncement"],
  1333. 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 ] ])",
  1334. messageSends: ["contents:", "streamContents:", "linesDo:", "ifTrue:ifFalse:", "nextPutAll:", "copyFrom:to:", "column", "message", "+", "size", "=", "line", "cr", "contents"],
  1335. referencedClasses: ["String"]
  1336. }),
  1337. smalltalk.HLSourceCodeWidget);
  1338. smalltalk.addMethod(
  1339. smalltalk.method({
  1340. selector: "onProtocolSelected:",
  1341. category: 'reactions',
  1342. fn: function (aString){
  1343. var self=this;
  1344. return smalltalk.withContext(function($ctx1) {
  1345. var $1,$2;
  1346. $1=_st(_st(self)._browserModel())._selectedClass();
  1347. if(($receiver = $1) == nil || $receiver == undefined){
  1348. $2=_st(self)._contents_("");
  1349. return $2;
  1350. } else {
  1351. $1;
  1352. };
  1353. _st(self)._contents_(_st(_st(_st(self)._browserModel())._selectedClass())._definition());
  1354. return self}, function($ctx1) {$ctx1.fill(self,"onProtocolSelected:",{aString:aString},smalltalk.HLSourceCodeWidget)})},
  1355. args: ["aString"],
  1356. source: "onProtocolSelected: aString\x0a\x09self browserModel selectedClass ifNil: [ ^ self contents: '' ].\x0a \x0a self contents: self browserModel selectedClass definition",
  1357. messageSends: ["ifNil:", "contents:", "selectedClass", "browserModel", "definition"],
  1358. referencedClasses: []
  1359. }),
  1360. smalltalk.HLSourceCodeWidget);
  1361. smalltalk.addMethod(
  1362. smalltalk.method({
  1363. selector: "onSaveIt",
  1364. category: 'reactions',
  1365. fn: function (){
  1366. var self=this;
  1367. return smalltalk.withContext(function($ctx1) {
  1368. _st(_st(self)._browserModel())._save_(_st(self)._contents());
  1369. return self}, function($ctx1) {$ctx1.fill(self,"onSaveIt",{},smalltalk.HLSourceCodeWidget)})},
  1370. args: [],
  1371. source: "onSaveIt\x0a\x09self browserModel save: self contents",
  1372. messageSends: ["save:", "contents", "browserModel"],
  1373. referencedClasses: []
  1374. }),
  1375. smalltalk.HLSourceCodeWidget);
  1376. smalltalk.addMethod(
  1377. smalltalk.method({
  1378. selector: "onSourceCodeFocusRequested",
  1379. category: 'reactions',
  1380. fn: function (){
  1381. var self=this;
  1382. return smalltalk.withContext(function($ctx1) {
  1383. _st(self)._focus();
  1384. return self}, function($ctx1) {$ctx1.fill(self,"onSourceCodeFocusRequested",{},smalltalk.HLSourceCodeWidget)})},
  1385. args: [],
  1386. source: "onSourceCodeFocusRequested\x0a\x09self focus",
  1387. messageSends: ["focus"],
  1388. referencedClasses: []
  1389. }),
  1390. smalltalk.HLSourceCodeWidget);
  1391. smalltalk.addMethod(
  1392. smalltalk.method({
  1393. selector: "onUnknownVariableError:",
  1394. category: 'reactions',
  1395. fn: function (anError){
  1396. var self=this;
  1397. var confirm;
  1398. function $String(){return smalltalk.String||(typeof String=="undefined"?nil:String)}
  1399. return smalltalk.withContext(function($ctx1) {
  1400. var $1,$2,$3,$4;
  1401. confirm=_st(self)._confirm_(_st($String())._streamContents_((function(stream){
  1402. return smalltalk.withContext(function($ctx2) {
  1403. $1=stream;
  1404. _st($1)._nextPutAll_(_st(anError)._messageText());
  1405. _st($1)._nextPutAll_(_st($String())._cr());
  1406. $2=_st($1)._nextPutAll_("Would you like to define an instance variable?");
  1407. return $2;
  1408. }, function($ctx2) {$ctx2.fillBlock({stream:stream},$ctx1)})})));
  1409. $3=confirm;
  1410. if(! smalltalk.assert($3)){
  1411. $4=self;
  1412. return $4;
  1413. };
  1414. _st(_st(self)._browserModel())._addInstVarNamed_(_st(anError)._variableName());
  1415. return self}, function($ctx1) {$ctx1.fill(self,"onUnknownVariableError:",{anError:anError,confirm:confirm},smalltalk.HLSourceCodeWidget)})},
  1416. args: ["anError"],
  1417. source: "onUnknownVariableError: anError\x0a\x09| confirm |\x0a\x0a\x09confirm := self confirm: (String streamContents: [ :stream |\x0a\x09\x09stream \x0a\x09\x09\x09nextPutAll: anError messageText;\x0a\x09\x09\x09nextPutAll: String cr;\x0a\x09\x09\x09nextPutAll: 'Would you like to define an instance variable?' ]).\x0a\x09\x09\x09\x0a\x09confirm ifFalse: [ ^ self ].\x0a\x09\x0a\x09self browserModel addInstVarNamed: anError variableName",
  1418. messageSends: ["confirm:", "streamContents:", "nextPutAll:", "messageText", "cr", "ifFalse:", "addInstVarNamed:", "variableName", "browserModel"],
  1419. referencedClasses: ["String"]
  1420. }),
  1421. smalltalk.HLSourceCodeWidget);
  1422. smalltalk.addMethod(
  1423. smalltalk.method({
  1424. selector: "previous",
  1425. category: 'accessing',
  1426. fn: function (){
  1427. var self=this;
  1428. return smalltalk.withContext(function($ctx1) {
  1429. return self}, function($ctx1) {$ctx1.fill(self,"previous",{},smalltalk.HLSourceCodeWidget)})},
  1430. args: [],
  1431. source: "previous\x0a\x09\x22for browser lists widget\x22",
  1432. messageSends: [],
  1433. referencedClasses: []
  1434. }),
  1435. smalltalk.HLSourceCodeWidget);
  1436. smalltalk.addMethod(
  1437. smalltalk.method({
  1438. selector: "previous:",
  1439. category: 'accessing',
  1440. fn: function (aWidget){
  1441. var self=this;
  1442. return smalltalk.withContext(function($ctx1) {
  1443. return self}, function($ctx1) {$ctx1.fill(self,"previous:",{aWidget:aWidget},smalltalk.HLSourceCodeWidget)})},
  1444. args: ["aWidget"],
  1445. source: "previous: aWidget\x0a\x09\x22for browser lists widget\x22",
  1446. messageSends: [],
  1447. referencedClasses: []
  1448. }),
  1449. smalltalk.HLSourceCodeWidget);
  1450. smalltalk.addMethod(
  1451. smalltalk.method({
  1452. selector: "refresh",
  1453. category: 'actions',
  1454. fn: function (){
  1455. var self=this;
  1456. return smalltalk.withContext(function($ctx1) {
  1457. var $1,$2,$3,$4;
  1458. $1=_st(self)._hasModification();
  1459. if(smalltalk.assert($1)){
  1460. $2=self;
  1461. return $2;
  1462. };
  1463. $3=_st(self)._hasFocus();
  1464. if(smalltalk.assert($3)){
  1465. $4=self;
  1466. return $4;
  1467. };
  1468. _st(self)._contents_(_st(_st(_st(self)._model())._selectedMethod())._source());
  1469. return self}, function($ctx1) {$ctx1.fill(self,"refresh",{},smalltalk.HLSourceCodeWidget)})},
  1470. args: [],
  1471. source: "refresh\x0a\x09self hasModification ifTrue: [ ^ self ].\x0a self hasFocus ifTrue: [ ^ self ].\x0a\x0a\x09self contents: self model selectedMethod source",
  1472. messageSends: ["ifTrue:", "hasModification", "hasFocus", "contents:", "source", "selectedMethod", "model"],
  1473. referencedClasses: []
  1474. }),
  1475. smalltalk.HLSourceCodeWidget);
  1476. smalltalk.addMethod(
  1477. smalltalk.method({
  1478. selector: "saveIt",
  1479. category: 'actions',
  1480. fn: function (){
  1481. var self=this;
  1482. return smalltalk.withContext(function($ctx1) {
  1483. _st(_st(self)._browserModel())._saveSourceCode();
  1484. return self}, function($ctx1) {$ctx1.fill(self,"saveIt",{},smalltalk.HLSourceCodeWidget)})},
  1485. args: [],
  1486. source: "saveIt\x0a\x09self browserModel saveSourceCode",
  1487. messageSends: ["saveSourceCode", "browserModel"],
  1488. referencedClasses: []
  1489. }),
  1490. smalltalk.HLSourceCodeWidget);
  1491. smalltalk.addMethod(
  1492. smalltalk.method({
  1493. selector: "canBeOpenAsTab",
  1494. category: 'testing',
  1495. fn: function (){
  1496. var self=this;
  1497. return smalltalk.withContext(function($ctx1) {
  1498. return false;
  1499. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLSourceCodeWidget.klass)})},
  1500. args: [],
  1501. source: "canBeOpenAsTab\x0a\x09^ false",
  1502. messageSends: [],
  1503. referencedClasses: []
  1504. }),
  1505. smalltalk.HLSourceCodeWidget.klass);
  1506. smalltalk.addMethod(
  1507. smalltalk.method({
  1508. selector: "on:",
  1509. category: 'instance creation',
  1510. fn: function (aBrowserModel){
  1511. var self=this;
  1512. return smalltalk.withContext(function($ctx1) {
  1513. var $2,$3,$1;
  1514. $2=_st(self)._new();
  1515. _st($2)._browserModel_(aBrowserModel);
  1516. $3=_st($2)._yourself();
  1517. $1=$3;
  1518. return $1;
  1519. }, function($ctx1) {$ctx1.fill(self,"on:",{aBrowserModel:aBrowserModel},smalltalk.HLSourceCodeWidget.klass)})},
  1520. args: ["aBrowserModel"],
  1521. source: "on: aBrowserModel\x0a\x09^ self new\x0a\x09\x09browserModel: aBrowserModel;\x0a\x09\x09yourself",
  1522. messageSends: ["browserModel:", "new", "yourself"],
  1523. referencedClasses: []
  1524. }),
  1525. smalltalk.HLSourceCodeWidget.klass);
  1526. smalltalk.addClass('HLWorkspace', smalltalk.HLWidget, ['codeWidget'], 'Helios-Workspace');
  1527. smalltalk.addMethod(
  1528. smalltalk.method({
  1529. selector: "canHaveFocus",
  1530. category: 'testing',
  1531. fn: function (){
  1532. var self=this;
  1533. return smalltalk.withContext(function($ctx1) {
  1534. return true;
  1535. }, function($ctx1) {$ctx1.fill(self,"canHaveFocus",{},smalltalk.HLWorkspace)})},
  1536. args: [],
  1537. source: "canHaveFocus\x0a\x09^ true",
  1538. messageSends: [],
  1539. referencedClasses: []
  1540. }),
  1541. smalltalk.HLWorkspace);
  1542. smalltalk.addMethod(
  1543. smalltalk.method({
  1544. selector: "codeWidget",
  1545. category: 'accessing',
  1546. fn: function (){
  1547. var self=this;
  1548. function $HLCodeWidget(){return smalltalk.HLCodeWidget||(typeof HLCodeWidget=="undefined"?nil:HLCodeWidget)}
  1549. return smalltalk.withContext(function($ctx1) {
  1550. var $2,$1;
  1551. $2=self["@codeWidget"];
  1552. if(($receiver = $2) == nil || $receiver == undefined){
  1553. self["@codeWidget"]=_st($HLCodeWidget())._new();
  1554. $1=self["@codeWidget"];
  1555. } else {
  1556. $1=$2;
  1557. };
  1558. return $1;
  1559. }, function($ctx1) {$ctx1.fill(self,"codeWidget",{},smalltalk.HLWorkspace)})},
  1560. args: [],
  1561. source: "codeWidget\x0a\x09^ codeWidget ifNil: [ codeWidget := HLCodeWidget new ]",
  1562. messageSends: ["ifNil:", "new"],
  1563. referencedClasses: ["HLCodeWidget"]
  1564. }),
  1565. smalltalk.HLWorkspace);
  1566. smalltalk.addMethod(
  1567. smalltalk.method({
  1568. selector: "focus",
  1569. category: 'actions',
  1570. fn: function (){
  1571. var self=this;
  1572. return smalltalk.withContext(function($ctx1) {
  1573. var $1;
  1574. $1=_st(_st(self)._codeWidget())._focus();
  1575. return $1;
  1576. }, function($ctx1) {$ctx1.fill(self,"focus",{},smalltalk.HLWorkspace)})},
  1577. args: [],
  1578. source: "focus\x0a\x09^ self codeWidget focus",
  1579. messageSends: ["focus", "codeWidget"],
  1580. referencedClasses: []
  1581. }),
  1582. smalltalk.HLWorkspace);
  1583. smalltalk.addMethod(
  1584. smalltalk.method({
  1585. selector: "renderContentOn:",
  1586. category: 'rendering',
  1587. fn: function (html){
  1588. var self=this;
  1589. function $HLContainer(){return smalltalk.HLContainer||(typeof HLContainer=="undefined"?nil:HLContainer)}
  1590. return smalltalk.withContext(function($ctx1) {
  1591. _st(html)._with_(_st($HLContainer())._with_(_st(self)._codeWidget()));
  1592. return self}, function($ctx1) {$ctx1.fill(self,"renderContentOn:",{html:html},smalltalk.HLWorkspace)})},
  1593. args: ["html"],
  1594. source: "renderContentOn: html\x0a\x09html with: (HLContainer with: self codeWidget)",
  1595. messageSends: ["with:", "codeWidget"],
  1596. referencedClasses: ["HLContainer"]
  1597. }),
  1598. smalltalk.HLWorkspace);
  1599. smalltalk.addMethod(
  1600. smalltalk.method({
  1601. selector: "canBeOpenAsTab",
  1602. category: 'testing',
  1603. fn: function (){
  1604. var self=this;
  1605. return smalltalk.withContext(function($ctx1) {
  1606. return true;
  1607. }, function($ctx1) {$ctx1.fill(self,"canBeOpenAsTab",{},smalltalk.HLWorkspace.klass)})},
  1608. args: [],
  1609. source: "canBeOpenAsTab\x0a\x09^ true",
  1610. messageSends: [],
  1611. referencedClasses: []
  1612. }),
  1613. smalltalk.HLWorkspace.klass);
  1614. smalltalk.addMethod(
  1615. smalltalk.method({
  1616. selector: "tabLabel",
  1617. category: 'accessing',
  1618. fn: function (){
  1619. var self=this;
  1620. return smalltalk.withContext(function($ctx1) {
  1621. return "Workspace";
  1622. }, function($ctx1) {$ctx1.fill(self,"tabLabel",{},smalltalk.HLWorkspace.klass)})},
  1623. args: [],
  1624. source: "tabLabel\x0a\x09^ 'Workspace'",
  1625. messageSends: [],
  1626. referencedClasses: []
  1627. }),
  1628. smalltalk.HLWorkspace.klass);
  1629. smalltalk.addMethod(
  1630. smalltalk.method({
  1631. selector: "tabPriority",
  1632. category: 'accessing',
  1633. fn: function (){
  1634. var self=this;
  1635. return smalltalk.withContext(function($ctx1) {
  1636. var $1;
  1637. $1=(10);
  1638. return $1;
  1639. }, function($ctx1) {$ctx1.fill(self,"tabPriority",{},smalltalk.HLWorkspace.klass)})},
  1640. args: [],
  1641. source: "tabPriority\x0a\x09^ 10",
  1642. messageSends: [],
  1643. referencedClasses: []
  1644. }),
  1645. smalltalk.HLWorkspace.klass);