InspectorView.st
author Stefan Vogel <sv@exept.de>
Sun, 02 Mar 2003 21:40:39 +0100
changeset 4642 ee63c37d9d3c
parent 4314 7dbc212d0cd2
child 4984 8a11dd7973bd
permissions -rw-r--r--
Convert Object>>errorSignal -> Error
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
     1
"
5
claus
parents: 3
diff changeset
     2
 COPYRIGHT (c) 1989 by Claus Gittinger
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
     3
	      All Rights Reserved
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
     4
571fd5eee315 Initial revision
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
571fd5eee315 Initial revision
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
571fd5eee315 Initial revision
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
571fd5eee315 Initial revision
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
571fd5eee315 Initial revision
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
571fd5eee315 Initial revision
claus
parents:
diff changeset
    10
 hereby transferred.
571fd5eee315 Initial revision
claus
parents:
diff changeset
    11
"
571fd5eee315 Initial revision
claus
parents:
diff changeset
    12
2657
0623fcb714f7 care for nil strings
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
    13
"{ Package: 'stx:libtool' }"
0623fcb714f7 care for nil strings
Claus Gittinger <cg@exept.de>
parents: 2598
diff changeset
    14
93
claus
parents: 80
diff changeset
    15
SimpleView subclass:#InspectorView
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
    16
	instanceVariableNames:'listView labelView workspace inspectedObject selectedLine nShown
1930
fc38f714f4ab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
    17
		hasMore monitorProcess hideReceiver showHex inspectHistory
2598
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
    18
		allowFollow isStandaloneInspector selectionIndex object
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
    19
		inspectedObjectHolder displayStringMessage suppressPseudoSlots
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
    20
		dereferenceValueHolders'
295
92bcaa9996ae minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents: 268
diff changeset
    21
	classVariableNames:'DefaultIcon'
92bcaa9996ae minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents: 268
diff changeset
    22
	poolDictionaries:''
92bcaa9996ae minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents: 268
diff changeset
    23
	category:'Interface-Inspector'
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    24
!
571fd5eee315 Initial revision
claus
parents:
diff changeset
    25
871
a29021918ec5 fixed openOn:monitor:
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
    26
!InspectorView class methodsFor:'documentation'!
29
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    27
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    28
copyright
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    29
"
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    30
 COPYRIGHT (c) 1989 by Claus Gittinger
45
950b84ba89e6 *** empty log message ***
claus
parents: 37
diff changeset
    31
	      All Rights Reserved
29
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    32
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    33
 This software is furnished under a license and may be used
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    34
 only in accordance with the terms of that license and with the
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    35
 inclusion of the above copyright notice.   This software may not
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    36
 be provided or otherwise made available to, or used by, any
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    37
 other person.  No title to or ownership of the software is
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    38
 hereby transferred.
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    39
"
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    40
!
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    41
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    42
documentation
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    43
"
1570
7b8bda4df1dc comment
Claus Gittinger <cg@exept.de>
parents: 1494
diff changeset
    44
    This class implements a graphical inspector.
29
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    45
    Inspecting can be done on an object -
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    46
    (where its instvarnames/values are inspected)
1570
7b8bda4df1dc comment
Claus Gittinger <cg@exept.de>
parents: 1494
diff changeset
    47
    or a list of objects (where a nameArray/valuesArray is inspected).
29
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    48
    The later is used by the debugger to inspect method variables/args.
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    49
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    50
    The system calls the inspector through the global variable 'Inspector'
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    51
    which is bound to this class (but could be redefined - it actually is
1570
7b8bda4df1dc comment
Claus Gittinger <cg@exept.de>
parents: 1494
diff changeset
    52
    set to MiniInspector in a smalltalk without graphical user interface,
7b8bda4df1dc comment
Claus Gittinger <cg@exept.de>
parents: 1494
diff changeset
    53
    or to NewInspector if that is wanted).
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    54
29
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    55
    Also notice, that there are two methods to inspect an object:
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    56
    sending #basicInspect to any object, will open this kind of inspector on 
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    57
    it (showing instance variables which are physically present).
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    58
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    59
    Sending it #inspect, will - depending on the object - sometimes invoke a
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    60
    specialized inspector. 
1570
7b8bda4df1dc comment
Claus Gittinger <cg@exept.de>
parents: 1494
diff changeset
    61
    (see OrderedCollectionInspectorView, ImageInspectorView, 
7b8bda4df1dc comment
Claus Gittinger <cg@exept.de>
parents: 1494
diff changeset
    62
     ColorInspectorView etc. as examples).
29
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    63
446
8ded3f1df7d2 commentary
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
    64
    You can also open a monitoring inspector, which displays some instance
8ded3f1df7d2 commentary
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
    65
    variable in regular intervals. See #openOn:monitor:.
8ded3f1df7d2 commentary
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
    66
29
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    67
    examples:
2008
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    68
            #(1 2 3 4) asOrderedCollection inspect
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    69
            #(1 2 3 4) asOrderedCollection basicInspect
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    70
            (Array new:10000) inspect
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    71
            (Image fromFile:'bitmaps/claus.gif') inspect
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    72
            (Image fromFile:'bitmaps/claus.gif') basicInspect
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    73
            (Image fromFile:'bitmaps/SBrowser.xbm') inspect
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    74
            (Image fromFile:'bitmaps/SBrowser.xbm') basicInspect
446
8ded3f1df7d2 commentary
Claus Gittinger <cg@exept.de>
parents: 426
diff changeset
    75
2008
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    76
            InspectorView openOn:Display
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    77
            InspectorView openOn:Display monitor:'shiftDown'
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    78
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    79
    The InspectorView can also be used as a subComponent within another view.
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    80
    In this case, the isStandAlone flag should be cleared, to prevent the
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    81
    inspector from changing the topViews window label.
510
6543e55fb227 documentation
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
    82
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
    83
    Notice:
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
    84
        the instvars 'inspectedObject' and 'selectedLine' have been 
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
    85
        renamed to 'object' and 'selectionIndex' for squeak compatibility;
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
    86
        however, the old vars are kept (in sync) for a while, to allow for
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
    87
        smooth migration.
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
    88
510
6543e55fb227 documentation
Claus Gittinger <cg@exept.de>
parents: 472
diff changeset
    89
    [author:]
2008
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
    90
        Claus Gittinger
29
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    91
"
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
    92
! !
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    93
871
a29021918ec5 fixed openOn:monitor:
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
    94
!InspectorView class methodsFor:'instance creation'!
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
    95
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
    96
for:anObject
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
    97
    "create and launch a new inspector for anObject.
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
    98
     This protocol is a historic leftover - this method will vanish."
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
    99
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   100
    ^ self openOn:anObject
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   101
!
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   102
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   103
inspect:anObject
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   104
    "create and launch a new inspector for anObject.
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   105
     This protocol is a historic leftover - this method will vanish."
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   106
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   107
    ^ self openOn:anObject
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   108
!
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   109
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   110
openOn:anObject
571fd5eee315 Initial revision
claus
parents:
diff changeset
   111
    "create and launch a new inspector for anObject"
571fd5eee315 Initial revision
claus
parents:
diff changeset
   112
416
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   113
    ^ self openOn:anObject monitor:nil
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   114
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   115
    "
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   116
     InspectorView openOn:(5 @ 7)
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   117
     InspectorView openOn:(Array new:400)
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   118
     DictionaryInspectorView openOn:(IdentityDictionary new)
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   119
    "
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   120
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   121
    "Modified: 1.3.1996 / 19:31:03 / cg"
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   122
!
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   123
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   124
openOn:anObject monitor:anInstVarName
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   125
    "create and launch a new inspector for anObject.
2008
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
   126
     If anInstVarName is nonNil, let the inspector monitor it
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
   127
     (use an integer-printString as name, for indexed instVars)."
416
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   128
105
claus
parents: 100
diff changeset
   129
    |topView inspectorView|
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   130
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   131
    topView := StandardSystemView new.
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   132
    topView icon:self defaultIcon.
2147
afc85f49fc18 removed minExtent - let topView decide.
Claus Gittinger <cg@exept.de>
parents: 2117
diff changeset
   133
    "/ topView minExtent:(100 @ 100).
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   134
    topView label:'Inspector'.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   135
    topView iconLabel:'Inspector'.
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   136
1873
5fd55aa184d4 added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   137
    topView extent:(self defaultExtent).
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   138
571fd5eee315 Initial revision
claus
parents:
diff changeset
   139
    inspectorView := self origin:(0.0 @ 0.0)
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   140
                          corner:(1.0 @ 1.0)
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   141
                             in:topView.
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   142
3
claus
parents: 0
diff changeset
   143
    "kludge: must realize first, to be able to set menu again"
352
e84b6352735d set focusSequence
Claus Gittinger <cg@exept.de>
parents: 351
diff changeset
   144
    topView openAndWait.
871
a29021918ec5 fixed openOn:monitor:
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
   145
    topView windowGroup 
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   146
        focusSequence:(Array 
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   147
                            with:inspectorView listView
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   148
                            with:inspectorView workspace).
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   149
    inspectorView allowFollow:true.
2008
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
   150
    inspectorView isStandaloneInspector:true.
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   151
    inspectorView inspect:anObject.
416
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   152
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   153
    anInstVarName notNil ifTrue:[
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   154
        inspectorView monitor:anInstVarName
416
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   155
    ].
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   156
69
0d6acfdae045 *** empty log message ***
claus
parents: 61
diff changeset
   157
    ^ inspectorView
0
571fd5eee315 Initial revision
claus
parents:
diff changeset
   158
29
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
   159
    "
416
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   160
     |m|
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   161
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   162
     m := 1 asValue.
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   163
     InspectorView openOn:m monitor:'value'.
871
a29021918ec5 fixed openOn:monitor:
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
   164
a29021918ec5 fixed openOn:monitor:
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
   165
     2 to:10 do:[:i |
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   166
         Delay waitForSeconds:1.
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   167
         m value:i
871
a29021918ec5 fixed openOn:monitor:
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
   168
     ]
416
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   169
    "
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   170
29
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
   171
    "
416
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   172
     |o|
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   173
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   174
     o := Array with:1 with:2 with:3.
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   175
     InspectorView openOn:o monitor:'2'.
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   176
     Delay waitForSeconds:1.
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   177
     o at:2 put:20
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   178
    "
fd30ab6185c7 added startup-with-monitor method
Claus Gittinger <cg@exept.de>
parents: 383
diff changeset
   179
1873
5fd55aa184d4 added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   180
    "Created: / 1.3.1996 / 19:30:50 / cg"
2008
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
   181
    "Modified: / 12.2.1999 / 16:04:42 / cg"
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   182
!
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   183
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   184
openOn:anObject withEvalPane:withEvalPane
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   185
    ^ self openOn:anObject
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   186
!
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   187
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   188
openOn:anObject withEvalPane:withEvalPane withLabel:aLabel
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   189
    ^ self openOn:anObject
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   190
! !
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   191
871
a29021918ec5 fixed openOn:monitor:
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
   192
!InspectorView class methodsFor:'defaults'!
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   193
1873
5fd55aa184d4 added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   194
defaultExtent
5fd55aa184d4 added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   195
    ^ (Screen current extent // 3)
5fd55aa184d4 added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   196
5fd55aa184d4 added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   197
    "Created: / 7.9.1998 / 13:47:45 / cg"
5fd55aa184d4 added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   198
    "Modified: / 7.9.1998 / 14:15:38 / cg"
5fd55aa184d4 added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   199
!
5fd55aa184d4 added redefinable #defaultExtent method.
Claus Gittinger <cg@exept.de>
parents: 1855
diff changeset
   200
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   201
defaultIcon
1146
231ebb35a507 defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   202
    "return the browsers default window icon"
231ebb35a507 defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   203
231ebb35a507 defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   204
    <resource: #style (#ICON #ICON_FILE)>
231ebb35a507 defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   205
231ebb35a507 defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   206
    |nm i|
231ebb35a507 defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   207
231ebb35a507 defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   208
    (i := DefaultIcon) isNil ifTrue:[
2338
0d791a4b518a #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2323
diff changeset
   209
        i := self classResources at:'ICON' default:nil.
0d791a4b518a #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2323
diff changeset
   210
        i isNil ifTrue:[
0d791a4b518a #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2323
diff changeset
   211
            nm := ClassResources at:'ICON_FILE' default:'Inspector.xbm'.
2475
12068d713365 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2454
diff changeset
   212
            i := Smalltalk imageFromFileNamed:nm forClass:self.
2338
0d791a4b518a #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2323
diff changeset
   213
            i isNil ifTrue:[
2454
114111038a2b try my bitmaps in package directory
Claus Gittinger <cg@exept.de>
parents: 2447
diff changeset
   214
                i := StandardSystemView defaultIcon
2338
0d791a4b518a #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2323
diff changeset
   215
            ]
0d791a4b518a #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2323
diff changeset
   216
        ].
0d791a4b518a #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2323
diff changeset
   217
        i notNil ifTrue:[
0d791a4b518a #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2323
diff changeset
   218
            DefaultIcon := i := i onDevice:Display
0d791a4b518a #on: -> #onDevice:
Claus Gittinger <cg@exept.de>
parents: 2323
diff changeset
   219
        ]
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   220
    ].
1146
231ebb35a507 defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   221
    ^ i
874
9ec421cec441 use Image instead of Form
Claus Gittinger <cg@exept.de>
parents: 871
diff changeset
   222
1146
231ebb35a507 defaultIcon improved
Claus Gittinger <cg@exept.de>
parents: 1094
diff changeset
   223
    "Modified: 18.4.1997 / 15:16:53 / cg"
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   224
! !
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   225
2598
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   226
!InspectorView class methodsFor:'queries-plugin'!
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   227
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   228
aspectSelectors
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   229
    ^ #( inspectedObjectHolder )
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   230
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   231
    "Modified: / 10.2.2000 / 12:25:28 / cg"
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   232
! !
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   233
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   234
!InspectorView methodsFor:'accessing'!
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   235
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   236
allowFollow:aBoolean
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   237
    "enable/disable the follow menu item;
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   238
     This is disabled for inspectors which are embedded in the debugger"
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   239
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   240
    allowFollow := aBoolean
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   241
!
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   242
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   243
dereferenceValueHolders:aBoolean
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   244
    dereferenceValueHolders := aBoolean
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   245
!
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   246
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   247
fieldListLabel:aString
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   248
    labelView label:aString
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   249
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   250
    "Created: 28.6.1996 / 15:30:26 / cg"
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   251
!
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   252
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   253
hideReceiver:aBoolean
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   254
    "hide/show the self-entry for the inspected object;
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   255
     This is hidden for context inspectors in the debugger"
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   256
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   257
    hideReceiver := aBoolean
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   258
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   259
    "Created: 28.6.1996 / 15:08:32 / cg"
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   260
!
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   261
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   262
inspect:anObject
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   263
    "define the object to be inspected"
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   264
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   265
    |aList sameObject|
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   266
2996
2230855f6283 Show 'self for an UndefinedObject
Stefan Vogel <sv@exept.de>
parents: 2850
diff changeset
   267
    sameObject := anObject == inspectedObject and:[inspectedObject notNil].
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   268
    inspectedObject := object := anObject.
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   269
1770
5cb6d7232aaa re-inspecting the same object suppresses list update;
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
   270
    sameObject ifFalse:[
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   271
        hasMore := false.
2996
2230855f6283 Show 'self for an UndefinedObject
Stefan Vogel <sv@exept.de>
parents: 2850
diff changeset
   272
        aList := self fieldList.                               
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   273
        hasMore ifTrue:[
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   274
            aList add:' ... '
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   275
        ].
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   276
    ].
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   277
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   278
    sameObject ifTrue:[
1770
5cb6d7232aaa re-inspecting the same object suppresses list update;
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
   279
"/        listView setContents:aList.
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   280
    ] ifFalse:[
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   281
        listView contents:aList.
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   282
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   283
        workspace contents:nil.
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   284
        self setDoItAction.
1770
5cb6d7232aaa re-inspecting the same object suppresses list update;
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
   285
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   286
    ].
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   287
2284
0f4ee9b43468 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2275
diff changeset
   288
    selectionIndex := selectedLine := nil.
0f4ee9b43468 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2275
diff changeset
   289
0f4ee9b43468 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2275
diff changeset
   290
    isStandaloneInspector == true ifTrue:[
0f4ee9b43468 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2275
diff changeset
   291
        self topView 
0f4ee9b43468 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2275
diff changeset
   292
            label:(self labelFor:anObject);
0f4ee9b43468 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2275
diff changeset
   293
            iconLabel:(self labelNameFor:anObject).
0f4ee9b43468 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2275
diff changeset
   294
    ]
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   295
2008
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
   296
    "Modified: / 12.2.1999 / 16:03:27 / cg"
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   297
!
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   298
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   299
isStandaloneInspector:aBoolean
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   300
    "obsolete now"
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   301
2008
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
   302
    isStandaloneInspector := aBoolean
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
   303
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
   304
    "Modified: / 12.2.1999 / 16:01:44 / cg"
29
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
   305
!
8a72e10043f6 *** empty log message ***
claus
parents: 23
diff changeset
   306
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   307
label:aString
4106
1222d4e1166e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
   308
    "set the fieldListLabel - obsolete; collides with inherited label-functionality"
1222d4e1166e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
   309
1222d4e1166e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
   310
    self obsoleteMethodWarning:'use fieldListLabel:'.
1222d4e1166e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
   311
    self fieldListLabel:aString.
1222d4e1166e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
   312
    super label:aString.
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   313
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   314
    "Created: 28.6.1996 / 15:30:26 / cg"
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   315
!
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   316
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   317
listView
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   318
    ^ listView
352
e84b6352735d set focusSequence
Claus Gittinger <cg@exept.de>
parents: 351
diff changeset
   319
!
e84b6352735d set focusSequence
Claus Gittinger <cg@exept.de>
parents: 351
diff changeset
   320
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   321
reinspect
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   322
    "update display for a changed inspectedObject"
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   323
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   324
    |aList|
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   325
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   326
    hasMore := false.
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   327
    aList := self fieldList.
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   328
    hasMore ifTrue:[
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   329
        aList add:' ... '
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   330
    ].
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   331
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   332
    listView contents:aList.
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   333
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   334
"/    workspace contents:nil.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   335
    self setDoItAction.
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   336
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   337
    selectionIndex := selectedLine := nil
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   338
!
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
   339
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   340
suppressPseudoSlots:aBoolean
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   341
    suppressPseudoSlots := aBoolean
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   342
!
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   343
352
e84b6352735d set focusSequence
Claus Gittinger <cg@exept.de>
parents: 351
diff changeset
   344
workspace
e84b6352735d set focusSequence
Claus Gittinger <cg@exept.de>
parents: 351
diff changeset
   345
    ^ workspace
52
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   346
! !
7b48409ae088 *** empty log message ***
claus
parents: 49
diff changeset
   347
2724
ca96b304e992 category changes
Claus Gittinger <cg@exept.de>
parents: 2657
diff changeset
   348
!InspectorView methodsFor:'accessing-channels'!
2598
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   349
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   350
inspectedObjectHolder
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   351
    inspectedObjectHolder isNil ifTrue:[
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   352
        inspectedObjectHolder := ValueHolder new.
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   353
        inspectedObjectHolder addDependent:self.
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   354
    ].
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   355
    ^ inspectedObjectHolder
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   356
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   357
    "Created: / 10.2.2000 / 13:33:16 / cg"
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   358
    "Modified: / 10.2.2000 / 13:34:23 / cg"
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   359
!
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   360
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   361
inspectedObjectHolder:aValueHolder
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   362
    inspectedObjectHolder notNil ifTrue:[
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   363
        inspectedObjectHolder removeDependent:self.
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   364
    ].
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   365
    inspectedObjectHolder := aValueHolder.
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   366
    inspectedObjectHolder notNil ifTrue:[
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   367
        inspectedObjectHolder addDependent:self.
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   368
    ].
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   369
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   370
    "Created: / 10.2.2000 / 13:34:53 / cg"
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   371
! !
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   372
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   373
!InspectorView methodsFor:'change & update'!
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   374
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   375
update:something with:aParameter from:changedObject
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   376
    "Invoked when one of my dependees sends a change notification."
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   377
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   378
    |oldSelection|
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   379
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   380
    changedObject == inspectedObject ifTrue:[
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   381
        oldSelection := listView selection.
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   382
        self inspect:inspectedObject.
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   383
        oldSelection notNil ifTrue:[
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   384
            self showSelection:oldSelection
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   385
        ]
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   386
    ].
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   387
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   388
    changedObject == inspectedObjectHolder ifTrue:[
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   389
        self inspect:(inspectedObjectHolder value)
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   390
    ].
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   391
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   392
    super update:something with:aParameter from:changedObject
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   393
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   394
    "Created: / 10.2.2000 / 13:46:38 / cg"
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   395
    "Modified: / 10.2.2000 / 13:48:18 / cg"
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   396
! !
298843749a49 inspectedObjectHolder added
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   397
2587
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   398
!InspectorView methodsFor:'initialization & release'!
2117
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   399
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   400
destroy
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   401
    inspectedObject := object := nil.
2117
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   402
    monitorProcess notNil ifTrue:[
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   403
        monitorProcess terminate
2117
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   404
    ].
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   405
    super destroy
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   406
!
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   407
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   408
initialize
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   409
    |v panel helpView labelView2|
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   410
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   411
    super initialize.
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   412
3318
46c3347385f4 preps to allow for displayString message to be configured
Claus Gittinger <cg@exept.de>
parents: 3199
diff changeset
   413
    displayStringMessage := #displayString.
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   414
    hideReceiver := false.
1634
216a4254e634 added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
   415
    showHex := false.
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   416
    allowFollow := false.
2008
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
   417
    isStandaloneInspector := false.
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   418
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   419
    panel := VariableHorizontalPanel 
1991
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   420
                origin:(0.0 @ 0.0)
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   421
                corner:(1.0 @ 1.0)
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   422
                in:self.
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   423
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   424
    helpView := View origin:(0.0 @ 0.0) corner:(0.3 @ 1.0) in:panel.
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   425
    helpView level:0; borderWidth:0.
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   426
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   427
    labelView := Label origin:0.0@0.0 corner:1.0@0.0 in:helpView.
647
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   428
    labelView label:(self defaultLabel).
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   429
    labelView bottomInset:(labelView preferredExtent y negated).
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   430
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   431
    v := HVScrollableView 
1991
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   432
                for:SelectionInListView 
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   433
                miniScrollerH:true
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   434
                miniScrollerV:false
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   435
                in:helpView.
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   436
"/    v autoHideScrollBars:true.
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   437
    v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   438
    v topInset:(labelView preferredExtent y).
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   439
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   440
    listView := v scrolledView.
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   441
    listView action:[:lineNr | self showSelection:lineNr].
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   442
    listView doubleClickAction:[:lineNr | self doInspect].
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   443
    listView ignoreReselect:false.
98
claus
parents: 93
diff changeset
   444
    listView menuHolder:self; menuPerformer:self; menuMessage:#fieldMenu.
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   445
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   446
    helpView := View origin:(0.3 @ 0.0) corner:(1.0 @ 1.0) in:panel.
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   447
    helpView level:0; borderWidth:0.
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   448
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   449
    labelView2 := Label origin:0.0@0.0 corner:1.0@0.0 in:helpView.
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   450
    labelView2 label:''.
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   451
    labelView2 bottomInset:(labelView preferredExtent y negated).
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   452
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   453
    v := HVScrollableView 
1991
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   454
                for:CodeView 
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   455
                miniScrollerH:true
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   456
                miniScrollerV:false
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   457
                in:helpView.
dfbb30988edd no miniScrollers; no autoHide
Claus Gittinger <cg@exept.de>
parents: 1930
diff changeset
   458
"/    v autoHideScrollBars:true.
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   459
    v origin:(0.0 @ 0.0) corner:(1.0 @ 1.0).
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   460
    v topInset:(labelView2 preferredExtent y).
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   461
    workspace := v scrolledView.
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   462
3608
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
   463
    self setAcceptAction.
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   464
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   465
    nShown := 100.
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   466
    hasMore := false.
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
   467
2008
52bf8b8afd3b separated allowFollow from isStandAlone flag
Claus Gittinger <cg@exept.de>
parents: 2007
diff changeset
   468
    "Modified: / 12.2.1999 / 16:03:19 / cg"
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   469
!
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   470
593
6bc83313d7ff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   471
realize
6bc83313d7ff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   472
    "delayed setup of lists till first map-time - 
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   473
     this makes startup of inspectors a bit faster"
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   474
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   475
    |o|
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   476
593
6bc83313d7ff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   477
    super realize.
383
e5760d864242 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 352
diff changeset
   478
    inspectedObject notNil ifTrue:[
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   479
        "
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   480
         kludge to trick inspect:, which ignores setting the
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   481
         same object again ...
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   482
        "
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   483
        o := inspectedObject.
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   484
        inspectedObject := object := nil.
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   485
        self inspect:o
383
e5760d864242 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 352
diff changeset
   486
    ]
593
6bc83313d7ff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   487
6bc83313d7ff checkin from browser
Claus Gittinger <cg@exept.de>
parents: 570
diff changeset
   488
    "Created: 30.5.1996 / 09:38:37 / cg"
2117
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   489
!
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   490
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   491
release
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   492
    "release inpected object. This is normally not needed,
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   493
     since the garbage collector will find this memory alone.
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   494
     However, if some applications keeps invisible inspectors around
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   495
     (for example, the debugger does this), the inspected object
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   496
     would be kept from being freed or freed very late."
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   497
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   498
"
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   499
    inspectedObject notNil ifTrue:[
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   500
        inspectedObject removeDependent:self
2117
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   501
    ].
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   502
"
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   503
    inspectedObject := object := nil.
2117
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   504
    self setDoItAction.      "/ to release ref to inspectedObject in doItBlock
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   505
    workspace contents:nil.
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   506
    listView contents:nil.
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   507
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   508
    super release.
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   509
dd96b2478eeb category change
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   510
    "Modified: 11.6.1997 / 13:20:39 / cg"
98
claus
parents: 93
diff changeset
   511
! !
claus
parents: 93
diff changeset
   512
claus
parents: 93
diff changeset
   513
!InspectorView methodsFor:'menu'!
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   514
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   515
fieldMenu
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   516
    "return the menu for the field-list"
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   517
1235
13610578a5d2 resource flag: #menu -> #programMenu
Claus Gittinger <cg@exept.de>
parents: 1185
diff changeset
   518
    <resource: #programMenu>
1040
5835207bcb3e menu resource
Claus Gittinger <cg@exept.de>
parents: 901
diff changeset
   519
3526
d8f3082ea1d7 Remove unused vars
Stefan Vogel <sv@exept.de>
parents: 3525
diff changeset
   520
    |items m sel|
1597
48629e1fc7b6 use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents: 1570
diff changeset
   521
48629e1fc7b6 use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents: 1570
diff changeset
   522
    items := #(
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3164
diff changeset
   523
                       ('Copy Name or Key'             #doCopyKey              )
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 2008
diff changeset
   524
                       ('-')
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3164
diff changeset
   525
                       ('Inspect'                      #doInspect              )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3164
diff changeset
   526
                       ('BasicInspect'                 #doBasicInspect         )
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   527
                       ('Inspect Hierarchical'         #doNewInspect           )
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 2008
diff changeset
   528
                       ('-')
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   529
                       ('Ref Chains'                   #showReferences         )
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 2008
diff changeset
   530
                       ('-')
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3164
diff changeset
   531
                       ('Browse'                       #browse                 )
3199
5478ca0ac71f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   532
"/                       ('Browse class hierarchy'       #browseClassHierarchy   )
5478ca0ac71f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   533
"/                       ('Browse full class protocol'   #browseFullClassProtocol)
2579
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   534
              ).
2587
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   535
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   536
    sel := self selection.
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   537
    (sel isBlock or:[sel isContext]) ifTrue:[
2579
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   538
        items := items , #(
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   539
                       ('Browse Blocks Home'           #browseHome)
2579
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   540
              ).
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   541
    ].
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   542
    (inspectedObject isMethod or:[sel isMethod]) ifTrue:[
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   543
        items := items , #(
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   544
                       ('Browse Methods Class'         #browseMethodsClass)
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   545
                 ).
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   546
    ].
2587
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   547
    (sel isStream and:[self isExternalStream not]) ifTrue:[
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   548
        items := items , #(
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   549
                       ('-')
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   550
                       ('Show Stream Contents'         #showStreamContents)
2587
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   551
              ).
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   552
    ].
2579
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   553
    items := items , #(
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 2008
diff changeset
   554
                       ('-')
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   555
                       ('Trap Message...'              #doTrap                 )
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   556
                       ('Trap all Messages'            #doTrapAll              )
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   557
                       ('Trace all Messages'           #doTraceAll             )
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   558
                       ('Untrace/Untrap'               #doUntrace              )
2850
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   559
"/                       ('-')
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3164
diff changeset
   560
"/                       ('Trap change to instVar'       #doTrapInstVarChange    )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3164
diff changeset
   561
"/                       ('Trap change to any instVar'   #doTrapAnyInstVarChange )
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   562
              ).
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   563
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   564
    allowFollow ifTrue:[
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   565
        items := #(
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3164
diff changeset
   566
                            ('Follow'                       #doFollow              )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3164
diff changeset
   567
                            ('Back'                         #doBack              )
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   568
                            ('-')
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   569
                  )
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   570
                 ,
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   571
                 items.
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   572
    ].
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   573
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   574
    hasMore ifTrue:[
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   575
        items := items , #(
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   576
                        ('-')
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   577
                        ('Show More'                    #showMore               )
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   578
                          )
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   579
    ].
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   580
93
claus
parents: 80
diff changeset
   581
    monitorProcess isNil ifTrue:[
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   582
        items := items , #(
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   583
                        ('-')
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   584
                        ('Start Monitor'                #doStartMonitor         )
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   585
                          ).
93
claus
parents: 80
diff changeset
   586
    ] ifFalse:[
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   587
        items := items , #(
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   588
                        ('-')
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   589
                        ('Stop Monitor'                #doStopMonitor           )
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   590
                          ).
93
claus
parents: 80
diff changeset
   591
    ].
claus
parents: 80
diff changeset
   592
1634
216a4254e634 added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
   593
    showHex ifTrue:[
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   594
        items := items , #(
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   595
                        ('-')
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   596
                        ('Decimal Integers'  #toggleHex               )
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   597
                          )
1634
216a4254e634 added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
   598
    ] ifFalse:[
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   599
        items := items , #(
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   600
                        ('-')
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   601
                        ('Hex Integers'      #toggleHex               )
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   602
                          )
1634
216a4254e634 added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
   603
    ].
216a4254e634 added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
   604
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   605
    m := PopUpMenu
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   606
          itemList:items
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   607
          resources:resources.
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   608
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   609
    selectionIndex isNil ifTrue:[
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   610
        m disableAll:#(doFollow doInspect doBasicInspect doNewInspect
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   611
                       browse browseClassHierarchy browseFullClassProtocol
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   612
                       doStartMonitor doCopyKey doCopyKey)
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   613
    ].
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   614
    (selectionIndex == 1) ifTrue:[
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   615
        m disableAll:#(doFollow doCopyKey)
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   616
    ].
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   617
    inspectHistory size == 0 ifTrue:[
2007
cd423a740a14 renamed instance variable.
Claus Gittinger <cg@exept.de>
parents: 1991
diff changeset
   618
        m disable:#doBack
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   619
    ].
2580
d0c284a14c9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2579
diff changeset
   620
    self selection class hasImmediateInstances ifTrue:[
d0c284a14c9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2579
diff changeset
   621
        m disableAll:#(showReferences doNewInspect)
d0c284a14c9c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2579
diff changeset
   622
    ].
3199
5478ca0ac71f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   623
    sel inspectorClass == self class ifFalse:[
5478ca0ac71f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   624
        m disable:#doFollow
5478ca0ac71f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   625
    ].
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   626
    sel isMethod ifFalse:[
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   627
        m disable:#browseMethodsClass
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   628
    ].
3199
5478ca0ac71f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3198
diff changeset
   629
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   630
    ^ m
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   631
2587
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   632
    "Modified: / 6.2.2000 / 13:48:09 / cg"
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   633
! !
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   634
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   635
!InspectorView methodsFor:'menu actions'!
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   636
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   637
browse
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   638
    |cls|
527
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   639
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   640
    cls := self selection class.
527
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   641
    cls browserClass openInClass:cls selector:nil
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   642
1930
fc38f714f4ab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   643
    "Created: / 14.12.1995 / 19:15:50 / cg"
fc38f714f4ab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   644
    "Modified: / 14.10.1998 / 15:32:10 / cg"
527
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   645
!
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   646
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   647
browseClass
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   648
    |cls|
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   649
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   650
    cls := self selection class.
527
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   651
    cls browserClass browseClass:cls
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   652
527
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   653
    "Modified: 3.5.1996 / 12:39:32 / cg"
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   654
!
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   655
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   656
browseClassHierarchy
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   657
    |cls|
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   658
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   659
    cls := self selection class.
527
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   660
    cls browserClass browseClassHierarchy:cls
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   661
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   662
    "Modified: 3.5.1996 / 12:40:04 / cg"
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   663
!
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   664
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   665
browseFullClassProtocol
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   666
    |cls|
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   667
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   668
    cls := self selection class.
527
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   669
    cls browserClass browseFullClassProtocol:cls
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   670
2faba0c6ab96 ask class for browserClass
Claus Gittinger <cg@exept.de>
parents: 510
diff changeset
   671
    "Modified: 3.5.1996 / 12:40:17 / cg"
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   672
!
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   673
2579
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   674
browseHome
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   675
    |sel mthd|
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   676
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   677
    sel := self selection.
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   678
    sel isBlock ifTrue:[
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   679
        mthd := sel homeMethod
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   680
    ] ifFalse:[
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   681
        sel isContext ifTrue:[
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   682
            mthd := sel method.
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   683
        ]
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   684
    ].
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   685
    mthd isNil ifTrue:[
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   686
        ^ self warn:'Sorry - cannot figure out home method.'
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   687
    ].
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   688
    mthd class browserClass 
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   689
        openInClass:mthd mclass selector:mthd selector
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   690
!
81108fb4f996 added browse home-method
Claus Gittinger <cg@exept.de>
parents: 2475
diff changeset
   691
4197
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   692
browseMethodsClass
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   693
    |mthd|
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   694
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   695
    mthd := self selection.
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   696
    mthd mclass browserClass 
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   697
        openInClass:mthd mclass selector:mthd selector
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   698
!
8086dadff648 added broese methods class
Claus Gittinger <cg@exept.de>
parents: 4106
diff changeset
   699
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   700
doBack
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   701
    "user selected back-menu entry"
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   702
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   703
    |objectToInspect|
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   704
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   705
    inspectHistory size > 0 ifTrue:[
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   706
	objectToInspect := inspectHistory removeLast.
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   707
	inspectHistory size == 0 ifTrue:[
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   708
	    inspectHistory := nil
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   709
	].
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   710
	self inspect:objectToInspect.
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   711
    ]
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   712
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   713
    "Created: / 22.9.1998 / 18:22:01 / cg"
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   714
    "Modified: / 22.9.1998 / 18:22:28 / cg"
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   715
!
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   716
1930
fc38f714f4ab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   717
doBasicInspect
fc38f714f4ab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   718
    "user selected inspect-menu entry"
fc38f714f4ab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   719
fc38f714f4ab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   720
    self doInspect:true 
fc38f714f4ab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   721
!
fc38f714f4ab checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1895
diff changeset
   722
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   723
doFollow
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   724
    "user selected follow-menu entry"
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   725
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   726
    |objectToInspect|
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   727
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   728
    selectionIndex notNil ifTrue:[
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   729
        objectToInspect := self selection.
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   730
        inspectHistory isNil ifTrue:[
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   731
            inspectHistory := OrderedCollection new
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   732
        ].
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   733
        inspectHistory addLast:inspectedObject.
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   734
        self inspect:objectToInspect.
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   735
    ]
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   736
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   737
    "Created: / 22.9.1998 / 18:21:08 / cg"
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   738
    "Modified: / 22.9.1998 / 18:22:23 / cg"
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   739
!
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   740
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   741
doInspect
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   742
    "user selected inspect-menu entry"
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   743
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   744
    self doInspect:false
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   745
!
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   746
1365
4a98e9a59430 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
   747
doNewInspect
4a98e9a59430 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
   748
    self doInspect:#new
4a98e9a59430 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
   749
4a98e9a59430 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
   750
    "Created: / 31.10.1997 / 12:45:38 / cg"
4a98e9a59430 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
   751
    "Modified: / 31.10.1997 / 12:47:11 / cg"
4a98e9a59430 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
   752
!
4a98e9a59430 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1270
diff changeset
   753
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   754
doStartMonitor
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   755
    "start a monitoring process"
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   756
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   757
    monitorProcess isNil ifTrue:[
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   758
        monitorProcess :=
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   759
            [
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   760
                |sel|
295
92bcaa9996ae minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents: 268
diff changeset
   761
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   762
                [true] whileTrue:[
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   763
                    (sel := selectionIndex) notNil ifTrue:[
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   764
                        self showSelection:sel 
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   765
                    ].
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   766
                    (Delay forSeconds:0.5) wait
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   767
                ]
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   768
            ] forkAt:Processor userBackgroundPriority
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   769
    ]
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   770
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   771
    "Modified: 12.4.1996 / 14:20:06 / cg"
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   772
!
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   773
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   774
doStopMonitor
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   775
    "stop the monitor"
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   776
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   777
    monitorProcess terminate.
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   778
    monitorProcess := nil
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   779
!
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   780
2800
4e5792ade7aa menu fix
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
   781
doTraceAll
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   782
    "place a trace on all messages sent to the inspected object"
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   783
1597
48629e1fc7b6 use new menu-creation message in PopUpMenu.
Claus Gittinger <cg@exept.de>
parents: 1570
diff changeset
   784
    self topView withWaitCursorDo:[MessageTracer traceAll:inspectedObject on:Transcript]
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   785
!
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   786
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   787
doTrap
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   788
    "place a trap on a message sent to the inspected object"
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   789
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   790
    |string selector|
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   791
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   792
    string := Dialog request:'Selector to trap on:' onCancel:nil.
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   793
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   794
    string notNil ifTrue:[
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   795
	selector := string asSymbolIfInterned.
901
56fe927e0734 fix doTrap
ca
parents: 874
diff changeset
   796
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   797
	selector isNil ifTrue:[
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   798
	    self warn:'no such selector'
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   799
	] ifFalse:[
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   800
	    self topView withWaitCursorDo:[MessageTracer trap:inspectedObject 
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   801
							 selector:selector]
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
   802
	]
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   803
    ]
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   804
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   805
    "Modified: 12.4.1996 / 14:07:01 / cg"
901
56fe927e0734 fix doTrap
ca
parents: 874
diff changeset
   806
56fe927e0734 fix doTrap
ca
parents: 874
diff changeset
   807
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   808
!
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   809
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   810
doTrapAll
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   811
    "place a trap on all messages sent to the inspected object"
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   812
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   813
    self topView withWaitCursorDo:[MessageTracer trapAll:inspectedObject]
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   814
!
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   815
2850
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   816
doTrapAnyInstVarChange
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   817
    "place a trap which is triggered if any instVar of the inspected object is changed"
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   818
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   819
    self topView withWaitCursorDo:[
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   820
        MessageTracer trapModificationsIn:inspectedObject
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   821
    ]
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   822
!
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   823
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   824
doTrapInstVarChange
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   825
    "place a trap which is triggered if the selected instVar of the inspected object is changed"
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   826
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   827
    self topView withWaitCursorDo:[
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   828
        |idx|
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   829
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   830
        "/ a named instVar ?
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   831
        idx := self instVarIndexForLine:selectionIndex.
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   832
        idx isNil ifTrue:[
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   833
            self warn:'select an instance variable first.'.
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   834
            ^ self.
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   835
        ].
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   836
        MessageTracer 
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   837
                trapModificationsOf:(inspectedObject class allInstVarNames at:idx)
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   838
                in:inspectedObject
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   839
    ]
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   840
!
f05e61a40fe8 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2800
diff changeset
   841
472
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   842
doUntrace
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   843
    "remove traps/traces"
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   844
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   845
    MessageTracer untrace:inspectedObject
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   846
!
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   847
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   848
inspectOwners
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   849
    "open an inspector on owners of the inspectedObject.
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   850
     (this is a secret function)"
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   851
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   852
    self withCursor:(Cursor questionMark) do:[
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   853
	|owners dict|
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   854
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   855
	owners := (ObjectMemory whoReferences:inspectedObject) asOrderedCollection.
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   856
	owners size > 500 ifTrue:[
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   857
	    (self confirm:'there are ' , owners size printString , ' owners.\\Do you really want to see them all ?' withCRs)
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   858
	    ifFalse:[^ self]
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   859
	].
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   860
	dict := IdentityDictionary new.
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   861
	owners do:[:owner |
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   862
	    |set names oClass|
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   863
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   864
	    owner ~~ self ifTrue:[
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   865
		set := Set new.
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   866
		names := owner class allInstVarNames.
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   867
		oClass := owner class.
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   868
		1 to:oClass instSize do:[:i |
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   869
		    (owner instVarAt:i) == inspectedObject ifTrue:[
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   870
			set add:(names at:i).
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   871
		    ].
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   872
		].
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   873
		oClass isVariable ifTrue:[
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   874
		    oClass isPointers ifTrue:[
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   875
			1 to:owner basicSize do:[:i |
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   876
			    (owner basicAt:i) == inspectedObject ifTrue:[
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   877
				 set add:i
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   878
			    ]
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   879
			]
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   880
		    ]
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   881
		].
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   882
		dict at:owner put:set
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   883
	    ].
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   884
	].
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   885
	dict inspect
7e2d83585ed7 category rename; menu order changed
Claus Gittinger <cg@exept.de>
parents: 446
diff changeset
   886
    ]
2587
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   887
!
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   888
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   889
showStreamContents
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   890
    |sel|
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   891
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   892
    sel := self selection.
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   893
    (sel isStream and:[sel isExternalStream not]) ifTrue:[
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   894
        workspace replace:(sel contents printString)
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   895
    ].
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   896
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   897
    "Created: / 6.2.2000 / 13:46:37 / cg"
b6838cdb1f14 added show-stream-contents menu item
Claus Gittinger <cg@exept.de>
parents: 2580
diff changeset
   898
    "Modified: / 6.2.2000 / 13:47:37 / cg"
73
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   899
! !
e332d9c71624 *** empty log message ***
claus
parents: 71
diff changeset
   900
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   901
!InspectorView methodsFor:'private'!
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
   902
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   903
baseInspectedObjectClass
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   904
    ^ Object
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   905
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   906
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   907
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
   908
647
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   909
defaultLabel
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
   910
    ^ 'InstVars'
647
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   911
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   912
    "Modified: 28.6.1996 / 16:04:53 / cg"
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   913
!
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 644
diff changeset
   914
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   915
displayStringForValue:someValue 
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   916
    "return the values displayString"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   917
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   918
    |s sel radix|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   919
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   920
    sel := listView at:selectionIndex.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   921
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   922
    inspectedObject isNumber ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   923
        (sel startsWith:$-) ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   924
            (sel startsWith:'-hex') ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   925
                radix := 16.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   926
            ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   927
            (sel startsWith:'-oct') ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   928
                radix := 8.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   929
            ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   930
            (sel startsWith:'-bin') ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   931
                radix := 2.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   932
            ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   933
            radix notNil ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   934
                ^ inspectedObject radixPrintStringRadix:radix
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   935
            ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   936
        ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   937
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   938
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   939
    (inspectedObject isKindOf:Method) ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   940
        (sel startsWith:'-code') ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   941
            ^ String streamContents:[:s | inspectedObject decompileTo:s] 
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   942
        ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   943
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   944
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   945
    (inspectedObject isKindOf:Text) ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   946
        (sel startsWith:'-text') ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   947
            ^ inspectedObject
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   948
        ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   949
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   950
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   951
    (inspectedObject isKindOf:ByteArray) ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   952
        (sel startsWith:'-hex') ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   953
            ^ String streamContents:[:s | inspectedObject asByteArray printOn:s base:16 showRadix:true]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   954
        ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   955
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   956
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   957
    (sel startsWith:'-all inst vars') ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   958
        ^ self stringWithAllInstVarValues
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   959
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   960
    (sel startsWith:'-all indexed vars') ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   961
        ^ self stringWithAllIndexedVarValues
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   962
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   963
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   964
    Error handle:[:ex |
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   965
        s := someValue classNameWithArticle.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   966
        displayStringMessage == #displayString ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   967
            s := s , ' "error in displayString: ' , ex description , '"'
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   968
        ] ifFalse:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   969
            s := s , ' "error in displayString (' , displayStringMessage , '): ' , ex description , '"'
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   970
        ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   971
    ] do:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   972
        showHex ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   973
            someValue isInteger ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   974
                ^ '16r' , someValue hexPrintString
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   975
            ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   976
            (someValue isMemberOf:ByteArray) ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   977
                ^ String streamContents:[:s | inspectedObject asByteArray printOn:s base:16 showRadix:true]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   978
"/                    s := '' writeStream.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   979
"/                    s nextPutAll:'#['.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   980
"/                    someValue keysAndValuesDo:[:i :byte |
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   981
"/                        i ~~ 1 ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   982
"/                            s space
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   983
"/                        ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   984
"/                        s nextPutAll:'16r'.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   985
"/                        s nextPutAll:(byte hexPrintString leftPaddedTo:2 with:$0).
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   986
"/                    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   987
"/                    s nextPutAll:']'.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   988
"/                    s := s contents
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   989
            ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   990
        ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   991
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   992
        "/ displayStringMessage := #classNameWithArticle
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   993
        "/ displayStringMessage := #displayString
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   994
        "/ displayStringMessage := #printString
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   995
        s := someValue perform:displayStringMessage.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   996
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   997
    ^ s.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   998
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
   999
    "Modified: / 31.10.2001 / 10:44:16 / cg"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1000
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1001
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1002
fieldList 
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1003
    "return a list of names to show in the selectionList.
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1004
     Leave hasMore as true, if a '...' entry should be added."
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1005
3868
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1006
    |aList cls indexedList|
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1007
3338
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1008
    inspectedObject isNil ifTrue:[
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1009
        ^ self hasSelfEntry ifFalse:[ #() ] ifTrue:[ #('-self') ]
3338
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1010
    ].
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1011
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1012
    cls := inspectedObject class.
2188
a393adbae856 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2147
diff changeset
  1013
2275
b402f5173c79 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
  1014
    self topView withWaitCursorDo:[
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1015
        aList := self namedFieldList.
3868
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1016
        indexedList := self indexedFieldList.
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1017
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1018
        self hasSelfEntry ifTrue:[
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1019
            self suppressPseudoSlots ifFalse:[
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1020
                (indexedList notNil and:[self showAllIndexedVarsInFieldList]) ifTrue:[
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1021
                    aList addFirst:'-all indexed vars'.
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1022
                ].
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1023
                cls instSize > 0 ifTrue:[
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1024
                    aList addFirst:'-all inst vars'.
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1025
                ].
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1026
                cls hasImmediateInstances ifFalse:[
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1027
                    aList addFirst:'-dependents'.
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1028
                ].
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1029
                aList addFirst:'-identityHash'.
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1030
                aList addFirst:'-hash'.
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1031
                aList addFirst:'-self'.
3608
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1032
            ].
3525
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1033
        ].
531
4b079a4e85b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  1034
3868
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1035
        indexedList notNil ifTrue:[aList addAll:indexedList].
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1036
    ].
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1037
    ^ aList
531
4b079a4e85b4 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 527
diff changeset
  1038
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1039
    "Modified: / 31.10.2001 / 09:14:10 / cg"
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1040
!
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1041
295
92bcaa9996ae minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents: 268
diff changeset
  1042
hasSelfEntry
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1043
    ^ hideReceiver not and:[self suppressPseudoSlots not]
295
92bcaa9996ae minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents: 268
diff changeset
  1044
92bcaa9996ae minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents: 268
diff changeset
  1045
    "Created: 14.12.1995 / 19:30:03 / cg"
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
  1046
    "Modified: 28.6.1996 / 15:13:41 / cg"
295
92bcaa9996ae minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents: 268
diff changeset
  1047
!
92bcaa9996ae minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents: 268
diff changeset
  1048
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1049
indexList 
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1050
    "return a list of indexes to show in the selectionList.
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1051
     Set hasMore to true, if a '...' entry should be added."
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1052
3526
d8f3082ea1d7 Remove unused vars
Stefan Vogel <sv@exept.de>
parents: 3525
diff changeset
  1053
    | n cls|
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1054
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1055
    cls := inspectedObject class.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1056
3868
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1057
    cls isVariable ifFalse:[^ nil ].
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1058
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1059
    n := inspectedObject basicSize.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1060
    (n > nShown) ifTrue:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1061
        n := nShown.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1062
        hasMore := true.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1063
    ].
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1064
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1065
    ^ (1 to:n)
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1066
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1067
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1068
indexedFieldList 
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1069
    "return a list of indexed-variable names to show in the selectionList.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1070
     Set hasMore to true, if a '...' entry should be added."
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1071
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1072
    |l|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1073
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1074
    l := self indexList.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1075
    l isNil ifTrue:[^ nil ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1076
    ^ l collect:[:i | i printString].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1077
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1078
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1079
indexedValueAtIndex:idx
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1080
    ^ inspectedObject basicAt:idx
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1081
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1082
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1083
indexedValueAtIndex:idx put:newValue
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1084
    inspectedObject basicAt:idx put:newValue
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1085
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1086
3884
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3874
diff changeset
  1087
indexedValueAtKey:key
4314
7dbc212d0cd2 kludge to show Float bytes
Claus Gittinger <cg@exept.de>
parents: 4268
diff changeset
  1088
    "/ kludge
7dbc212d0cd2 kludge to show Float bytes
Claus Gittinger <cg@exept.de>
parents: 4268
diff changeset
  1089
    inspectedObject isLimitedPrecisionReal ifTrue:[
7dbc212d0cd2 kludge to show Float bytes
Claus Gittinger <cg@exept.de>
parents: 4268
diff changeset
  1090
        ^ inspectedObject basicAt:key
7dbc212d0cd2 kludge to show Float bytes
Claus Gittinger <cg@exept.de>
parents: 4268
diff changeset
  1091
    ].
3884
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3874
diff changeset
  1092
    ^ inspectedObject at:key
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3874
diff changeset
  1093
!
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3874
diff changeset
  1094
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1095
instVarIndexForLine:lineNr
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1096
    "helper - return the index for a named instVar;
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1097
     nil, if self or a keyed instvar is selected."
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1098
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1099
    |idx nNamedInstvarsShown cls baseCls firstRealIndex|
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1100
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1101
    lineNr isNil ifTrue:[^ nil].
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1102
    firstRealIndex := 1.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1103
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1104
    idx := lineNr.
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1105
    self hasSelfEntry ifTrue:[
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1106
        (lineNr == 1 or:[lineNr isNil]) ifTrue:[
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1107
            ^ nil "/ self selected
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1108
        ].
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1109
        idx := idx - 1.
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1110
        firstRealIndex := 2.
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1111
    ].
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1112
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1113
    [(listView at:firstRealIndex) startsWith:'-'] whileTrue:[
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1114
        firstRealIndex := firstRealIndex + 1.
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1115
        idx := idx - 1.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1116
    ].
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1117
2447
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1118
    cls := inspectedObject class.
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1119
    baseCls := self baseInspectedObjectClass.
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1120
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1121
    nNamedInstvarsShown := cls instSize.
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1122
    "/ only the namedInstvars below baseInspectedObjectClass
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1123
    "/ are shown ...
2447
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1124
    (cls == baseCls or:[cls isSubclassOf:baseCls]) ifTrue:[
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1125
        nNamedInstvarsShown := nNamedInstvarsShown - baseCls instSize.
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1126
    ].
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1127
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1128
    idx <= nNamedInstvarsShown ifTrue:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1129
        ^ idx + self baseInspectedObjectClass instSize.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1130
    ].
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1131
    ^ nil "/ indexed instvar or other selected
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1132
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1133
    "Modified: / 31.10.2001 / 09:20:20 / cg"
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1134
!
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1135
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1136
keyIndexForLine:lineNr
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1137
    "helper - return the index of the key-list;
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1138
     nil, if self or a namedInstVar is selected."
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1139
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1140
    |idx nNamedInstvarsShown cls baseCls firstRealIndex|
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1141
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1142
    lineNr isNil ifTrue:[^ nil].
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1143
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1144
    firstRealIndex := 1.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1145
    idx := lineNr.
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1146
    self hasSelfEntry ifTrue:[
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1147
        (lineNr == 1 or:[lineNr isNil]) ifTrue:[
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1148
            ^ nil "/ self selected
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1149
        ].
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1150
        idx := idx - 1.
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1151
        firstRealIndex := firstRealIndex + 1.
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1152
    ].
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1153
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1154
    [(listView at:firstRealIndex) startsWith:'-'] whileTrue:[
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1155
        firstRealIndex := firstRealIndex + 1.
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1156
        idx := idx - 1.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1157
    ].
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1158
2447
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1159
    cls := inspectedObject class.
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1160
    baseCls := self baseInspectedObjectClass.
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1161
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1162
    nNamedInstvarsShown := cls instSize.
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1163
    "/ only the namedInstvars below baseInspectedObjectClass
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1164
    "/ are shown ...
2447
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1165
    (cls == baseCls or:[cls isSubclassOf:baseCls]) ifTrue:[
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1166
        nNamedInstvarsShown := nNamedInstvarsShown - baseCls instSize.
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1167
    ].
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1168
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1169
    idx <= nNamedInstvarsShown ifTrue:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1170
        ^ nil "/ named instVar selected.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1171
    ].
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1172
    ^ idx - nNamedInstvarsShown.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1173
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1174
    "Modified: / 31.10.2001 / 09:21:13 / cg"
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1175
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1176
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1177
namedFieldList 
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1178
    "return a list of instVar names to show in the selectionList."
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1179
2447
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1180
    |aList cls baseCls|
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1181
2447
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1182
    cls := inspectedObject class.
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1183
    baseCls := self baseInspectedObjectClass.
95055cf58b2e checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2446
diff changeset
  1184
3351
64cdbec2dd8e text display
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
  1185
    aList := OrderedCollection new.
3338
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1186
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1187
    inspectedObject isInteger ifTrue:[
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1188
        aList addLast:'-hexadecimal'.
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1189
        aList addLast:'-octal'.
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1190
        aList addLast:'-binary'.
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1191
    ].
3351
64cdbec2dd8e text display
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
  1192
    (inspectedObject isKindOf:Text) ifTrue:[
64cdbec2dd8e text display
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
  1193
        aList addLast:'-text'.
64cdbec2dd8e text display
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
  1194
    ].
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1195
    (inspectedObject isKindOf:ByteArray) ifTrue:[
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1196
        aList addLast:'-hexadecimal'.
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1197
    ].
3567
e784eb071ee1 decompiler for methods
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
  1198
    (inspectedObject isKindOf:Method) ifTrue:[
e784eb071ee1 decompiler for methods
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
  1199
        aList addLast:'-code'.
e784eb071ee1 decompiler for methods
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
  1200
    ].
3338
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1201
3351
64cdbec2dd8e text display
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
  1202
    aList addAll:(cls allInstVarNames).
64cdbec2dd8e text display
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
  1203
    (cls == baseCls or:[cls isSubclassOf:baseCls]) ifTrue:[
64cdbec2dd8e text display
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
  1204
        "/ hide some stuff
64cdbec2dd8e text display
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
  1205
        aList := aList copyFrom:(self baseInspectedObjectClass instSize + 1).
64cdbec2dd8e text display
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
  1206
    ].
64cdbec2dd8e text display
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
  1207
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1208
    ^ aList
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1209
3351
64cdbec2dd8e text display
Claus Gittinger <cg@exept.de>
parents: 3349
diff changeset
  1210
    "Modified: / 31.10.2001 / 10:44:29 / cg"
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1211
!
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1212
3608
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1213
setAcceptAction
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1214
    "set the codeViews accept action"
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1215
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1216
    |acceptAction sel|
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1217
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1218
    acceptAction := [:theText | self doAccept:theText asString].
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1219
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1220
    (selectionIndex isNil 
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1221
    or:[ inspectedObject class hasImmediateInstances])
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1222
    ifTrue:[
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1223
        acceptAction := nil.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1224
    ] ifFalse:[
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1225
        sel := listView at:selectionIndex.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1226
3868
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1227
        (sel startsWith:'-all') ifTrue:[
3608
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1228
            acceptAction := nil.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1229
        ].
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1230
        (sel startsWith:'-hash') ifTrue:[
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1231
            acceptAction := nil.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1232
        ].
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1233
        (sel startsWith:'-identityHash') ifTrue:[
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1234
            acceptAction := nil.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1235
        ].
3634
db094dd598f7 -dependents
Claus Gittinger <cg@exept.de>
parents: 3608
diff changeset
  1236
        (sel startsWith:'-dependents') ifTrue:[
db094dd598f7 -dependents
Claus Gittinger <cg@exept.de>
parents: 3608
diff changeset
  1237
            acceptAction := nil.
db094dd598f7 -dependents
Claus Gittinger <cg@exept.de>
parents: 3608
diff changeset
  1238
        ].
3608
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1239
    ].
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1240
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1241
    workspace acceptAction:acceptAction.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1242
!
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1243
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1244
setDoItAction
542
12d3bf714076 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
  1245
    "set the codeViews doit action"
12d3bf714076 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
  1246
12d3bf714076 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
  1247
    workspace 
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1248
	doItAction:[:theCode |
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1249
	    |evaluator|
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1250
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1251
	    (evaluator := inspectedObject class evaluatorClass)
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1252
	    notNil ifTrue:[
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1253
		evaluator
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1254
		    evaluate:theCode 
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1255
		    in:nil 
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1256
		    receiver:inspectedObject 
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1257
		    notifying:workspace 
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1258
		    logged:true 
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1259
		    ifFail:nil
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1260
	    ] ifFalse:[
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1261
		'objects class provides no evaluator'
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1262
	    ]
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1263
	].
542
12d3bf714076 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 531
diff changeset
  1264
1270
3dc841708edd disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
  1265
    inspectedObject class evaluatorClass isNil ifTrue:[
1895
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1266
	workspace doItAction:nil.
8b51d61d9c0a added follow & back menu items.
Claus Gittinger <cg@exept.de>
parents: 1873
diff changeset
  1267
	workspace acceptAction:nil.
1270
3dc841708edd disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
  1268
    ]
3dc841708edd disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
  1269
3dc841708edd disable accept/doIt, if instances class provides no evaluator
Claus Gittinger <cg@exept.de>
parents: 1235
diff changeset
  1270
    "Modified: 1.8.1997 / 21:47:09 / cg"
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1271
!
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1272
3884
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3874
diff changeset
  1273
showAllIndexedVarsInFieldList
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3874
diff changeset
  1274
    ^ true
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3874
diff changeset
  1275
!
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3874
diff changeset
  1276
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1277
showMore
1855
24108d2b3374 oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  1278
    |o|
24108d2b3374 oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  1279
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1280
    hasMore ifTrue:[
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  1281
        nShown := nShown * 2.
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  1282
        "/ force update (which is otherwise ignored)
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  1283
        o := inspectedObject.
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  1284
        inspectedObject := object := nil.
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  1285
        self inspect:o
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1286
    ]
1855
24108d2b3374 oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  1287
24108d2b3374 oops - fixed showMore handling
Claus Gittinger <cg@exept.de>
parents: 1770
diff changeset
  1288
    "Modified: / 26.8.1998 / 19:05:25 / cg"
1739
d98fa6eea4fc added show references
Claus Gittinger <cg@exept.de>
parents: 1634
diff changeset
  1289
!
d98fa6eea4fc added show references
Claus Gittinger <cg@exept.de>
parents: 1634
diff changeset
  1290
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1291
showSelection:lineNr
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1292
    "user clicked on an instvar - show value in workspace"
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1293
3526
d8f3082ea1d7 Remove unused vars
Stefan Vogel <sv@exept.de>
parents: 3525
diff changeset
  1294
    |val|
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1295
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1296
    (hasMore and:[lineNr == listView list size]) ifTrue:[
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1297
        "clicked on the '...' entry"
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1298
        self showMore.
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1299
        listView setSelection:lineNr.
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1300
    ].
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1301
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1302
    self hasSelfEntry ifTrue:[
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1303
        (self hasSelfEntry and:[lineNr == 1]) ifTrue:[
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1304
            "selecting self also does a re-set, this allows updating the list"
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1305
            self reinspect.
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2188
diff changeset
  1306
        ].
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1307
    ].
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  1308
    selectionIndex := selectedLine := lineNr.
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  1309
    val := self selection.
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1310
    self dereferenceValueHolders ifTrue:[
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1311
        val := val value
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1312
    ].
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1313
    self showValue:val.
295
92bcaa9996ae minor changes for ContextInspector required
Claus Gittinger <cg@exept.de>
parents: 268
diff changeset
  1314
3608
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1315
    self setAcceptAction.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1316
1770
5cb6d7232aaa re-inspecting the same object suppresses list update;
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
  1317
    "Modified: / 30.7.1998 / 13:36:33 / cg"
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1318
!
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1319
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1320
showValue:someValue 
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1321
    "user clicked on an entry - show value in workspace"
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1322
3338
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1323
    |s|
1634
216a4254e634 added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  1324
3338
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1325
    self topView withWaitCursorDo:[
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1326
        s := self displayStringForValue:someValue.
2323
1f9604acad4a catch errors while generating displayString of a value
Claus Gittinger <cg@exept.de>
parents: 2284
diff changeset
  1327
        workspace replace:s.
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1328
    ].
1634
216a4254e634 added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  1329
!
216a4254e634 added 'hex integers' toggle to menu.
Claus Gittinger <cg@exept.de>
parents: 1597
diff changeset
  1330
3868
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1331
stringWithAllIndexedVarValues
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1332
    |nIdx s names maxLen varString padLeft|
3868
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1333
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1334
    nIdx := inspectedObject size.
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1335
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1336
    s := '' writeStream.
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1337
    names := self indexList.
3868
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1338
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1339
    maxLen := (names collect:[:eachName | eachName printString size]) max.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1340
    padLeft := names conform:[:eachIdx | eachIdx isInteger].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1341
    
3869
5d45932d6a28 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3868
diff changeset
  1342
    names do:[:eachIdx |
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1343
        |val|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1344
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1345
        padLeft ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1346
            s nextPutAll:(eachIdx printStringLeftPaddedTo:maxLen).
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1347
        ] ifFalse:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1348
            s nextPutAll:((eachIdx printString , ' ') paddedTo:maxLen+1 with:$.).
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1349
        ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1350
3868
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1351
        s nextPutAll:' : '.
3884
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3874
diff changeset
  1352
        val := self indexedValueAtKey:eachIdx.
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1353
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1354
        varString := val displayString.
3868
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1355
        (varString includes:Character cr) ifTrue:[
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1356
            varString := varString copyTo:(varString indexOf:Character cr)-1.
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1357
            varString := varString , '...'.
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1358
        ].
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1359
        s nextPutLine:varString.
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1360
    ].
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1361
    nShown < nIdx ifTrue:[
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1362
        s nextPutLine:' ...'.
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1363
    ].
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1364
    ^ s contents
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1365
!
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1366
3608
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1367
stringWithAllInstVarValues
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1368
    |s names maxLen varString|
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1369
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1370
    s := '' writeStream.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1371
    names := inspectedObject class allInstVarNames.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1372
    maxLen := (names collect:[:eachName | eachName size]) max.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1373
    names do:[:eachInstVarName |
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1374
        s nextPutAll:((eachInstVarName , ' ') paddedTo:maxLen+1 with:$.).
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1375
        s nextPutAll:' : '.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1376
        varString := (inspectedObject instVarNamed:eachInstVarName) displayString.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1377
        (varString includes:Character cr) ifTrue:[
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1378
            varString := varString copyTo:(varString indexOf:Character cr)-1.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1379
            varString := varString , '...'.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1380
        ].
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1381
        s nextPutAll:varString.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1382
        s cr.
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1383
    ].
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1384
    ^ s contents
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1385
!
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1386
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1387
valueAtLine:lineNr
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1388
    "helper - return the value of the selected entry"
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1389
3645
d88ce5dea1ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3639
diff changeset
  1390
    |idx l|
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1391
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1392
    (self hasSelfEntry
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1393
    and:[lineNr == 1 or:[lineNr isNil]]) ifTrue:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1394
        ^ inspectedObject
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1395
    ].
2235
ce49947e61f7 migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
  1396
3645
d88ce5dea1ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3639
diff changeset
  1397
    ((l := listView at:lineNr) startsWith:$-) ifTrue:[
d88ce5dea1ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3639
diff changeset
  1398
        (l ~= '-') ifTrue:[
d88ce5dea1ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3639
diff changeset
  1399
            ^ self valueForSpecialLine:(listView at:lineNr)
d88ce5dea1ce *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3639
diff changeset
  1400
        ].
3338
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1401
    ].
c2691e356f51 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 3318
diff changeset
  1402
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1403
    "/ a named instVar ?
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1404
    idx := self instVarIndexForLine:lineNr.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1405
    idx notNil ifTrue:[
3432
087493c18c74 class based exceptions - no longer need to send #breakPointSígnal
Claus Gittinger <cg@exept.de>
parents: 3428
diff changeset
  1406
        BreakPointInterrupt catch:[
2800
4e5792ade7aa menu fix
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  1407
            ^ inspectedObject instVarAt:idx
4e5792ade7aa menu fix
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  1408
        ]
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1409
    ].
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1410
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1411
    "/ an indexed instVar ?
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1412
    idx := self keyIndexForLine:lineNr.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1413
    idx notNil ifTrue:[
3432
087493c18c74 class based exceptions - no longer need to send #breakPointSígnal
Claus Gittinger <cg@exept.de>
parents: 3428
diff changeset
  1414
        BreakPointInterrupt catch:[
2800
4e5792ade7aa menu fix
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  1415
            ^ self indexedValueAtIndex:idx.
4e5792ade7aa menu fix
Claus Gittinger <cg@exept.de>
parents: 2724
diff changeset
  1416
        ]
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1417
    ].
644
aab7d4f7c8c3 allow hiding self; added a label
Claus Gittinger <cg@exept.de>
parents: 621
diff changeset
  1418
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1419
    "/ nope
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1420
    ^ nil
613
048942111c7b checkin from browser
Claus Gittinger <cg@exept.de>
parents: 593
diff changeset
  1421
3432
087493c18c74 class based exceptions - no longer need to send #breakPointSígnal
Claus Gittinger <cg@exept.de>
parents: 3428
diff changeset
  1422
    "Modified: / 16.11.2001 / 16:19:04 / cg"
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1423
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1424
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1425
valueAtLine:lineNr put:newValue
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1426
    |idx|
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1427
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1428
    idx := self instVarIndexForLine:selectionIndex.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1429
    idx notNil ifTrue:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1430
        inspectedObject instVarAt:idx put:newValue.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1431
    ] ifFalse:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1432
        idx := self keyIndexForLine:selectionIndex.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1433
        idx notNil ifTrue:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1434
            self indexedValueAtIndex:idx put:newValue.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1435
        ] ifFalse:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1436
            ^ self "/ self selected - dont store
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1437
        ]
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2235
diff changeset
  1438
    ].
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1439
!
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1440
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1441
valueForSpecialLine:line
3525
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1442
    (line startsWith:'-self') ifTrue:[
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1443
        ^ inspectedObject
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1444
    ].
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1445
    (line startsWith:'-hash') ifTrue:[
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1446
        ^ inspectedObject hash
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1447
    ].
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1448
    (line startsWith:'-identityHash') ifTrue:[
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1449
        ^ inspectedObject identityHash
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1450
    ].
3634
db094dd598f7 -dependents
Claus Gittinger <cg@exept.de>
parents: 3608
diff changeset
  1451
    (line startsWith:'-dependents') ifTrue:[
db094dd598f7 -dependents
Claus Gittinger <cg@exept.de>
parents: 3608
diff changeset
  1452
        ^ inspectedObject dependents
db094dd598f7 -dependents
Claus Gittinger <cg@exept.de>
parents: 3608
diff changeset
  1453
    ].
3525
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1454
    (line startsWith:'-hex') ifTrue:[
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1455
        ^ inspectedObject
761785907491 checkin from browser
martin
parents: 3432
diff changeset
  1456
    ].
3538
9516799c7911 octal & binary
Claus Gittinger <cg@exept.de>
parents: 3526
diff changeset
  1457
    (line startsWith:'-octal') ifTrue:[
9516799c7911 octal & binary
Claus Gittinger <cg@exept.de>
parents: 3526
diff changeset
  1458
        ^ inspectedObject
9516799c7911 octal & binary
Claus Gittinger <cg@exept.de>
parents: 3526
diff changeset
  1459
    ].
9516799c7911 octal & binary
Claus Gittinger <cg@exept.de>
parents: 3526
diff changeset
  1460
    (line startsWith:'-binary') ifTrue:[
9516799c7911 octal & binary
Claus Gittinger <cg@exept.de>
parents: 3526
diff changeset
  1461
        ^ inspectedObject
9516799c7911 octal & binary
Claus Gittinger <cg@exept.de>
parents: 3526
diff changeset
  1462
    ].
3567
e784eb071ee1 decompiler for methods
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
  1463
    (line startsWith:'-code') ifTrue:[
e784eb071ee1 decompiler for methods
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
  1464
        ^ inspectedObject
e784eb071ee1 decompiler for methods
Claus Gittinger <cg@exept.de>
parents: 3538
diff changeset
  1465
    ].
3868
77040d8d3526 all indexed vars
Claus Gittinger <cg@exept.de>
parents: 3657
diff changeset
  1466
    (line startsWith:'-all') ifTrue:[
3608
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1467
        ^ inspectedObject
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1468
    ].
aebf9f1eb30e all inst vars
Claus Gittinger <cg@exept.de>
parents: 3567
diff changeset
  1469
3526
d8f3082ea1d7 Remove unused vars
Stefan Vogel <sv@exept.de>
parents: 3525
diff changeset
  1470
    self error:'unknown special line'.
3349
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1471
b9a9138f8017 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3338
diff changeset
  1472
    "Created: / 31.10.2001 / 09:17:45 / cg"
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1473
! !
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1474
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1475
!InspectorView methodsFor:'queries'!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1476
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1477
canInspect:anObject
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1478
    ^ anObject inspectorClass == self class
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1479
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1480
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1481
dereferenceValueHolders
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1482
    ^ dereferenceValueHolders ? false
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1483
!
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1484
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1485
labelFor:anObject
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1486
    "return the windowLabel to use in my topView, when inspecting anObject."
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1487
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1488
    |lbl|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1489
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1490
    (self class == InspectorView
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1491
    and:[anObject inspectorClass ~~ InspectorView]) ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1492
        lbl := 'BasicInspector on: %1'
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1493
    ] ifFalse:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1494
        lbl := 'Inspector on: %1'
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1495
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1496
    ^ self class classResources 
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1497
        string:lbl with:(self labelNameFor:anObject)
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1498
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1499
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1500
labelNameFor:anObject
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1501
    "return the iconLabel to use in my topView, when inspecting anObject.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1502
     Simply returns the className or name of anObjects class"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1503
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1504
    |s|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1505
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1506
    anObject isClass ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1507
        s := anObject displayString
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1508
    ] ifFalse:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1509
        s := anObject classNameWithArticle
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1510
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1511
    s isNil ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1512
        anObject isBehavior ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1513
            ^ 'someBehavior'
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1514
        ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1515
        ^ 'something'
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1516
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1517
    ^ s
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1518
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1519
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1520
selectedKeyName
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1521
    selectionIndex notNil ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1522
        ^ listView listAt:selectionIndex.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1523
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1524
    ^ nil
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1525
!
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1526
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1527
suppressPseudoSlots
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1528
    ^ suppressPseudoSlots ? false
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1529
! !
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1530
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1531
!InspectorView methodsFor:'user interaction'!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1532
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1533
doAccept:theText
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1534
    |sel newValue|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1535
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1536
    sel := listView at:selectionIndex.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1537
    (sel startsWith:'-all') ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1538
        workspace flash.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1539
        ^ self.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1540
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1541
4642
ee63c37d9d3c Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 4314
diff changeset
  1542
    Error handle:[:ex |
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1543
        workspace flash
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1544
    ] do:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1545
        newValue := inspectedObject class evaluatorClass 
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1546
                       evaluate:theText
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1547
                       receiver:inspectedObject 
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1548
                       notifying:workspace.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1549
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1550
        self dereferenceValueHolders ifTrue:[
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1551
            (self valueAtLine:selectionIndex) value:newValue
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1552
        ] ifFalse:[
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1553
            self valueAtLine:selectionIndex put:newValue.
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
  1554
        ]
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1555
    ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1556
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1557
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1558
doCopyKey
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1559
    "put the instVar-name into the text-copy-buffer"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1560
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1561
    |nm|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1562
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1563
    selectionIndex notNil ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1564
        nm := listView listAt:selectionIndex.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1565
        nm notNil ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1566
            self setTextSelection:(nm asString)
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1567
        ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1568
    ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1569
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1570
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1571
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1572
doInspect:basic
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1573
    "user selected inspect-menu entry"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1574
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1575
    |objectToInspect|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1576
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1577
    selectionIndex notNil ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1578
        objectToInspect := self selection.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1579
        basic == #new ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1580
            NewInspector::NewInspectorView inspect:objectToInspect
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1581
        ] ifFalse:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1582
            basic ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1583
                objectToInspect basicInspect
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1584
            ] ifFalse:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1585
                objectToInspect inspect
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1586
            ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1587
        ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1588
    ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1589
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1590
    "Modified: / 31.10.1997 / 12:46:53 / cg"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1591
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1592
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1593
doUpdate
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1594
    self reinspect
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1595
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1596
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1597
keyPress:aKey x:x y:y
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1598
    "all my input is passed on to the workspace-field"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1599
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1600
    x notNil ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1601
	"/ not already delegated
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1602
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1603
	workspace keyPress:aKey x:-1 y:-1
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1604
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1605
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1606
    "Modified: 4.3.1996 / 22:21:37 / cg"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1607
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1608
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1609
monitor:anInstVarName
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1610
    "start a monitoring process, showing the given instVar
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1611
     in regular intervals."
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1612
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1613
    |ivName|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1614
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1615
    (ivName := anInstVarName) isInteger ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1616
        ivName := anInstVarName printString
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1617
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1618
    listView selectElement:ivName.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1619
    self doStartMonitor
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1620
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1621
    "Created: / 1.3.1996 / 19:31:45 / cg"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1622
    "Modified: / 12.2.1999 / 16:05:47 / cg"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1623
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1624
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1625
selection
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1626
    "helper - return the value of the selected entry"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1627
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1628
    ^ self valueAtLine:selectionIndex
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1629
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1630
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1631
showLast
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1632
    "user clicked on an instvar - show value in workspace"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1633
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1634
    |lastIdx|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1635
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1636
    lastIdx := listView list size.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1637
    lastIdx ~~ 0 ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1638
	self showSelection:lastIdx.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1639
	listView selection:lastIdx.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1640
    ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1641
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1642
    "Created: 28.6.1996 / 15:06:38 / cg"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1643
    "Modified: 18.3.1997 / 18:22:54 / cg"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1644
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1645
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1646
showReferences
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1647
    "user selected references-menu entry"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1648
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1649
    self selection class hasImmediateInstances ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1650
        ^ self warn:'Sorry - cannot show references to immediate objects'
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1651
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1652
    ObjectMemory displayRefChainTo:(self selection)
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1653
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1654
    "Modified: / 30.7.1998 / 14:03:16 / cg"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1655
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1656
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1657
toggleHex
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1658
    |sel|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1659
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1660
    showHex := showHex not.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1661
    sel := listView selection.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1662
    sel notNil ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1663
	self showSelection:sel
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1664
    ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1665
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1666
    "Created: / 7.5.1998 / 01:54:52 / cg"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1667
    "Modified: / 7.5.1998 / 02:00:10 / cg"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1668
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1669
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1670
tryToSelectKeyNamed:aString
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1671
    |idx|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1672
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1673
    (idx := listView list indexOf:aString) ~= 0 ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1674
        listView selection:idx
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1675
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1676
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1677
    "Created: / 16.11.2001 / 13:48:51 / cg"
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1678
! !
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3869
diff changeset
  1679
4268
0fe3e4a82ddf more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
  1680
!InspectorView methodsFor:'workspace protocol'!
0fe3e4a82ddf more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
  1681
0fe3e4a82ddf more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
  1682
modified:aBoolean
0fe3e4a82ddf more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
  1683
    ^ workspace modified:aBoolean
0fe3e4a82ddf more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
  1684
!
0fe3e4a82ddf more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
  1685
0fe3e4a82ddf more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
  1686
saveAs:file doAppend:doAppend
0fe3e4a82ddf more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
  1687
    workspace saveAs:file doAppend:doAppend
0fe3e4a82ddf more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
  1688
! !
0fe3e4a82ddf more textView protocol (for Workspace)
Claus Gittinger <cg@exept.de>
parents: 4197
diff changeset
  1689
871
a29021918ec5 fixed openOn:monitor:
Claus Gittinger <cg@exept.de>
parents: 742
diff changeset
  1690
!InspectorView class methodsFor:'documentation'!
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1691
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1692
version
4642
ee63c37d9d3c Convert Object>>errorSignal -> Error
Stefan Vogel <sv@exept.de>
parents: 4314
diff changeset
  1693
    ^ '$Header: /cvs/stx/stx/libtool/InspectorView.st,v 1.139 2003-03-02 20:40:39 stefan Exp $'
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 188
diff changeset
  1694
! !