InspectorView.st
changeset 5421 86a6077b131d
parent 5134 536fbfead179
child 5492 cd1121310792
equal deleted inserted replaced
5420:3841c84ec520 5421:86a6077b131d
  1104 
  1104 
  1105 instVarIndexForLine:lineNr
  1105 instVarIndexForLine:lineNr
  1106     "helper - return the index for a named instVar;
  1106     "helper - return the index for a named instVar;
  1107      nil, if self or a keyed instvar is selected."
  1107      nil, if self or a keyed instvar is selected."
  1108 
  1108 
  1109     |idx nNamedInstvarsShown cls baseCls firstRealIndex|
  1109     |idx nNamedInstvarsShown cls baseCls firstRealIndex line|
  1110 
  1110 
  1111     lineNr isNil ifTrue:[^ nil].
  1111     lineNr isNil ifTrue:[^ nil].
  1112     firstRealIndex := 1.
  1112     firstRealIndex := 1.
  1113 
  1113 
  1114     idx := lineNr.
  1114     idx := lineNr.
  1118         ].
  1118         ].
  1119         idx := idx - 1.
  1119         idx := idx - 1.
  1120         firstRealIndex := 2.
  1120         firstRealIndex := 2.
  1121     ].
  1121     ].
  1122 
  1122 
  1123     [(listView at:firstRealIndex) startsWith:'-'] whileTrue:[
  1123     [line := listView at:firstRealIndex. 
       
  1124      (line startsWith:'-') and:[line size < 2 or:[line second isDigit not]]] whileTrue:[
  1124         firstRealIndex := firstRealIndex + 1.
  1125         firstRealIndex := firstRealIndex + 1.
  1125         idx := idx - 1.
  1126         idx := idx - 1.
  1126     ].
  1127     ].
  1127 
  1128 
  1128     cls := inspectedObject class.
  1129     cls := inspectedObject class.
  1145 
  1146 
  1146 keyIndexForLine:lineNr
  1147 keyIndexForLine:lineNr
  1147     "helper - return the index of the key-list;
  1148     "helper - return the index of the key-list;
  1148      nil, if self or a namedInstVar is selected."
  1149      nil, if self or a namedInstVar is selected."
  1149 
  1150 
  1150     |idx nNamedInstvarsShown cls baseCls firstRealIndex|
  1151     |idx nNamedInstvarsShown cls baseCls firstRealIndex line|
  1151 
  1152 
  1152     lineNr isNil ifTrue:[^ nil].
  1153     lineNr isNil ifTrue:[^ nil].
  1153 
  1154 
  1154     firstRealIndex := 1.
  1155     firstRealIndex := 1.
  1155     idx := lineNr.
  1156     idx := lineNr.
  1159         ].
  1160         ].
  1160         idx := idx - 1.
  1161         idx := idx - 1.
  1161         firstRealIndex := firstRealIndex + 1.
  1162         firstRealIndex := firstRealIndex + 1.
  1162     ].
  1163     ].
  1163 
  1164 
  1164     [(listView at:firstRealIndex) startsWith:'-'] whileTrue:[
  1165     [line := listView at:firstRealIndex. 
       
  1166      (line startsWith:'-') and:[line size < 2 or:[line second isDigit not]]] whileTrue:[
  1165         firstRealIndex := firstRealIndex + 1.
  1167         firstRealIndex := firstRealIndex + 1.
  1166         idx := idx - 1.
  1168         idx := idx - 1.
  1167     ].
  1169     ].
  1168 
  1170 
  1169     cls := inspectedObject class.
  1171     cls := inspectedObject class.
  1408     and:[lineNr == 1 or:[lineNr isNil]]) ifTrue:[
  1410     and:[lineNr == 1 or:[lineNr isNil]]) ifTrue:[
  1409         ^ inspectedObject
  1411         ^ inspectedObject
  1410     ].
  1412     ].
  1411 
  1413 
  1412     ((l := listView at:lineNr) startsWith:$-) ifTrue:[
  1414     ((l := listView at:lineNr) startsWith:$-) ifTrue:[
  1413         (l ~= '-') ifTrue:[
  1415         (l ~= '-' and:[(l at:2) isDigit not "negative number"]) ifTrue:[
  1414             ^ self valueForSpecialLine:(listView at:lineNr)
  1416             ^ self valueForSpecialLine:(listView at:lineNr)
  1415         ].
  1417         ].
  1416     ].
  1418     ].
  1417 
  1419 
  1418     "/ a named instVar ?
  1420     "/ a named instVar ?
  1706 ! !
  1708 ! !
  1707 
  1709 
  1708 !InspectorView class methodsFor:'documentation'!
  1710 !InspectorView class methodsFor:'documentation'!
  1709 
  1711 
  1710 version
  1712 version
  1711     ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.142 2003-08-29 15:39:36 cg Exp $'
  1713     ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.143 2004-01-12 13:46:46 stefan Exp $'
  1712 ! !
  1714 ! !