Helios-Commands-Browser.st 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843
  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: 'defaults'!
  139. defaultInput
  140. ^ self model selectedClass 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. HLBrowserCommand subclass: #HLFindCommand
  164. instanceVariableNames: ''
  165. package: 'Helios-Commands-Browser'!
  166. !HLFindCommand class methodsFor: 'accessing'!
  167. key
  168. ^ 'f'
  169. !
  170. label
  171. ^ 'Find'
  172. ! !
  173. HLFindCommand subclass: #HLFindClassCommand
  174. instanceVariableNames: ''
  175. package: 'Helios-Commands-Browser'!
  176. !HLFindClassCommand methodsFor: 'accessing'!
  177. displayLabel
  178. ^ 'select a class'
  179. !
  180. inputCompletion
  181. ^ self model availableClassNames
  182. !
  183. inputLabel
  184. ^ 'Find a class'
  185. ! !
  186. !HLFindClassCommand methodsFor: 'executing'!
  187. execute
  188. self model openClassNamed: self input
  189. ! !
  190. !HLFindClassCommand methodsFor: 'testing'!
  191. isInputRequired
  192. ^ true
  193. ! !
  194. !HLFindClassCommand class methodsFor: 'accessing'!
  195. key
  196. ^ 'c'
  197. !
  198. label
  199. ^ 'Class'
  200. ! !
  201. HLFindCommand subclass: #HLFindReferencesCommand
  202. instanceVariableNames: ''
  203. package: 'Helios-Commands-Browser'!
  204. !HLFindReferencesCommand methodsFor: 'accessing'!
  205. displayLabel
  206. ^ 'find references'
  207. !
  208. inputCompletion
  209. ^ self model availableClassNames, self model allSelectors
  210. !
  211. inputLabel
  212. ^ 'Find references of'
  213. ! !
  214. !HLFindReferencesCommand methodsFor: 'defaults'!
  215. defaultInput
  216. ^ self model selectedMethod
  217. ifNil: [
  218. self model selectedClass
  219. ifNil: [ '' ]
  220. ifNotNil: [ :class | class name ] ]
  221. ifNotNil: [ :method | method selector ]
  222. ! !
  223. !HLFindReferencesCommand methodsFor: 'executing'!
  224. execute
  225. HLReferences new
  226. open;
  227. search: self input
  228. ! !
  229. !HLFindReferencesCommand methodsFor: 'testing'!
  230. isInputRequired
  231. ^ true
  232. ! !
  233. !HLFindReferencesCommand class methodsFor: 'accessing'!
  234. key
  235. ^ 'r'
  236. !
  237. label
  238. ^ 'References'
  239. ! !
  240. HLBrowserCommand subclass: #HLMoveToCommand
  241. instanceVariableNames: ''
  242. package: 'Helios-Commands-Browser'!
  243. !HLMoveToCommand class methodsFor: 'accessing'!
  244. key
  245. ^ 'm'
  246. !
  247. label
  248. ^ 'Move'
  249. ! !
  250. HLMoveToCommand subclass: #HLMoveClassToCommand
  251. instanceVariableNames: ''
  252. package: 'Helios-Commands-Browser'!
  253. !HLMoveClassToCommand methodsFor: 'testing'!
  254. isActive
  255. ^ self model selectedClass notNil
  256. ! !
  257. !HLMoveClassToCommand class methodsFor: 'accessing'!
  258. key
  259. ^ 'c'
  260. !
  261. label
  262. ^ 'Class'
  263. ! !
  264. HLMoveClassToCommand subclass: #HLMoveClassToPackageCommand
  265. instanceVariableNames: ''
  266. package: 'Helios-Commands-Browser'!
  267. !HLMoveClassToPackageCommand methodsFor: 'accessing'!
  268. category
  269. ^ 'Classes'
  270. !
  271. displayLabel
  272. ^ 'select a package'
  273. !
  274. inputCompletion
  275. ^ self model availablePackageNames
  276. !
  277. inputLabel
  278. ^ 'Move class to package:'
  279. ! !
  280. !HLMoveClassToPackageCommand methodsFor: 'executing'!
  281. execute
  282. self model moveClassToPackage: self input
  283. ! !
  284. !HLMoveClassToPackageCommand methodsFor: 'testing'!
  285. isInputRequired
  286. ^ true
  287. ! !
  288. !HLMoveClassToPackageCommand class methodsFor: 'accessing'!
  289. key
  290. ^ 'p'
  291. !
  292. label
  293. ^ 'to package'
  294. !
  295. menuLabel
  296. ^ 'Move to package...'
  297. ! !
  298. HLMoveToCommand subclass: #HLMoveMethodToCommand
  299. instanceVariableNames: ''
  300. package: 'Helios-Commands-Browser'!
  301. !HLMoveMethodToCommand methodsFor: 'accessing'!
  302. category
  303. ^ 'Methods'
  304. ! !
  305. !HLMoveMethodToCommand methodsFor: 'testing'!
  306. isActive
  307. ^ self model selectedMethod notNil
  308. ! !
  309. !HLMoveMethodToCommand class methodsFor: 'accessing'!
  310. key
  311. ^ 'm'
  312. !
  313. label
  314. ^ 'Method'
  315. ! !
  316. HLMoveMethodToCommand subclass: #HLMoveMethodToClassCommand
  317. instanceVariableNames: ''
  318. package: 'Helios-Commands-Browser'!
  319. !HLMoveMethodToClassCommand methodsFor: 'accessing'!
  320. displayLabel
  321. ^ 'select a class'
  322. !
  323. inputCompletion
  324. ^ self model availableClassNames
  325. !
  326. inputLabel
  327. ^ 'Move method to class:'
  328. ! !
  329. !HLMoveMethodToClassCommand methodsFor: 'executing'!
  330. execute
  331. self model moveMethodToClass: self input
  332. ! !
  333. !HLMoveMethodToClassCommand methodsFor: 'testing'!
  334. isInputRequired
  335. ^ true
  336. ! !
  337. !HLMoveMethodToClassCommand class methodsFor: 'accessing'!
  338. key
  339. ^ 'c'
  340. !
  341. label
  342. ^ 'to class'
  343. !
  344. menuLabel
  345. ^ 'Move to class...'
  346. ! !
  347. HLMoveMethodToCommand subclass: #HLMoveMethodToProtocolCommand
  348. instanceVariableNames: ''
  349. package: 'Helios-Commands-Browser'!
  350. !HLMoveMethodToProtocolCommand methodsFor: 'accessing'!
  351. displayLabel
  352. ^ 'select a protocol'
  353. !
  354. inputCompletion
  355. ^ self model availableProtocols
  356. !
  357. inputLabel
  358. ^ 'Move method to a protocol:'
  359. ! !
  360. !HLMoveMethodToProtocolCommand methodsFor: 'executing'!
  361. execute
  362. self model moveMethodToProtocol: self input
  363. ! !
  364. !HLMoveMethodToProtocolCommand methodsFor: 'testing'!
  365. isInputRequired
  366. ^ true
  367. ! !
  368. !HLMoveMethodToProtocolCommand class methodsFor: 'accessing'!
  369. key
  370. ^ 't'
  371. !
  372. label
  373. ^ 'to protocol'
  374. !
  375. menuLabel
  376. ^ 'Move to protocol...'
  377. ! !
  378. HLBrowserCommand subclass: #HLRemoveCommand
  379. instanceVariableNames: ''
  380. package: 'Helios-Commands-Browser'!
  381. !HLRemoveCommand class methodsFor: 'accessing'!
  382. key
  383. ^ 'x'
  384. !
  385. label
  386. ^ 'Remove'
  387. ! !
  388. HLRemoveCommand subclass: #HLRemoveClassCommand
  389. instanceVariableNames: ''
  390. package: 'Helios-Commands-Browser'!
  391. !HLRemoveClassCommand methodsFor: 'accessing'!
  392. category
  393. ^ 'Classes'
  394. ! !
  395. !HLRemoveClassCommand methodsFor: 'executing'!
  396. execute
  397. self model removeClass
  398. ! !
  399. !HLRemoveClassCommand methodsFor: 'testing'!
  400. isActive
  401. ^ self model selectedClass notNil
  402. ! !
  403. !HLRemoveClassCommand class methodsFor: 'accessing'!
  404. key
  405. ^ 'c'
  406. !
  407. label
  408. ^ 'Class'
  409. !
  410. menuLabel
  411. ^ 'Remove class'
  412. ! !
  413. HLRemoveCommand subclass: #HLRemoveMethodCommand
  414. instanceVariableNames: ''
  415. package: 'Helios-Commands-Browser'!
  416. !HLRemoveMethodCommand methodsFor: 'accessing'!
  417. category
  418. ^ 'Methods'
  419. ! !
  420. !HLRemoveMethodCommand methodsFor: 'executing'!
  421. execute
  422. self model removeMethod
  423. ! !
  424. !HLRemoveMethodCommand methodsFor: 'testing'!
  425. isActive
  426. ^ self model selectedMethod notNil
  427. ! !
  428. !HLRemoveMethodCommand class methodsFor: 'accessing'!
  429. key
  430. ^ 'm'
  431. !
  432. label
  433. ^ 'Method'
  434. !
  435. menuLabel
  436. ^ 'Remove method'
  437. ! !
  438. HLRemoveCommand subclass: #HLRemoveProtocolCommand
  439. instanceVariableNames: ''
  440. package: 'Helios-Commands-Browser'!
  441. !HLRemoveProtocolCommand methodsFor: 'accessing'!
  442. category
  443. ^ 'Protocols'
  444. ! !
  445. !HLRemoveProtocolCommand methodsFor: 'executing'!
  446. execute
  447. self model removeProtocol
  448. ! !
  449. !HLRemoveProtocolCommand methodsFor: 'testing'!
  450. isActive
  451. ^ self model selectedProtocol notNil
  452. ! !
  453. !HLRemoveProtocolCommand class methodsFor: 'accessing'!
  454. key
  455. ^ 't'
  456. !
  457. label
  458. ^ 'Protocol'
  459. !
  460. menuLabel
  461. ^ 'Remove protocol'
  462. ! !
  463. HLBrowserCommand subclass: #HLRenameCommand
  464. instanceVariableNames: ''
  465. package: 'Helios-Commands-Browser'!
  466. !HLRenameCommand class methodsFor: 'accessing'!
  467. key
  468. ^ 'r'
  469. !
  470. label
  471. ^ 'Rename'
  472. ! !
  473. HLRenameCommand subclass: #HLRenameClassCommand
  474. instanceVariableNames: ''
  475. package: 'Helios-Commands-Browser'!
  476. !HLRenameClassCommand methodsFor: 'accessing'!
  477. category
  478. ^ 'Classes'
  479. !
  480. displayLabel
  481. ^ 'Rename class to:'
  482. ! !
  483. !HLRenameClassCommand methodsFor: 'defaults'!
  484. defaultInput
  485. ^ self model selectedClass name
  486. ! !
  487. !HLRenameClassCommand methodsFor: 'executing'!
  488. execute
  489. self model renameClassTo: self input
  490. ! !
  491. !HLRenameClassCommand methodsFor: 'testing'!
  492. isActive
  493. ^ self model selectedClass notNil
  494. !
  495. isInputRequired
  496. ^ true
  497. ! !
  498. !HLRenameClassCommand class methodsFor: 'accessing'!
  499. key
  500. ^ 'c'
  501. !
  502. label
  503. ^ 'Class'
  504. !
  505. menuLabel
  506. ^ 'Rename class...'
  507. ! !
  508. HLRenameCommand subclass: #HLRenameProtocolCommand
  509. instanceVariableNames: ''
  510. package: 'Helios-Commands-Browser'!
  511. !HLRenameProtocolCommand methodsFor: 'accessing'!
  512. category
  513. ^ 'Protocols'
  514. !
  515. displayLabel
  516. ^ 'Rename protocol to:'
  517. ! !
  518. !HLRenameProtocolCommand methodsFor: 'defaults'!
  519. defaultInput
  520. ^ self model selectedProtocol
  521. ! !
  522. !HLRenameProtocolCommand methodsFor: 'executing'!
  523. execute
  524. self model renameProtocolTo: self input
  525. ! !
  526. !HLRenameProtocolCommand methodsFor: 'testing'!
  527. isActive
  528. ^ self model selectedProtocol notNil
  529. !
  530. isInputRequired
  531. ^ true
  532. ! !
  533. !HLRenameProtocolCommand class methodsFor: 'accessing'!
  534. key
  535. ^ 't'
  536. !
  537. label
  538. ^ 'Protocol'
  539. !
  540. menuLabel
  541. ^ 'Rename protocol...'
  542. ! !
  543. HLBrowserCommand subclass: #HLToggleCommand
  544. instanceVariableNames: ''
  545. package: 'Helios-Commands-Browser'!
  546. !HLToggleCommand class methodsFor: 'accessing'!
  547. key
  548. ^ 't'
  549. !
  550. label
  551. ^ 'Toggle'
  552. ! !
  553. HLToggleCommand subclass: #HLToggleClassCommentCommand
  554. instanceVariableNames: ''
  555. package: 'Helios-Commands-Browser'!
  556. !HLToggleClassCommentCommand methodsFor: 'executing'!
  557. execute
  558. self model showComment: true
  559. ! !
  560. !HLToggleClassCommentCommand class methodsFor: 'accessing'!
  561. key
  562. ^ 'd'
  563. !
  564. label
  565. ^ 'Documentation'
  566. ! !
  567. HLToggleCommand subclass: #HLToggleClassSideCommand
  568. instanceVariableNames: ''
  569. package: 'Helios-Commands-Browser'!
  570. !HLToggleClassSideCommand methodsFor: 'executing'!
  571. execute
  572. self model showInstance: false
  573. ! !
  574. !HLToggleClassSideCommand class methodsFor: 'accessing'!
  575. key
  576. ^ 'c'
  577. !
  578. label
  579. ^ 'Class side'
  580. ! !
  581. HLToggleCommand subclass: #HLToggleInstanceSideCommand
  582. instanceVariableNames: ''
  583. package: 'Helios-Commands-Browser'!
  584. !HLToggleInstanceSideCommand methodsFor: 'executing'!
  585. execute
  586. self model showInstance: true
  587. ! !
  588. !HLToggleInstanceSideCommand class methodsFor: 'accessing'!
  589. key
  590. ^ 'i'
  591. !
  592. label
  593. ^ 'Instance side'
  594. ! !