DictionaryInspectorView.st
author Stefan Vogel <sv@exept.de>
Thu, 11 Jan 2007 19:05:31 +0100
changeset 7577 9769c6225ff7
parent 7373 6a42251b4415
child 7805 a2d82b06d71b
permissions -rw-r--r--
Rename nt.mak to bc.mak
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     1
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     2
 COPYRIGHT (c) 1993 by Claus Gittinger
52
7b48409ae088 *** empty log message ***
claus
parents: 45
diff changeset
     3
	      All Rights Reserved
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     4
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     5
 This software is furnished under a license and may be used
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     6
 only in accordance with the terms of that license and with the
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     8
 be provided or otherwise made available to, or used by, any
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
     9
 other person.  No title to or ownership of the software is
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    10
 hereby transferred.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    11
"
2697
b4f4e431b71e browserClass from preferences
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
    12
"{ Package: 'stx:libtool' }"
b4f4e431b71e browserClass from preferences
Claus Gittinger <cg@exept.de>
parents: 2647
diff changeset
    13
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    14
InspectorView subclass:#DictionaryInspectorView
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    15
	instanceVariableNames:'keys hideClassVars hideClasses hideAliases'
361
d1c82e7aa149 handle nil inspectedObjects (mhmh)
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    16
	classVariableNames:''
d1c82e7aa149 handle nil inspectedObjects (mhmh)
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    17
	poolDictionaries:''
d1c82e7aa149 handle nil inspectedObjects (mhmh)
Claus Gittinger <cg@exept.de>
parents: 200
diff changeset
    18
	category:'Interface-Inspector'
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    19
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    20
957
ecbcb2c15ae8 show a waitCursor, while collecitng keys
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
    21
!DictionaryInspectorView class methodsFor:'documentation'!
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    22
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    23
copyright
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    24
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    25
 COPYRIGHT (c) 1993 by Claus Gittinger
52
7b48409ae088 *** empty log message ***
claus
parents: 45
diff changeset
    26
	      All Rights Reserved
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    27
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    28
 This software is furnished under a license and may be used
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    29
 only in accordance with the terms of that license and with the
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    31
 be provided or otherwise made available to, or used by, any
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    32
 other person.  No title to or ownership of the software is
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    33
 hereby transferred.
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    34
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    35
!
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    37
documentation
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    38
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    39
    a modified Inspector for Dictionaries
510
6543e55fb227 documentation
Claus Gittinger <cg@exept.de>
parents: 470
diff changeset
    40
6543e55fb227 documentation
Claus Gittinger <cg@exept.de>
parents: 470
diff changeset
    41
    [author:]
6543e55fb227 documentation
Claus Gittinger <cg@exept.de>
parents: 470
diff changeset
    42
        Claus Gittinger
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    43
"
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    44
! !
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    45
470
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
    46
!DictionaryInspectorView methodsFor:'menu'!
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    47
73
e332d9c71624 *** empty log message ***
claus
parents: 57
diff changeset
    48
fieldMenu
1361
20c353524524 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    49
    <resource: #programMenu >
20c353524524 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    50
4269
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
    51
    |items m|
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
    52
2645
d01d467c5199 #isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
    53
    inspectedObject isNameSpace ifTrue:[
1665
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
    54
        items := #(
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    55
                       ('Copy Key'             doCopyKey      )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    56
                       ('-')
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    57
                       ('Inspect'              doInspect      )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    58
                       ('Inspect Key'          doInspectKey   )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    59
                       ('BasicInspect'         doBasicInspect )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    60
                       ('Inspect Hierarchical' doNewInspect   )
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
    61
                       ('-')
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    62
                       ('Ref chains'           showReferences )
4269
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
    63
                       ('References to Global' showKeyReferences )
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
    64
                       ('-')
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    65
                       ('Browse'               browse         )
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
    66
                       ('-')
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    67
                       ('Add Key'              doAddKey       )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    68
                       ('Remove Key'           doRemoveKey    )
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    69
                       ('-')
470
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
    70
                   ).
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    71
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    72
        hideClassVars == true ifTrue:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    73
            items := items , #(
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    74
                           ('Show classVars'   doShowClassVars )
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    75
                       ).
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    76
        ] ifFalse:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    77
            items := items , #(
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    78
                           ('Hide classVars'   doHideClassVars )
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    79
                       ).
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    80
        ].
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    81
        hideClasses == true ifTrue:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    82
            items := items , #(
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    83
                           ('Show classes'     doShowClasses )
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    84
                       ).
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    85
        ] ifFalse:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    86
            items := items , #(
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    87
                           ('Hide classes'     doHideClasses )
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    88
                       ).
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    89
        ].
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    90
        hideAliases == true ifTrue:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    91
            items := items , #(
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    92
                           ('Show aliases'     doShowAliases )
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    93
                       ).
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    94
        ] ifFalse:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    95
            items := items , #(
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
    96
                           ('Hide aliases'     doHideAliases )
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    97
                       ).
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
    98
        ]
45
950b84ba89e6 *** empty log message ***
claus
parents: 36
diff changeset
    99
    ] ifFalse:[
1665
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
   100
        items := #(
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   101
                       ('Copy Key'             doCopyKey      )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   102
                       ('-')
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   103
                       ('Inspect'              doInspect      )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   104
                       ('Inspect Key'          doInspectKey   )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   105
                       ('BasicInspect'         doBasicInspect )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   106
                       ('Inspect Hierarchical' doNewInspect   )
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
   107
                       ('-')
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   108
                       ('Ref chains'           showReferences )
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
   109
                       ('-')
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   110
                       ('Browse'                       browse                 )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   111
                       ('Browse class hierarchy'       browseClassHierarchy   )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   112
                       ('Browse full class protocol'   browseFullClassProtocol)
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
   113
                       ('-')
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   114
                       ('Add Key'              doAddKey       )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   115
                       ('Remove Key'           doRemoveKey    )
470
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   116
                   ).
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   117
    ].
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   118
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   119
    monitorProcess isNil ifTrue:[
1665
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
   120
        items := items , #(
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
   121
                       ('-')
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   122
                       ('Start Monitor'    doStartMonitor )
1665
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
   123
                          ).
470
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   124
    ] ifFalse:[
1665
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
   125
        items := items , #(
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
   126
                       ('-')
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   127
                       ('Stop Monitor'     doStopMonitor  )
1665
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
   128
                          ).
45
950b84ba89e6 *** empty log message ***
claus
parents: 36
diff changeset
   129
    ].
950b84ba89e6 *** empty log message ***
claus
parents: 36
diff changeset
   130
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   131
    items := items , #(
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   132
                   ('-')
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   133
                   ('Update'     doUpdate  )
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   134
                      ).
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   135
1665
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
   136
    m := PopUpMenu itemList:items resources:resources.
470
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   137
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2215
diff changeset
   138
    selectionIndex isNil ifTrue:[
1665
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
   139
        m disableAll:#(doInspect doInspectKey doBasicInspect doNewInspect
2085
ec4daf11d3b6 added #copyKey - menu item
Claus Gittinger <cg@exept.de>
parents: 1743
diff changeset
   140
                       doRemoveKey doStartMonitor doStopMonitor doCopyKey
1665
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
   141
                      )
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   142
    ] ifFalse:[
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2215
diff changeset
   143
        (self keyIndexForLine:selectionIndex) isNil ifTrue:[
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   144
            m disableAll:#(doInspectKey doRemoveKey doCopyKey)
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   145
        ]
1665
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
   146
    ].
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   147
1665
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
   148
    ^ m.
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
   149
7e3fc40e26ad *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1361
diff changeset
   150
    "Modified: / 21.5.1998 / 13:25:10 / cg"
36
ccde5a941840 *** empty log message ***
claus
parents:
diff changeset
   151
! !
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   152
470
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   153
!DictionaryInspectorView methodsFor:'menu actions'!
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   154
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   155
browse
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   156
    |cls|
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   157
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   158
    cls := self selection class theNonMetaclass.
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   159
"/    cls isNameSpace ifTrue:[
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   160
"/        self halt.
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   161
"/    ].
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   162
    cls browserClass openInClass:cls selector:nil
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   163
!
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   164
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   165
doAddKey
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   166
    "add a key"
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   167
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   168
    |keyName key val l|
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   169
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   170
    keyName := Dialog request:'Key to add (storeString):' initialAnswer:''.
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   171
    keyName notEmpty ifTrue:[
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   172
        key := Object readFrom:keyName onError:[ self information:'Bad input.'. ^ self].
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   173
        (inspectedObject includesKey:key) ifFalse:[
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   174
            val := Dialog request:'Value to add (storeString):' initialAnswer:''.
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   175
            val notNil ifTrue:[
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   176
                val := Object readFrom:val onError:[ self information:'Bad input.'. ^ self].
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   177
            ].
3198
1c34cd12b80b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3140
diff changeset
   178
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   179
            inspectedObject at:key put:val.
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2215
diff changeset
   180
            selectionIndex := selectedLine := nil.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   181
            inspectedObject changed.
2213
d6e6c41db3ef keep scroll-offset when removing a key
Claus Gittinger <cg@exept.de>
parents: 2212
diff changeset
   182
            l := listView firstLineShown.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   183
            self reinspect. "force list update"
2213
d6e6c41db3ef keep scroll-offset when removing a key
Claus Gittinger <cg@exept.de>
parents: 2212
diff changeset
   184
            listView scrollToLine:l
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   185
        ]
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   186
    ]
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   187
!
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   188
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   189
doHideAliases
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   190
    hideAliases := true.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   191
    self reinspect
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   192
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   193
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   194
doHideClassVars
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   195
    hideClassVars := true.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   196
    self reinspect
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   197
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   198
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   199
doHideClasses
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   200
    hideClasses := true.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   201
    self reinspect
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   202
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   203
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   204
doInspectKey
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   205
    "inspect selected items key"
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   206
4269
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   207
    |key|
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   208
4269
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   209
    key := self selectedKey.
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   210
    key notNil ifTrue:[
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   211
        key inspect
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   212
    ]
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   213
!
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   214
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   215
doRemoveKey
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   216
    "remove selected item from keys"
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   217
4269
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   218
    |key l|
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   219
4269
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   220
    key := self selectedKey.
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   221
    key notNil ifTrue:[
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   222
        (inspectedObject includesKey:key) ifTrue:[
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   223
            listView cursor:(Cursor wait).
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   224
            inspectedObject removeKey:key.
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   225
            keys := nil.
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2215
diff changeset
   226
            selectionIndex := selectedLine := nil.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   227
            inspectedObject changed.
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   228
            listView cursor:(Cursor hand).
2212
10903bf15c4b keep scroll-offset when removing a key
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   229
            l := listView firstLineShown.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   230
            self reinspect. "force list update"
2212
10903bf15c4b keep scroll-offset when removing a key
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   231
            listView scrollToLine:l.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   232
        ].
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   233
    ]
1740
5dd8db18c0cf added show references
Claus Gittinger <cg@exept.de>
parents: 1665
diff changeset
   234
!
5dd8db18c0cf added show references
Claus Gittinger <cg@exept.de>
parents: 1665
diff changeset
   235
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   236
doShowAliases
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   237
    hideAliases := false.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   238
    self reinspect
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   239
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   240
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   241
doShowClassVars
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   242
    hideClassVars := false.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   243
    self reinspect
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   244
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   245
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   246
doShowClasses
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   247
    hideClasses := false.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   248
    self reinspect
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   249
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   250
1740
5dd8db18c0cf added show references
Claus Gittinger <cg@exept.de>
parents: 1665
diff changeset
   251
showKeyReferences
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   252
    "show users of selected key (i.e. global).
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   253
     Only useful when inspecting smalltalk"
1740
5dd8db18c0cf added show references
Claus Gittinger <cg@exept.de>
parents: 1665
diff changeset
   254
4269
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   255
    |key|
1740
5dd8db18c0cf added show references
Claus Gittinger <cg@exept.de>
parents: 1665
diff changeset
   256
4269
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   257
    key := self selectedKey.
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   258
    key notNil ifTrue:[
2274
a225b0d4dce7 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
   259
        self topView withWaitCursorDo:[
4269
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   260
            UserPreferences systemBrowserClass browseReferendsOf:(key asSymbol)
1740
5dd8db18c0cf added show references
Claus Gittinger <cg@exept.de>
parents: 1665
diff changeset
   261
        ].
5dd8db18c0cf added show references
Claus Gittinger <cg@exept.de>
parents: 1665
diff changeset
   262
    ]
470
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   263
! !
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   264
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   265
!DictionaryInspectorView methodsFor:'private'!
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   266
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   267
baseInspectedObjectClass
2297
a881c775d42f Fix for classes like MethodDictionary, that are not a subclass of Dictionary.
Stefan Vogel <sv@exept.de>
parents: 2274
diff changeset
   268
2298
4cff11435fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
   269
    (inspectedObject isMemberOf:Dictionary) ifFalse:[
4cff11435fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
   270
        (inspectedObject class inheritsFrom:Dictionary) ifFalse:[
4cff11435fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
   271
            "this is true for e.g. MethodDictionary"
4cff11435fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
   272
            ^ Object
4cff11435fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
   273
        ]
2297
a881c775d42f Fix for classes like MethodDictionary, that are not a subclass of Dictionary.
Stefan Vogel <sv@exept.de>
parents: 2274
diff changeset
   274
    ].
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   275
    ^ Dictionary
2297
a881c775d42f Fix for classes like MethodDictionary, that are not a subclass of Dictionary.
Stefan Vogel <sv@exept.de>
parents: 2274
diff changeset
   276
a881c775d42f Fix for classes like MethodDictionary, that are not a subclass of Dictionary.
Stefan Vogel <sv@exept.de>
parents: 2274
diff changeset
   277
    "Modified: / 23.7.1999 / 10:39:11 / stefan"
2298
4cff11435fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
   278
4cff11435fb8 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 2297
diff changeset
   279
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   280
!
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2190
diff changeset
   281
649
11d4cbff1092 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
   282
defaultLabel
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3874
diff changeset
   283
    ^ 'Keys'
649
11d4cbff1092 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
   284
11d4cbff1092 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
   285
    "Created: 28.6.1996 / 19:46:51 / cg"
11d4cbff1092 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
   286
!
11d4cbff1092 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
   287
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   288
indexList
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   289
    "return a list of indexes to show in the selectionList.
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   290
     Set hasMore to true, if a '...' entry should be added."
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   291
2645
d01d467c5199 #isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   292
    inspectedObject isNameSpace ifTrue:[
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   293
        ^ self indexListForNameSpace.
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   294
    ].
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   295
2647
888a03260cf0 be prepared for nil being a valid key
Claus Gittinger <cg@exept.de>
parents: 2645
diff changeset
   296
    "/ do not use 'inspectedObjectkeys',
888a03260cf0 be prepared for nil being a valid key
Claus Gittinger <cg@exept.de>
parents: 2645
diff changeset
   297
    "/ since Sets cannot hold nils (which are now valid keys)
888a03260cf0 be prepared for nil being a valid key
Claus Gittinger <cg@exept.de>
parents: 2645
diff changeset
   298
    keys := OrderedCollection new.
888a03260cf0 be prepared for nil being a valid key
Claus Gittinger <cg@exept.de>
parents: 2645
diff changeset
   299
    inspectedObject keysDo:[:k | keys add:k].
888a03260cf0 be prepared for nil being a valid key
Claus Gittinger <cg@exept.de>
parents: 2645
diff changeset
   300
    keys := keys asSortedCollection:[:a :b | a displayString < b displayString].
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   301
    ^ keys
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   302
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   303
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   304
indexListForNameSpace
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   305
    "return a list of indexes to show in the selectionList.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   306
     Set hasMore to true, if a '...' entry should be added."
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   307
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   308
    keys := SortedCollection new:1000.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   309
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   310
    (hideClassVars or:[hideClasses or:[hideAliases]]) ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   311
        inspectedObject keysDo:[:k |
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   312
            |hidden i o|
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   313
3874
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   314
            hidden := false.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   315
            hideClassVars == true ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   316
                (i := k lastIndexOf:$:) ~~ 0 ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   317
                    (i > 1 and:[(k at:i-1) ~~ $:]) ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   318
                        hidden := true
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   319
                    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   320
                ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   321
            ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   322
            (hidden not and:[hideClasses == true]) ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   323
                o := inspectedObject at:k ifAbsent:nil.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   324
                o isBehavior ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   325
                    inspectedObject == Smalltalk ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   326
                        o name == k ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   327
                            hidden := true
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   328
                        ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   329
                    ] ifFalse:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   330
                        o nameWithoutNameSpacePrefix = k ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   331
                            hidden := true
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   332
                        ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   333
                    ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   334
                ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   335
            ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   336
            (hidden not and:[hideAliases == true]) ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   337
                o := inspectedObject at:k ifAbsent:nil.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   338
                o isBehavior ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   339
                    inspectedObject == Smalltalk ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   340
                        o name ~~ k ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   341
                            hidden := true
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   342
                        ]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   343
                    ] ifFalse:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   344
                        o nameWithoutNameSpacePrefix ~= k ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   345
                            hidden := true
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   346
                        ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   347
                    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   348
                ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   349
            ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   350
            hidden ifFalse:[keys add:k]
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   351
        ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   352
    ] ifFalse:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   353
        inspectedObject keysDo:[:k | keys add:k].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   354
    ].
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   355
    ^ keys
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   356
!
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   357
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   358
indexedFieldList 
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   359
    "return a list of indexed-variable names to show in the selectionList.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   360
     Set hasMore to true, if a '...' entry should be added."
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   361
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   362
    |keys|
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   363
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   364
    keys := self indexList.
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   365
    ^ keys 
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   366
        collect:[:k | 
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   367
            k isSymbol 
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   368
                ifTrue:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   369
                    k printString] 
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   370
                ifFalse:[
ed3a652e5ce0 all indexed vars for dictionaries
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   371
                    k displayString]].
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   372
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   373
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   374
instVarIndexForLine:lineNr
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   375
    "helper - return the index for a named instVar;
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   376
     nil, if self or a keyed instvar is selected."
2189
db73912a0b4c show named instvars (except those of Dictionary)
Claus Gittinger <cg@exept.de>
parents: 2085
diff changeset
   377
2645
d01d467c5199 #isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   378
    inspectedObject isNameSpace ifTrue:[
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   379
        ^ nil
957
ecbcb2c15ae8 show a waitCursor, while collecitng keys
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   380
    ].
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   381
    ^ super instVarIndexForLine:lineNr
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   382
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   383
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   384
keyIndexForLine:lineNr
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   385
    "helper - return the index of the key-list"
470
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   386
5421
86a6077b131d Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents: 4269
diff changeset
   387
    |firstRealIndex idx line|
4100
d515e0e48272 suppressed pseudo vars fix
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
   388
2645
d01d467c5199 #isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   389
    inspectedObject isNameSpace ifTrue:[
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3874
diff changeset
   390
        (self hasSelfEntry
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   391
        and:[lineNr == 1 or:[lineNr isNil]]) ifTrue:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   392
            ^ nil "/ self selected
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   393
        ].
4100
d515e0e48272 suppressed pseudo vars fix
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
   394
        firstRealIndex := 1.
d515e0e48272 suppressed pseudo vars fix
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
   395
        idx := lineNr.
5421
86a6077b131d Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents: 4269
diff changeset
   396
        [line := listView at:firstRealIndex. 
86a6077b131d Fix for negative numbers as keys in a Dictionary
Stefan Vogel <sv@exept.de>
parents: 4269
diff changeset
   397
         (line startsWith:'-') and:[line size < 2 or:[line second isDigit not]]] whileTrue:[
4100
d515e0e48272 suppressed pseudo vars fix
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
   398
            firstRealIndex := firstRealIndex + 1.
d515e0e48272 suppressed pseudo vars fix
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
   399
            idx := idx - 1.
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3874
diff changeset
   400
        ].
4100
d515e0e48272 suppressed pseudo vars fix
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
   401
d515e0e48272 suppressed pseudo vars fix
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
   402
        ^ idx   
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   403
    ].
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   404
    ^ super keyIndexForLine:lineNr
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   405
!
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   406
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   407
namedFieldList 
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   408
    "return a list of instVar names to show in the selectionList."
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   409
2645
d01d467c5199 #isNamespace renamed to #isNameSpace
Claus Gittinger <cg@exept.de>
parents: 2298
diff changeset
   410
    inspectedObject isNameSpace ifTrue:[
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   411
        "/ empty ...
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   412
        ^ OrderedCollection new
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   413
    ].
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   414
    ^ super namedFieldList
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   415
470
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   416
!
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   417
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   418
release 
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   419
    "release inspected object"
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   420
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   421
    keys := nil.
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   422
    super release
4269
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   423
!
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   424
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   425
selectedKey
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   426
    "selected items key or nil"
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   427
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   428
    |idx|
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   429
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   430
    idx := self keyIndexForLine:selectionIndex.
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   431
    idx notNil ifTrue:[
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   432
        ^ (keys at:idx)
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   433
    ].
b5d1e481db7a refactored
Claus Gittinger <cg@exept.de>
parents: 4100
diff changeset
   434
    ^ nil.
470
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   435
! !
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   436
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   437
!DictionaryInspectorView methodsFor:'user interaction'!
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   438
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   439
indexedValueAtIndex:idx
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   440
    |key|
470
5bb60cb688c8 category rename / added monitor stuff
Claus Gittinger <cg@exept.de>
parents: 385
diff changeset
   441
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   442
    key := keys at:idx.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   443
    ^ inspectedObject at:key ifAbsent:nil.
2190
12158a4f0d9c care for last change when accepting
Claus Gittinger <cg@exept.de>
parents: 2189
diff changeset
   444
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   445
!
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   446
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   447
indexedValueAtIndex:idx put:newValue
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   448
    |key|
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   449
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   450
    key := keys at:idx.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   451
    inspectedObject at:key put:newValue.
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   452
! !
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   453
957
ecbcb2c15ae8 show a waitCursor, while collecitng keys
Claus Gittinger <cg@exept.de>
parents: 689
diff changeset
   454
!DictionaryInspectorView class methodsFor:'documentation'!
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   455
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   456
version
7373
6a42251b4415 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 7053
diff changeset
   457
    ^ '$Header: /cvs/stx/stx/libtool/DictionaryInspectorView.st,v 1.59 2006-10-06 16:50:16 cg Exp $'
200
01ce3d3636d5 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 165
diff changeset
   458
! !