| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341 | 
							- Smalltalk current createPackage: 'Helios-Commands-Browser'!
 
- HLToolCommand subclass: #HLBrowserCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLBrowserCommand class methodsFor: 'testing'!
 
- isValidFor: aModel
 
- 	^ aModel isBrowserModel
 
- ! !
 
- HLBrowserCommand subclass: #HLBrowserGoToCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLBrowserGoToCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 'g'
 
- !
 
- label
 
- 	^ 'Go to'
 
- ! !
 
- !HLBrowserGoToCommand class methodsFor: 'testing'!
 
- isValidFor: aModel
 
- 	^ aModel isBrowserModel
 
- ! !
 
- HLBrowserGoToCommand subclass: #HLGoToClassesCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLGoToClassesCommand methodsFor: 'executing'!
 
- execute
 
- 	self model focusOnClasses
 
- ! !
 
- !HLGoToClassesCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 'c'
 
- !
 
- label
 
- 	^ 'Classes'
 
- ! !
 
- HLBrowserGoToCommand subclass: #HLGoToMethodsCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLGoToMethodsCommand methodsFor: 'executing'!
 
- execute
 
- 	self model focusOnMethods
 
- ! !
 
- !HLGoToMethodsCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 'm'
 
- !
 
- label
 
- 	^ 'Methods'
 
- ! !
 
- HLBrowserGoToCommand subclass: #HLGoToPackagesCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLGoToPackagesCommand methodsFor: 'executing'!
 
- execute
 
- 	self model focusOnPackages
 
- ! !
 
- !HLGoToPackagesCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 'p'
 
- !
 
- label
 
- 	^ 'Packages'
 
- ! !
 
- HLBrowserGoToCommand subclass: #HLGoToProtocolsCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLGoToProtocolsCommand methodsFor: 'executing'!
 
- execute
 
- 	self model focusOnProtocols
 
- ! !
 
- !HLGoToProtocolsCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 't'
 
- !
 
- label
 
- 	^ 'Protocols'
 
- ! !
 
- HLBrowserGoToCommand subclass: #HLGoToSourceCodeCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLGoToSourceCodeCommand methodsFor: 'executing'!
 
- execute
 
- 	self model focusOnSourceCode
 
- ! !
 
- !HLGoToSourceCodeCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 's'
 
- !
 
- label
 
- 	^ 'Source code'
 
- ! !
 
- HLBrowserCommand subclass: #HLEditCommentCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLEditCommentCommand methodsFor: 'executing'!
 
- execute
 
- 	self model editComment
 
- ! !
 
- !HLEditCommentCommand methodsFor: 'testing'!
 
- isActive
 
- 	^ self model showComment and: [ self model selectedClass notNil ]
 
- ! !
 
- !HLEditCommentCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 'd'
 
- !
 
- label
 
- 	^ 'Edit documentation'
 
- ! !
 
- HLBrowserCommand subclass: #HLGenerateCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLGenerateCommand commentStamp!
 
- I am a group command used to gather all the commands generating code (`accessors`, `initialize`, etc)!
 
- !HLGenerateCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 'h'
 
- !
 
- label
 
- 	^ 'Generate'
 
- ! !
 
- HLGenerateCommand subclass: #HLCategorizeUnclassifiedCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLCategorizeUnclassifiedCommand commentStamp!
 
- I am the command used to categorize unclassified methods!
 
- !HLCategorizeUnclassifiedCommand methodsFor: 'executing'!
 
- execute
 
- 	| targetClass unclassified |
 
- 	targetClass := self model selectedClass.
 
- 	unclassified := targetClass methods select:[ :e | e protocol = 'as yet unclassified' ].
 
- 		
 
- 	HLMethodClassifier new
 
- 		classifyAll: unclassified
 
- ! !
 
- !HLCategorizeUnclassifiedCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 'c'
 
- !
 
- label
 
- 	^ 'Categorize'
 
- ! !
 
- HLGenerateCommand subclass: #HLGenerateAccessorsCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLGenerateAccessorsCommand commentStamp!
 
- I am the command used to generate the `getter` and the `setter` methods depending of the selected class!
 
- !HLGenerateAccessorsCommand methodsFor: 'executing'!
 
- execute
 
- 	| targetClass output first |
 
- 	targetClass := self model selectedClass.
 
- 	output := HLInitializeGenerator new
 
- 		class: targetClass;
 
- 		generate;
 
- 		output.
 
- 		
 
- 	output compile.
 
- 	first := output sourceCodes first.
 
- 	self model
 
- 		selectedProtocol: output protocol;
 
- 		selectedMethod:(targetClass>>first selector);
 
- 		focusOnSourceCode
 
- ! !
 
- !HLGenerateAccessorsCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 'i'
 
- !
 
- label
 
- 	^ 'Initialize'
 
- ! !
 
- HLGenerateCommand subclass: #HLGenerateInitializeCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLGenerateInitializeCommand commentStamp!
 
- I am the command used to generate the `initialize` method depending of the selected class!
 
- !HLGenerateInitializeCommand methodsFor: 'executing'!
 
- execute
 
- 	| targetClass output |
 
- 	targetClass := self model selectedClass.
 
- 	output := HLAccessorsGenerator new
 
- 		class: targetClass;
 
- 		generate;
 
- 		output.
 
- 		
 
- 	output compile.
 
- 	self model selectedProtocol: output protocol
 
- ! !
 
- !HLGenerateInitializeCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 'a'
 
- !
 
- label
 
- 	^ 'Accessors'
 
- ! !
 
- HLBrowserCommand subclass: #HLToggleCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLToggleCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 't'
 
- !
 
- label
 
- 	^ 'Toggle'
 
- ! !
 
- HLToggleCommand subclass: #HLToggleClassCommentCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLToggleClassCommentCommand methodsFor: 'executing'!
 
- execute
 
- 	self model showComment: self model showComment not
 
- ! !
 
- !HLToggleClassCommentCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 'd'
 
- !
 
- label
 
- 	^ 'Documentation'
 
- ! !
 
- HLToggleCommand subclass: #HLToggleClassSideCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLToggleClassSideCommand methodsFor: 'executing'!
 
- execute
 
- 	self model showInstance: false
 
- ! !
 
- !HLToggleClassSideCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 'c'
 
- !
 
- label
 
- 	^ 'Class side'
 
- ! !
 
- HLToggleCommand subclass: #HLToggleInstanceSideCommand
 
- 	instanceVariableNames: ''
 
- 	package: 'Helios-Commands-Browser'!
 
- !HLToggleInstanceSideCommand methodsFor: 'executing'!
 
- execute
 
- 	self model showInstance: true
 
- ! !
 
- !HLToggleInstanceSideCommand class methodsFor: 'accessing'!
 
- key
 
- 	^ 'i'
 
- !
 
- label
 
- 	^ 'Instance side'
 
- ! !
 
 
  |