Helios-Commands-Tools.st 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855
  1. Smalltalk current createPackage: 'Helios-Commands-Tools'!
  2. HLModelCommand subclass: #HLBrowserCommand
  3. instanceVariableNames: ''
  4. package: 'Helios-Commands-Tools'!
  5. !HLBrowserCommand methodsFor: 'accessing'!
  6. category
  7. ^ nil
  8. ! !
  9. !HLBrowserCommand class methodsFor: 'instance creation'!
  10. for: aToolModel
  11. ^ self new
  12. model: aToolModel;
  13. yourself
  14. ! !
  15. !HLBrowserCommand class methodsFor: 'testing'!
  16. isValidFor: aModel
  17. ^ aModel isToolModel
  18. ! !
  19. HLBrowserCommand subclass: #HLBrowserGoToCommand
  20. instanceVariableNames: ''
  21. package: 'Helios-Commands-Tools'!
  22. !HLBrowserGoToCommand class methodsFor: 'accessing'!
  23. key
  24. ^ 'g'
  25. !
  26. label
  27. ^ 'Go to'
  28. ! !
  29. !HLBrowserGoToCommand class methodsFor: 'testing'!
  30. isValidFor: aModel
  31. ^ aModel isBrowserModel
  32. ! !
  33. HLBrowserGoToCommand subclass: #HLGoToClassesCommand
  34. instanceVariableNames: ''
  35. package: 'Helios-Commands-Tools'!
  36. !HLGoToClassesCommand methodsFor: 'executing'!
  37. execute
  38. self model focusOnClasses
  39. ! !
  40. !HLGoToClassesCommand class methodsFor: 'accessing'!
  41. key
  42. ^ 'c'
  43. !
  44. label
  45. ^ 'Classes'
  46. ! !
  47. HLBrowserGoToCommand subclass: #HLGoToMethodsCommand
  48. instanceVariableNames: ''
  49. package: 'Helios-Commands-Tools'!
  50. !HLGoToMethodsCommand methodsFor: 'executing'!
  51. execute
  52. self model focusOnMethods
  53. ! !
  54. !HLGoToMethodsCommand class methodsFor: 'accessing'!
  55. key
  56. ^ 'm'
  57. !
  58. label
  59. ^ 'Methods'
  60. ! !
  61. HLBrowserGoToCommand subclass: #HLGoToPackagesCommand
  62. instanceVariableNames: ''
  63. package: 'Helios-Commands-Tools'!
  64. !HLGoToPackagesCommand methodsFor: 'executing'!
  65. execute
  66. self model focusOnPackages
  67. ! !
  68. !HLGoToPackagesCommand class methodsFor: 'accessing'!
  69. key
  70. ^ 'p'
  71. !
  72. label
  73. ^ 'Packages'
  74. ! !
  75. HLBrowserGoToCommand subclass: #HLGoToProtocolsCommand
  76. instanceVariableNames: ''
  77. package: 'Helios-Commands-Tools'!
  78. !HLGoToProtocolsCommand methodsFor: 'executing'!
  79. execute
  80. self model focusOnProtocols
  81. ! !
  82. !HLGoToProtocolsCommand class methodsFor: 'accessing'!
  83. key
  84. ^ 't'
  85. !
  86. label
  87. ^ 'Protocols'
  88. ! !
  89. HLBrowserGoToCommand subclass: #HLGoToSourceCodeCommand
  90. instanceVariableNames: ''
  91. package: 'Helios-Commands-Tools'!
  92. !HLGoToSourceCodeCommand methodsFor: 'executing'!
  93. execute
  94. self model focusOnSourceCode
  95. ! !
  96. !HLGoToSourceCodeCommand class methodsFor: 'accessing'!
  97. key
  98. ^ 's'
  99. !
  100. label
  101. ^ 'Source code'
  102. ! !
  103. HLBrowserCommand subclass: #HLCommitPackageCommand
  104. instanceVariableNames: ''
  105. package: 'Helios-Commands-Tools'!
  106. !HLCommitPackageCommand methodsFor: 'accessing'!
  107. category
  108. ^ 'Packages'
  109. ! !
  110. !HLCommitPackageCommand methodsFor: 'executing'!
  111. execute
  112. self model commitPackage
  113. ! !
  114. !HLCommitPackageCommand methodsFor: 'testing'!
  115. isActive
  116. ^ true
  117. " slf model isPackageDirty"
  118. ! !
  119. !HLCommitPackageCommand class methodsFor: 'accessing'!
  120. key
  121. ^ 'k'
  122. !
  123. label
  124. ^ 'Commit'
  125. ! !
  126. HLBrowserCommand subclass: #HLCopyCommand
  127. instanceVariableNames: ''
  128. package: 'Helios-Commands-Tools'!
  129. !HLCopyCommand class methodsFor: 'accessing'!
  130. key
  131. ^ 'c'
  132. !
  133. label
  134. ^ 'Copy'
  135. ! !
  136. HLCopyCommand subclass: #HLCopyClassCommand
  137. instanceVariableNames: ''
  138. package: 'Helios-Commands-Tools'!
  139. !HLCopyClassCommand methodsFor: 'accessing'!
  140. category
  141. ^ 'Classes'
  142. !
  143. displayLabel
  144. ^ 'New class name:'
  145. ! !
  146. !HLCopyClassCommand methodsFor: 'defaults'!
  147. defaultInput
  148. ^ self model selectedClass name
  149. ! !
  150. !HLCopyClassCommand methodsFor: 'executing'!
  151. execute
  152. self model copyClassTo: self input
  153. ! !
  154. !HLCopyClassCommand methodsFor: 'testing'!
  155. isActive
  156. ^ self model selectedClass notNil
  157. !
  158. isInputRequired
  159. ^ true
  160. ! !
  161. !HLCopyClassCommand class methodsFor: 'accessing'!
  162. key
  163. ^ 'c'
  164. !
  165. label
  166. ^ 'Class'
  167. !
  168. menuLabel
  169. ^ 'Copy class...'
  170. ! !
  171. HLBrowserCommand subclass: #HLFindCommand
  172. instanceVariableNames: ''
  173. package: 'Helios-Commands-Tools'!
  174. !HLFindCommand class methodsFor: 'accessing'!
  175. key
  176. ^ 'f'
  177. !
  178. label
  179. ^ 'Find'
  180. ! !
  181. HLFindCommand subclass: #HLFindClassCommand
  182. instanceVariableNames: ''
  183. package: 'Helios-Commands-Tools'!
  184. !HLFindClassCommand methodsFor: 'accessing'!
  185. displayLabel
  186. ^ 'select a class'
  187. !
  188. inputCompletion
  189. ^ self model availableClassNames
  190. !
  191. inputLabel
  192. ^ 'Find a class'
  193. ! !
  194. !HLFindClassCommand methodsFor: 'executing'!
  195. execute
  196. self model openClassNamed: self input
  197. ! !
  198. !HLFindClassCommand methodsFor: 'testing'!
  199. isInputRequired
  200. ^ true
  201. ! !
  202. !HLFindClassCommand class methodsFor: 'accessing'!
  203. key
  204. ^ 'c'
  205. !
  206. label
  207. ^ 'Class'
  208. ! !
  209. HLFindCommand subclass: #HLFindReferencesCommand
  210. instanceVariableNames: ''
  211. package: 'Helios-Commands-Tools'!
  212. !HLFindReferencesCommand methodsFor: 'accessing'!
  213. displayLabel
  214. ^ 'find references'
  215. !
  216. inputCompletion
  217. ^ self model availableClassNames, self model allSelectors
  218. !
  219. inputLabel
  220. ^ 'Find references of'
  221. ! !
  222. !HLFindReferencesCommand methodsFor: 'defaults'!
  223. defaultInput
  224. ^ self model selectedMethod
  225. ifNil: [
  226. self model selectedClass
  227. ifNil: [ '' ]
  228. ifNotNil: [ :class | class name ] ]
  229. ifNotNil: [ :method | method selector ]
  230. ! !
  231. !HLFindReferencesCommand methodsFor: 'executing'!
  232. execute
  233. HLReferences new
  234. open;
  235. search: self input
  236. ! !
  237. !HLFindReferencesCommand methodsFor: 'testing'!
  238. isInputRequired
  239. ^ true
  240. ! !
  241. !HLFindReferencesCommand class methodsFor: 'accessing'!
  242. key
  243. ^ 'r'
  244. !
  245. label
  246. ^ 'References'
  247. ! !
  248. HLBrowserCommand subclass: #HLMoveToCommand
  249. instanceVariableNames: ''
  250. package: 'Helios-Commands-Tools'!
  251. !HLMoveToCommand class methodsFor: 'accessing'!
  252. key
  253. ^ 'm'
  254. !
  255. label
  256. ^ 'Move'
  257. ! !
  258. HLMoveToCommand subclass: #HLMoveClassToCommand
  259. instanceVariableNames: ''
  260. package: 'Helios-Commands-Tools'!
  261. !HLMoveClassToCommand methodsFor: 'testing'!
  262. isActive
  263. ^ self model selectedClass notNil
  264. ! !
  265. !HLMoveClassToCommand class methodsFor: 'accessing'!
  266. key
  267. ^ 'c'
  268. !
  269. label
  270. ^ 'Class'
  271. ! !
  272. HLMoveClassToCommand subclass: #HLMoveClassToPackageCommand
  273. instanceVariableNames: ''
  274. package: 'Helios-Commands-Tools'!
  275. !HLMoveClassToPackageCommand methodsFor: 'accessing'!
  276. category
  277. ^ 'Classes'
  278. !
  279. displayLabel
  280. ^ 'select a package'
  281. !
  282. inputCompletion
  283. ^ self model availablePackageNames
  284. !
  285. inputLabel
  286. ^ 'Move class to package:'
  287. ! !
  288. !HLMoveClassToPackageCommand methodsFor: 'executing'!
  289. execute
  290. self model moveClassToPackage: self input
  291. ! !
  292. !HLMoveClassToPackageCommand methodsFor: 'testing'!
  293. isInputRequired
  294. ^ true
  295. ! !
  296. !HLMoveClassToPackageCommand class methodsFor: 'accessing'!
  297. key
  298. ^ 'p'
  299. !
  300. label
  301. ^ 'to package'
  302. !
  303. menuLabel
  304. ^ 'Move to package...'
  305. ! !
  306. HLMoveToCommand subclass: #HLMoveMethodToCommand
  307. instanceVariableNames: ''
  308. package: 'Helios-Commands-Tools'!
  309. !HLMoveMethodToCommand methodsFor: 'accessing'!
  310. category
  311. ^ 'Methods'
  312. ! !
  313. !HLMoveMethodToCommand methodsFor: 'testing'!
  314. isActive
  315. ^ self model selectedMethod notNil
  316. ! !
  317. !HLMoveMethodToCommand class methodsFor: 'accessing'!
  318. key
  319. ^ 'm'
  320. !
  321. label
  322. ^ 'Method'
  323. ! !
  324. HLMoveMethodToCommand subclass: #HLMoveMethodToClassCommand
  325. instanceVariableNames: ''
  326. package: 'Helios-Commands-Tools'!
  327. !HLMoveMethodToClassCommand methodsFor: 'accessing'!
  328. displayLabel
  329. ^ 'select a class'
  330. !
  331. inputCompletion
  332. ^ self model availableClassNames
  333. !
  334. inputLabel
  335. ^ 'Move method to class:'
  336. ! !
  337. !HLMoveMethodToClassCommand methodsFor: 'executing'!
  338. execute
  339. self model moveMethodToClass: self input
  340. ! !
  341. !HLMoveMethodToClassCommand methodsFor: 'testing'!
  342. isInputRequired
  343. ^ true
  344. ! !
  345. !HLMoveMethodToClassCommand class methodsFor: 'accessing'!
  346. key
  347. ^ 'c'
  348. !
  349. label
  350. ^ 'to class'
  351. !
  352. menuLabel
  353. ^ 'Move to class...'
  354. ! !
  355. HLMoveMethodToCommand subclass: #HLMoveMethodToProtocolCommand
  356. instanceVariableNames: ''
  357. package: 'Helios-Commands-Tools'!
  358. !HLMoveMethodToProtocolCommand methodsFor: 'accessing'!
  359. displayLabel
  360. ^ 'select a protocol'
  361. !
  362. inputCompletion
  363. ^ self model availableProtocols
  364. !
  365. inputLabel
  366. ^ 'Move method to a protocol:'
  367. ! !
  368. !HLMoveMethodToProtocolCommand methodsFor: 'executing'!
  369. execute
  370. self model moveMethodToProtocol: self input
  371. ! !
  372. !HLMoveMethodToProtocolCommand methodsFor: 'testing'!
  373. isInputRequired
  374. ^ true
  375. ! !
  376. !HLMoveMethodToProtocolCommand class methodsFor: 'accessing'!
  377. key
  378. ^ 't'
  379. !
  380. label
  381. ^ 'to protocol'
  382. !
  383. menuLabel
  384. ^ 'Move to protocol...'
  385. ! !
  386. HLBrowserCommand subclass: #HLRemoveCommand
  387. instanceVariableNames: ''
  388. package: 'Helios-Commands-Tools'!
  389. !HLRemoveCommand class methodsFor: 'accessing'!
  390. key
  391. ^ 'x'
  392. !
  393. label
  394. ^ 'Remove'
  395. ! !
  396. HLRemoveCommand subclass: #HLRemoveClassCommand
  397. instanceVariableNames: ''
  398. package: 'Helios-Commands-Tools'!
  399. !HLRemoveClassCommand methodsFor: 'accessing'!
  400. category
  401. ^ 'Classes'
  402. ! !
  403. !HLRemoveClassCommand methodsFor: 'executing'!
  404. execute
  405. self model removeClass
  406. ! !
  407. !HLRemoveClassCommand methodsFor: 'testing'!
  408. isActive
  409. ^ self model selectedClass notNil
  410. ! !
  411. !HLRemoveClassCommand class methodsFor: 'accessing'!
  412. key
  413. ^ 'c'
  414. !
  415. label
  416. ^ 'Class'
  417. !
  418. menuLabel
  419. ^ 'Remove class'
  420. ! !
  421. HLRemoveCommand subclass: #HLRemoveMethodCommand
  422. instanceVariableNames: ''
  423. package: 'Helios-Commands-Tools'!
  424. !HLRemoveMethodCommand methodsFor: 'accessing'!
  425. category
  426. ^ 'Methods'
  427. ! !
  428. !HLRemoveMethodCommand methodsFor: 'executing'!
  429. execute
  430. self model removeMethod
  431. ! !
  432. !HLRemoveMethodCommand methodsFor: 'testing'!
  433. isActive
  434. ^ self model selectedMethod notNil
  435. ! !
  436. !HLRemoveMethodCommand class methodsFor: 'accessing'!
  437. key
  438. ^ 'm'
  439. !
  440. label
  441. ^ 'Method'
  442. !
  443. menuLabel
  444. ^ 'Remove method'
  445. ! !
  446. HLRemoveCommand subclass: #HLRemoveProtocolCommand
  447. instanceVariableNames: ''
  448. package: 'Helios-Commands-Tools'!
  449. !HLRemoveProtocolCommand methodsFor: 'accessing'!
  450. category
  451. ^ 'Protocols'
  452. ! !
  453. !HLRemoveProtocolCommand methodsFor: 'executing'!
  454. execute
  455. self model removeProtocol
  456. ! !
  457. !HLRemoveProtocolCommand methodsFor: 'testing'!
  458. isActive
  459. ^ self model selectedProtocol notNil
  460. ! !
  461. !HLRemoveProtocolCommand class methodsFor: 'accessing'!
  462. key
  463. ^ 't'
  464. !
  465. label
  466. ^ 'Protocol'
  467. !
  468. menuLabel
  469. ^ 'Remove protocol'
  470. ! !
  471. HLBrowserCommand subclass: #HLRenameCommand
  472. instanceVariableNames: ''
  473. package: 'Helios-Commands-Tools'!
  474. !HLRenameCommand class methodsFor: 'accessing'!
  475. key
  476. ^ 'r'
  477. !
  478. label
  479. ^ 'Rename'
  480. ! !
  481. HLRenameCommand subclass: #HLRenameClassCommand
  482. instanceVariableNames: ''
  483. package: 'Helios-Commands-Tools'!
  484. !HLRenameClassCommand methodsFor: 'accessing'!
  485. category
  486. ^ 'Classes'
  487. !
  488. displayLabel
  489. ^ 'Rename class to:'
  490. ! !
  491. !HLRenameClassCommand methodsFor: 'defaults'!
  492. defaultInput
  493. ^ self model selectedClass name
  494. ! !
  495. !HLRenameClassCommand methodsFor: 'executing'!
  496. execute
  497. self model renameClassTo: self input
  498. ! !
  499. !HLRenameClassCommand methodsFor: 'testing'!
  500. isActive
  501. ^ self model selectedClass notNil
  502. !
  503. isInputRequired
  504. ^ true
  505. ! !
  506. !HLRenameClassCommand class methodsFor: 'accessing'!
  507. key
  508. ^ 'c'
  509. !
  510. label
  511. ^ 'Class'
  512. !
  513. menuLabel
  514. ^ 'Rename class...'
  515. ! !
  516. HLRenameCommand subclass: #HLRenameProtocolCommand
  517. instanceVariableNames: ''
  518. package: 'Helios-Commands-Tools'!
  519. !HLRenameProtocolCommand methodsFor: 'accessing'!
  520. category
  521. ^ 'Protocols'
  522. !
  523. displayLabel
  524. ^ 'Rename protocol to:'
  525. ! !
  526. !HLRenameProtocolCommand methodsFor: 'defaults'!
  527. defaultInput
  528. ^ self model selectedProtocol
  529. ! !
  530. !HLRenameProtocolCommand methodsFor: 'executing'!
  531. execute
  532. self model renameProtocolTo: self input
  533. ! !
  534. !HLRenameProtocolCommand methodsFor: 'testing'!
  535. isActive
  536. ^ self model selectedProtocol notNil
  537. !
  538. isInputRequired
  539. ^ true
  540. ! !
  541. !HLRenameProtocolCommand class methodsFor: 'accessing'!
  542. key
  543. ^ 't'
  544. !
  545. label
  546. ^ 'Protocol'
  547. !
  548. menuLabel
  549. ^ 'Rename protocol...'
  550. ! !
  551. HLBrowserCommand subclass: #HLToggleCommand
  552. instanceVariableNames: ''
  553. package: 'Helios-Commands-Tools'!
  554. !HLToggleCommand class methodsFor: 'accessing'!
  555. key
  556. ^ 't'
  557. !
  558. label
  559. ^ 'Toggle'
  560. ! !
  561. HLToggleCommand subclass: #HLToggleClassCommentCommand
  562. instanceVariableNames: ''
  563. package: 'Helios-Commands-Tools'!
  564. !HLToggleClassCommentCommand methodsFor: 'executing'!
  565. execute
  566. self model showComment: true
  567. ! !
  568. !HLToggleClassCommentCommand class methodsFor: 'accessing'!
  569. key
  570. ^ 'd'
  571. !
  572. label
  573. ^ 'Documentation'
  574. ! !
  575. HLToggleCommand subclass: #HLToggleClassSideCommand
  576. instanceVariableNames: ''
  577. package: 'Helios-Commands-Tools'!
  578. !HLToggleClassSideCommand methodsFor: 'executing'!
  579. execute
  580. self model showInstance: false
  581. ! !
  582. !HLToggleClassSideCommand class methodsFor: 'accessing'!
  583. key
  584. ^ 'c'
  585. !
  586. label
  587. ^ 'Class side'
  588. ! !
  589. HLToggleCommand subclass: #HLToggleInstanceSideCommand
  590. instanceVariableNames: ''
  591. package: 'Helios-Commands-Tools'!
  592. !HLToggleInstanceSideCommand methodsFor: 'executing'!
  593. execute
  594. self model showInstance: true
  595. ! !
  596. !HLToggleInstanceSideCommand class methodsFor: 'accessing'!
  597. key
  598. ^ 'i'
  599. !
  600. label
  601. ^ 'Instance side'
  602. ! !