Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting bag occurrences by number instead of alphabetically in inspector #17419

Open
Ducasse opened this issue Nov 20, 2024 · 0 comments · May be fixed by pharo-spec/NewTools#915
Open

Sorting bag occurrences by number instead of alphabetically in inspector #17419

Ducasse opened this issue Nov 20, 2024 · 0 comments · May be fixed by pharo-spec/NewTools#915

Comments

@Ducasse
Copy link
Member

Ducasse commented Nov 20, 2024

inspectionItems: aBuilder
	<inspectorPresentationOrder: 0 title: 'Items'> 

	^ aBuilder newTable		
		addColumn: (SpStringTableColumn new 
			title: 'Items';
			evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: each key ];
			beNotExpandable;
			beSortable;
			yourself);
		addColumn: (SpStringTableColumn new  
			title: 'Occurences'; 
			evaluated: [ :each | StObjectPrinter asTruncatedTextFrom: (self occurrencesOf: each key) ];
			beSortable;
			compareFunction: [ :c1 :c2 | c1 value < c2 value ];
			yourself);
		items: contents associations;
		yourself
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant