--- a/SetInspectorView.st Wed Jun 23 18:02:04 1999 +0200
+++ b/SetInspectorView.st Wed Jun 23 18:02:23 1999 +0200
@@ -57,29 +57,31 @@
!
fieldList
- "return a list of names for the selectionlist. Leave hasMore as
- true, if a '...' entry should be added."
+ "return a list of names for the selectionlist."
- |aList|
+ |aList l|
inspectedObject isNil ifTrue:[^ #()].
self topView withWaitCursorDo:[
+ aList := inspectedObject class allInstVarNames asOrderedCollection.
+ "/ hide Set stuff
+ aList := aList copyFrom:(Set instSize + 1).
+ hideReceiver ifFalse:[aList addFirst:'self'].
+
keys := inspectedObject asSortedCollection:[:a :b | a displayString < b displayString].
- aList := keys collect:[:k | k isSymbol ifTrue:[
+ l := keys collect:[:k | k isSymbol ifTrue:[
k printString
] ifFalse:[
k displayString
]
].
- aList := aList asOrderedCollection.
- hideReceiver ifFalse:[aList addFirst:'self'].
+ aList addAll:l.
].
^ aList
- "Modified: 8.5.1996 / 14:29:45 / stefan"
- "Modified: 14.2.1997 / 18:26:04 / cg"
+
!
release
@@ -129,21 +131,34 @@
!
valueAtLine:lineNr
- "helper - return the value of the selected entry"
+ "helper - return the value of the selected entry;
+ Here, the key itself is the value."
- |key|
+ |key idx|
- lineNr == 1 ifTrue:[
- ^ inspectedObject
+ idx := lineNr.
+ hideReceiver ifFalse:[
+ (lineNr == 1 or:[lineNr isNil]) ifTrue:[
+ ^ inspectedObject
+ ].
+ idx := idx - 1.
].
- key := (keys at:lineNr - 1).
+
+ inspectedObject ~~ Smalltalk ifTrue:[
+ idx := idx + Dictionary instSize.
+ idx <= inspectedObject class instSize ifTrue:[
+ ^ inspectedObject instVarAt:idx
+ ].
+ idx := idx - inspectedObject class instSize.
+ ].
+
+ key := keys at:idx.
^ key.
- "Created: 9.2.1996 / 12:03:29 / stefan"
! !
!SetInspectorView class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libtool/SetInspectorView.st,v 1.8 1997-10-29 16:06:29 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libtool/SetInspectorView.st,v 1.9 1999-06-23 16:02:23 cg Exp $'
! !