1
0

Helios-Commands-Core.st 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. Smalltalk current createPackage: 'Helios-Commands-Core'!
  2. Object subclass: #HLCommand
  3. instanceVariableNames: ''
  4. package: 'Helios-Commands-Core'!
  5. !HLCommand methodsFor: 'accessing'!
  6. documentation
  7. ^ self class documentation
  8. !
  9. key
  10. ^ self class key
  11. !
  12. label
  13. ^ self class label
  14. ! !
  15. !HLCommand methodsFor: 'converting'!
  16. asActionBinding
  17. ^ (HLBindingAction on: self key labelled: self label)
  18. callback: [ self execute ]
  19. !
  20. asBinding
  21. ^ self isBindingGroup
  22. ifTrue: [ self asGroupBinding ]
  23. ifFalse: [ self asActionBinding ]
  24. !
  25. asGroupBinding
  26. ^ HLBindingGroup
  27. on: self key
  28. labelled: self label
  29. ! !
  30. !HLCommand methodsFor: 'executing'!
  31. execute
  32. ! !
  33. !HLCommand methodsFor: 'registration'!
  34. registerOn: aBinding
  35. ^ aBinding add: self asBinding
  36. ! !
  37. !HLCommand methodsFor: 'testing'!
  38. isBindingGroup
  39. ^ (self class methodDictionary includesKey: 'execute') not
  40. ! !
  41. !HLCommand class methodsFor: 'accessing'!
  42. concreteSubclasses
  43. ^ self subclasses select: [ :each |
  44. each isConcrete ]
  45. !
  46. documentation
  47. ^ ''
  48. !
  49. key
  50. ^ nil
  51. !
  52. label
  53. ^ ''
  54. ! !
  55. !HLCommand class methodsFor: 'registration'!
  56. registerConcreteClassesOn: aBinding
  57. self concreteSubclasses do: [ :each | | binding |
  58. binding := each registerOn: aBinding.
  59. binding isBindingGroup ifTrue: [
  60. each registerConcreteClassesOn: binding ] ]
  61. !
  62. registerOn: aBinding
  63. ^ self new registerOn: aBinding
  64. ! !
  65. !HLCommand class methodsFor: 'testing'!
  66. isConcrete
  67. ^ self key notNil
  68. ! !
  69. HLCommand subclass: #HLCloseTabCommand
  70. instanceVariableNames: ''
  71. package: 'Helios-Commands-Core'!
  72. !HLCloseTabCommand methodsFor: 'executing'!
  73. execute
  74. HLManager current removeActiveTab
  75. ! !
  76. !HLCloseTabCommand class methodsFor: 'accessing'!
  77. key
  78. ^ 87
  79. !
  80. label
  81. ^ 'Close tab'
  82. ! !
  83. HLCommand subclass: #HLModelCommand
  84. instanceVariableNames: 'model'
  85. package: 'Helios-Commands-Core'!
  86. !HLModelCommand methodsFor: 'accessing'!
  87. model
  88. ^ model
  89. !
  90. model: aModel
  91. model := aModel
  92. ! !
  93. !HLModelCommand class methodsFor: 'instance creation'!
  94. for: aModel
  95. ^ self new
  96. ! !
  97. !HLModelCommand class methodsFor: 'registration'!
  98. registerConcreteClassesOn: aBinding for: aModel
  99. self concreteSubclasses do: [ :each | | binding |
  100. binding := each registerOn: aBinding for: aModel.
  101. binding isBindingGroup ifTrue: [
  102. each registerConcreteClassesOn: binding for: aModel ] ]
  103. !
  104. registerOn: aBinding for: aModel
  105. ^ (self for: aModel) registerOn: aBinding
  106. ! !
  107. HLModelCommand subclass: #HLBrowserCommand
  108. instanceVariableNames: ''
  109. package: 'Helios-Commands-Browser'!
  110. !HLBrowserCommand class methodsFor: 'instance creation'!
  111. for: aBrowserModel
  112. ^ self new
  113. model: aBrowserModel;
  114. yourself
  115. ! !
  116. HLBrowserCommand subclass: #HLBrowserGoToCommand
  117. instanceVariableNames: ''
  118. package: 'Helios-Commands-Browser'!
  119. !HLBrowserGoToCommand class methodsFor: 'accessing'!
  120. key
  121. ^ 71
  122. !
  123. label
  124. ^ 'Go to'
  125. ! !
  126. HLBrowserGoToCommand subclass: #HLGoToClassesCommand
  127. instanceVariableNames: ''
  128. package: 'Helios-Commands-Browser'!
  129. !HLGoToClassesCommand methodsFor: 'executing'!
  130. execute
  131. self model focusOnClasses
  132. ! !
  133. !HLGoToClassesCommand class methodsFor: 'accessing'!
  134. key
  135. "c"
  136. ^ 67
  137. !
  138. label
  139. ^ 'Classes'
  140. ! !
  141. HLBrowserGoToCommand subclass: #HLGoToMethodsCommand
  142. instanceVariableNames: ''
  143. package: 'Helios-Commands-Browser'!
  144. !HLGoToMethodsCommand methodsFor: 'executing'!
  145. execute
  146. self model focusOnMethods
  147. ! !
  148. !HLGoToMethodsCommand class methodsFor: 'accessing'!
  149. key
  150. "m"
  151. ^ 77
  152. !
  153. label
  154. ^ 'Methods'
  155. ! !
  156. HLBrowserGoToCommand subclass: #HLGoToPackagesCommand
  157. instanceVariableNames: ''
  158. package: 'Helios-Commands-Browser'!
  159. !HLGoToPackagesCommand methodsFor: 'executing'!
  160. execute
  161. self model focusOnPackages
  162. ! !
  163. !HLGoToPackagesCommand class methodsFor: 'accessing'!
  164. key
  165. "p"
  166. ^ 80
  167. !
  168. label
  169. ^ 'Packages'
  170. ! !
  171. HLBrowserGoToCommand subclass: #HLGoToProtocolsCommand
  172. instanceVariableNames: ''
  173. package: 'Helios-Commands-Browser'!
  174. !HLGoToProtocolsCommand methodsFor: 'executing'!
  175. execute
  176. self model focusOnProtocols
  177. ! !
  178. !HLGoToProtocolsCommand class methodsFor: 'accessing'!
  179. key
  180. "p"
  181. ^ 84
  182. !
  183. label
  184. ^ 'Protocols'
  185. ! !
  186. HLBrowserGoToCommand subclass: #HLGoToSourceCodeCommand
  187. instanceVariableNames: ''
  188. package: 'Helios-Commands-Browser'!
  189. !HLGoToSourceCodeCommand methodsFor: 'executing'!
  190. execute
  191. self model focusOnSourceCode
  192. ! !
  193. !HLGoToSourceCodeCommand class methodsFor: 'accessing'!
  194. key
  195. "s"
  196. ^ 83
  197. !
  198. label
  199. ^ 'Source code'
  200. ! !
  201. HLBrowserCommand subclass: #HLMoveToCommand
  202. instanceVariableNames: ''
  203. package: 'Helios-Commands-Browser'!
  204. !HLMoveToCommand class methodsFor: 'accessing'!
  205. key
  206. ^ 77
  207. !
  208. label
  209. ^ 'Move'
  210. ! !
  211. HLMoveToCommand subclass: #HLMoveMethodToCommand
  212. instanceVariableNames: ''
  213. package: 'Helios-Commands-Browser'!
  214. !HLMoveMethodToCommand class methodsFor: 'accessing'!
  215. key
  216. ^ 77
  217. !
  218. label
  219. ^ 'Method'
  220. ! !
  221. HLMoveMethodToCommand subclass: #HLMoveMethodToClassCommand
  222. instanceVariableNames: ''
  223. package: 'Helios-Commands-Browser'!
  224. !HLMoveMethodToClassCommand methodsFor: 'executing'!
  225. execute
  226. ! !
  227. !HLMoveMethodToClassCommand class methodsFor: 'accessing'!
  228. key
  229. ^ 67
  230. !
  231. label
  232. ^ 'to class'
  233. ! !
  234. HLMoveMethodToCommand subclass: #HLMoveMethodToProtocolCommand
  235. instanceVariableNames: ''
  236. package: 'Helios-Commands-Browser'!
  237. !HLMoveMethodToProtocolCommand methodsFor: 'executing'!
  238. execute
  239. ! !
  240. !HLMoveMethodToProtocolCommand class methodsFor: 'accessing'!
  241. key
  242. ^ 84
  243. !
  244. label
  245. ^ 'to protocol'
  246. ! !
  247. HLBrowserCommand subclass: #HLToggleCommand
  248. instanceVariableNames: ''
  249. package: 'Helios-Commands-Browser'!
  250. !HLToggleCommand class methodsFor: 'accessing'!
  251. key
  252. ^ 84
  253. !
  254. label
  255. ^ 'Toggle'
  256. ! !
  257. HLToggleCommand subclass: #HLToggleClassSideCommand
  258. instanceVariableNames: ''
  259. package: 'Helios-Commands-Browser'!
  260. !HLToggleClassSideCommand methodsFor: 'executing'!
  261. execute
  262. self model showInstance: false
  263. ! !
  264. !HLToggleClassSideCommand class methodsFor: 'accessing'!
  265. key
  266. "c"
  267. ^ 67
  268. !
  269. label
  270. ^ 'Class side'
  271. ! !
  272. HLToggleCommand subclass: #HLToggleInstanceSideCommand
  273. instanceVariableNames: ''
  274. package: 'Helios-Commands-Browser'!
  275. !HLToggleInstanceSideCommand methodsFor: 'executing'!
  276. execute
  277. self model showInstance: true
  278. ! !
  279. !HLToggleInstanceSideCommand class methodsFor: 'accessing'!
  280. key
  281. "i"
  282. ^ 73
  283. !
  284. label
  285. ^ 'Instance side'
  286. ! !
  287. HLCommand subclass: #HLOpenCommand
  288. instanceVariableNames: ''
  289. package: 'Helios-Commands-Core'!
  290. !HLOpenCommand class methodsFor: 'accessing'!
  291. key
  292. ^ 79
  293. !
  294. label
  295. ^ 'Open'
  296. ! !
  297. HLOpenCommand subclass: #HLOpenBrowserCommand
  298. instanceVariableNames: ''
  299. package: 'Helios-Commands-Core'!
  300. !HLOpenBrowserCommand methodsFor: 'executing'!
  301. execute
  302. ^ HLBrowser openAsTab
  303. ! !
  304. !HLOpenBrowserCommand class methodsFor: 'accessing'!
  305. key
  306. ^ 66
  307. !
  308. label
  309. ^ 'Browser'
  310. ! !
  311. HLOpenCommand subclass: #HLOpenTranscriptCommand
  312. instanceVariableNames: ''
  313. package: 'Helios-Commands-Core'!
  314. !HLOpenTranscriptCommand methodsFor: 'executing'!
  315. execute
  316. ^ HLTranscript openAsTab
  317. ! !
  318. !HLOpenTranscriptCommand class methodsFor: 'accessing'!
  319. key
  320. ^ 84
  321. !
  322. label
  323. ^ 'Transcript'
  324. ! !
  325. HLOpenCommand subclass: #HLOpenWorkspaceCommand
  326. instanceVariableNames: ''
  327. package: 'Helios-Commands-Core'!
  328. !HLOpenWorkspaceCommand methodsFor: 'executing'!
  329. execute
  330. ^ HLCodeWidget openAsTab
  331. ! !
  332. !HLOpenWorkspaceCommand class methodsFor: 'accessing'!
  333. key
  334. ^ 87
  335. !
  336. label
  337. ^ 'Workspace'
  338. ! !
  339. HLCommand subclass: #HLViewCommand
  340. instanceVariableNames: ''
  341. package: 'Helios-Commands-Core'!
  342. !HLViewCommand class methodsFor: 'accessing'!
  343. label
  344. ^ 'View'
  345. ! !