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