Helios-Commands-Browser.st 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290
  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: #HLMoveToCommand
  97. instanceVariableNames: ''
  98. package: 'Helios-Commands-Browser'!
  99. !HLMoveToCommand class methodsFor: 'accessing'!
  100. key
  101. ^ 77
  102. !
  103. label
  104. ^ 'Move'
  105. ! !
  106. HLMoveToCommand subclass: #HLMoveMethodToCommand
  107. instanceVariableNames: ''
  108. package: 'Helios-Commands-Browser'!
  109. !HLMoveMethodToCommand methodsFor: 'accessing'!
  110. activeBlock
  111. ^ [ self model selectedMethod notNil ]
  112. ! !
  113. !HLMoveMethodToCommand class methodsFor: 'accessing'!
  114. key
  115. ^ 77
  116. !
  117. label
  118. ^ 'Method'
  119. ! !
  120. HLMoveMethodToCommand subclass: #HLMoveMethodToClassCommand
  121. instanceVariableNames: ''
  122. package: 'Helios-Commands-Browser'!
  123. !HLMoveMethodToClassCommand class methodsFor: 'accessing'!
  124. key
  125. ^ 67
  126. !
  127. label
  128. ^ 'to class'
  129. ! !
  130. HLMoveMethodToClassCommand subclass: #HLMethodMoveToClassSelectionCommand
  131. instanceVariableNames: ''
  132. package: 'Helios-Commands-Browser'!
  133. !HLMethodMoveToClassSelectionCommand methodsFor: 'actions'!
  134. execute: aClass
  135. self model moveMethodToClass: aClass
  136. ! !
  137. !HLMethodMoveToClassSelectionCommand methodsFor: 'converting'!
  138. asBinding
  139. ^ (HLBindingInput on: self key labelled: self label activeBlock: self activeBlock)
  140. callback: [:ex | self execute: ex ]
  141. ! !
  142. !HLMethodMoveToClassSelectionCommand class methodsFor: 'accessing'!
  143. key
  144. ^ 13 "enter"
  145. !
  146. label
  147. ^ 'select a class'
  148. ! !
  149. HLMoveMethodToCommand subclass: #HLMoveMethodToProtocolCommand
  150. instanceVariableNames: ''
  151. package: 'Helios-Commands-Browser'!
  152. !HLMoveMethodToProtocolCommand methodsFor: 'executing'!
  153. execute
  154. self model moveMethodToProtocol
  155. ! !
  156. !HLMoveMethodToProtocolCommand class methodsFor: 'accessing'!
  157. key
  158. ^ 84
  159. !
  160. label
  161. ^ 'to protocol'
  162. ! !
  163. HLBrowserCommand subclass: #HLToggleCommand
  164. instanceVariableNames: ''
  165. package: 'Helios-Commands-Browser'!
  166. !HLToggleCommand class methodsFor: 'accessing'!
  167. key
  168. ^ 84
  169. !
  170. label
  171. ^ 'Toggle'
  172. ! !
  173. HLToggleCommand subclass: #HLToggleClassSideCommand
  174. instanceVariableNames: ''
  175. package: 'Helios-Commands-Browser'!
  176. !HLToggleClassSideCommand methodsFor: 'executing'!
  177. execute
  178. self model showInstance: false
  179. ! !
  180. !HLToggleClassSideCommand class methodsFor: 'accessing'!
  181. key
  182. "c"
  183. ^ 67
  184. !
  185. label
  186. ^ 'Class side'
  187. ! !
  188. HLToggleCommand subclass: #HLToggleInstanceSideCommand
  189. instanceVariableNames: ''
  190. package: 'Helios-Commands-Browser'!
  191. !HLToggleInstanceSideCommand methodsFor: 'executing'!
  192. execute
  193. self model showInstance: true
  194. ! !
  195. !HLToggleInstanceSideCommand class methodsFor: 'accessing'!
  196. key
  197. "i"
  198. ^ 73
  199. !
  200. label
  201. ^ 'Instance side'
  202. ! !