Helios-Commands-Browser.st 10 KB

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