SetInspectorView.st
author Claus Gittinger <cg@exept.de>
Mon, 20 Jan 2020 21:02:47 +0100
changeset 19422 c6ca1c3e0fd7
parent 19338 e416bad39186
permissions -rw-r--r--
#REFACTORING by exept class: MultiViewToolApplication added: #askForFile:default:forSave:thenDo: changed: #askForFile:default:thenDo: #askForFile:thenDo: #menuSaveAllAs #menuSaveAs
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18969
a8655dd978bc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 18954
diff changeset
     1
"{ Encoding: utf8 }"
a8655dd978bc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 18954
diff changeset
     2
2627
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
     3
"
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
     4
 COPYRIGHT (c) 1996 by Claus Gittinger / eXept Software AG
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
     5
              All Rights Reserved
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
     6
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
     7
 This software is furnished under a license and may be used
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
     8
 only in accordance with the terms of that license and with the
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
     9
 inclusion of the above copyright notice.   This software may not
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    10
 be provided or otherwise made available to, or used by, any
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    11
 other person.  No title to or ownership of the software is
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    12
 hereby transferred.
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    13
"
2717
dc997032a34e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    14
"{ Package: 'stx:libtool' }"
dc997032a34e *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2627
diff changeset
    15
15801
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
    16
"{ NameSpace: Smalltalk }"
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
    17
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    18
InspectorView subclass:#SetInspectorView
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    19
	instanceVariableNames:'keys'
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    20
	classVariableNames:''
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    21
	poolDictionaries:''
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    22
	category:'Interface-Inspector'
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    23
!
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    24
794
b4b902784e00 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 647
diff changeset
    25
!SetInspectorView class methodsFor:'documentation'!
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    26
2627
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    27
copyright
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    28
"
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    29
 COPYRIGHT (c) 1996 by Claus Gittinger / eXept Software AG
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    30
              All Rights Reserved
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    31
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    32
 This software is furnished under a license and may be used
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    33
 only in accordance with the terms of that license and with the
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    34
 inclusion of the above copyright notice.   This software may not
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    35
 be provided or otherwise made available to, or used by, any
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    36
 other person.  No title to or ownership of the software is
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    37
 hereby transferred.
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    38
"
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    39
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    40
!
e633d9928ddd copyrights
Claus Gittinger <cg@exept.de>
parents: 2271
diff changeset
    41
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    42
documentation
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    43
"
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    44
    A modified inspector for Sets
510
6543e55fb227 documentation
Claus Gittinger <cg@exept.de>
parents: 370
diff changeset
    45
6543e55fb227 documentation
Claus Gittinger <cg@exept.de>
parents: 370
diff changeset
    46
    [author:]
6543e55fb227 documentation
Claus Gittinger <cg@exept.de>
parents: 370
diff changeset
    47
        Stefan Vogel
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    48
"
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    49
!
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    50
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    51
examples
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    52
"
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    53
    #(a b c d e) asSet inspect
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    54
"
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    55
! !
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    56
6491
d02c41c57d02 better menu
Claus Gittinger <cg@exept.de>
parents: 6324
diff changeset
    57
!SetInspectorView methodsFor:'menu'!
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    58
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    59
fieldMenu
1361
20c353524524 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
    60
    <resource: #programMenu >
20c353524524 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
    61
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    62
    |menu|
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    63
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    64
    menu := super fieldMenu.
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    65
    menu addLabels:#(
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    66
                       '-'
3200
4889a13402db *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2717
diff changeset
    67
                       'Remove element'
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    68
                   )
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    69
         selectors:#(
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    70
                       nil 
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    71
                       doRemoveKey
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    72
                   ).
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    73
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
    74
    (self keyIndexForLine:selectionIndex) isNil ifTrue:[
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
    75
        menu disableAll:#(doRemoveKey)
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
    76
    ].
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
    77
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    78
    ^ menu
1361
20c353524524 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
    79
20c353524524 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 956
diff changeset
    80
    "Modified: / 29.10.1997 / 03:41:47 / cg"
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    81
! !
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    82
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    83
!SetInspectorView methodsFor:'private'!
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
    84
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
    85
baseInspectedObjectClass
18969
a8655dd978bc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 18954
diff changeset
    86
    "only instvars below that are shown by me in the non-basic tab.
a8655dd978bc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 18954
diff changeset
    87
     This hides uninterresting details in the regular tab"
a8655dd978bc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 18954
diff changeset
    88
15801
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
    89
    (inspectedObject class inheritsFrom:Set) ifTrue:[
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
    90
        ^ Set
6324
29bf9ceffe8f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 4095
diff changeset
    91
    ].
15801
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
    92
    ^ Object
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
    93
!
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
    94
647
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
    95
defaultLabel
4095
5bd36b14723d labels; added suppressPseudoVars & dereferenceValueHolders
Claus Gittinger <cg@exept.de>
parents: 3884
diff changeset
    96
    ^ 'Contents'
647
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
    97
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
    98
    "
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
    99
     (Set with:1 with:2 with:3) inspect
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
   100
    "
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
   101
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
   102
    "Modified: 28.6.1996 / 16:05:42 / cg"
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
   103
!
1791ceddf2ef checkin from browser
Claus Gittinger <cg@exept.de>
parents: 645
diff changeset
   104
3875
40e2e851a32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   105
indexList 
40e2e851a32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   106
    "return a list of indexes to show in the selectionList.
40e2e851a32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   107
     Set hasMore to true, if a '...' entry should be added."
40e2e851a32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   108
8526
5ecd6ffcfa6c also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents: 7379
diff changeset
   109
    inspectedObject size > nShown ifTrue:[
5ecd6ffcfa6c also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents: 7379
diff changeset
   110
        |coll|
5ecd6ffcfa6c also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents: 7379
diff changeset
   111
19338
e416bad39186 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18969
diff changeset
   112
        (inspectedObject isOrdered not or:[sortOrder == SortOrderAlphabetical]) ifTrue:[
e416bad39186 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18969
diff changeset
   113
            coll := (SortedCollection new:nShown) sortBlock:[:a :b | a displayString < b displayString].
e416bad39186 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18969
diff changeset
   114
        ] ifFalse:[
e416bad39186 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18969
diff changeset
   115
            coll := OrderedCollection new:nShown
e416bad39186 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18969
diff changeset
   116
        ].
8526
5ecd6ffcfa6c also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents: 7379
diff changeset
   117
        inspectedObject do:[:el |
5ecd6ffcfa6c also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents: 7379
diff changeset
   118
            coll add:el.
5ecd6ffcfa6c also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents: 7379
diff changeset
   119
            coll size >= nShown ifTrue:[ 
5ecd6ffcfa6c also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents: 7379
diff changeset
   120
                hasMore := true.
5ecd6ffcfa6c also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents: 7379
diff changeset
   121
                ^ coll
5ecd6ffcfa6c also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents: 7379
diff changeset
   122
            ].
5ecd6ffcfa6c also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents: 7379
diff changeset
   123
        ].
5ecd6ffcfa6c also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents: 7379
diff changeset
   124
    ].
5ecd6ffcfa6c also show only the first nShown names;
Claus Gittinger <cg@exept.de>
parents: 7379
diff changeset
   125
19338
e416bad39186 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18969
diff changeset
   126
    (inspectedObject isOrdered not or:[sortOrder == SortOrderAlphabetical]) ifTrue:[
e416bad39186 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18969
diff changeset
   127
        ^ inspectedObject asSortedCollection:[:a :b | a displayString < b displayString].
e416bad39186 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18969
diff changeset
   128
    ].
e416bad39186 #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 18969
diff changeset
   129
    ^ inspectedObject asOrderedCollection
3875
40e2e851a32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   130
!
40e2e851a32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   131
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   132
indexedFieldList 
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   133
    "return a list of indexed-variable names to show in the selectionList.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   134
     Set hasMore to true, if a '...' entry should be added."
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   135
3875
40e2e851a32c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 3870
diff changeset
   136
    keys := self indexList.
15801
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
   137
    ^ keys collect:[:k | k displayString].
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   138
!
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   139
12833
eaceca8a5fb0 menu fix: showMore/hasMore
Claus Gittinger <cg@exept.de>
parents: 11894
diff changeset
   140
numIndexedFields
eaceca8a5fb0 menu fix: showMore/hasMore
Claus Gittinger <cg@exept.de>
parents: 11894
diff changeset
   141
    ^ inspectedObject size
eaceca8a5fb0 menu fix: showMore/hasMore
Claus Gittinger <cg@exept.de>
parents: 11894
diff changeset
   142
!
eaceca8a5fb0 menu fix: showMore/hasMore
Claus Gittinger <cg@exept.de>
parents: 11894
diff changeset
   143
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   144
release 
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   145
    "release inspected object"
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   146
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   147
    keys := nil.
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   148
    super release
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   149
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   150
    "Created: 9.2.1996 / 12:04:30 / stefan"
3884
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3875
diff changeset
   151
!
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3875
diff changeset
   152
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3875
diff changeset
   153
showAllIndexedVarsInFieldList
15801
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
   154
    ^ true
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
   155
! !
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
   156
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
   157
!SetInspectorView methodsFor:'queries'!
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
   158
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
   159
isIndexShown
3884
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3875
diff changeset
   160
    ^ false
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   161
! !
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   162
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   163
!SetInspectorView methodsFor:'user interaction'!
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   164
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   165
doRemoveKey
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   166
    "remove selected item from keys"
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   167
2192
c7bce869223c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2191
diff changeset
   168
    |key idx|
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   169
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   170
    idx := self keyIndexForLine:selectionIndex.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
   171
    idx notNil ifTrue:[
2192
c7bce869223c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2191
diff changeset
   172
        key := keys at:idx.
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   173
        (inspectedObject includes:key) ifTrue:[
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   174
            listView cursor:(Cursor wait).
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   175
            inspectedObject remove:key.
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   176
            keys := nil.
2236
257f587ad7dc migrate instvars 'inspectedObject' to 'object'
Claus Gittinger <cg@exept.de>
parents: 2193
diff changeset
   177
            selectionIndex := selectedLine := nil.
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   178
            inspectedObject changed.
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   179
            listView cursor:(Cursor hand).
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
   180
            self reinspect.
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   181
        ].
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   182
    ]
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   183
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   184
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   185
!
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   186
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   187
indexedValueAtIndex:idx
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   188
    ^ keys at:idx
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   189
!
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   190
3884
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3875
diff changeset
   191
indexedValueAtKey:idx
15801
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
   192
    ^ idx
3884
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3875
diff changeset
   193
!
4329e6c615a5 dont crash in set showing all indexed vars
james
parents: 3875
diff changeset
   194
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   195
valueAtLine:lineNr put:newValue
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   196
    "store newValue;
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   197
     For non-named instvars, we add the new value - ignoring the selection"
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   198
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   199
    |idx|
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   200
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   201
    idx := self instVarIndexForLine:selectionIndex.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
   202
    idx notNil ifTrue:[
2271
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   203
        inspectedObject instVarAt:idx put:newValue.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   204
    ] ifFalse:[
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   205
        inspectedObject add:newValue.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   206
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   207
"/        inspectedObject changed.
0cf238543cb1 fixed and improved fieldNameList generation & use.
Claus Gittinger <cg@exept.de>
parents: 2236
diff changeset
   208
        self reinspect.
2193
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
   209
    ].
3d7b1044e8c8 fixed access to namedInstvars
Claus Gittinger <cg@exept.de>
parents: 2192
diff changeset
   210
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   211
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   212
! !
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   213
794
b4b902784e00 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 647
diff changeset
   214
!SetInspectorView class methodsFor:'documentation'!
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   215
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   216
version
15801
693e2bc2b0e1 class: SetInspectorView
Stefan Vogel <sv@exept.de>
parents: 12833
diff changeset
   217
    ^ '$Header$'
18969
a8655dd978bc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 18954
diff changeset
   218
!
a8655dd978bc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 18954
diff changeset
   219
a8655dd978bc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 18954
diff changeset
   220
version_CVS
a8655dd978bc #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 18954
diff changeset
   221
    ^ '$Header$'
370
7476940ca13f New SetInspectorView.
Stefan Vogel <sv@exept.de>
parents:
diff changeset
   222
! !
12833
eaceca8a5fb0 menu fix: showMore/hasMore
Claus Gittinger <cg@exept.de>
parents: 11894
diff changeset
   223