extensions.st
author Claus Gittinger <cg@exept.de>
Mon, 14 Feb 2011 17:23:19 +0100
changeset 9764 47b9c33465a1
parent 9691 312706640f5c
child 10051 5b7e30460ea4
permissions -rw-r--r--
added: #hasZipFileSelectedHolder changed: #hasZipFileSelected #toolsMenuSpec
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
9691
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   122
!Date methodsFor:'inspecting'!
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   123
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   124
inspectorExtraAttributes
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   125
    "extra (pseudo instvar) entries to be shown in an inspector."
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   126
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   127
    ^ Dictionary new
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   128
        declareAllNewFrom:(super inspectorExtraAttributes ? #());
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   129
        add:'-dayInWeek' -> [ self dayInWeek printString , ' "', self dayOfWeekName , '"' ];
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   130
        add:'-dayInYear' -> [ self dayInYear ];
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   131
        add:'-daysInMonth' -> [ self daysInMonth ];
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   132
        add:'-monthName' -> [ self monthName ];
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   133
        add:'-leapYear' -> [ self isLeapYear ];
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   134
        yourself
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   135
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   136
    "
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   137
     Date today inspect
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   138
    "
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   139
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   140
    "Created: / 20-01-2011 / 12:19:05 / cg"
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   141
! !
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   142
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   143
!Dictionary methodsFor:'inspecting'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   144
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   145
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   146
    "redefined to use DictionaryInspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   147
     (instead of the default Inspector)."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   148
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   149
    ^ DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   150
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   151
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   152
!ExecutableFunction methodsFor:'printing & storing'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   153
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   154
printStringForBrowserWithSelector:selector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   155
    "return a printString to represent myself to the user in a browser."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   156
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   157
    ^ self printStringForBrowserWithSelector:selector inClass:nil
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   158
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   159
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   160
!Form methodsFor:'inspecting'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   161
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   162
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   163
    "redefined to launch an ImageInspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   164
     (instead of the default InspectorView)."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   165
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   166
    ^ ImageInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   167
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   168
8839
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   169
!Image methodsFor:'inspecting'!
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   170
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   171
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   172
    "redefined to launch an ImageInspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   173
     (instead of the default InspectorView)."
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   174
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   175
    (width notNil and:[height notNil]) ifTrue:[
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   176
	^ ImageInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   177
    ].
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   178
    ^ super inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   179
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   180
    "Modified: 10.6.1996 / 18:23:55 / cg"
8839
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   181
! !
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   182
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   183
!Integer methodsFor:'inspecting'!
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   184
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   185
inspectorExtraAttributes
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   186
    "extra (pseudo instvar) entries to be shown in an inspector."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   187
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   188
    ^ Dictionary new
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   189
	declareAllNewFrom:(super inspectorExtraAttributes ? #());
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   190
	add:'-hexadecimal' -> [ self radixPrintStringRadix:16 ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   191
	add:'-octal' -> [ self radixPrintStringRadix:8 ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   192
	add:'-binary' -> [ self radixPrintStringRadix:2 ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   193
	yourself
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   194
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   195
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   196
     123 inspect
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   197
    "
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   198
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   199
    "Created: / 18-09-2006 / 21:22:46 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   200
    "Modified: / 06-10-2006 / 13:57:28 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   201
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   202
8839
792607726eb6 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8838
diff changeset
   203
!Method methodsFor:'inspecting'!
7735
a85329ee3b3a todo notification
Claus Gittinger <cg@exept.de>
parents: 7703
diff changeset
   204
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   205
inspectorExtraAttributes
8677
Claus Gittinger <cg@exept.de>
parents: 8417
diff changeset
   206
    "extra (pseudo instvar) entries to be shown in an inspector."
Claus Gittinger <cg@exept.de>
parents: 8417
diff changeset
   207
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   208
    ^ Dictionary new
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   209
	declareAllNewFrom:(super inspectorExtraAttributes ? #());
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   210
	add:'-code' -> [ String streamContents:[:s | self decompileTo:s] ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   211
	add:'-source' -> [ self source ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   212
	yourself
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   213
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   214
    "
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   215
     (Method compiledMethodAt:#inspectorExtraAttributes) inspect
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   216
    "
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   217
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   218
    "Created: / 18-09-2006 / 21:34:01 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   219
    "Modified: / 06-10-2006 / 13:57:33 / cg"
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   220
! !
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   221
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   222
!Method methodsFor:'printing & storing'!
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   223
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   224
printStringForBrowserWithSelector:selector inClass:aClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   225
    "return a printString to represent myself to the user in a browser.
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   226
     Defined here to allow for browsers to deal with nonStandard pseudoMethods"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   227
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   228
    |s privInfo moreInfo p info n cls currentChangeSet isInChangeSet mthdPackage
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   229
     userPreferences shownSelector suppressPackage timeRounded|
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   230
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   231
    moreInfo := ''.
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   232
    privInfo := ''.
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   233
    userPreferences := UserPreferences current.
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   234
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   235
    self isWrapped ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   236
        (MessageTracer isCounting:self) ifTrue:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   237
            (MessageTracer isCountingMemoryUsage:self) ifTrue:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   238
                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
   239
            ] ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   240
                moreInfo := moreInfo , (' (called %1 times)' bindWith:(MessageTracer executionCountOfMethod:self) printString allBold).
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   241
            ]
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   242
        ] ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   243
            (MessageTracer isTiming:self) ifTrue:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   244
                info := MessageTracer executionTimesOfMethod:self.
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   245
                ((n := info count) == 0) ifTrue:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   246
                    moreInfo := moreInfo , (' (cnt: %1)' bindWith:n)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   247
                ] ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   248
                    timeRounded := [:millis |
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   249
                        |rnd|
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   250
                        rnd := (millis > 100)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   251
                                 ifTrue:[ 1 ]
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   252
                                 ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   253
                                     (millis > 10)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   254
                                        ifTrue:[ 0.1 ]
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
                                            (millis > 1)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   257
                                                ifTrue:[ 0.01 ]
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   258
                                                ifFalse:[ 0.001 ]]].
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   259
                        millis roundTo:rnd
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   260
                    ].
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   261
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   262
                    (n == 1 or:[ info avgTimeRounded = info minTimeRounded  ]) ifTrue:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   263
                        moreInfo := moreInfo ,
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   264
                                    (' (t: %1ms cnt: %2)'
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   265
                                        bindWith:((timeRounded value:info avgTimeRounded) printString allBold)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   266
                                        with:n)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   267
                    ] ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   268
                        moreInfo := moreInfo ,
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   269
                                    (' (avg: %1ms min: %2 max: %3 cnt: %4)'
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   270
                                        bindWith:((timeRounded value:info avgTimeRounded) printString allBold)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   271
                                        with:((timeRounded value:info minTimeRounded) printString)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   272
                                        with:((timeRounded value:info maxTimeRounded) printString)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   273
                                        with:n)
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   274
                    ].
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   275
                ].
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   276
            ] ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   277
                moreInfo := ' !!'
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   278
            ]
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   279
        ].
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   280
    ].
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   281
    p := self privacy.
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
    p ~~ #public ifTrue:[
9050
b9df3c89888d comment/format in: #colorizeAllWith:on:
Claus Gittinger <cg@exept.de>
parents: 8970
diff changeset
   284
        privInfo := (' (* ' , p , ' *)') allItalic.
7299
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
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   287
"/    self isInvalid ifTrue:[
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   288
"/        moreInfo := ' (** not executable **)'.
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
    (self isLazyMethod not and:[self isUnloaded]) ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   292
        moreInfo := ' (** unloaded **)'
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   293
    ].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   294
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   295
    privInfo size ~~ 0 ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   296
        moreInfo := privInfo , ' ' , moreInfo
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   297
    ].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   298
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   299
    s := shownSelector := (self selectorPrintStringInBrowserFor:selector class:aClass).
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   300
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   301
    (cls := aClass) isNil ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   302
        cls := self containingClass
7299
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
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   305
    currentChangeSet := ChangeSet current.
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   306
    isInChangeSet := currentChangeSet includesChangeForClass:cls selector:selector.
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
    isInChangeSet ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   309
        s := s asText emphasisAllAdd:(userPreferences emphasisForChangedCode)
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
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   312
    (cls isNil or:[(mthdPackage := self package) ~= cls package]) ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   313
        suppressPackage := false.
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   314
        mthdPackage = PackageId noProjectID ifTrue:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   315
            mthdPackage := '+'.
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   316
            "/ suppressPackage := true
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   317
        ].
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   318
        suppressPackage ifFalse:[
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   319
            p := ' [' , (mthdPackage ? '?') allItalic , '] '.
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   320
            p := p asText emphasisAllAdd:(userPreferences emphasisForDifferentPackage).
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   321
            s := s , ' ' , p
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   322
        ].
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   323
    ].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   324
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   325
    moreInfo size == 0 ifTrue:[^ s].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   326
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   327
    s := shownSelector , moreInfo.
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   328
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   329
    self isInvalid ifTrue:[
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   330
        s := s asText emphasizeAllWith:(userPreferences emphasisForObsoleteCode).
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   331
    ].
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   332
    ^ s
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   333
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   334
    "Modified: / 23-01-1998 / 13:15:15 / stefan"
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   335
    "Created: / 05-02-2000 / 22:55:56 / cg"
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   336
    "Modified: / 05-03-2007 / 16:18:53 / cg"
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   337
! !
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   338
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   339
!Method methodsFor:'printing & storing'!
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   340
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   341
selectorPrintStringInBrowserFor:selector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   342
    ^ selector
7735
a85329ee3b3a todo notification
Claus Gittinger <cg@exept.de>
parents: 7703
diff changeset
   343
! !
a85329ee3b3a todo notification
Claus Gittinger <cg@exept.de>
parents: 7703
diff changeset
   344
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   345
!Method methodsFor:'printing & storing'!
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   346
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   347
selectorPrintStringInBrowserFor:selector class:aClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   348
    |nsPart selPart idx ns|
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   349
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   350
    selector isNameSpaceSelector ifFalse:[^ selector].
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   351
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   352
    idx := selector indexOf:$: startingAt:3.
7703
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   353
    nsPart := selector copyFrom:2 to:idx-1.
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   354
    ns := Smalltalk at:nsPart asSymbol.
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   355
    selPart := selector copyFrom:idx+2.
cfa8b91be77b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7657
diff changeset
   356
    ^ selPart , ' {',nsPart,'}'.
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   357
! !
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   358
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   359
!MethodDictionary methodsFor:'inspecting'!
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   360
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   361
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   362
    "redefined to use DictionaryInspector
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   363
     (instead of the default Inspector)."
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   364
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   365
    ^ DictionaryInspectorView
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   366
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   367
    "Created: 12.6.1996 / 12:29:13 / stefan"
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   368
! !
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   369
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   370
!NameSpace class methodsFor:'inspecting'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   371
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   372
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   373
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   374
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   375
    "redefined to launch a DictionaryInspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   376
     (instead of the default Inspector)."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   377
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   378
    ^ DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   379
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
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   383
!Object methodsFor:'debugging'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   384
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   385
inspectorExtraAttributes
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   386
    "extra (pseudo instvar) entries to be shown in an inspector.
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   387
     Answers a dictionary of aString -> aBlock.
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   388
     aString is name of extra attribute and MUST start with minus ($-).
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   389
     aBlock returns the object representing extra attribute."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   390
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   391
    ^Dictionary new
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   392
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   393
    " Try to uncomment following and inspect any object "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   394
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   395
"/    ^Dictionary new
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   396
"/        add:'-test' -> ['TEST TEST'];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   397
"/        yourself
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   398
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   399
    "Created: / 16-08-2005 / 20:43:33 / janfrog"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   400
    "Modified: / 02-09-2005 / 19:00:01 / janfrog"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   401
    "Modified: / 04-10-2006 / 14:33:34 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   402
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   403
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   404
!OrderedCollection methodsFor:'inspecting'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   405
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   406
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   407
    "redefined to launch an OrderedCollectionInspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   408
     (instead of the default InspectorView)."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   409
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   410
    ^ OrderedCollectionInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   411
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   412
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   413
     (OrderedCollection withAll:#(3 2 1)) inspect
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   414
     (OrderedCollection withAll:#(3 2 1)) removeFirst; yourself; inspect
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   415
     #(0 8 15 3 99 2) asSortedCollection inspect
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   416
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   417
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   418
9673
c590ef71ca2a sharedpool inspector
Claus Gittinger <cg@exept.de>
parents: 9324
diff changeset
   419
!RunArray methodsFor:'inspecting'!
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   420
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   421
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   422
    "Re-reimplemented so that we don't get an ordered collection inspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   423
     which would get very confused when confronted with a runArray."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   424
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   425
    ^ InspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   426
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   427
    "Modified: / 30.10.1997 / 14:28:20 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   428
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   429
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   430
!Set methodsFor:'inspecting'!
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   431
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   432
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   433
    "redefined to use SetInspector
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   434
     (instead of the default Inspector)."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   435
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   436
    ^ SetInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   437
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   438
9673
c590ef71ca2a sharedpool inspector
Claus Gittinger <cg@exept.de>
parents: 9324
diff changeset
   439
!SharedPool class methodsFor:'inspecting'!
c590ef71ca2a sharedpool inspector
Claus Gittinger <cg@exept.de>
parents: 9324
diff changeset
   440
c590ef71ca2a sharedpool inspector
Claus Gittinger <cg@exept.de>
parents: 9324
diff changeset
   441
inspectorClass
c590ef71ca2a sharedpool inspector
Claus Gittinger <cg@exept.de>
parents: 9324
diff changeset
   442
    "{ Pragma: +optSpace }"
c590ef71ca2a sharedpool inspector
Claus Gittinger <cg@exept.de>
parents: 9324
diff changeset
   443
c590ef71ca2a sharedpool inspector
Claus Gittinger <cg@exept.de>
parents: 9324
diff changeset
   444
    "redefined to launch a DictionaryInspector (instead of the default Inspector)."
c590ef71ca2a sharedpool inspector
Claus Gittinger <cg@exept.de>
parents: 9324
diff changeset
   445
c590ef71ca2a sharedpool inspector
Claus Gittinger <cg@exept.de>
parents: 9324
diff changeset
   446
    ^ DictionaryInspectorView
c590ef71ca2a sharedpool inspector
Claus Gittinger <cg@exept.de>
parents: 9324
diff changeset
   447
! !
c590ef71ca2a sharedpool inspector
Claus Gittinger <cg@exept.de>
parents: 9324
diff changeset
   448
7754
7c76e5708dfa oops - got corrupted
Claus Gittinger <cg@exept.de>
parents: 7753
diff changeset
   449
!Smalltalk class methodsFor:'inspecting'!
7c76e5708dfa oops - got corrupted
Claus Gittinger <cg@exept.de>
parents: 7753
diff changeset
   450
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   451
inspectorClass
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   452
    "{ Pragma: +optSpace }"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   453
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   454
    "redefined to launch a DictionaryInspector (instead of the default Inspector)."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   455
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   456
    ^ DictionaryInspectorView
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   457
! !
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   458
7754
7c76e5708dfa oops - got corrupted
Claus Gittinger <cg@exept.de>
parents: 7753
diff changeset
   459
!Text methodsFor:'inspecting'!
7c76e5708dfa oops - got corrupted
Claus Gittinger <cg@exept.de>
parents: 7753
diff changeset
   460
8843
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   461
inspectorExtraAttributes
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   462
    "extra (pseudo instvar) entries to be shown in an inspector."
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   463
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   464
    ^ Dictionary new
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   465
	declareAllNewFrom:(super inspectorExtraAttributes ? #());
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   466
	add:'-text' -> [ self ];
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   467
	yourself
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   468
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   469
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   470
     'hello' allBold inspect
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   471
    "
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   472
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   473
    "Created: / 18-09-2006 / 21:25:52 / cg"
Claus Gittinger <cg@exept.de>
parents: 8839
diff changeset
   474
    "Modified: / 06-10-2006 / 13:57:38 / cg"
7299
efa954fda5c1 inspector code now as extension
Claus Gittinger <cg@exept.de>
parents: 7298
diff changeset
   475
! !
8918
230356e1b722 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8844
diff changeset
   476
9691
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   477
!Timestamp methodsFor:'inspecting'!
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   478
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   479
inspectorExtraAttributes
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   480
    "extra (pseudo instvar) entries to be shown in an inspector."
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   481
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   482
    ^ Dictionary new
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   483
        declareAllNewFrom:(super inspectorExtraAttributes ? #());
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   484
        add:'-dayInWeek' -> [ self dayInWeek printString , ' "', self asDate dayOfWeekName , '"' ];
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   485
        add:'-dayInYear' -> [ self dayInYear ];
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   486
        add:'-daysInMonth' -> [ self asDate daysInMonth ];
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   487
        add:'-monthName' -> [ self asDate monthName ];
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   488
        add:'-leapYear' -> [ self asDate isLeapYear ];
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   489
        yourself
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   490
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   491
    "
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   492
     Timestamp now inspect
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   493
    "
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   494
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   495
    "Created: / 20-01-2011 / 12:19:05 / cg"
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   496
! !
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   497
8919
e18fa0224d6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8918
diff changeset
   498
!stx_libtool class methodsFor:'documentation'!
e18fa0224d6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8918
diff changeset
   499
e18fa0224d6e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 8918
diff changeset
   500
extensionsVersion_CVS
9691
312706640f5c better date and timestamp inspecting
Claus Gittinger <cg@exept.de>
parents: 9673
diff changeset
   501
    ^ '$Header: /cvs/stx/stx/libtool/extensions.st,v 1.30 2011-01-20 11:24:55 cg Exp $'
8970
7b17f7901516 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 8919
diff changeset
   502
! !