In the beginning there was darkness.
This commit is contained in:
commit
444e60e684
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
#format : #tonel
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
Class {
|
||||||
|
#name : #BaselineOfClouseau,
|
||||||
|
#superclass : #Object,
|
||||||
|
#category : #BaselineOfClouseau
|
||||||
|
}
|
||||||
|
|
||||||
|
{ #category : #baselines }
|
||||||
|
BaselineOfClouseau >> baseline: spec [
|
||||||
|
<baseline>
|
||||||
|
spec
|
||||||
|
for: #common
|
||||||
|
do: [ spec package: 'Clouseau' ].
|
||||||
|
]
|
|
@ -0,0 +1 @@
|
||||||
|
Package { #name : #BaselineOfClouseau }
|
|
@ -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
|
||||||
|
]
|
|
@ -0,0 +1 @@
|
||||||
|
Package { #name : #Clouseau }
|
Loading…
Reference in New Issue