In the beginning there was darkness.
This commit is contained in:
commit
444e60e684
3
src/.properties
Normal file
3
src/.properties
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
#format : #tonel
|
||||
}
|
13
src/BaselineOfClouseau/BaselineOfClouseau.class.st
Normal file
13
src/BaselineOfClouseau/BaselineOfClouseau.class.st
Normal 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' ].
|
||||
]
|
1
src/BaselineOfClouseau/package.st
Normal file
1
src/BaselineOfClouseau/package.st
Normal file
@ -0,0 +1 @@
|
||||
Package { #name : #BaselineOfClouseau }
|
42
src/Clouseau/Dictionary.extension.st
Normal file
42
src/Clouseau/Dictionary.extension.st
Normal 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
1
src/Clouseau/package.st
Normal file
@ -0,0 +1 @@
|
||||
Package { #name : #Clouseau }
|
Loading…
Reference in New Issue
Block a user