author | Claus Gittinger <cg@exept.de> |
Tue, 21 Apr 2020 13:54:09 +0200 | |
changeset 19580 | ce40b5d1e941 |
parent 19450 | 2c5138c94562 |
permissions | -rw-r--r-- |
18640 | 1 |
"{ Encoding: utf8 }" |
2 |
||
30 | 3 |
" |
4 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
5 |
All Rights Reserved |
30 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
2997
928594257211
Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
14 |
"{ Package: 'stx:libtool' }" |
928594257211
Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
15 |
|
15533 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
30 | 18 |
InspectorView subclass:#ClassInspectorView |
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
19 |
instanceVariableNames:'' |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
20 |
classVariableNames:'' |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
21 |
poolDictionaries:'' |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
22 |
category:'Interface-Inspector' |
30 | 23 |
! |
24 |
||
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
25 |
!ClassInspectorView class methodsFor:'documentation'! |
30 | 26 |
|
27 |
copyright |
|
28 |
" |
|
29 |
COPYRIGHT (c) 1994 by Claus Gittinger |
|
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
30 |
All Rights Reserved |
30 | 31 |
|
32 |
This software is furnished under a license and may be used |
|
33 |
only in accordance with the terms of that license and with the |
|
34 |
inclusion of the above copyright notice. This software may not |
|
35 |
be provided or otherwise made available to, or used by, any |
|
36 |
other person. No title to or ownership of the software is |
|
37 |
hereby transferred. |
|
38 |
" |
|
39 |
||
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
40 |
|
2997
928594257211
Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
41 |
! |
928594257211
Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
42 |
|
928594257211
Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
43 |
documentation |
928594257211
Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
44 |
" |
928594257211
Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
45 |
modified Inspector for Classes; in addition to instance variables, |
928594257211
Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
46 |
also shows ClassVariables in its left SelectionList. |
3200 | 47 |
|
48 |
Array inspect |
|
49 |
View inspect |
|
2997
928594257211
Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents:
2271
diff
changeset
|
50 |
" |
30 | 51 |
! ! |
52 |
||
53 |
!ClassInspectorView methodsFor:'accessing'! |
|
54 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
55 |
fieldList |
30 | 56 |
"return a list of names to show in the selectionList" |
57 |
||
58 |
|aList| |
|
59 |
||
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
60 |
aList := super fieldList. |
19450 | 61 |
inspectedObject isNil ifTrue:[ |
62 |
"/ only happens with becomeNil |
|
63 |
"/ as an inspector which is used in debugging tools, I am tolerant |
|
64 |
^ aList |
|
65 |
]. |
|
30 | 66 |
|
67 |
"/ |
|
16548 | 68 |
"/ add class variables (always sorted) |
30 | 69 |
"/ |
15533 | 70 |
inspectedObject theNonMetaclass withAllSuperclasses reverseDo:[:aClass | |
19095 | 71 |
|varNames headLine classNameAsShown| |
30 | 72 |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
73 |
varNames := aClass classVarNames. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
74 |
varNames notEmpty ifTrue:[ |
16548 | 75 |
varNames sort. |
19095 | 76 |
classNameAsShown := aClass name allBold. |
77 |
headLine := resources |
|
78 |
string:(aClass isSharedPool |
|
79 |
ifTrue:['pool variables in %1'] |
|
80 |
ifFalse:['class variables from %1'] |
|
81 |
) |
|
82 |
with:classNameAsShown. |
|
83 |
aList add:('----- ',headLine,' -----'). |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
84 |
varNames do:[:classVarName | |
19095 | 85 |
|value| |
86 |
||
87 |
value := aClass classVarAt:classVarName. |
|
88 |
aList add:(self listEntryForName:classVarName value:value). |
|
89 |
"/ aList add:classVarName |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
90 |
] |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
91 |
] |
30 | 92 |
]. |
93 |
^ aList |
|
17392 | 94 |
|
95 |
"Modified: / 12-02-2017 / 11:03:47 / cg" |
|
12447 | 96 |
! |
97 |
||
98 |
valueAtLine:lineNr |
|
18640 | 99 |
"helper - return the value of the selected entry" |
12447 | 100 |
|
16654 | 101 |
|list idx0 nm cls| |
12447 | 102 |
|
103 |
list := super fieldList. |
|
104 |
lineNr <= list size ifTrue:[ ^ super valueAtLine:lineNr ]. |
|
105 |
||
16654 | 106 |
nm := self listEntryAt:lineNr. |
107 |
nm isNil ifTrue:[ ^nil]. |
|
12447 | 108 |
|
16654 | 109 |
"/ |
110 |
"/ a class variable? |
|
111 |
"/ |
|
112 |
cls := inspectedObject class theNonMetaclass whichClassDefinesClassVar:nm. |
|
113 |
cls notNil ifTrue:[ |
|
114 |
^ cls classVarAt:nm. |
|
12447 | 115 |
]. |
16654 | 116 |
|
117 |
"/ idx0 := list size + 1. |
|
118 |
"/ inspectedObject class withAllSuperclasses reverseDo:[:aClass | |
|
119 |
"/ |varNames varName| |
|
120 |
"/ |
|
121 |
"/ varNames := aClass classVarNames. |
|
122 |
"/ varNames notEmpty ifTrue:[ |
|
123 |
"/ (lineNr between:idx0+1 and:(idx0 + 1 + varNames size - 1)) ifTrue:[ |
|
124 |
"/ varName := varNames at:lineNr-idx0. |
|
125 |
"/ ^ aClass classVarAt:varName. |
|
126 |
"/ ]. |
|
127 |
"/ idx0 := idx0 + varNames size + 1. |
|
128 |
"/ ] |
|
129 |
"/ ]. |
|
12447 | 130 |
^ nil |
18640 | 131 |
|
132 |
"Modified (comment): / 01-03-2019 / 20:21:18 / Claus Gittinger" |
|
30 | 133 |
! ! |
134 |
||
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
135 |
!ClassInspectorView class methodsFor:'documentation'! |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
136 |
|
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
137 |
version |
16548 | 138 |
^ '$Header$' |
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
139 |
! ! |
12447 | 140 |