ClassInspectorView.st
author Stefan Vogel <sv@exept.de>
Fri, 06 Jun 2014 09:30:13 +0200
changeset 14466 533775670ece
parent 13697 5840dbaaa7d2
child 15533 705cf3d2d10a
permissions -rw-r--r--
Sending of Image>>#clearMaskedPixels moved to Image >> #asFormOnDevice:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
     1
"
205d53e91c52 Initial revision
claus
parents:
diff changeset
     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
205d53e91c52 Initial revision
claus
parents:
diff changeset
     4
205d53e91c52 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
205d53e91c52 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
205d53e91c52 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
205d53e91c52 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
205d53e91c52 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
205d53e91c52 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
205d53e91c52 Initial revision
claus
parents:
diff changeset
    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
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    14
InspectorView subclass:#ClassInspectorView
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
    15
	instanceVariableNames:''
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
    16
	classVariableNames:''
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
    17
	poolDictionaries:''
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
    18
	category:'Interface-Inspector'
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    19
!
205d53e91c52 Initial revision
claus
parents:
diff changeset
    20
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
    21
!ClassInspectorView class methodsFor:'documentation'!
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    22
205d53e91c52 Initial revision
claus
parents:
diff changeset
    23
copyright
205d53e91c52 Initial revision
claus
parents:
diff changeset
    24
"
205d53e91c52 Initial revision
claus
parents:
diff changeset
    25
 COPYRIGHT (c) 1994 by Claus Gittinger
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
    26
              All Rights Reserved
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    27
205d53e91c52 Initial revision
claus
parents:
diff changeset
    28
 This software is furnished under a license and may be used
205d53e91c52 Initial revision
claus
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
205d53e91c52 Initial revision
claus
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
205d53e91c52 Initial revision
claus
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
205d53e91c52 Initial revision
claus
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
205d53e91c52 Initial revision
claus
parents:
diff changeset
    33
 hereby transferred.
205d53e91c52 Initial revision
claus
parents:
diff changeset
    34
"
205d53e91c52 Initial revision
claus
parents:
diff changeset
    35
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
    36
2997
928594257211 Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents: 2271
diff changeset
    37
!
928594257211 Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents: 2271
diff changeset
    38
928594257211 Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents: 2271
diff changeset
    39
documentation
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
    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
    42
    also shows ClassVariables in its left SelectionList.
3200
4889a13402db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2997
diff changeset
    43
4889a13402db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2997
diff changeset
    44
        Array inspect
4889a13402db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2997
diff changeset
    45
        View inspect
2997
928594257211 Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents: 2271
diff changeset
    46
"
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    47
! !
205d53e91c52 Initial revision
claus
parents:
diff changeset
    48
205d53e91c52 Initial revision
claus
parents:
diff changeset
    49
!ClassInspectorView methodsFor:'accessing'!
205d53e91c52 Initial revision
claus
parents:
diff changeset
    50
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    51
fieldList
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    52
    "return a list of names to show in the selectionList"
205d53e91c52 Initial revision
claus
parents:
diff changeset
    53
205d53e91c52 Initial revision
claus
parents:
diff changeset
    54
    |aList|
205d53e91c52 Initial revision
claus
parents:
diff changeset
    55
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    56
    aList := super fieldList.
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    57
205d53e91c52 Initial revision
claus
parents:
diff changeset
    58
    "/
205d53e91c52 Initial revision
claus
parents:
diff changeset
    59
    "/ add class variables
205d53e91c52 Initial revision
claus
parents:
diff changeset
    60
    "/
13697
5840dbaaa7d2 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 12933
diff changeset
    61
    inspectedObject theNonMetaclass withAllSuperclasses reverse do:[:aClass |
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    62
        |varNames|
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    63
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    64
        varNames := aClass classVarNames.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    65
        varNames notEmpty ifTrue:[
12933
497e83e8c65a class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 12447
diff changeset
    66
            aList add:('--- classvariables from ' , aClass name allBold, ' ---').
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    67
            varNames do:[:classVarName |
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    68
                aList add:classVarName
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    69
            ]
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    70
        ]
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    71
    ].
205d53e91c52 Initial revision
claus
parents:
diff changeset
    72
    ^ aList
12447
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    73
!
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    74
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    75
valueAtLine:lineNr
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    76
    "return a list of names to show in the selectionList"
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    77
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    78
    |list idx0|
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    79
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    80
    list := super fieldList.
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    81
    lineNr <= list size ifTrue:[ ^ super valueAtLine:lineNr ].
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    82
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    83
    "/
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    84
    "/ a class variable
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    85
    "/
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    86
    idx0 := list size + 1.
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    87
    inspectedObject class withAllSuperclasses reverse do:[:aClass |
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    88
        |varNames varName|
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    89
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    90
        varNames := aClass classVarNames.
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    91
        varNames notEmpty ifTrue:[
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    92
            (lineNr between:idx0+1 and:(idx0 + 1 + varNames size - 1)) ifTrue:[
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    93
                varName := varNames at:lineNr-idx0.
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    94
                ^ aClass classVarAt:varName.
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    95
            ].
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    96
            idx0 := idx0 + varNames size + 1.
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    97
        ]
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    98
    ].
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    99
    ^ nil
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
   100
! !
205d53e91c52 Initial revision
claus
parents:
diff changeset
   101
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   102
!ClassInspectorView class methodsFor:'documentation'!
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   103
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   104
version
13697
5840dbaaa7d2 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 12933
diff changeset
   105
    ^ '$Header: /cvs/stx/stx/libtool/ClassInspectorView.st,v 1.14 2013-11-28 22:07:05 cg Exp $'
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   106
! !
12447
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
   107