class: ContextInspectorView
authorClaus Gittinger <cg@exept.de>
Mon, 11 Mar 2013 17:58:00 +0100
changeset 12456 87fdcd23e545
parent 12455 dab98ae0d660
child 12457 db4080187675
class: ContextInspectorView changed: #inspect: #valueAtLine:put: fix: context inspector in debugger did not accept new values
ContextInspectorView.st
--- a/ContextInspectorView.st	Mon Mar 11 12:51:45 2013 +0100
+++ b/ContextInspectorView.st	Mon Mar 11 17:58:00 2013 +0100
@@ -87,7 +87,7 @@
     ] ifFalse:[
         hasMore := argsOnly := false.
         inspectedObject := object := nil.
-        inspectedContext := aContext.
+        inspectedContext := object := aContext.
         contextSize := inspectedContext size.
 
         aContext isNil ifTrue:[
@@ -616,6 +616,25 @@
     "Modified: / 16-05-2012 / 17:55:57 / cg"
 !
 
+valueAtLine:lineNr put:newValue
+    "helper - return the value of the selected entry"
+
+    |indexOfFirstNonSpecial contextIndex|
+
+    inspectedContext isNil ifTrue:[^ self].
+
+    "/ count the special lines
+    indexOfFirstNonSpecial := self fieldList findFirst:[:l | (l string startsWith:'-') not].
+    indexOfFirstNonSpecial == 0 ifTrue:[
+        ^ self
+    ].
+
+    contextIndex := lineNr - indexOfFirstNonSpecial + 1.
+
+    "yes, you can do that with a context"
+    inspectedContext at:contextIndex put:newValue.
+!
+
 valueForSpecialLine:line
     (line startsWith:'-all local vars') ifTrue:[
         ^ inspectedObject
@@ -628,24 +647,6 @@
 
 !ContextInspectorView methodsFor:'user actions'!
 
-doAccept:theText
-    "text in the right pane was accepted - evaluate the contents and
-     assign to the selected field"
-
-    super doAccept:theText.
-"/    |newValue|
-"/
-"/    selectionIndex notNil ifTrue:[
-"/        newValue := inspectedObject class evaluatorClass 
-"/                       evaluate:theText
-"/                       receiver:inspectedObject 
-"/                       notifying:workspace.
-"/
-"/        "yes, you can do that with a context"
-"/        inspectedContext at:selectionIndex put:newValue.
-"/    ].
-!
-
 hideTemporaries
     "do not show contexts temporaries"
 
@@ -662,19 +663,15 @@
     self inspect:inspectedContext
 
     "Modified: 14.12.1995 / 19:24:49 / cg"
-!
-
-valueAtLine:selectionIndex put:newValue
-    "yes, you can do that with a context"
-    inspectedContext at:selectionIndex put:newValue.
 ! !
 
 !ContextInspectorView class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.79 2012-07-20 09:22:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.80 2013-03-11 16:58:00 cg Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.79 2012-07-20 09:22:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/ContextInspectorView.st,v 1.80 2013-03-11 16:58:00 cg Exp $'
 ! !
+