Helios-Workspace.js 75 KB

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