ClassInspectorView.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Thu, 14 Jun 2018 22:19:39 +0100
branchjv
changeset 18227 d25a407ba86d
parent 16664 ef51c9c52b52
child 18532 cccb41254edf
permissions -rw-r--r--
Mini testrunner: show "green" if there's at least one pass and rest is pass or skip This is more meaningfull result then showing "gray" if there's at least one skip.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16654
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
     1
"{ Encoding: utf8 }"
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
     2
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
     3
"
205d53e91c52 Initial revision
claus
parents:
diff changeset
     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
205d53e91c52 Initial revision
claus
parents:
diff changeset
     6
205d53e91c52 Initial revision
claus
parents:
diff changeset
     7
 This software is furnished under a license and may be used
205d53e91c52 Initial revision
claus
parents:
diff changeset
     8
 only in accordance with the terms of that license and with the
205d53e91c52 Initial revision
claus
parents:
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
205d53e91c52 Initial revision
claus
parents:
diff changeset
    10
 be provided or otherwise made available to, or used by, any
205d53e91c52 Initial revision
claus
parents:
diff changeset
    11
 other person.  No title to or ownership of the software is
205d53e91c52 Initial revision
claus
parents:
diff changeset
    12
 hereby transferred.
205d53e91c52 Initial revision
claus
parents:
diff changeset
    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
705cf3d2d10a class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 13697
diff changeset
    16
"{ NameSpace: Smalltalk }"
705cf3d2d10a class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 13697
diff changeset
    17
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    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
205d53e91c52 Initial revision
claus
parents:
diff changeset
    23
!
205d53e91c52 Initial revision
claus
parents:
diff changeset
    24
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
    25
!ClassInspectorView class methodsFor:'documentation'!
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    26
205d53e91c52 Initial revision
claus
parents:
diff changeset
    27
copyright
205d53e91c52 Initial revision
claus
parents:
diff changeset
    28
"
205d53e91c52 Initial revision
claus
parents:
diff changeset
    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
205d53e91c52 Initial revision
claus
parents:
diff changeset
    31
205d53e91c52 Initial revision
claus
parents:
diff changeset
    32
 This software is furnished under a license and may be used
205d53e91c52 Initial revision
claus
parents:
diff changeset
    33
 only in accordance with the terms of that license and with the
205d53e91c52 Initial revision
claus
parents:
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
205d53e91c52 Initial revision
claus
parents:
diff changeset
    35
 be provided or otherwise made available to, or used by, any
205d53e91c52 Initial revision
claus
parents:
diff changeset
    36
 other person.  No title to or ownership of the software is
205d53e91c52 Initial revision
claus
parents:
diff changeset
    37
 hereby transferred.
205d53e91c52 Initial revision
claus
parents:
diff changeset
    38
"
205d53e91c52 Initial revision
claus
parents:
diff changeset
    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
4889a13402db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2997
diff changeset
    47
4889a13402db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2997
diff changeset
    48
        Array inspect
4889a13402db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2997
diff changeset
    49
        View inspect
2997
928594257211 Move documentation method to class protocol.
Stefan Vogel <sv@exept.de>
parents: 2271
diff changeset
    50
"
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    51
! !
205d53e91c52 Initial revision
claus
parents:
diff changeset
    52
205d53e91c52 Initial revision
claus
parents:
diff changeset
    53
!ClassInspectorView methodsFor:'accessing'!
205d53e91c52 Initial revision
claus
parents:
diff changeset
    54
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    55
fieldList
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    56
    "return a list of names to show in the selectionList"
205d53e91c52 Initial revision
claus
parents:
diff changeset
    57
205d53e91c52 Initial revision
claus
parents:
diff changeset
    58
    |aList|
205d53e91c52 Initial revision
claus
parents:
diff changeset
    59
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    60
    aList := super fieldList.
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    61
205d53e91c52 Initial revision
claus
parents:
diff changeset
    62
    "/
16548
b8f9c3d05c67 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 15533
diff changeset
    63
    "/ add class variables (always sorted)
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    64
    "/
15533
705cf3d2d10a class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 13697
diff changeset
    65
    inspectedObject theNonMetaclass withAllSuperclasses reverseDo:[:aClass |
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    66
        |varNames|
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    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
b8f9c3d05c67 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 15533
diff changeset
    70
            varNames sort.
12933
497e83e8c65a class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 12447
diff changeset
    71
            aList add:('--- classvariables from ' , aClass name allBold, ' ---').
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    72
            varNames do:[:classVarName |
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    73
                aList add:classVarName
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    74
            ]
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    75
        ]
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
    76
    ].
205d53e91c52 Initial revision
claus
parents:
diff changeset
    77
    ^ aList
12447
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    78
!
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
valueAtLine:lineNr
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    81
    "return a list of names to show in the selectionList"
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    82
16654
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
    83
    |list idx0 nm cls|
12447
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    84
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    85
    list := super fieldList.
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    86
    lineNr <= list size ifTrue:[ ^ super valueAtLine:lineNr ].
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    87
16654
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
    88
    nm := self listEntryAt:lineNr.
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
    89
    nm isNil ifTrue:[ ^nil].
12447
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    90
16654
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
    91
    "/
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
    92
    "/ a class variable?
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
    93
    "/
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
    94
    cls := inspectedObject class theNonMetaclass whichClassDefinesClassVar:nm.
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
    95
    cls notNil ifTrue:[
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
    96
        ^ cls classVarAt:nm.
12447
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
    97
    ].
16654
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
    98
    
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
    99
"/    idx0 := list size + 1.
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
   100
"/    inspectedObject class withAllSuperclasses reverseDo:[:aClass |
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
   101
"/        |varNames varName|
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
   102
"/
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
   103
"/        varNames := aClass classVarNames.
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
   104
"/        varNames notEmpty ifTrue:[
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
   105
"/            (lineNr between:idx0+1 and:(idx0 + 1 + varNames size - 1)) ifTrue:[
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
   106
"/                varName := varNames at:lineNr-idx0.
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
   107
"/                ^ aClass classVarAt:varName.
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
   108
"/            ].
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
   109
"/            idx0 := idx0 + varNames size + 1.
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
   110
"/        ]
769d7d0f32b4 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 16548
diff changeset
   111
"/    ].
12447
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
   112
    ^ nil
30
205d53e91c52 Initial revision
claus
parents:
diff changeset
   113
! !
205d53e91c52 Initial revision
claus
parents:
diff changeset
   114
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   115
!ClassInspectorView class methodsFor:'documentation'!
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   116
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   117
version
16548
b8f9c3d05c67 #OTHER by cg
Claus Gittinger <cg@exept.de>
parents: 15533
diff changeset
   118
    ^ '$Header$'
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   119
! !
12447
a35a8b2fe1f5 class: ClassInspectorView
Claus Gittinger <cg@exept.de>
parents: 3201
diff changeset
   120