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