2
0

Helios-Commands-Tools.st 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. Smalltalk current createPackage: 'Helios-Commands-Tools'!
  2. HLModelCommand subclass: #HLToolCommand
  3. instanceVariableNames: ''
  4. package: 'Helios-Commands-Tools'!
  5. !HLToolCommand methodsFor: 'accessing'!
  6. category
  7. ^ nil
  8. ! !
  9. !HLToolCommand class methodsFor: 'instance creation'!
  10. for: aToolModel
  11. ^ self new
  12. model: aToolModel;
  13. yourself
  14. ! !
  15. !HLToolCommand class methodsFor: 'testing'!
  16. isValidFor: aModel
  17. ^ aModel isToolModel
  18. ! !
  19. HLToolCommand subclass: #HLCommitPackageCommand
  20. instanceVariableNames: ''
  21. package: 'Helios-Commands-Tools'!
  22. !HLCommitPackageCommand methodsFor: 'accessing'!
  23. category
  24. ^ 'Packages'
  25. ! !
  26. !HLCommitPackageCommand methodsFor: 'executing'!
  27. execute
  28. self model commitPackage
  29. ! !
  30. !HLCommitPackageCommand methodsFor: 'testing'!
  31. isActive
  32. ^ true
  33. " slf model isPackageDirty"
  34. ! !
  35. !HLCommitPackageCommand class methodsFor: 'accessing'!
  36. key
  37. ^ 'k'
  38. !
  39. label
  40. ^ 'Commit'
  41. ! !
  42. HLToolCommand subclass: #HLCopyCommand
  43. instanceVariableNames: ''
  44. package: 'Helios-Commands-Tools'!
  45. !HLCopyCommand class methodsFor: 'accessing'!
  46. key
  47. ^ 'c'
  48. !
  49. label
  50. ^ 'Copy'
  51. ! !
  52. HLCopyCommand subclass: #HLCopyClassCommand
  53. instanceVariableNames: ''
  54. package: 'Helios-Commands-Tools'!
  55. !HLCopyClassCommand methodsFor: 'accessing'!
  56. category
  57. ^ 'Classes'
  58. !
  59. displayLabel
  60. ^ 'New class name:'
  61. ! !
  62. !HLCopyClassCommand methodsFor: 'defaults'!
  63. defaultInput
  64. ^ self model selectedClass name
  65. ! !
  66. !HLCopyClassCommand methodsFor: 'executing'!
  67. execute
  68. self model copyClassTo: self input
  69. ! !
  70. !HLCopyClassCommand methodsFor: 'testing'!
  71. isActive
  72. ^ self model selectedClass notNil
  73. !
  74. isInputRequired
  75. ^ true
  76. ! !
  77. !HLCopyClassCommand class methodsFor: 'accessing'!
  78. key
  79. ^ 'c'
  80. !
  81. label
  82. ^ 'Class'
  83. !
  84. menuLabel
  85. ^ 'Copy class...'
  86. ! !
  87. HLToolCommand subclass: #HLFindCommand
  88. instanceVariableNames: ''
  89. package: 'Helios-Commands-Tools'!
  90. !HLFindCommand class methodsFor: 'accessing'!
  91. key
  92. ^ 'f'
  93. !
  94. label
  95. ^ 'Find'
  96. ! !
  97. HLFindCommand subclass: #HLFindClassCommand
  98. instanceVariableNames: ''
  99. package: 'Helios-Commands-Tools'!
  100. !HLFindClassCommand methodsFor: 'accessing'!
  101. displayLabel
  102. ^ 'select a class'
  103. !
  104. inputCompletion
  105. ^ self model availableClassNames
  106. !
  107. inputLabel
  108. ^ 'Find a class'
  109. ! !
  110. !HLFindClassCommand methodsFor: 'executing'!
  111. execute
  112. self model openClassNamed: self input
  113. ! !
  114. !HLFindClassCommand methodsFor: 'testing'!
  115. isInputRequired
  116. ^ true
  117. ! !
  118. !HLFindClassCommand class methodsFor: 'accessing'!
  119. key
  120. ^ 'c'
  121. !
  122. label
  123. ^ 'Class'
  124. ! !
  125. HLFindCommand subclass: #HLFindReferencesCommand
  126. instanceVariableNames: ''
  127. package: 'Helios-Commands-Tools'!
  128. !HLFindReferencesCommand methodsFor: 'accessing'!
  129. displayLabel
  130. ^ 'find references'
  131. !
  132. inputCompletion
  133. ^ self model availableClassNames, self model allSelectors
  134. !
  135. inputLabel
  136. ^ 'Find references of'
  137. ! !
  138. !HLFindReferencesCommand methodsFor: 'defaults'!
  139. defaultInput
  140. ^ self model selectedMethod
  141. ifNil: [
  142. self model selectedClass
  143. ifNil: [ '' ]
  144. ifNotNil: [ :class | class name ] ]
  145. ifNotNil: [ :method | method selector ]
  146. ! !
  147. !HLFindReferencesCommand methodsFor: 'executing'!
  148. execute
  149. HLReferences new
  150. open;
  151. search: self input
  152. ! !
  153. !HLFindReferencesCommand methodsFor: 'testing'!
  154. isInputRequired
  155. ^ true
  156. ! !
  157. !HLFindReferencesCommand class methodsFor: 'accessing'!
  158. key
  159. ^ 'r'
  160. !
  161. label
  162. ^ 'References'
  163. ! !
  164. HLToolCommand subclass: #HLMoveToCommand
  165. instanceVariableNames: ''
  166. package: 'Helios-Commands-Tools'!
  167. !HLMoveToCommand class methodsFor: 'accessing'!
  168. key
  169. ^ 'm'
  170. !
  171. label
  172. ^ 'Move'
  173. ! !
  174. HLMoveToCommand subclass: #HLMoveClassToCommand
  175. instanceVariableNames: ''
  176. package: 'Helios-Commands-Tools'!
  177. !HLMoveClassToCommand methodsFor: 'testing'!
  178. isActive
  179. ^ self model selectedClass notNil
  180. ! !
  181. !HLMoveClassToCommand class methodsFor: 'accessing'!
  182. key
  183. ^ 'c'
  184. !
  185. label
  186. ^ 'Class'
  187. ! !
  188. HLMoveClassToCommand subclass: #HLMoveClassToPackageCommand
  189. instanceVariableNames: ''
  190. package: 'Helios-Commands-Tools'!
  191. !HLMoveClassToPackageCommand methodsFor: 'accessing'!
  192. category
  193. ^ 'Classes'
  194. !
  195. displayLabel
  196. ^ 'select a package'
  197. !
  198. inputCompletion
  199. ^ self model availablePackageNames
  200. !
  201. inputLabel
  202. ^ 'Move class to package:'
  203. ! !
  204. !HLMoveClassToPackageCommand methodsFor: 'executing'!
  205. execute
  206. self model moveClassToPackage: self input
  207. ! !
  208. !HLMoveClassToPackageCommand methodsFor: 'testing'!
  209. isInputRequired
  210. ^ true
  211. ! !
  212. !HLMoveClassToPackageCommand class methodsFor: 'accessing'!
  213. key
  214. ^ 'p'
  215. !
  216. label
  217. ^ 'to package'
  218. !
  219. menuLabel
  220. ^ 'Move to package...'
  221. ! !
  222. HLMoveToCommand subclass: #HLMoveMethodToCommand
  223. instanceVariableNames: ''
  224. package: 'Helios-Commands-Tools'!
  225. !HLMoveMethodToCommand methodsFor: 'accessing'!
  226. category
  227. ^ 'Methods'
  228. ! !
  229. !HLMoveMethodToCommand methodsFor: 'testing'!
  230. isActive
  231. ^ self model selectedMethod notNil
  232. ! !
  233. !HLMoveMethodToCommand class methodsFor: 'accessing'!
  234. key
  235. ^ 'm'
  236. !
  237. label
  238. ^ 'Method'
  239. ! !
  240. HLMoveMethodToCommand subclass: #HLMoveMethodToClassCommand
  241. instanceVariableNames: ''
  242. package: 'Helios-Commands-Tools'!
  243. !HLMoveMethodToClassCommand methodsFor: 'accessing'!
  244. displayLabel
  245. ^ 'select a class'
  246. !
  247. inputCompletion
  248. ^ self model availableClassNames
  249. !
  250. inputLabel
  251. ^ 'Move method to class:'
  252. ! !
  253. !HLMoveMethodToClassCommand methodsFor: 'executing'!
  254. execute
  255. self model moveMethodToClass: self input
  256. ! !
  257. !HLMoveMethodToClassCommand methodsFor: 'testing'!
  258. isInputRequired
  259. ^ true
  260. ! !
  261. !HLMoveMethodToClassCommand class methodsFor: 'accessing'!
  262. key
  263. ^ 'c'
  264. !
  265. label
  266. ^ 'to class'
  267. !
  268. menuLabel
  269. ^ 'Move to class...'
  270. ! !
  271. HLMoveMethodToCommand subclass: #HLMoveMethodToProtocolCommand
  272. instanceVariableNames: ''
  273. package: 'Helios-Commands-Tools'!
  274. !HLMoveMethodToProtocolCommand methodsFor: 'accessing'!
  275. displayLabel
  276. ^ 'select a protocol'
  277. !
  278. inputCompletion
  279. ^ self model availableProtocols
  280. !
  281. inputLabel
  282. ^ 'Move method to a protocol:'
  283. ! !
  284. !HLMoveMethodToProtocolCommand methodsFor: 'executing'!
  285. execute
  286. self model moveMethodToProtocol: self input
  287. ! !
  288. !HLMoveMethodToProtocolCommand methodsFor: 'testing'!
  289. isInputRequired
  290. ^ true
  291. ! !
  292. !HLMoveMethodToProtocolCommand class methodsFor: 'accessing'!
  293. key
  294. ^ 't'
  295. !
  296. label
  297. ^ 'to protocol'
  298. !
  299. menuLabel
  300. ^ 'Move to protocol...'
  301. ! !
  302. HLToolCommand subclass: #HLRemoveCommand
  303. instanceVariableNames: ''
  304. package: 'Helios-Commands-Tools'!
  305. !HLRemoveCommand class methodsFor: 'accessing'!
  306. key
  307. ^ 'x'
  308. !
  309. label
  310. ^ 'Remove'
  311. ! !
  312. HLRemoveCommand subclass: #HLRemoveClassCommand
  313. instanceVariableNames: ''
  314. package: 'Helios-Commands-Tools'!
  315. !HLRemoveClassCommand methodsFor: 'accessing'!
  316. category
  317. ^ 'Classes'
  318. ! !
  319. !HLRemoveClassCommand methodsFor: 'executing'!
  320. execute
  321. self model removeClass
  322. ! !
  323. !HLRemoveClassCommand methodsFor: 'testing'!
  324. isActive
  325. ^ self model selectedClass notNil
  326. ! !
  327. !HLRemoveClassCommand class methodsFor: 'accessing'!
  328. key
  329. ^ 'c'
  330. !
  331. label
  332. ^ 'Class'
  333. !
  334. menuLabel
  335. ^ 'Remove class'
  336. ! !
  337. HLRemoveCommand subclass: #HLRemoveMethodCommand
  338. instanceVariableNames: ''
  339. package: 'Helios-Commands-Tools'!
  340. !HLRemoveMethodCommand methodsFor: 'accessing'!
  341. category
  342. ^ 'Methods'
  343. ! !
  344. !HLRemoveMethodCommand methodsFor: 'executing'!
  345. execute
  346. self model removeMethod
  347. ! !
  348. !HLRemoveMethodCommand methodsFor: 'testing'!
  349. isActive
  350. ^ self model selectedMethod notNil
  351. ! !
  352. !HLRemoveMethodCommand class methodsFor: 'accessing'!
  353. key
  354. ^ 'm'
  355. !
  356. label
  357. ^ 'Method'
  358. !
  359. menuLabel
  360. ^ 'Remove method'
  361. ! !
  362. HLRemoveCommand subclass: #HLRemoveProtocolCommand
  363. instanceVariableNames: ''
  364. package: 'Helios-Commands-Tools'!
  365. !HLRemoveProtocolCommand methodsFor: 'accessing'!
  366. category
  367. ^ 'Protocols'
  368. ! !
  369. !HLRemoveProtocolCommand methodsFor: 'executing'!
  370. execute
  371. self model removeProtocol
  372. ! !
  373. !HLRemoveProtocolCommand methodsFor: 'testing'!
  374. isActive
  375. ^ self model selectedProtocol notNil
  376. ! !
  377. !HLRemoveProtocolCommand class methodsFor: 'accessing'!
  378. key
  379. ^ 't'
  380. !
  381. label
  382. ^ 'Protocol'
  383. !
  384. menuLabel
  385. ^ 'Remove protocol'
  386. ! !
  387. HLToolCommand subclass: #HLRenameCommand
  388. instanceVariableNames: ''
  389. package: 'Helios-Commands-Tools'!
  390. !HLRenameCommand class methodsFor: 'accessing'!
  391. key
  392. ^ 'r'
  393. !
  394. label
  395. ^ 'Rename'
  396. ! !
  397. HLRenameCommand subclass: #HLRenameClassCommand
  398. instanceVariableNames: ''
  399. package: 'Helios-Commands-Tools'!
  400. !HLRenameClassCommand methodsFor: 'accessing'!
  401. category
  402. ^ 'Classes'
  403. !
  404. displayLabel
  405. ^ 'Rename class to:'
  406. ! !
  407. !HLRenameClassCommand methodsFor: 'defaults'!
  408. defaultInput
  409. ^ self model selectedClass name
  410. ! !
  411. !HLRenameClassCommand methodsFor: 'executing'!
  412. execute
  413. self model renameClassTo: self input
  414. ! !
  415. !HLRenameClassCommand methodsFor: 'testing'!
  416. isActive
  417. ^ self model selectedClass notNil
  418. !
  419. isInputRequired
  420. ^ true
  421. ! !
  422. !HLRenameClassCommand class methodsFor: 'accessing'!
  423. key
  424. ^ 'c'
  425. !
  426. label
  427. ^ 'Class'
  428. !
  429. menuLabel
  430. ^ 'Rename class...'
  431. ! !
  432. HLRenameCommand subclass: #HLRenameProtocolCommand
  433. instanceVariableNames: ''
  434. package: 'Helios-Commands-Tools'!
  435. !HLRenameProtocolCommand methodsFor: 'accessing'!
  436. category
  437. ^ 'Protocols'
  438. !
  439. displayLabel
  440. ^ 'Rename protocol to:'
  441. ! !
  442. !HLRenameProtocolCommand methodsFor: 'defaults'!
  443. defaultInput
  444. ^ self model selectedProtocol
  445. ! !
  446. !HLRenameProtocolCommand methodsFor: 'executing'!
  447. execute
  448. self model renameProtocolTo: self input
  449. ! !
  450. !HLRenameProtocolCommand methodsFor: 'testing'!
  451. isActive
  452. ^ self model selectedProtocol notNil
  453. !
  454. isInputRequired
  455. ^ true
  456. ! !
  457. !HLRenameProtocolCommand class methodsFor: 'accessing'!
  458. key
  459. ^ 't'
  460. !
  461. label
  462. ^ 'Protocol'
  463. !
  464. menuLabel
  465. ^ 'Rename protocol...'
  466. ! !