author | Claus Gittinger <cg@exept.de> |
Mon, 20 Jan 2020 21:02:47 +0100 | |
changeset 19422 | c6ca1c3e0fd7 |
parent 19095 | 5d44c62ca402 |
child 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. |
30 | 61 |
|
62 |
"/ |
|
16548 | 63 |
"/ add class variables (always sorted) |
30 | 64 |
"/ |
15533 | 65 |
inspectedObject theNonMetaclass withAllSuperclasses reverseDo:[:aClass | |
19095 | 66 |
|varNames headLine classNameAsShown| |
30 | 67 |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
68 |
varNames := aClass classVarNames. |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
69 |
varNames notEmpty ifTrue:[ |
16548 | 70 |
varNames sort. |
19095 | 71 |
classNameAsShown := aClass name allBold. |
72 |
headLine := resources |
|
73 |
string:(aClass isSharedPool |
|
74 |
ifTrue:['pool variables in %1'] |
|
75 |
ifFalse:['class variables from %1'] |
|
76 |
) |
|
77 |
with:classNameAsShown. |
|
78 |
aList add:('----- ',headLine,' -----'). |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
79 |
varNames do:[:classVarName | |
19095 | 80 |
|value| |
81 |
||
82 |
value := aClass classVarAt:classVarName. |
|
83 |
aList add:(self listEntryForName:classVarName value:value). |
|
84 |
"/ aList add:classVarName |
|
2271
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
85 |
] |
0cf238543cb1
fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents:
2236
diff
changeset
|
86 |
] |
30 | 87 |
]. |
88 |
^ aList |
|
17392 | 89 |
|
90 |
"Modified: / 12-02-2017 / 11:03:47 / cg" |
|
12447 | 91 |
! |
92 |
||
93 |
valueAtLine:lineNr |
|
18640 | 94 |
"helper - return the value of the selected entry" |
12447 | 95 |
|
16654 | 96 |
|list idx0 nm cls| |
12447 | 97 |
|
98 |
list := super fieldList. |
|
99 |
lineNr <= list size ifTrue:[ ^ super valueAtLine:lineNr ]. |
|
100 |
||
16654 | 101 |
nm := self listEntryAt:lineNr. |
102 |
nm isNil ifTrue:[ ^nil]. |
|
12447 | 103 |
|
16654 | 104 |
"/ |
105 |
"/ a class variable? |
|
106 |
"/ |
|
107 |
cls := inspectedObject class theNonMetaclass whichClassDefinesClassVar:nm. |
|
108 |
cls notNil ifTrue:[ |
|
109 |
^ cls classVarAt:nm. |
|
12447 | 110 |
]. |
16654 | 111 |
|
112 |
"/ idx0 := list size + 1. |
|
113 |
"/ inspectedObject class withAllSuperclasses reverseDo:[:aClass | |
|
114 |
"/ |varNames varName| |
|
115 |
"/ |
|
116 |
"/ varNames := aClass classVarNames. |
|
117 |
"/ varNames notEmpty ifTrue:[ |
|
118 |
"/ (lineNr between:idx0+1 and:(idx0 + 1 + varNames size - 1)) ifTrue:[ |
|
119 |
"/ varName := varNames at:lineNr-idx0. |
|
120 |
"/ ^ aClass classVarAt:varName. |
|
121 |
"/ ]. |
|
122 |
"/ idx0 := idx0 + varNames size + 1. |
|
123 |
"/ ] |
|
124 |
"/ ]. |
|
12447 | 125 |
^ nil |
18640 | 126 |
|
127 |
"Modified (comment): / 01-03-2019 / 20:21:18 / Claus Gittinger" |
|
30 | 128 |
! ! |
129 |
||
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
130 |
!ClassInspectorView class methodsFor:'documentation'! |
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
131 |
|
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
132 |
version |
16548 | 133 |
^ '$Header$' |
2236
257f587ad7dc
migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents:
165
diff
changeset
|
134 |
! ! |
12447 | 135 |