<commit_before>"
Visual browser of Roassal example.
This class create a world menu item to open the examples
"
Class {
	#name : #RTExampleBrowser,
	#superclass : #RTObject,
	#category : #'Roassal2-MorphSpecific'
}

{ #category : #menu }
RTExampleBrowser class >> menuCommandOn: aBuilder [
	<worldMenu>
	((aBuilder item: #Roassal) icon: RTIcon smallRoassal)
	withSeparatorAfter;
	with: [
		(aBuilder item: #'Roassal Examples')
			order: 0.1; 
			parent: #Roassal;
			label: 'Roassal examples';
			icon: RTIcon smallRoassal;
			action: [ self new open ] ]
]

{ #category : #'instance creation' }
RTExampleBrowser >> examples [
	<todo: 'deprecated (?) #title / dont use #label'>
	^ RTExampleFinder myExamples asSortedCollection: [ :a :b | a label <= b label ]
]

{ #category : #'instance creation' }
RTExampleBrowser >> open [
	| pager |
	pager := GLMPager new.
	pager title: 'Roassal examples browser'.
	pager showFirst: [ :a | a list format: #label ].
	pager
		show: [ :a :each | 
			a title: [ GTInspector new printObjectAsAnItem: each ].
			a dynamicActions: [ :aPresentation | each gtInspectorActions asOrderedCollection ].
			a dynamic
				display: [ :x | (GLMCompositePresentation new with: [ :d | each gtInspectorPresentationsIn: d inContext: pager ]) startOn: x ] ].
	pager openOn: self examples
]<commit_msg>reverted back / I misunderstood the intention of that method / sorry<commit_after>"
Visual browser of Roassal example.
This class create a world menu item to open the examples
"
Class {
	#name : #RTExampleBrowser,
	#superclass : #RTObject,
	#category : #'Roassal2-MorphSpecific'
}

{ #category : #menu }
RTExampleBrowser class >> menuCommandOn: aBuilder [
	<worldMenu>
	((aBuilder item: #Roassal) icon: RTIcon smallRoassal)
	withSeparatorAfter;
	with: [
		(aBuilder item: #'Roassal Examples')
			order: 0.1; 
			parent: #Roassal;
			label: 'Roassal examples';
			icon: RTIcon smallRoassal;
			action: [ self new open ] ]
]

{ #category : #'instance creation' }
RTExampleBrowser >> examples [
	| es |
	es := RTAbstractExample allSubclasses collect: #new.
	^ es sortedAs: #label
]

{ #category : #'instance creation' }
RTExampleBrowser >> open [
	| pager |
	pager := GLMPager new.
	pager title: 'Roassal examples browser'.
	pager showFirst: [ :a | a list format: #label ].
	pager
		show: [ :a :each | 
			a title: [ GTInspector new printObjectAsAnItem: each ].
			a dynamicActions: [ :aPresentation | each gtInspectorActions asOrderedCollection ].
			a dynamic
				display: [ :x | (GLMCompositePresentation new with: [ :d | each gtInspectorPresentationsIn: d inContext: pager ]) startOn: x ] ].
	pager openOn: self examples
]
{'fraction_non_alphanumeric': 0.11751326762699014, 'fraction_numerical': 0.002274450341167551, 'mean_word_length': 4.236111111111111, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2257269', 'n_tokens_mistral': 946, 'n_tokens_neox': 895, 'n_words': 269}