[ENH] Sets in ObjectExplorer
Bert Freudenberg
bert at isgnw.CS.Uni-Magdeburg.De
Thu Mar 16 18:49:53 UTC 2000
"Change Set: setExplore-bf
Date: 16 March 2000
Author: Bert Freudenberg
Shows contents instead of implementation details for Sets in
ObjectExplorer (as already done for OrderedCollection, FloatArray and
Dictionary)"
-Bert-
-------------- next part --------------
'From Squeak2.8alpha of 18 January 2000 [latest update: #1919] on 16 March 2000 at 7:48:22 pm'!
"Change Set: setExplore-bf
Date: 16 March 2000
Author: Bert Freudenberg
Shows contents instead of implementation details for Sets in ObjectExplorer (as already done for OrderedCollection, FloatArray and Dictionary)"!
!ObjectExplorerWrapper methodsFor: 'as yet unclassified' stamp: 'bf 3/16/2000 18:07'!
contents
| answer |
answer _ OrderedCollection new.
"Don't show internal representation of these"
({OrderedCollection. FloatArray. Dictionary} anySatisfy: [:class | item isKindOf: class])
ifTrue: [
item keysAndValuesDo: [:key :value |
answer add: (ObjectExplorerWrapper
with: value
name: (key printString contractTo: 32)
model: item)].
^ answer].
"Same for Sets, but must provide an index"
(item isKindOf: Set) ifTrue: [
item doWithIndex: [:each :index |
answer add: (ObjectExplorerWrapper
with: each
name: index printString
model: item)].
^ answer].
"For all others, show named vars first, then indexed vars"
item class allInstVarNames asArray doWithIndex: [:each :index |
answer add: (ObjectExplorerWrapper
with: (item instVarAt: index)
name: each
model: item)].
1 to: item basicSize do: [:index |
answer add: (ObjectExplorerWrapper
with: (item basicAt: index)
name: index printString
model: item)].
^ answer! !
!Set methodsFor: 'testing' stamp: 'bf 3/16/2000 18:06'!
hasContentsInExplorer
^self isEmpty not! !
More information about the Squeak-dev
mailing list
|