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