1
0

Helios-Commands-Browser.st 10 KB

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