diff -r 89a5fc4c5d78 -r 0cf238543cb1 OrderedCollectionInspectorView.st --- a/OrderedCollectionInspectorView.st Fri Jul 16 18:47:58 1999 +0200 +++ b/OrderedCollectionInspectorView.st Fri Jul 16 19:26:38 1999 +0200 @@ -60,27 +60,6 @@ "Modified: 28.6.1996 / 16:06:24 / cg" ! -fieldList - "return a list of names for the selectionlist. Leave hasMore as - true, if a '...' entry should be added." - - |aList n| - - n := inspectedObject size. - (n > nShown) ifTrue:[ - n := nShown. - hasMore := true. - ]. - aList := OrderedCollection new:n+1. - hideReceiver ifFalse:[aList add:'self']. - 1 to:n do:[:index | - aList add:(index printString) - ]. - ^ aList - - "Modified: 28.6.1996 / 15:09:24 / cg" -! - fieldMenu "return the menu for the field-list" @@ -143,28 +122,38 @@ ^ m "Modified: / 21.5.1998 / 13:32:09 / cg" +! + +indexedFieldList + "return a list of indexed-variable names to show in the selectionList. + Set hasMore to true, if a '...' entry should be added." + + |n cls| + + cls := inspectedObject class. + + cls isVariable ifFalse:[^ #() ]. + + n := inspectedObject size. + (n > nShown) ifTrue:[ + n := nShown. + hasMore := true. + ]. + + ^ (1 to:n) collect:[:i | i printString]. + ! ! !OrderedCollectionInspectorView methodsFor:'user interaction'! -doAccept:theText - |value idx| - - value := Compiler evaluate:theText - receiver:inspectedObject - notifying:workspace. +indexedValueAtIndex:idx + ^ inspectedObject at:idx ifAbsent:nil. - idx := self keyIndexForLine:selectionIndex. - idx notNil ifTrue:[ - inspectedObject at:idx put:value. - ] ifFalse:[ - idx := self instVarIndexForLine:selectionIndex. - idx notNil ifTrue:[ - inspectedObject instVarAt:idx put:value. - ] ifFalse:[ - ^ self "/ self selected - ] - ]. +! + +indexedValueAtIndex:idx put:newValue + inspectedObject at:idx put:newValue. + ! removeIndex @@ -179,34 +168,10 @@ inspectedObject changed. self reinspect. ] -! - -valueAtLine:lineNr - "helper - return the value of the selected entry" - - |key idx| - - idx := self keyIndexForLine:lineNr. - idx notNil ifTrue:[ - ^ inspectedObject at:idx ifAbsent:nil. - ]. - idx := self instVarIndexForLine:lineNr. - idx notNil ifTrue:[ - ^ inspectedObject instVarAt:idx. - ]. - - hideReceiver ifFalse:[ - (lineNr == 1 or:[lineNr isNil]) ifTrue:[ - ^ inspectedObject - ]. - ]. - - ^ nil - ! ! !OrderedCollectionInspectorView class methodsFor:'documentation'! version - ^ '$Header: /cvs/stx/stx/libtool/OrderedCollectionInspectorView.st,v 1.26 1999-07-07 00:26:27 cg Exp $' + ^ '$Header: /cvs/stx/stx/libtool/OrderedCollectionInspectorView.st,v 1.27 1999-07-16 17:25:41 cg Exp $' ! !