[Cuis-dev] [ENH] --- browser sorts method categories

Andres Valloud ten at smallinteger.com
Sun Dec 26 04:44:32 PST 2021


See attached.

On 12/26/21 4:13 AM, Andres Valloud via Cuis-dev wrote:
> Hi,
> 
> On 12/26/21 3:56 AM, Luciano Notarfrancesco wrote:
>> This would be automatic? If so, we should remove the ‘alphabetize’ 
>> thing alt-a.
> 
> Agreed.
> 
>> Also, I like the convention of making private method categories begin 
>> with ‘private’ instead of making categories like ‘accessing-private’, 
>> in fact I now put setters in ‘private’, but maybe we should also 
>> consider categories ending with ‘-private’?
> 
> Sure, we could change the code to just read
> 
>      '*private*' match: category
> 
> or something to that effect.
> 
> Andres.
-------------- next part --------------
'From Cuis 5.0 [latest update: #5004] on 26 December 2021 at 4:44:00 am'!

!Browser methodsFor: 'message category list' stamp: 'sqr 12/26/2021 04:36:35'!
rawMessageCategoryList

	| categories public private |
	selectedClassName isNil ifTrue: [^#()].
	categories := self classOrMetaClassOrganizer categories.
	private := categories select: [:x | '*private*' match: x].
	public := categories reject: [:x | private includes: x].
	^public sort, private sort! !


!CodeWindow methodsFor: 'keyboard shortcuts' stamp: 'sqr 12/26/2021 04:38:05'!
messageCatListKey: aChar from: view

	aChar == $o ifTrue: [^model fileOutMessageCategories].
	aChar == $t ifTrue: [^model runMessageCategoryTests].
	aChar == $x ifTrue: [^model removeMessageCategory].
	aChar == $R ifTrue: [^model renameCategory].
	aChar == $n ifTrue: [^model addCategory].
	aChar == $e ifTrue: [^model removeEmptyCategories].
	aChar == $c ifTrue: [^model categorizeAllUncategorizedMethods].
	aChar == $r ifTrue: [^model editMessageCategories]! !


!BrowserWindow class methodsFor: 'browser menues' stamp: 'sqr 12/26/2021 04:37:19'!
messageCategoryMenuOptions

	^`{
			{
				#itemGroup 		-> 		10.
				#itemOrder 		-> 		10.
				#label 			-> 		'fileOut (o)'.
				#object 			-> 		#model.
				#selector 		-> 		#fileOutMessageCategories.
				#icon 			-> 		#fileOutIcon
			} asDictionary.
			{
				#itemGroup 		-> 		20.
				#itemOrder 		-> 		10.
				#label 			-> 		'reorganize (r)'.
				#object 			-> 		#model.
				#selector 		-> 		#editMessageCategories.
				#icon 			-> 		#sendReceiveIcon
			} asDictionary.
			{
				#itemGroup 		-> 		20.
				#itemOrder 		-> 		30.
				#label 			-> 		'remove empty categories (e)'.
				#object 			-> 		#model.
				#selector 		-> 		#removeEmptyCategories.
				#icon 			-> 		#listRemoveIcon
			} asDictionary.
			{
				#itemGroup 		-> 		20.
				#itemOrder 		-> 		40.
				#label 			-> 		'categorize all uncategorized (c)'.
				#object 			-> 		#model.
				#selector 		-> 		#categorizeAllUncategorizedMethods.
				#icon 			-> 		#packageIcon
			} asDictionary.
			{
				#itemGroup 		-> 		20.
				#itemOrder 		-> 		50.
				#label 			-> 		'new category... (n)'.
				#object 			-> 		#model.
				#selector 		-> 		#addCategory.
				#icon 			-> 		#newIcon
			} asDictionary.
			{
				#itemGroup 		-> 		30.
				#itemOrder 		-> 		10.
				#label 			-> 		'rename... (R)'.
				#object 			-> 		#model.
				#selector 		-> 		#renameCategory.
				#icon 			-> 		#saveAsIcon
			} asDictionary.
			{
				#itemGroup 		-> 		30.
				#itemOrder 		-> 		20.
				#label 			-> 		'remove (x)'.
				#object 			-> 		#model.
				#selector 		-> 		#removeMessageCategory.
				#icon 			-> 		#deleteIcon
			} asDictionary.
			{
				#itemGroup 		-> 		40.
				#itemOrder 		-> 		10.
				#label 			-> 		'run tests (t)'.
				#object 			-> 		#model.
				#selector 		-> 		#runMessageCategoryTests.
				#icon 			-> 		#weatherFewCloudsIcon
			} asDictionary.
		}`.
	! !

!methodRemoval: ClassOrganizer #sortCategories stamp: 'sqr 12/26/2021 04:41:54'!
ClassOrganizer removeSelector: #sortCategories!
!methodRemoval: Browser #alphabetizeMessageCategories stamp: 'sqr 12/26/2021 04:39:07'!
Browser removeSelector: #alphabetizeMessageCategories!


More information about the Cuis-dev mailing list