Helios-Commands-Browser.st 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. Smalltalk current createPackage: 'Helios-Commands-Browser'!
  2. HLModelCommand subclass: #HLBrowserCommand
  3. instanceVariableNames: ''
  4. package: 'Helios-Commands-Browser'!
  5. !HLBrowserCommand class methodsFor: 'instance creation'!
  6. for: aBrowserModel
  7. ^ self new
  8. model: aBrowserModel;
  9. yourself
  10. ! !
  11. HLBrowserCommand subclass: #HLBrowserGoToCommand
  12. instanceVariableNames: ''
  13. package: 'Helios-Commands-Browser'!
  14. !HLBrowserGoToCommand class methodsFor: 'accessing'!
  15. key
  16. ^ 71
  17. !
  18. label
  19. ^ 'Go to'
  20. ! !
  21. HLBrowserGoToCommand subclass: #HLGoToClassesCommand
  22. instanceVariableNames: ''
  23. package: 'Helios-Commands-Browser'!
  24. !HLGoToClassesCommand methodsFor: 'executing'!
  25. execute
  26. self model focusOnClasses
  27. ! !
  28. !HLGoToClassesCommand class methodsFor: 'accessing'!
  29. key
  30. "c"
  31. ^ 67
  32. !
  33. label
  34. ^ 'Classes'
  35. ! !
  36. HLBrowserGoToCommand subclass: #HLGoToMethodsCommand
  37. instanceVariableNames: ''
  38. package: 'Helios-Commands-Browser'!
  39. !HLGoToMethodsCommand methodsFor: 'executing'!
  40. execute
  41. self model focusOnMethods
  42. ! !
  43. !HLGoToMethodsCommand class methodsFor: 'accessing'!
  44. key
  45. "m"
  46. ^ 77
  47. !
  48. label
  49. ^ 'Methods'
  50. ! !
  51. HLBrowserGoToCommand subclass: #HLGoToPackagesCommand
  52. instanceVariableNames: ''
  53. package: 'Helios-Commands-Browser'!
  54. !HLGoToPackagesCommand methodsFor: 'executing'!
  55. execute
  56. self model focusOnPackages
  57. ! !
  58. !HLGoToPackagesCommand class methodsFor: 'accessing'!
  59. key
  60. "p"
  61. ^ 80
  62. !
  63. label
  64. ^ 'Packages'
  65. ! !
  66. HLBrowserGoToCommand subclass: #HLGoToProtocolsCommand
  67. instanceVariableNames: ''
  68. package: 'Helios-Commands-Browser'!
  69. !HLGoToProtocolsCommand methodsFor: 'executing'!
  70. execute
  71. self model focusOnProtocols
  72. ! !
  73. !HLGoToProtocolsCommand class methodsFor: 'accessing'!
  74. key
  75. "p"
  76. ^ 84
  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. ^ 83
  92. !
  93. label
  94. ^ 'Source code'
  95. ! !
  96. HLBrowserCommand subclass: #HLCommitPackageCommand
  97. instanceVariableNames: ''
  98. package: 'Helios-Commands-Browser'!
  99. !HLCommitPackageCommand methodsFor: 'executing'!
  100. execute
  101. self model commitPackage
  102. ! !
  103. !HLCommitPackageCommand methodsFor: 'testing'!
  104. isActive
  105. ^ true
  106. " slf model isPackageDirty"
  107. ! !
  108. !HLCommitPackageCommand class methodsFor: 'accessing'!
  109. key
  110. ^ 75
  111. !
  112. label
  113. ^ 'Commit package'
  114. ! !
  115. !HLCommitPackageCommand class methodsFor: 'testing'!
  116. isValidFor: anObject
  117. ^ anObject isPackage
  118. ! !
  119. HLBrowserCommand subclass: #HLFindCommand
  120. instanceVariableNames: ''
  121. package: 'Helios-Commands-Browser'!
  122. !HLFindCommand class methodsFor: 'accessing'!
  123. key
  124. ^ 70
  125. !
  126. label
  127. ^ 'Find'
  128. ! !
  129. HLFindCommand subclass: #HLFindClassCommand
  130. instanceVariableNames: ''
  131. package: 'Helios-Commands-Browser'!
  132. !HLFindClassCommand methodsFor: 'accessing'!
  133. displayLabel
  134. ^ 'select a class'
  135. !
  136. inputCompletion
  137. ^ self model availableClassNames
  138. !
  139. inputLabel
  140. ^ 'Find a class'
  141. ! !
  142. !HLFindClassCommand methodsFor: 'executing'!
  143. execute
  144. self model openClassNamed: self input
  145. ! !
  146. !HLFindClassCommand methodsFor: 'testing'!
  147. isInputRequired
  148. ^ true
  149. ! !
  150. !HLFindClassCommand class methodsFor: 'accessing'!
  151. key
  152. ^ 67
  153. !
  154. label
  155. ^ 'Class'
  156. ! !
  157. HLBrowserCommand subclass: #HLMoveToCommand
  158. instanceVariableNames: ''
  159. package: 'Helios-Commands-Browser'!
  160. !HLMoveToCommand class methodsFor: 'accessing'!
  161. key
  162. ^ 77
  163. !
  164. label
  165. ^ 'Move'
  166. ! !
  167. HLMoveToCommand subclass: #HLMoveClassToCommand
  168. instanceVariableNames: ''
  169. package: 'Helios-Commands-Browser'!
  170. !HLMoveClassToCommand methodsFor: 'testing'!
  171. isActive
  172. ^ self model selectedClass notNil
  173. ! !
  174. !HLMoveClassToCommand class methodsFor: 'accessing'!
  175. key
  176. ^ 67
  177. !
  178. label
  179. ^ 'Class'
  180. ! !
  181. HLMoveClassToCommand subclass: #HLMoveClassCommand
  182. instanceVariableNames: ''
  183. package: 'Helios-Commands-Browser'!
  184. !HLMoveClassCommand methodsFor: 'accessing'!
  185. displayLabel
  186. ^ 'select a package'
  187. !
  188. inputCompletion
  189. ^ self model availablePackageNames
  190. !
  191. inputLabel
  192. ^ 'Move class to package:'
  193. ! !
  194. !HLMoveClassCommand methodsFor: 'executing'!
  195. execute
  196. self model moveClassToPackage: self input
  197. ! !
  198. !HLMoveClassCommand methodsFor: 'testing'!
  199. isInputRequired
  200. ^ true
  201. ! !
  202. !HLMoveClassCommand class methodsFor: 'accessing'!
  203. key
  204. ^ 80
  205. !
  206. label
  207. ^ 'to package'
  208. !
  209. menuLabel
  210. ^ 'Move to package...'
  211. ! !
  212. !HLMoveClassCommand class methodsFor: 'testing'!
  213. isValidFor: anObject
  214. ^ anObject isBehavior
  215. ! !
  216. HLMoveToCommand subclass: #HLMoveMethodToCommand
  217. instanceVariableNames: ''
  218. package: 'Helios-Commands-Browser'!
  219. !HLMoveMethodToCommand methodsFor: 'testing'!
  220. isActive
  221. ^ self model selectedMethod notNil
  222. ! !
  223. !HLMoveMethodToCommand class methodsFor: 'accessing'!
  224. key
  225. ^ 77
  226. !
  227. label
  228. ^ 'Method'
  229. ! !
  230. HLMoveMethodToCommand subclass: #HLMoveMethodToClassCommand
  231. instanceVariableNames: ''
  232. package: 'Helios-Commands-Browser'!
  233. !HLMoveMethodToClassCommand methodsFor: 'accessing'!
  234. displayLabel
  235. ^ 'select a class'
  236. !
  237. inputCompletion
  238. ^ self model availableClassNames
  239. !
  240. inputLabel
  241. ^ 'Move method to class:'
  242. ! !
  243. !HLMoveMethodToClassCommand methodsFor: 'executing'!
  244. execute
  245. self model moveMethodToClass: self input
  246. ! !
  247. !HLMoveMethodToClassCommand methodsFor: 'testing'!
  248. isInputRequired
  249. ^ true
  250. ! !
  251. !HLMoveMethodToClassCommand class methodsFor: 'accessing'!
  252. key
  253. ^ 67
  254. !
  255. label
  256. ^ 'to class'
  257. !
  258. menuLabel
  259. ^ 'Move to class...'
  260. ! !
  261. !HLMoveMethodToClassCommand class methodsFor: 'testing'!
  262. isValidFor: anObject
  263. ^ anObject isCompiledMethod
  264. ! !
  265. HLMoveMethodToCommand subclass: #HLMoveMethodToProtocolCommand
  266. instanceVariableNames: ''
  267. package: 'Helios-Commands-Browser'!
  268. !HLMoveMethodToProtocolCommand methodsFor: 'accessing'!
  269. displayLabel
  270. ^ 'select a protocol'
  271. !
  272. inputCompletion
  273. ^ self model availableProtocols
  274. !
  275. inputLabel
  276. ^ 'Move method to a protocol:'
  277. ! !
  278. !HLMoveMethodToProtocolCommand methodsFor: 'executing'!
  279. execute
  280. self model moveMethodToProtocol: self input
  281. ! !
  282. !HLMoveMethodToProtocolCommand methodsFor: 'testing'!
  283. isInputRequired
  284. ^ true
  285. ! !
  286. !HLMoveMethodToProtocolCommand class methodsFor: 'accessing'!
  287. key
  288. ^ 84
  289. !
  290. label
  291. ^ 'to protocol'
  292. !
  293. menuLabel
  294. ^ 'Move to protocol...'
  295. ! !
  296. !HLMoveMethodToProtocolCommand class methodsFor: 'testing'!
  297. isValidFor: anObject
  298. ^ anObject isCompiledMethod
  299. ! !
  300. HLBrowserCommand subclass: #HLRemoveCommand
  301. instanceVariableNames: ''
  302. package: 'Helios-Commands-Browser'!
  303. !HLRemoveCommand class methodsFor: 'accessing'!
  304. key
  305. ^ 88
  306. !
  307. label
  308. ^ 'Remove'
  309. ! !
  310. HLRemoveCommand subclass: #HLRemoveClassCommand
  311. instanceVariableNames: ''
  312. package: 'Helios-Commands-Browser'!
  313. !HLRemoveClassCommand methodsFor: 'executing'!
  314. execute
  315. self model removeClass
  316. ! !
  317. !HLRemoveClassCommand methodsFor: 'testing'!
  318. isActive
  319. ^ self model selectedClass notNil
  320. ! !
  321. !HLRemoveClassCommand class methodsFor: 'accessing'!
  322. key
  323. ^ 67
  324. !
  325. label
  326. ^ 'Class'
  327. !
  328. menuLabel
  329. ^ 'Remove class'
  330. ! !
  331. !HLRemoveClassCommand class methodsFor: 'testing'!
  332. isValidFor: anObject
  333. ^ anObject isBehavior
  334. ! !
  335. HLRemoveCommand subclass: #HLRemoveMethodCommand
  336. instanceVariableNames: ''
  337. package: 'Helios-Commands-Browser'!
  338. !HLRemoveMethodCommand methodsFor: 'executing'!
  339. execute
  340. self model removeMethod
  341. ! !
  342. !HLRemoveMethodCommand methodsFor: 'testing'!
  343. isActive
  344. ^ self model selectedMethod notNil
  345. ! !
  346. !HLRemoveMethodCommand class methodsFor: 'accessing'!
  347. key
  348. ^ 77
  349. !
  350. label
  351. ^ 'Method'
  352. !
  353. menuLabel
  354. ^ 'Remove method'
  355. ! !
  356. !HLRemoveMethodCommand class methodsFor: 'testing'!
  357. isValidFor: anObject
  358. ^ anObject isCompiledMethod
  359. ! !
  360. HLBrowserCommand subclass: #HLToggleCommand
  361. instanceVariableNames: ''
  362. package: 'Helios-Commands-Browser'!
  363. !HLToggleCommand class methodsFor: 'accessing'!
  364. key
  365. ^ 84
  366. !
  367. label
  368. ^ 'Toggle'
  369. ! !
  370. HLToggleCommand subclass: #HLToggleClassCommentCommand
  371. instanceVariableNames: ''
  372. package: 'Helios-Commands-Browser'!
  373. !HLToggleClassCommentCommand methodsFor: 'executing'!
  374. execute
  375. self model showComment: true
  376. ! !
  377. !HLToggleClassCommentCommand class methodsFor: 'accessing'!
  378. key
  379. "d"
  380. ^ 68
  381. !
  382. label
  383. ^ 'Documentation'
  384. ! !
  385. HLToggleCommand subclass: #HLToggleClassSideCommand
  386. instanceVariableNames: ''
  387. package: 'Helios-Commands-Browser'!
  388. !HLToggleClassSideCommand methodsFor: 'executing'!
  389. execute
  390. self model showInstance: false
  391. ! !
  392. !HLToggleClassSideCommand class methodsFor: 'accessing'!
  393. key
  394. "c"
  395. ^ 67
  396. !
  397. label
  398. ^ 'Class side'
  399. ! !
  400. HLToggleCommand subclass: #HLToggleInstanceSideCommand
  401. instanceVariableNames: ''
  402. package: 'Helios-Commands-Browser'!
  403. !HLToggleInstanceSideCommand methodsFor: 'executing'!
  404. execute
  405. self model showInstance: true
  406. ! !
  407. !HLToggleInstanceSideCommand class methodsFor: 'accessing'!
  408. key
  409. "i"
  410. ^ 73
  411. !
  412. label
  413. ^ 'Instance side'
  414. ! !