In the beginning there was darkness.

This commit is contained in:
Daniel Ziltener 2022-05-18 19:03:36 +02:00
commit 444e60e684
6 changed files with 63 additions and 0 deletions

3
.project Normal file
View File

@ -0,0 +1,3 @@
{
'srcDirectory' : 'src'
}

3
src/.properties Normal file
View File

@ -0,0 +1,3 @@
{
#format : #tonel
}

View File

@ -0,0 +1,13 @@
Class {
#name : #BaselineOfClouseau,
#superclass : #Object,
#category : #BaselineOfClouseau
}
{ #category : #baselines }
BaselineOfClouseau >> baseline: spec [
<baseline>
spec
for: #common
do: [ spec package: 'Clouseau' ].
]

View File

@ -0,0 +1 @@
Package { #name : #BaselineOfClouseau }

View File

@ -0,0 +1,42 @@
Extension { #name : #Dictionary }
{ #category : #'*Clouseau' }
Dictionary >> asStringTablePresenter [
| tblRows |
tblRows := OrderedCollection new.
self keysAndValuesDo: [ :aKey :aValue | tblRows add: { aKey -> aValue } ].
^ SpTablePresenter new
addColumn: (SpStringTableColumn title: 'Key' evaluated: [ :anObject | (anObject at: 1) key ]);
addColumn: (SpStringTableColumn title: 'Value' evaluated: [ :anObject | (anObject at: 1) value ]);
items: tblRows;
alternateRowsColor;
yourself.
]
{ #category : #'*Clouseau' }
Dictionary >> asStringTreeTablePresenter [
^ SpTreeTablePresenter new
addColumn:
(SpStringTableColumn title: 'Key' evaluated: [ :anObject |
anObject isDictionary
ifTrue: [
anObject isEmpty
ifTrue: [ '' ]
ifFalse: [ anObject keys at: 1 ] ]
ifFalse: [ anObject key ] ]);
addColumn:
(SpStringTableColumn title: 'Value' evaluated: [ :anObject |
anObject isDictionary
ifTrue: [ '' ]
ifFalse: [ anObject value ] ]);
roots: self;
children: [ :anItem |
anItem value isDictionary
ifTrue: [
anItem value isEmpty
ifTrue: [ { } ]
ifFalse: [ anItem value ] ]
ifFalse: [ { } ] ];
yourself
]

1
src/Clouseau/package.st Normal file
View File

@ -0,0 +1 @@
Package { #name : #Clouseau }