extensions.st
author Claus Gittinger <cg@exept.de>
Tue, 16 Nov 2010 15:29:06 +0100
changeset 9635 aaaff033bfba
parent 9324 86307b0d7c57
child 9673 c590ef71ca2a
permissions -rw-r--r--
changed: #editMenu
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
     1
"{ Package: 'stx:libtool' }"!
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
     2
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
     3
!ByteArray methodsFor:'inspecting'!
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
     4
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
     5
inspectorExtraAttributes
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
     6
    "extra (pseudo instvar) entries to be shown in an inspector."
8839
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
     7
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
     8
    ^ Dictionary new
9324
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
     9
        declareAllNewFrom:(super inspectorExtraAttributes ? #());
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    10
        add:'-hexstring' -> [ self hexPrintString "WithSeparator:Character space" ];
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    11
        add:'-hexadecimal' ->
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    12
            [
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    13
                String
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    14
                    streamContents:[:s |
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    15
                        self class isWords ifTrue:[
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    16
                            self asWordArray printOn:s base:16 showRadix:true
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    17
                        ] ifFalse:[
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    18
                            self class isLongs ifTrue:[
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    19
                                self asLongIntegerArray printOn:s base:16 showRadix:true
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    20
                            ] ifFalse:[
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    21
                                self asByteArray printOn:s base:16 showRadix:true
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    22
                            ]
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    23
                        ]
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    24
                    ]
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    25
            ];
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
    26
        yourself
7365
20fe515d3a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7356
diff changeset
    27
20fe515d3a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7356
diff changeset
    28
    "Created: / 18-09-2006 / 21:29:59 / cg"
20fe515d3a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7356
diff changeset
    29
    "Modified: / 06-10-2006 / 13:57:20 / cg"
20fe515d3a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7356
diff changeset
    30
! !
20fe515d3a34 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7356
diff changeset
    31
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    32
!Character methodsFor:'inspecting'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    33
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    34
inspectorExtraAttributes
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    35
    "extra (pseudo instvar) entries to be shown in an inspector."
8677
Claus Gittinger <cg@exept.de>
parents: 8417
diff changeset
    36
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    37
    ^ Dictionary new
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    38
	declareAllNewFrom:(super inspectorExtraAttributes ? #());
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    39
	add:'-hexValue' -> [ self codePoint radixPrintStringRadix:16 ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    40
	add:'-string' -> [ self stringSpecies with:self ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    41
	add:'-utf8String' -> [ self utf8Encoded ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    42
	add:'-utf8' -> [ self utf8Encoded asByteArray hexPrintStringWithSeparator:Character space ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    43
	yourself
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    44
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    45
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    46
     $a inspect
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    47
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    48
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    49
    "Created: / 22-10-2006 / 03:52:20 / cg"
7447
744eea8ff31c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7371
diff changeset
    50
! !
744eea8ff31c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7371
diff changeset
    51
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    52
!CharacterArray methodsFor:'inspecting'!
8417
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
    53
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    54
inspectorExtraAttributes
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    55
    "extra (pseudo instvar) entries to be shown in an inspector."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    56
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    57
    |d|
8417
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
    58
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    59
    d := Dictionary new
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    60
	declareAllNewFrom:(super inspectorExtraAttributes ? #());
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    61
	add:'-utf8String' -> [ self utf8Encoded ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    62
	add:'-utf8' -> [ self utf8Encoded asByteArray hexPrintStringWithSeparator:Character space ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    63
	yourself.
8839
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
    64
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    65
    HTMLUtilities notNil ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    66
	d add:'-html' -> [ HTMLUtilities escapeCharacterEntities:self ].
8417
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
    67
    ].
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
    68
    ^ d
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
    69
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
    70
    "
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
    71
     'aouäöü' inspect
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
    72
    "
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
    73
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
    74
    "Created: / 22-10-2006 / 03:52:20 / cg"
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
    75
! !
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
    76
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    77
!Collection methodsFor:'inspecting'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    78
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    79
inspectorExtraAttributes
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    80
    "extra (pseudo instvar) entries to be shown in an inspector."
8677
Claus Gittinger <cg@exept.de>
parents: 8417
diff changeset
    81
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    82
    ^ Dictionary new
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    83
	declareAllNewFrom:(super inspectorExtraAttributes ? #());
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    84
	add:('-size' -> [ self size ]);
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    85
	yourself
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    86
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    87
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    88
     'hello' inspect
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    89
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    90
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    91
    "Created: / 06-10-2006 / 13:56:52 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    92
    "Modified: / 06-10-2006 / 17:43:45 / cg"
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    93
! !
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    94
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    95
!Color methodsFor:'inspecting'!
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    96
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    97
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
    98
    "return the class of an appropriate inspector.
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
    99
     ST/X has a specialized ColorInspectorView for that"
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   100
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   101
    ^ ColorInspectorView
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   102
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   103
    "Modified: 23.4.1996 / 13:39:50 / cg"
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   104
! !
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   105
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   106
!Color methodsFor:'inspecting'!
8406
445174a4db22 #inspectorExtraAttributes
Stefan Vogel <sv@exept.de>
parents: 7754
diff changeset
   107
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   108
inspectorExtraAttributes
8677
Claus Gittinger <cg@exept.de>
parents: 8417
diff changeset
   109
    "extra (pseudo instvar) entries to be shown in an inspector."
Claus Gittinger <cg@exept.de>
parents: 8417
diff changeset
   110
8406
445174a4db22 #inspectorExtraAttributes
Stefan Vogel <sv@exept.de>
parents: 7754
diff changeset
   111
    ^ Dictionary new
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   112
	declareAllNewFrom:(super inspectorExtraAttributes ? #());
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   113
	add:'-rgb' -> [ self rgbValue hexPrintString ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   114
	add:'-html' -> [ self htmlPrintString ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   115
	yourself
8417
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
   116
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
   117
    "
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
   118
     Color red inspect
7ba7a8ebe38c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8406
diff changeset
   119
    "
8406
445174a4db22 #inspectorExtraAttributes
Stefan Vogel <sv@exept.de>
parents: 7754
diff changeset
   120
! !
445174a4db22 #inspectorExtraAttributes
Stefan Vogel <sv@exept.de>
parents: 7754
diff changeset
   121
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   122
!Dictionary methodsFor:'inspecting'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   123
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   124
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   125
    "redefined to use DictionaryInspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   126
     (instead of the default Inspector)."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   127
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   128
    ^ DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   129
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   130
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   131
!ExecutableFunction methodsFor:'printing & storing'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   132
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   133
printStringForBrowserWithSelector:selector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   134
    "return a printString to represent myself to the user in a browser."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   135
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   136
    ^ self printStringForBrowserWithSelector:selector inClass:nil
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   137
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   138
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   139
!Form methodsFor:'inspecting'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   140
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   141
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   142
    "redefined to launch an ImageInspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   143
     (instead of the default InspectorView)."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   144
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   145
    ^ ImageInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   146
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   147
8839
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   148
!Image methodsFor:'inspecting'!
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   149
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   150
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   151
    "redefined to launch an ImageInspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   152
     (instead of the default InspectorView)."
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   153
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   154
    (width notNil and:[height notNil]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   155
	^ ImageInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   156
    ].
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   157
    ^ super inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   158
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   159
    "Modified: 10.6.1996 / 18:23:55 / cg"
8839
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   160
! !
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   161
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   162
!Integer methodsFor:'inspecting'!
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   163
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   164
inspectorExtraAttributes
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   165
    "extra (pseudo instvar) entries to be shown in an inspector."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   166
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   167
    ^ Dictionary new
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   168
	declareAllNewFrom:(super inspectorExtraAttributes ? #());
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   169
	add:'-hexadecimal' -> [ self radixPrintStringRadix:16 ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   170
	add:'-octal' -> [ self radixPrintStringRadix:8 ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   171
	add:'-binary' -> [ self radixPrintStringRadix:2 ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   172
	yourself
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   173
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   174
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   175
     123 inspect
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   176
    "
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   177
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   178
    "Created: / 18-09-2006 / 21:22:46 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   179
    "Modified: / 06-10-2006 / 13:57:28 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   180
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   181
8839
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   182
!Method methodsFor:'inspecting'!
7735
a85329ee3b3a todo notification
Claus Gittinger <cg@exept.de>
parents: 7703
diff changeset
   183
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   184
inspectorExtraAttributes
8677
Claus Gittinger <cg@exept.de>
parents: 8417
diff changeset
   185
    "extra (pseudo instvar) entries to be shown in an inspector."
Claus Gittinger <cg@exept.de>
parents: 8417
diff changeset
   186
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   187
    ^ Dictionary new
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   188
	declareAllNewFrom:(super inspectorExtraAttributes ? #());
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   189
	add:'-code' -> [ String streamContents:[:s | self decompileTo:s] ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   190
	add:'-source' -> [ self source ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   191
	yourself
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   192
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   193
    "
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   194
     (Method compiledMethodAt:#inspectorExtraAttributes) inspect
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   195
    "
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   196
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   197
    "Created: / 18-09-2006 / 21:34:01 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   198
    "Modified: / 06-10-2006 / 13:57:33 / cg"
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   199
! !
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   200
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   201
!Method methodsFor:'printing & storing'!
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   202
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   203
printStringForBrowserWithSelector:selector inClass:aClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   204
    "return a printString to represent myself to the user in a browser.
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   205
     Defined here to allow for browsers to deal with nonStandard pseudoMethods"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   206
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   207
    |s privInfo moreInfo p info n cls currentChangeSet isInChangeSet mthdPackage
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   208
     userPreferences shownSelector suppressPackage timeRounded|
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   209
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   210
    moreInfo := ''.
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   211
    privInfo := ''.
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   212
    userPreferences := UserPreferences current.
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   213
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   214
    self isWrapped ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   215
        (MessageTracer isCounting:self) ifTrue:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   216
            (MessageTracer isCountingMemoryUsage:self) ifTrue:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   217
                moreInfo := moreInfo , (' (mem usage avg: %1 bytes)' bindWith:(MessageTracer memoryUsageOfMethod:self) printString allBold).
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   218
            ] ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   219
                moreInfo := moreInfo , (' (called %1 times)' bindWith:(MessageTracer executionCountOfMethod:self) printString allBold).
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   220
            ]
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   221
        ] ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   222
            (MessageTracer isTiming:self) ifTrue:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   223
                info := MessageTracer executionTimesOfMethod:self.
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   224
                ((n := info count) == 0) ifTrue:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   225
                    moreInfo := moreInfo , (' (cnt: %1)' bindWith:n)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   226
                ] ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   227
                    timeRounded := [:millis |
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   228
                        |rnd|
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   229
                        rnd := (millis > 100)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   230
                                 ifTrue:[ 1 ]
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   231
                                 ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   232
                                     (millis > 10)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   233
                                        ifTrue:[ 0.1 ]
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   234
                                        ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   235
                                            (millis > 1)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   236
                                                ifTrue:[ 0.01 ]
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   237
                                                ifFalse:[ 0.001 ]]].
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   238
                        millis roundTo:rnd
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   239
                    ].
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   240
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   241
                    (n == 1 or:[ info avgTimeRounded = info minTimeRounded  ]) ifTrue:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   242
                        moreInfo := moreInfo ,
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   243
                                    (' (t: %1ms cnt: %2)'
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   244
                                        bindWith:((timeRounded value:info avgTimeRounded) printString allBold)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   245
                                        with:n)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   246
                    ] ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   247
                        moreInfo := moreInfo ,
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   248
                                    (' (avg: %1ms min: %2 max: %3 cnt: %4)'
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   249
                                        bindWith:((timeRounded value:info avgTimeRounded) printString allBold)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   250
                                        with:((timeRounded value:info minTimeRounded) printString)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   251
                                        with:((timeRounded value:info maxTimeRounded) printString)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   252
                                        with:n)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   253
                    ].
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   254
                ].
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   255
            ] ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   256
                moreInfo := ' !!'
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   257
            ]
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   258
        ].
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   259
    ].
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   260
    p := self privacy.
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   261
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   262
    p ~~ #public ifTrue:[
9050
b9df3c89888d comment/format in: #colorizeAllWith:on:
Claus Gittinger <cg@exept.de>
parents: 8970
diff changeset
   263
        privInfo := (' (* ' , p , ' *)') allItalic.
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   264
    ].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   265
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   266
"/    self isInvalid ifTrue:[
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   267
"/        moreInfo := ' (** not executable **)'.
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   268
"/    ].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   269
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   270
    (self isLazyMethod not and:[self isUnloaded]) ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   271
        moreInfo := ' (** unloaded **)'
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   272
    ].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   273
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   274
    privInfo size ~~ 0 ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   275
        moreInfo := privInfo , ' ' , moreInfo
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   276
    ].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   277
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   278
    s := shownSelector := (self selectorPrintStringInBrowserFor:selector class:aClass).
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   279
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   280
    (cls := aClass) isNil ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   281
        cls := self containingClass
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   282
    ].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   283
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   284
    currentChangeSet := ChangeSet current.
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   285
    isInChangeSet := currentChangeSet includesChangeForClass:cls selector:selector.
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   286
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   287
    isInChangeSet ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   288
        s := s asText emphasisAllAdd:(userPreferences emphasisForChangedCode)
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   289
    ].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   290
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   291
    (cls isNil or:[(mthdPackage := self package) ~= cls package]) ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   292
        suppressPackage := false.
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   293
        mthdPackage = PackageId noProjectID ifTrue:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   294
            mthdPackage := '+'.
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   295
            "/ suppressPackage := true
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   296
        ].
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   297
        suppressPackage ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   298
            p := ' [' , (mthdPackage ? '?') allItalic , '] '.
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   299
            p := p asText emphasisAllAdd:(userPreferences emphasisForDifferentPackage).
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   300
            s := s , ' ' , p
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   301
        ].
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   302
    ].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   303
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   304
    moreInfo size == 0 ifTrue:[^ s].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   305
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   306
    s := shownSelector , moreInfo.
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   307
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   308
    self isInvalid ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   309
        s := s asText emphasizeAllWith:(userPreferences emphasisForObsoleteCode).
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   310
    ].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   311
    ^ s
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   312
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   313
    "Modified: / 23-01-1998 / 13:15:15 / stefan"
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   314
    "Created: / 05-02-2000 / 22:55:56 / cg"
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   315
    "Modified: / 05-03-2007 / 16:18:53 / cg"
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   316
! !
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   317
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   318
!Method methodsFor:'printing & storing'!
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   319
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   320
selectorPrintStringInBrowserFor:selector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   321
    ^ selector
7735
a85329ee3b3a todo notification
Claus Gittinger <cg@exept.de>
parents: 7703
diff changeset
   322
! !
a85329ee3b3a todo notification
Claus Gittinger <cg@exept.de>
parents: 7703
diff changeset
   323
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   324
!Method methodsFor:'printing & storing'!
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   325
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   326
selectorPrintStringInBrowserFor:selector class:aClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   327
    |nsPart selPart idx ns|
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   328
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   329
    selector isNameSpaceSelector ifFalse:[^ selector].
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   330
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   331
    idx := selector indexOf:$: startingAt:3.
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   332
    nsPart := selector copyFrom:2 to:idx-1.
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   333
    ns := Smalltalk at:nsPart asSymbol.
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   334
    selPart := selector copyFrom:idx+2.
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   335
    ^ selPart , ' {',nsPart,'}'.
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   336
! !
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   337
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   338
!MethodDictionary methodsFor:'inspecting'!
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   339
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   340
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   341
    "redefined to use DictionaryInspector
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   342
     (instead of the default Inspector)."
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   343
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   344
    ^ DictionaryInspectorView
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   345
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   346
    "Created: 12.6.1996 / 12:29:13 / stefan"
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   347
! !
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   348
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   349
!NameSpace class methodsFor:'inspecting'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   350
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   351
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   352
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   353
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   354
    "redefined to launch a DictionaryInspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   355
     (instead of the default Inspector)."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   356
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   357
    ^ DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   358
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   359
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   360
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   361
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   362
!Object methodsFor:'debugging'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   363
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   364
inspectorExtraAttributes
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   365
    "extra (pseudo instvar) entries to be shown in an inspector.
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   366
     Answers a dictionary of aString -> aBlock.
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   367
     aString is name of extra attribute and MUST start with minus ($-).
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   368
     aBlock returns the object representing extra attribute."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   369
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   370
    ^Dictionary new
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   371
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   372
    " Try to uncomment following and inspect any object "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   373
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   374
"/    ^Dictionary new
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   375
"/        add:'-test' -> ['TEST TEST'];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   376
"/        yourself
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   377
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   378
    "Created: / 16-08-2005 / 20:43:33 / janfrog"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   379
    "Modified: / 02-09-2005 / 19:00:01 / janfrog"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   380
    "Modified: / 04-10-2006 / 14:33:34 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   381
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   382
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   383
!OrderedCollection methodsFor:'inspecting'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   384
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   385
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   386
    "redefined to launch an OrderedCollectionInspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   387
     (instead of the default InspectorView)."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   388
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   389
    ^ OrderedCollectionInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   390
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   391
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   392
     (OrderedCollection withAll:#(3 2 1)) inspect
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   393
     (OrderedCollection withAll:#(3 2 1)) removeFirst; yourself; inspect
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   394
     #(0 8 15 3 99 2) asSortedCollection inspect
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   395
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   396
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   397
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   398
!RunArray methodsFor:'user interface'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   399
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   400
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   401
    "Re-reimplemented so that we don't get an ordered collection inspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   402
     which would get very confused when confronted with a runArray."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   403
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   404
    ^ InspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   405
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   406
    "Modified: / 30.10.1997 / 14:28:20 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   407
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   408
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   409
!Set methodsFor:'inspecting'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   410
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   411
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   412
    "redefined to use SetInspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   413
     (instead of the default Inspector)."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   414
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   415
    ^ SetInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   416
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   417
7754
7c76e5708dfa oops - got corrupted
Claus Gittinger <cg@exept.de>
parents: 7753
diff changeset
   418
!Smalltalk class methodsFor:'inspecting'!
7c76e5708dfa oops - got corrupted
Claus Gittinger <cg@exept.de>
parents: 7753
diff changeset
   419
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   420
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   421
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   422
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   423
    "redefined to launch a DictionaryInspector (instead of the default Inspector)."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   424
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   425
    ^ DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   426
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   427
7754
7c76e5708dfa oops - got corrupted
Claus Gittinger <cg@exept.de>
parents: 7753
diff changeset
   428
!Text methodsFor:'inspecting'!
7c76e5708dfa oops - got corrupted
Claus Gittinger <cg@exept.de>
parents: 7753
diff changeset
   429
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   430
inspectorExtraAttributes
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   431
    "extra (pseudo instvar) entries to be shown in an inspector."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   432
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   433
    ^ Dictionary new
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   434
	declareAllNewFrom:(super inspectorExtraAttributes ? #());
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   435
	add:'-text' -> [ self ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   436
	yourself
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   437
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   438
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   439
     'hello' allBold inspect
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   440
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   441
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   442
    "Created: / 18-09-2006 / 21:25:52 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   443
    "Modified: / 06-10-2006 / 13:57:38 / cg"
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   444
! !
8918
230356e1b722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8844
diff changeset
   445
8919
e18fa0224d6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8918
diff changeset
   446
!stx_libtool class methodsFor:'documentation'!
e18fa0224d6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8918
diff changeset
   447
e18fa0224d6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8918
diff changeset
   448
extensionsVersion_CVS
9324
86307b0d7c57 hexString in inspector for ByteArrays
Claus Gittinger <cg@exept.de>
parents: 9050
diff changeset
   449
    ^ '$Header: /cvs/stx/stx/libtool/extensions.st,v 1.28 2009-12-16 17:17:11 cg Exp $'
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   450
! !