Helios-Commands-Browser.st 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  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. !HLCommitPackageCommand class methodsFor: 'testing'!
  119. isValidFor: anObject
  120. ^ anObject isPackage
  121. ! !
  122. HLBrowserCommand subclass: #HLCopyCommand
  123. instanceVariableNames: ''
  124. package: 'Helios-Commands-Browser'!
  125. !HLCopyCommand class methodsFor: 'accessing'!
  126. key
  127. ^ 'c'
  128. !
  129. label
  130. ^ 'Copy'
  131. ! !
  132. HLCopyCommand subclass: #HLCopyClassCommand
  133. instanceVariableNames: ''
  134. package: 'Helios-Commands-Browser'!
  135. !HLCopyClassCommand methodsFor: 'accessing'!
  136. category
  137. ^ 'Classes'
  138. !
  139. displayLabel
  140. ^ 'New class name:'
  141. ! !
  142. !HLCopyClassCommand methodsFor: 'executing'!
  143. execute
  144. self model copyClassTo: self input
  145. ! !
  146. !HLCopyClassCommand methodsFor: 'testing'!
  147. isActive
  148. ^ self model selectedClass notNil
  149. !
  150. isInputRequired
  151. ^ true
  152. ! !
  153. !HLCopyClassCommand class methodsFor: 'accessing'!
  154. key
  155. ^ 'c'
  156. !
  157. label
  158. ^ 'Class'
  159. !
  160. menuLabel
  161. ^ 'Copy class...'
  162. ! !
  163. !HLCopyClassCommand class methodsFor: 'testing'!
  164. isValidFor: anObject
  165. ^ anObject isBehavior
  166. ! !
  167. HLBrowserCommand subclass: #HLFindCommand
  168. instanceVariableNames: ''
  169. package: 'Helios-Commands-Browser'!
  170. !HLFindCommand class methodsFor: 'accessing'!
  171. key
  172. ^ 'f'
  173. !
  174. label
  175. ^ 'Find'
  176. ! !
  177. HLFindCommand subclass: #HLFindClassCommand
  178. instanceVariableNames: ''
  179. package: 'Helios-Commands-Browser'!
  180. !HLFindClassCommand methodsFor: 'accessing'!
  181. displayLabel
  182. ^ 'select a class'
  183. !
  184. inputCompletion
  185. ^ self model availableClassNames
  186. !
  187. inputLabel
  188. ^ 'Find a class'
  189. ! !
  190. !HLFindClassCommand methodsFor: 'executing'!
  191. execute
  192. self model openClassNamed: self input
  193. ! !
  194. !HLFindClassCommand methodsFor: 'testing'!
  195. isInputRequired
  196. ^ true
  197. ! !
  198. !HLFindClassCommand class methodsFor: 'accessing'!
  199. key
  200. ^ 'c'
  201. !
  202. label
  203. ^ 'Class'
  204. ! !
  205. HLBrowserCommand subclass: #HLMoveToCommand
  206. instanceVariableNames: ''
  207. package: 'Helios-Commands-Browser'!
  208. !HLMoveToCommand class methodsFor: 'accessing'!
  209. key
  210. ^ 'm'
  211. !
  212. label
  213. ^ 'Move'
  214. ! !
  215. HLMoveToCommand subclass: #HLMoveClassToCommand
  216. instanceVariableNames: ''
  217. package: 'Helios-Commands-Browser'!
  218. !HLMoveClassToCommand methodsFor: 'testing'!
  219. isActive
  220. ^ self model selectedClass notNil
  221. ! !
  222. !HLMoveClassToCommand class methodsFor: 'accessing'!
  223. key
  224. ^ 'c'
  225. !
  226. label
  227. ^ 'Class'
  228. ! !
  229. HLMoveClassToCommand subclass: #HLMoveClassToPackageCommand
  230. instanceVariableNames: ''
  231. package: 'Helios-Commands-Browser'!
  232. !HLMoveClassToPackageCommand methodsFor: 'accessing'!
  233. category
  234. ^ 'Classes'
  235. !
  236. displayLabel
  237. ^ 'select a package'
  238. !
  239. inputCompletion
  240. ^ self model availablePackageNames
  241. !
  242. inputLabel
  243. ^ 'Move class to package:'
  244. ! !
  245. !HLMoveClassToPackageCommand methodsFor: 'executing'!
  246. execute
  247. self model moveClassToPackage: self input
  248. ! !
  249. !HLMoveClassToPackageCommand methodsFor: 'testing'!
  250. isInputRequired
  251. ^ true
  252. ! !
  253. !HLMoveClassToPackageCommand class methodsFor: 'accessing'!
  254. key
  255. ^ 'p'
  256. !
  257. label
  258. ^ 'to package'
  259. !
  260. menuLabel
  261. ^ 'Move to package...'
  262. ! !
  263. !HLMoveClassToPackageCommand class methodsFor: 'testing'!
  264. isValidFor: anObject
  265. ^ anObject isBehavior
  266. ! !
  267. HLMoveToCommand subclass: #HLMoveMethodToCommand
  268. instanceVariableNames: ''
  269. package: 'Helios-Commands-Browser'!
  270. !HLMoveMethodToCommand methodsFor: 'accessing'!
  271. category
  272. ^ 'Methods'
  273. ! !
  274. !HLMoveMethodToCommand methodsFor: 'testing'!
  275. isActive
  276. ^ self model selectedMethod notNil
  277. ! !
  278. !HLMoveMethodToCommand class methodsFor: 'accessing'!
  279. key
  280. ^ 'm'
  281. !
  282. label
  283. ^ 'Method'
  284. ! !
  285. HLMoveMethodToCommand subclass: #HLMoveMethodToClassCommand
  286. instanceVariableNames: ''
  287. package: 'Helios-Commands-Browser'!
  288. !HLMoveMethodToClassCommand methodsFor: 'accessing'!
  289. displayLabel
  290. ^ 'select a class'
  291. !
  292. inputCompletion
  293. ^ self model availableClassNames
  294. !
  295. inputLabel
  296. ^ 'Move method to class:'
  297. ! !
  298. !HLMoveMethodToClassCommand methodsFor: 'executing'!
  299. execute
  300. self model moveMethodToClass: self input
  301. ! !
  302. !HLMoveMethodToClassCommand methodsFor: 'testing'!
  303. isInputRequired
  304. ^ true
  305. ! !
  306. !HLMoveMethodToClassCommand class methodsFor: 'accessing'!
  307. key
  308. ^ 'c'
  309. !
  310. label
  311. ^ 'to class'
  312. !
  313. menuLabel
  314. ^ 'Move to class...'
  315. ! !
  316. !HLMoveMethodToClassCommand class methodsFor: 'testing'!
  317. isValidFor: anObject
  318. ^ anObject isCompiledMethod
  319. ! !
  320. HLMoveMethodToCommand subclass: #HLMoveMethodToProtocolCommand
  321. instanceVariableNames: ''
  322. package: 'Helios-Commands-Browser'!
  323. !HLMoveMethodToProtocolCommand methodsFor: 'accessing'!
  324. displayLabel
  325. ^ 'select a protocol'
  326. !
  327. inputCompletion
  328. ^ self model availableProtocols
  329. !
  330. inputLabel
  331. ^ 'Move method to a protocol:'
  332. ! !
  333. !HLMoveMethodToProtocolCommand methodsFor: 'executing'!
  334. execute
  335. self model moveMethodToProtocol: self input
  336. ! !
  337. !HLMoveMethodToProtocolCommand methodsFor: 'testing'!
  338. isInputRequired
  339. ^ true
  340. ! !
  341. !HLMoveMethodToProtocolCommand class methodsFor: 'accessing'!
  342. key
  343. ^ 't'
  344. !
  345. label
  346. ^ 'to protocol'
  347. !
  348. menuLabel
  349. ^ 'Move to protocol...'
  350. ! !
  351. !HLMoveMethodToProtocolCommand class methodsFor: 'testing'!
  352. isValidFor: anObject
  353. ^ anObject isCompiledMethod
  354. ! !
  355. HLBrowserCommand subclass: #HLRemoveCommand
  356. instanceVariableNames: ''
  357. package: 'Helios-Commands-Browser'!
  358. !HLRemoveCommand class methodsFor: 'accessing'!
  359. key
  360. ^ 'x'
  361. !
  362. label
  363. ^ 'Remove'
  364. ! !
  365. HLRemoveCommand subclass: #HLRemoveClassCommand
  366. instanceVariableNames: ''
  367. package: 'Helios-Commands-Browser'!
  368. !HLRemoveClassCommand methodsFor: 'accessing'!
  369. category
  370. ^ 'Classes'
  371. ! !
  372. !HLRemoveClassCommand methodsFor: 'executing'!
  373. execute
  374. self model removeClass
  375. ! !
  376. !HLRemoveClassCommand methodsFor: 'testing'!
  377. isActive
  378. ^ self model selectedClass notNil
  379. ! !
  380. !HLRemoveClassCommand class methodsFor: 'accessing'!
  381. key
  382. ^ 'c'
  383. !
  384. label
  385. ^ 'Class'
  386. !
  387. menuLabel
  388. ^ 'Remove class'
  389. ! !
  390. !HLRemoveClassCommand class methodsFor: 'testing'!
  391. isValidFor: anObject
  392. ^ anObject isBehavior
  393. ! !
  394. HLRemoveCommand subclass: #HLRemoveMethodCommand
  395. instanceVariableNames: ''
  396. package: 'Helios-Commands-Browser'!
  397. !HLRemoveMethodCommand methodsFor: 'accessing'!
  398. category
  399. ^ 'Methods'
  400. ! !
  401. !HLRemoveMethodCommand methodsFor: 'executing'!
  402. execute
  403. self model removeMethod
  404. ! !
  405. !HLRemoveMethodCommand methodsFor: 'testing'!
  406. isActive
  407. ^ self model selectedMethod notNil
  408. ! !
  409. !HLRemoveMethodCommand class methodsFor: 'accessing'!
  410. key
  411. ^ 'm'
  412. !
  413. label
  414. ^ 'Method'
  415. !
  416. menuLabel
  417. ^ 'Remove method'
  418. ! !
  419. !HLRemoveMethodCommand class methodsFor: 'testing'!
  420. isValidFor: anObject
  421. ^ anObject isCompiledMethod
  422. ! !
  423. HLBrowserCommand subclass: #HLRenameCommand
  424. instanceVariableNames: ''
  425. package: 'Helios-Commands-Browser'!
  426. !HLRenameCommand class methodsFor: 'accessing'!
  427. key
  428. ^ 'r'
  429. !
  430. label
  431. ^ 'Rename'
  432. ! !
  433. HLRenameCommand subclass: #HLRenameClassCommand
  434. instanceVariableNames: ''
  435. package: 'Helios-Commands-Browser'!
  436. !HLRenameClassCommand methodsFor: 'accessing'!
  437. category
  438. ^ 'Classes'
  439. !
  440. displayLabel
  441. ^ 'Rename class to:'
  442. ! !
  443. !HLRenameClassCommand methodsFor: 'executing'!
  444. execute
  445. self model renameClassTo: self input
  446. ! !
  447. !HLRenameClassCommand methodsFor: 'testing'!
  448. isActive
  449. ^ self model selectedClass notNil
  450. !
  451. isInputRequired
  452. ^ true
  453. ! !
  454. !HLRenameClassCommand class methodsFor: 'accessing'!
  455. key
  456. ^ 'm'
  457. !
  458. label
  459. ^ 'Class'
  460. !
  461. menuLabel
  462. ^ 'Rename class...'
  463. ! !
  464. !HLRenameClassCommand class methodsFor: 'testing'!
  465. isValidFor: anObject
  466. ^ anObject isBehavior
  467. ! !
  468. HLBrowserCommand subclass: #HLToggleCommand
  469. instanceVariableNames: ''
  470. package: 'Helios-Commands-Browser'!
  471. !HLToggleCommand class methodsFor: 'accessing'!
  472. key
  473. ^ 't'
  474. !
  475. label
  476. ^ 'Toggle'
  477. ! !
  478. HLToggleCommand subclass: #HLToggleClassCommentCommand
  479. instanceVariableNames: ''
  480. package: 'Helios-Commands-Browser'!
  481. !HLToggleClassCommentCommand methodsFor: 'executing'!
  482. execute
  483. self model showComment: true
  484. ! !
  485. !HLToggleClassCommentCommand class methodsFor: 'accessing'!
  486. key
  487. ^ 'd'
  488. !
  489. label
  490. ^ 'Documentation'
  491. ! !
  492. HLToggleCommand subclass: #HLToggleClassSideCommand
  493. instanceVariableNames: ''
  494. package: 'Helios-Commands-Browser'!
  495. !HLToggleClassSideCommand methodsFor: 'executing'!
  496. execute
  497. self model showInstance: false
  498. ! !
  499. !HLToggleClassSideCommand class methodsFor: 'accessing'!
  500. key
  501. ^ 'c'
  502. !
  503. label
  504. ^ 'Class side'
  505. ! !
  506. HLToggleCommand subclass: #HLToggleInstanceSideCommand
  507. instanceVariableNames: ''
  508. package: 'Helios-Commands-Browser'!
  509. !HLToggleInstanceSideCommand methodsFor: 'executing'!
  510. execute
  511. self model showInstance: true
  512. ! !
  513. !HLToggleInstanceSideCommand class methodsFor: 'accessing'!
  514. key
  515. ^ 'i'
  516. !
  517. label
  518. ^ 'Instance side'
  519. ! !