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