Helios-Commands-Browser.st 10 KB

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