2
0

Helios-Commands-Browser.js 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  1. define("amber_core/Helios-Commands-Browser", ["amber_vm/smalltalk", "amber_vm/nil", "amber_vm/_st", "amber_vm/globals", "amber_core/Helios-Commands-Tools"], function(smalltalk,nil,_st, globals){
  2. smalltalk.addPackage('Helios-Commands-Browser');
  3. smalltalk.packages["Helios-Commands-Browser"].transport = {"type":"amd","amdNamespace":"amber_core"};
  4. smalltalk.addClass('HLBrowserCommand', globals.HLToolCommand, [], 'Helios-Commands-Browser');
  5. smalltalk.addMethod(
  6. smalltalk.method({
  7. selector: "isValidFor:",
  8. protocol: 'testing',
  9. fn: function (aModel){
  10. var self=this;
  11. return smalltalk.withContext(function($ctx1) {
  12. var $1;
  13. $1=_st(aModel)._isBrowserModel();
  14. return $1;
  15. }, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},globals.HLBrowserCommand.klass)})},
  16. args: ["aModel"],
  17. source: "isValidFor: aModel\x0a\x09^ aModel isBrowserModel",
  18. messageSends: ["isBrowserModel"],
  19. referencedClasses: []
  20. }),
  21. globals.HLBrowserCommand.klass);
  22. smalltalk.addClass('HLBrowserGoToCommand', globals.HLBrowserCommand, [], 'Helios-Commands-Browser');
  23. smalltalk.addMethod(
  24. smalltalk.method({
  25. selector: "isValidFor:",
  26. protocol: 'testing',
  27. fn: function (aModel){
  28. var self=this;
  29. return smalltalk.withContext(function($ctx1) {
  30. var $1;
  31. $1=_st(aModel)._isBrowserModel();
  32. return $1;
  33. }, function($ctx1) {$ctx1.fill(self,"isValidFor:",{aModel:aModel},globals.HLBrowserGoToCommand.klass)})},
  34. args: ["aModel"],
  35. source: "isValidFor: aModel\x0a\x09^ aModel isBrowserModel",
  36. messageSends: ["isBrowserModel"],
  37. referencedClasses: []
  38. }),
  39. globals.HLBrowserGoToCommand.klass);
  40. smalltalk.addMethod(
  41. smalltalk.method({
  42. selector: "key",
  43. protocol: 'accessing',
  44. fn: function (){
  45. var self=this;
  46. return "g";
  47. },
  48. args: [],
  49. source: "key\x0a\x09^ 'g'",
  50. messageSends: [],
  51. referencedClasses: []
  52. }),
  53. globals.HLBrowserGoToCommand.klass);
  54. smalltalk.addMethod(
  55. smalltalk.method({
  56. selector: "label",
  57. protocol: 'accessing',
  58. fn: function (){
  59. var self=this;
  60. return "Go to";
  61. },
  62. args: [],
  63. source: "label\x0a\x09^ 'Go to'",
  64. messageSends: [],
  65. referencedClasses: []
  66. }),
  67. globals.HLBrowserGoToCommand.klass);
  68. smalltalk.addClass('HLGoToClassesCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
  69. smalltalk.addMethod(
  70. smalltalk.method({
  71. selector: "execute",
  72. protocol: 'executing',
  73. fn: function (){
  74. var self=this;
  75. return smalltalk.withContext(function($ctx1) {
  76. _st(self._model())._focusOnClasses();
  77. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLGoToClassesCommand)})},
  78. args: [],
  79. source: "execute\x0a\x09self model focusOnClasses",
  80. messageSends: ["focusOnClasses", "model"],
  81. referencedClasses: []
  82. }),
  83. globals.HLGoToClassesCommand);
  84. smalltalk.addMethod(
  85. smalltalk.method({
  86. selector: "key",
  87. protocol: 'accessing',
  88. fn: function (){
  89. var self=this;
  90. return "c";
  91. },
  92. args: [],
  93. source: "key\x0a\x09^ 'c'",
  94. messageSends: [],
  95. referencedClasses: []
  96. }),
  97. globals.HLGoToClassesCommand.klass);
  98. smalltalk.addMethod(
  99. smalltalk.method({
  100. selector: "label",
  101. protocol: 'accessing',
  102. fn: function (){
  103. var self=this;
  104. return "Classes";
  105. },
  106. args: [],
  107. source: "label\x0a\x09^ 'Classes'",
  108. messageSends: [],
  109. referencedClasses: []
  110. }),
  111. globals.HLGoToClassesCommand.klass);
  112. smalltalk.addClass('HLGoToDocumentationCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
  113. smalltalk.addMethod(
  114. smalltalk.method({
  115. selector: "execute",
  116. protocol: 'executing',
  117. fn: function (){
  118. var self=this;
  119. return smalltalk.withContext(function($ctx1) {
  120. _st(self._model())._focusOnDocumentation();
  121. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLGoToDocumentationCommand)})},
  122. args: [],
  123. source: "execute\x0a\x09self model focusOnDocumentation",
  124. messageSends: ["focusOnDocumentation", "model"],
  125. referencedClasses: []
  126. }),
  127. globals.HLGoToDocumentationCommand);
  128. smalltalk.addMethod(
  129. smalltalk.method({
  130. selector: "key",
  131. protocol: 'accessing',
  132. fn: function (){
  133. var self=this;
  134. return "d";
  135. },
  136. args: [],
  137. source: "key\x0a\x09^ 'd'",
  138. messageSends: [],
  139. referencedClasses: []
  140. }),
  141. globals.HLGoToDocumentationCommand.klass);
  142. smalltalk.addMethod(
  143. smalltalk.method({
  144. selector: "label",
  145. protocol: 'accessing',
  146. fn: function (){
  147. var self=this;
  148. return "Documentation";
  149. },
  150. args: [],
  151. source: "label\x0a\x09^ 'Documentation'",
  152. messageSends: [],
  153. referencedClasses: []
  154. }),
  155. globals.HLGoToDocumentationCommand.klass);
  156. smalltalk.addClass('HLGoToMethodsCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
  157. smalltalk.addMethod(
  158. smalltalk.method({
  159. selector: "execute",
  160. protocol: 'executing',
  161. fn: function (){
  162. var self=this;
  163. return smalltalk.withContext(function($ctx1) {
  164. _st(self._model())._focusOnMethods();
  165. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLGoToMethodsCommand)})},
  166. args: [],
  167. source: "execute\x0a\x09self model focusOnMethods",
  168. messageSends: ["focusOnMethods", "model"],
  169. referencedClasses: []
  170. }),
  171. globals.HLGoToMethodsCommand);
  172. smalltalk.addMethod(
  173. smalltalk.method({
  174. selector: "key",
  175. protocol: 'accessing',
  176. fn: function (){
  177. var self=this;
  178. return "m";
  179. },
  180. args: [],
  181. source: "key\x0a\x09^ 'm'",
  182. messageSends: [],
  183. referencedClasses: []
  184. }),
  185. globals.HLGoToMethodsCommand.klass);
  186. smalltalk.addMethod(
  187. smalltalk.method({
  188. selector: "label",
  189. protocol: 'accessing',
  190. fn: function (){
  191. var self=this;
  192. return "Methods";
  193. },
  194. args: [],
  195. source: "label\x0a\x09^ 'Methods'",
  196. messageSends: [],
  197. referencedClasses: []
  198. }),
  199. globals.HLGoToMethodsCommand.klass);
  200. smalltalk.addClass('HLGoToPackagesCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
  201. smalltalk.addMethod(
  202. smalltalk.method({
  203. selector: "execute",
  204. protocol: 'executing',
  205. fn: function (){
  206. var self=this;
  207. return smalltalk.withContext(function($ctx1) {
  208. _st(self._model())._focusOnPackages();
  209. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLGoToPackagesCommand)})},
  210. args: [],
  211. source: "execute\x0a\x09self model focusOnPackages",
  212. messageSends: ["focusOnPackages", "model"],
  213. referencedClasses: []
  214. }),
  215. globals.HLGoToPackagesCommand);
  216. smalltalk.addMethod(
  217. smalltalk.method({
  218. selector: "key",
  219. protocol: 'accessing',
  220. fn: function (){
  221. var self=this;
  222. return "p";
  223. },
  224. args: [],
  225. source: "key\x0a\x09^ 'p'",
  226. messageSends: [],
  227. referencedClasses: []
  228. }),
  229. globals.HLGoToPackagesCommand.klass);
  230. smalltalk.addMethod(
  231. smalltalk.method({
  232. selector: "label",
  233. protocol: 'accessing',
  234. fn: function (){
  235. var self=this;
  236. return "Packages";
  237. },
  238. args: [],
  239. source: "label\x0a\x09^ 'Packages'",
  240. messageSends: [],
  241. referencedClasses: []
  242. }),
  243. globals.HLGoToPackagesCommand.klass);
  244. smalltalk.addClass('HLGoToProtocolsCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
  245. smalltalk.addMethod(
  246. smalltalk.method({
  247. selector: "execute",
  248. protocol: 'executing',
  249. fn: function (){
  250. var self=this;
  251. return smalltalk.withContext(function($ctx1) {
  252. _st(self._model())._focusOnProtocols();
  253. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLGoToProtocolsCommand)})},
  254. args: [],
  255. source: "execute\x0a\x09self model focusOnProtocols",
  256. messageSends: ["focusOnProtocols", "model"],
  257. referencedClasses: []
  258. }),
  259. globals.HLGoToProtocolsCommand);
  260. smalltalk.addMethod(
  261. smalltalk.method({
  262. selector: "key",
  263. protocol: 'accessing',
  264. fn: function (){
  265. var self=this;
  266. return "t";
  267. },
  268. args: [],
  269. source: "key\x0a\x09^ 't'",
  270. messageSends: [],
  271. referencedClasses: []
  272. }),
  273. globals.HLGoToProtocolsCommand.klass);
  274. smalltalk.addMethod(
  275. smalltalk.method({
  276. selector: "label",
  277. protocol: 'accessing',
  278. fn: function (){
  279. var self=this;
  280. return "Protocols";
  281. },
  282. args: [],
  283. source: "label\x0a\x09^ 'Protocols'",
  284. messageSends: [],
  285. referencedClasses: []
  286. }),
  287. globals.HLGoToProtocolsCommand.klass);
  288. smalltalk.addClass('HLGoToSourceCodeCommand', globals.HLBrowserGoToCommand, [], 'Helios-Commands-Browser');
  289. smalltalk.addMethod(
  290. smalltalk.method({
  291. selector: "execute",
  292. protocol: 'executing',
  293. fn: function (){
  294. var self=this;
  295. return smalltalk.withContext(function($ctx1) {
  296. _st(self._model())._focusOnSourceCode();
  297. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLGoToSourceCodeCommand)})},
  298. args: [],
  299. source: "execute\x0a\x09self model focusOnSourceCode",
  300. messageSends: ["focusOnSourceCode", "model"],
  301. referencedClasses: []
  302. }),
  303. globals.HLGoToSourceCodeCommand);
  304. smalltalk.addMethod(
  305. smalltalk.method({
  306. selector: "key",
  307. protocol: 'accessing',
  308. fn: function (){
  309. var self=this;
  310. return "s";
  311. },
  312. args: [],
  313. source: "key\x0a\x09^ 's'",
  314. messageSends: [],
  315. referencedClasses: []
  316. }),
  317. globals.HLGoToSourceCodeCommand.klass);
  318. smalltalk.addMethod(
  319. smalltalk.method({
  320. selector: "label",
  321. protocol: 'accessing',
  322. fn: function (){
  323. var self=this;
  324. return "Source code";
  325. },
  326. args: [],
  327. source: "label\x0a\x09^ 'Source code'",
  328. messageSends: [],
  329. referencedClasses: []
  330. }),
  331. globals.HLGoToSourceCodeCommand.klass);
  332. smalltalk.addClass('HLEditCommentCommand', globals.HLBrowserCommand, [], 'Helios-Commands-Browser');
  333. smalltalk.addMethod(
  334. smalltalk.method({
  335. selector: "execute",
  336. protocol: 'executing',
  337. fn: function (){
  338. var self=this;
  339. return smalltalk.withContext(function($ctx1) {
  340. _st(self._model())._editComment();
  341. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLEditCommentCommand)})},
  342. args: [],
  343. source: "execute\x0a\x09self model editComment",
  344. messageSends: ["editComment", "model"],
  345. referencedClasses: []
  346. }),
  347. globals.HLEditCommentCommand);
  348. smalltalk.addMethod(
  349. smalltalk.method({
  350. selector: "isActive",
  351. protocol: 'testing',
  352. fn: function (){
  353. var self=this;
  354. return smalltalk.withContext(function($ctx1) {
  355. var $3,$2,$1;
  356. $3=self._model();
  357. $ctx1.sendIdx["model"]=1;
  358. $2=_st($3)._showComment();
  359. $1=_st($2)._and_((function(){
  360. return smalltalk.withContext(function($ctx2) {
  361. return _st(_st(self._model())._selectedClass())._notNil();
  362. }, function($ctx2) {$ctx2.fillBlock({},$ctx1,1)})}));
  363. return $1;
  364. }, function($ctx1) {$ctx1.fill(self,"isActive",{},globals.HLEditCommentCommand)})},
  365. args: [],
  366. source: "isActive\x0a\x09^ self model showComment and: [ self model selectedClass notNil ]",
  367. messageSends: ["and:", "showComment", "model", "notNil", "selectedClass"],
  368. referencedClasses: []
  369. }),
  370. globals.HLEditCommentCommand);
  371. smalltalk.addMethod(
  372. smalltalk.method({
  373. selector: "key",
  374. protocol: 'accessing',
  375. fn: function (){
  376. var self=this;
  377. return "d";
  378. },
  379. args: [],
  380. source: "key\x0a\x09^ 'd'",
  381. messageSends: [],
  382. referencedClasses: []
  383. }),
  384. globals.HLEditCommentCommand.klass);
  385. smalltalk.addMethod(
  386. smalltalk.method({
  387. selector: "label",
  388. protocol: 'accessing',
  389. fn: function (){
  390. var self=this;
  391. return "Edit documentation";
  392. },
  393. args: [],
  394. source: "label\x0a\x09^ 'Edit documentation'",
  395. messageSends: [],
  396. referencedClasses: []
  397. }),
  398. globals.HLEditCommentCommand.klass);
  399. smalltalk.addClass('HLGenerateCommand', globals.HLBrowserCommand, [], 'Helios-Commands-Browser');
  400. globals.HLGenerateCommand.comment="I am a group command used to gather all the commands generating code (`accessors`, `initialize`, etc)";
  401. smalltalk.addMethod(
  402. smalltalk.method({
  403. selector: "key",
  404. protocol: 'accessing',
  405. fn: function (){
  406. var self=this;
  407. return "h";
  408. },
  409. args: [],
  410. source: "key\x0a\x09^ 'h'",
  411. messageSends: [],
  412. referencedClasses: []
  413. }),
  414. globals.HLGenerateCommand.klass);
  415. smalltalk.addMethod(
  416. smalltalk.method({
  417. selector: "label",
  418. protocol: 'accessing',
  419. fn: function (){
  420. var self=this;
  421. return "Generate";
  422. },
  423. args: [],
  424. source: "label\x0a\x09^ 'Generate'",
  425. messageSends: [],
  426. referencedClasses: []
  427. }),
  428. globals.HLGenerateCommand.klass);
  429. smalltalk.addClass('HLCategorizeUnclassifiedCommand', globals.HLGenerateCommand, [], 'Helios-Commands-Browser');
  430. globals.HLCategorizeUnclassifiedCommand.comment="I am the command used to categorize unclassified methods";
  431. smalltalk.addMethod(
  432. smalltalk.method({
  433. selector: "execute",
  434. protocol: 'executing',
  435. fn: function (){
  436. var self=this;
  437. var targetClass,unclassified;
  438. function $HLMethodClassifier(){return globals.HLMethodClassifier||(typeof HLMethodClassifier=="undefined"?nil:HLMethodClassifier)}
  439. return smalltalk.withContext(function($ctx1) {
  440. targetClass=_st(self._model())._selectedClass();
  441. unclassified=_st(_st(targetClass)._methods())._select_((function(e){
  442. return smalltalk.withContext(function($ctx2) {
  443. return _st(_st(e)._protocol()).__eq("as yet unclassified");
  444. }, function($ctx2) {$ctx2.fillBlock({e:e},$ctx1,1)})}));
  445. _st(_st($HLMethodClassifier())._new())._classifyAll_(unclassified);
  446. return self}, function($ctx1) {$ctx1.fill(self,"execute",{targetClass:targetClass,unclassified:unclassified},globals.HLCategorizeUnclassifiedCommand)})},
  447. args: [],
  448. source: "execute\x0a\x09| targetClass unclassified |\x0a\x09targetClass := self model selectedClass.\x0a\x0a\x09unclassified := targetClass methods select:[ :e | e protocol = 'as yet unclassified' ].\x0a\x09\x09\x0a\x09HLMethodClassifier new\x0a\x09\x09classifyAll: unclassified",
  449. messageSends: ["selectedClass", "model", "select:", "methods", "=", "protocol", "classifyAll:", "new"],
  450. referencedClasses: ["HLMethodClassifier"]
  451. }),
  452. globals.HLCategorizeUnclassifiedCommand);
  453. smalltalk.addMethod(
  454. smalltalk.method({
  455. selector: "key",
  456. protocol: 'accessing',
  457. fn: function (){
  458. var self=this;
  459. return "c";
  460. },
  461. args: [],
  462. source: "key\x0a\x09^ 'c'",
  463. messageSends: [],
  464. referencedClasses: []
  465. }),
  466. globals.HLCategorizeUnclassifiedCommand.klass);
  467. smalltalk.addMethod(
  468. smalltalk.method({
  469. selector: "label",
  470. protocol: 'accessing',
  471. fn: function (){
  472. var self=this;
  473. return "Categorize";
  474. },
  475. args: [],
  476. source: "label\x0a\x09^ 'Categorize'",
  477. messageSends: [],
  478. referencedClasses: []
  479. }),
  480. globals.HLCategorizeUnclassifiedCommand.klass);
  481. smalltalk.addClass('HLGenerateAccessorsCommand', globals.HLGenerateCommand, [], 'Helios-Commands-Browser');
  482. globals.HLGenerateAccessorsCommand.comment="I am the command used to generate the `getter` and the `setter` methods depending of the selected class";
  483. smalltalk.addMethod(
  484. smalltalk.method({
  485. selector: "execute",
  486. protocol: 'executing',
  487. fn: function (){
  488. var self=this;
  489. var targetClass,output,first;
  490. function $HLInitializeGenerator(){return globals.HLInitializeGenerator||(typeof HLInitializeGenerator=="undefined"?nil:HLInitializeGenerator)}
  491. return smalltalk.withContext(function($ctx1) {
  492. var $1,$2,$3,$4,$5;
  493. $1=self._model();
  494. $ctx1.sendIdx["model"]=1;
  495. targetClass=_st($1)._selectedClass();
  496. $2=_st($HLInitializeGenerator())._new();
  497. _st($2)._class_(targetClass);
  498. _st($2)._generate();
  499. $3=_st($2)._output();
  500. output=$3;
  501. _st(output)._compile();
  502. first=_st(_st(output)._sourceCodes())._first();
  503. $4=self._model();
  504. _st($4)._selectedProtocol_(_st(output)._protocol());
  505. _st($4)._selectedMethod_(_st(targetClass).__gt_gt(_st(first)._selector()));
  506. $5=_st($4)._focusOnSourceCode();
  507. return self}, function($ctx1) {$ctx1.fill(self,"execute",{targetClass:targetClass,output:output,first:first},globals.HLGenerateAccessorsCommand)})},
  508. args: [],
  509. source: "execute\x0a\x09| targetClass output first |\x0a\x09targetClass := self model selectedClass.\x0a\x0a\x09output := HLInitializeGenerator new\x0a\x09\x09class: targetClass;\x0a\x09\x09generate;\x0a\x09\x09output.\x0a\x09\x09\x0a\x09output compile.\x0a\x09first := output sourceCodes first.\x0a\x09self model\x0a\x09\x09selectedProtocol: output protocol;\x0a\x09\x09selectedMethod:(targetClass>>first selector);\x0a\x09\x09focusOnSourceCode",
  510. messageSends: ["selectedClass", "model", "class:", "new", "generate", "output", "compile", "first", "sourceCodes", "selectedProtocol:", "protocol", "selectedMethod:", ">>", "selector", "focusOnSourceCode"],
  511. referencedClasses: ["HLInitializeGenerator"]
  512. }),
  513. globals.HLGenerateAccessorsCommand);
  514. smalltalk.addMethod(
  515. smalltalk.method({
  516. selector: "key",
  517. protocol: 'accessing',
  518. fn: function (){
  519. var self=this;
  520. return "i";
  521. },
  522. args: [],
  523. source: "key\x0a\x09^ 'i'",
  524. messageSends: [],
  525. referencedClasses: []
  526. }),
  527. globals.HLGenerateAccessorsCommand.klass);
  528. smalltalk.addMethod(
  529. smalltalk.method({
  530. selector: "label",
  531. protocol: 'accessing',
  532. fn: function (){
  533. var self=this;
  534. return "Initialize";
  535. },
  536. args: [],
  537. source: "label\x0a\x09^ 'Initialize'",
  538. messageSends: [],
  539. referencedClasses: []
  540. }),
  541. globals.HLGenerateAccessorsCommand.klass);
  542. smalltalk.addClass('HLGenerateInitializeCommand', globals.HLGenerateCommand, [], 'Helios-Commands-Browser');
  543. globals.HLGenerateInitializeCommand.comment="I am the command used to generate the `initialize` method depending of the selected class";
  544. smalltalk.addMethod(
  545. smalltalk.method({
  546. selector: "execute",
  547. protocol: 'executing',
  548. fn: function (){
  549. var self=this;
  550. var targetClass,output;
  551. function $HLAccessorsGenerator(){return globals.HLAccessorsGenerator||(typeof HLAccessorsGenerator=="undefined"?nil:HLAccessorsGenerator)}
  552. return smalltalk.withContext(function($ctx1) {
  553. var $1,$2,$3;
  554. $1=self._model();
  555. $ctx1.sendIdx["model"]=1;
  556. targetClass=_st($1)._selectedClass();
  557. $2=_st($HLAccessorsGenerator())._new();
  558. _st($2)._class_(targetClass);
  559. _st($2)._generate();
  560. $3=_st($2)._output();
  561. output=$3;
  562. _st(output)._compile();
  563. _st(self._model())._selectedProtocol_(_st(output)._protocol());
  564. return self}, function($ctx1) {$ctx1.fill(self,"execute",{targetClass:targetClass,output:output},globals.HLGenerateInitializeCommand)})},
  565. args: [],
  566. source: "execute\x0a\x09| targetClass output |\x0a\x09targetClass := self model selectedClass.\x0a\x0a\x09output := HLAccessorsGenerator new\x0a\x09\x09class: targetClass;\x0a\x09\x09generate;\x0a\x09\x09output.\x0a\x09\x09\x0a\x09output compile.\x0a\x09self model selectedProtocol: output protocol",
  567. messageSends: ["selectedClass", "model", "class:", "new", "generate", "output", "compile", "selectedProtocol:", "protocol"],
  568. referencedClasses: ["HLAccessorsGenerator"]
  569. }),
  570. globals.HLGenerateInitializeCommand);
  571. smalltalk.addMethod(
  572. smalltalk.method({
  573. selector: "key",
  574. protocol: 'accessing',
  575. fn: function (){
  576. var self=this;
  577. return "a";
  578. },
  579. args: [],
  580. source: "key\x0a\x09^ 'a'",
  581. messageSends: [],
  582. referencedClasses: []
  583. }),
  584. globals.HLGenerateInitializeCommand.klass);
  585. smalltalk.addMethod(
  586. smalltalk.method({
  587. selector: "label",
  588. protocol: 'accessing',
  589. fn: function (){
  590. var self=this;
  591. return "Accessors";
  592. },
  593. args: [],
  594. source: "label\x0a\x09^ 'Accessors'",
  595. messageSends: [],
  596. referencedClasses: []
  597. }),
  598. globals.HLGenerateInitializeCommand.klass);
  599. smalltalk.addClass('HLToggleCommand', globals.HLBrowserCommand, [], 'Helios-Commands-Browser');
  600. smalltalk.addMethod(
  601. smalltalk.method({
  602. selector: "key",
  603. protocol: 'accessing',
  604. fn: function (){
  605. var self=this;
  606. return "t";
  607. },
  608. args: [],
  609. source: "key\x0a\x09^ 't'",
  610. messageSends: [],
  611. referencedClasses: []
  612. }),
  613. globals.HLToggleCommand.klass);
  614. smalltalk.addMethod(
  615. smalltalk.method({
  616. selector: "label",
  617. protocol: 'accessing',
  618. fn: function (){
  619. var self=this;
  620. return "Toggle";
  621. },
  622. args: [],
  623. source: "label\x0a\x09^ 'Toggle'",
  624. messageSends: [],
  625. referencedClasses: []
  626. }),
  627. globals.HLToggleCommand.klass);
  628. smalltalk.addClass('HLToggleClassCommentCommand', globals.HLToggleCommand, [], 'Helios-Commands-Browser');
  629. smalltalk.addMethod(
  630. smalltalk.method({
  631. selector: "execute",
  632. protocol: 'executing',
  633. fn: function (){
  634. var self=this;
  635. return smalltalk.withContext(function($ctx1) {
  636. var $1;
  637. $1=self._model();
  638. $ctx1.sendIdx["model"]=1;
  639. _st($1)._showComment_(_st(_st(self._model())._showComment())._not());
  640. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLToggleClassCommentCommand)})},
  641. args: [],
  642. source: "execute\x0a\x09self model showComment: self model showComment not",
  643. messageSends: ["showComment:", "model", "not", "showComment"],
  644. referencedClasses: []
  645. }),
  646. globals.HLToggleClassCommentCommand);
  647. smalltalk.addMethod(
  648. smalltalk.method({
  649. selector: "key",
  650. protocol: 'accessing',
  651. fn: function (){
  652. var self=this;
  653. return "d";
  654. },
  655. args: [],
  656. source: "key\x0a\x09^ 'd'",
  657. messageSends: [],
  658. referencedClasses: []
  659. }),
  660. globals.HLToggleClassCommentCommand.klass);
  661. smalltalk.addMethod(
  662. smalltalk.method({
  663. selector: "label",
  664. protocol: 'accessing',
  665. fn: function (){
  666. var self=this;
  667. return "Documentation";
  668. },
  669. args: [],
  670. source: "label\x0a\x09^ 'Documentation'",
  671. messageSends: [],
  672. referencedClasses: []
  673. }),
  674. globals.HLToggleClassCommentCommand.klass);
  675. smalltalk.addClass('HLToggleClassSideCommand', globals.HLToggleCommand, [], 'Helios-Commands-Browser');
  676. smalltalk.addMethod(
  677. smalltalk.method({
  678. selector: "execute",
  679. protocol: 'executing',
  680. fn: function (){
  681. var self=this;
  682. return smalltalk.withContext(function($ctx1) {
  683. var $1;
  684. $1=self._model();
  685. $ctx1.sendIdx["model"]=1;
  686. _st($1)._showInstance_(_st(_st(self._model())._showInstance())._not());
  687. return self}, function($ctx1) {$ctx1.fill(self,"execute",{},globals.HLToggleClassSideCommand)})},
  688. args: [],
  689. source: "execute\x0a\x09self model showInstance: self model showInstance not",
  690. messageSends: ["showInstance:", "model", "not", "showInstance"],
  691. referencedClasses: []
  692. }),
  693. globals.HLToggleClassSideCommand);
  694. smalltalk.addMethod(
  695. smalltalk.method({
  696. selector: "key",
  697. protocol: 'accessing',
  698. fn: function (){
  699. var self=this;
  700. return "c";
  701. },
  702. args: [],
  703. source: "key\x0a\x09^ 'c'",
  704. messageSends: [],
  705. referencedClasses: []
  706. }),
  707. globals.HLToggleClassSideCommand.klass);
  708. smalltalk.addMethod(
  709. smalltalk.method({
  710. selector: "label",
  711. protocol: 'accessing',
  712. fn: function (){
  713. var self=this;
  714. return "Class side";
  715. },
  716. args: [],
  717. source: "label\x0a\x09^ 'Class side'",
  718. messageSends: [],
  719. referencedClasses: []
  720. }),
  721. globals.HLToggleClassSideCommand.klass);
  722. });