NewInspectorPanelView.st
author ca
Mon, 16 Jun 1997 19:00:00 +0200
changeset 154 34d5602e13d7
parent 39 03af455029eb
child 327 0040d47658c6
permissions -rw-r--r--
application remove halt
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
     1
"{ NameSpace: NewInspector }"
6f1565819b63 intitial checkin
ca
parents:
diff changeset
     2
6f1565819b63 intitial checkin
ca
parents:
diff changeset
     3
SimpleView subclass:#InspectorPanelView
6f1565819b63 intitial checkin
ca
parents:
diff changeset
     4
	instanceVariableNames:'frames labelViews listViews scrollBar maxDepth leftHistory
6f1565819b63 intitial checkin
ca
parents:
diff changeset
     5
		rightHistory hzpView actionBlock valueChangedAction'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
     6
	classVariableNames:''
6f1565819b63 intitial checkin
ca
parents:
diff changeset
     7
	poolDictionaries:''
6f1565819b63 intitial checkin
ca
parents:
diff changeset
     8
	category:'Inspector'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
     9
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    10
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    11
!InspectorPanelView class methodsFor:'documentation'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    12
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    13
examples
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    14
"
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    15
    example 1
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    16
    =========
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    17
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
    18
                                                                        [exBegin]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    19
    |top slv|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    20
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    21
    top := StandardSystemView new extent:600@400.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    22
    slv := NewInspector::InspectorPanelView origin:0.0@0.0 corner:1.0@1.0 in:top.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    23
    slv inspect:top.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    24
    slv action:[:el|Transcript showCR:el].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    25
    top open.
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
    26
                                                                        [exEnd]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    27
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    28
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    29
    example 2
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    30
    =========
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
    31
                                                                        [exBegin]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    32
    |top slv edt a vvp|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    33
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    34
    a := Array new:5.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    35
    a at:4 put:(Array new:6).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    36
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    37
    top := StandardSystemView new extent:600@400.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    38
    vvp := VariableVerticalPanel origin:0.0@0.0  corner:1.0@1.0 in:top.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    39
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    40
    slv := NewInspector::InspectorPanelView origin:0.0@0.0 corner:1.0@0.5 in:vvp.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    41
    edt := Workspace origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:vvp.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    42
    edt acceptAction:[:theText|slv accept:theText notifying:edt].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    43
    edt   doItAction:[:theCode|slv doIt:theCode   notifying:edt].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    44
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    45
    slv action:[:el| Transcript showCR:(el printString)].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    46
    slv inspect:a.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    47
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    48
    top open.
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
    49
                                                                        [exEnd]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    50
"
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    51
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    52
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    53
!InspectorPanelView class methodsFor:'constants'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    54
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    55
minDepth
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
    56
    "returns the minimum of views assigned to a panel
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    57
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    58
    ^ 4
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    59
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    60
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    61
!InspectorPanelView methodsFor:'accessing'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    62
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    63
depth
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    64
    "returns number of listViews
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    65
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    66
  ^ listViews size
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    67
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    68
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    69
depth:aDepth
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    70
    "change the number of existing listViews
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    71
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    72
    |sz min|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    73
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    74
    min := self class minDepth.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    75
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    76
    aDepth > min ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    77
        sz := aDepth min:maxDepth.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    78
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    79
        sz < listViews size ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    80
            sz := listViews size
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    81
        ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    82
    ] ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    83
        sz := min
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    84
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    85
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    86
    listViews size == sz ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    87
        sz == aDepth ifFalse:[self moveContentsLeft:1].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    88
    ] ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    89
        [self createViewWithoutRedraw. listViews size ~~ sz] whileTrue.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    90
        self computeExtentOfFrames.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    91
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    92
        (self topView shown) ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    93
            hzpView sizeChanged:nil.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    94
            hzpView realizeAllSubViews.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    95
        ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    96
    ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    97
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    98
6f1565819b63 intitial checkin
ca
parents:
diff changeset
    99
maxDepth
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   100
    ^ maxDepth
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   101
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   102
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   103
maxDepth:aNumber
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   104
    "change max depth for instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   105
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   106
    aNumber > listViews size ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   107
        aNumber >= (self class minDepth) ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   108
            maxDepth := aNumber.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   109
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   110
            maxDepth < listViews size ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   111
                self depth:maxDepth
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   112
            ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   113
        ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   114
    ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   115
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   116
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   117
!InspectorPanelView methodsFor:'accessing actions'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   118
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   119
action:aOneArgBlock
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   120
    "set the single click action block.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   121
     If non-nil, that one is evaluated on single click, passing the
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   122
     selected instance as argument
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   123
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   124
    actionBlock := aOneArgBlock
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   125
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   126
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   127
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   128
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   129
valueChangedAction:aOneArgBlock
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   130
    "evaluated if an instnace changed its value; passing
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   131
     the instance as argument
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   132
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   133
    valueChangedAction := aOneArgBlock
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   134
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   135
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   136
!InspectorPanelView methodsFor:'accessing selections'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   137
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   138
inspectedObject
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   139
    "returns the current inspected object
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   140
    "
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   141
    ^ self findLastValidListWithSelection inspectedObject
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   142
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   143
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   144
selectedInstanceVar
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   145
    "returns the current selected instance var
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   146
    "
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   147
    ^ self findLastValidListWithSelection selectedInstanceVar
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   148
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   149
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   150
!InspectorPanelView methodsFor:'actions'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   151
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   152
accept:aText notifying:aView
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   153
    "evaluating aText on the last selected instance var. on success the views
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   154
     are updated.
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   155
    "
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   156
    self doItOrAccept:[:aList|aList accept:aText notifying:aView]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   157
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   158
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   159
doIt:aCode notifying:aView
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   160
    "evaluating aCode on the selected instance var; on success the views
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   161
     are updated.
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   162
    "
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   163
    ^ self doItOrAccept:[:aList|aList doIt:aCode notifying:aView]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   164
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   165
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   166
inspect:anObject
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   167
    "change the inspected object and all views
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   168
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   169
    |view|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   170
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   171
    view := listViews first.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   172
    leftHistory  removeAll.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   173
    rightHistory removeAll.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   174
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   175
    view inspect:anObject.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   176
    listViews from:2 do:[:v|v inspect:nil].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   177
    self update.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   178
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   179
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   180
!InspectorPanelView methodsFor:'event handling'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   181
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   182
handlesKeyPress:key inView:someView
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   183
    "all keys are handled by this instance itself
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   184
    "
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   185
    ^ true
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   186
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   187
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   188
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   189
keyPress:key x:x y:y view:someView
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   190
    "handle some special keys
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   191
    "
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   192
    key == #CursorLeft  ifTrue:[^ self moveContentsRight:1].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   193
    key == #CursorRight ifTrue:[^ self moveContentsLeft:1 ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   194
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   195
    someView keyPress:key x:x y:y.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   196
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   197
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   198
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   199
singleClickAt:anIndex
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   200
    "the view at an index changed its selection caused by a single click
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   201
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   202
    |view start sivar|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   203
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   204
    rightHistory removeAll.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   205
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   206
    view  := listViews at:anIndex.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   207
    start := anIndex + 1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   208
    sivar := view selectedInstanceVar.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   209
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   210
    start > listViews size ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   211
        start >= maxDepth ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   212
            self moveContentsLeft:1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   213
          ^ actionBlock value:sivar.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   214
        ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   215
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   216
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   217
    (view selectedInstanceType) == #directory ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   218
        (listViews at:start) setSelection:nil.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   219
        (listViews at:start) inspect:sivar.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   220
        
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   221
        start := start + 1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   222
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   223
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   224
    listViews from:start do:[:v|v inspect:nil].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   225
    self update.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   226
    actionBlock value:sivar.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   227
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   228
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   229
!InspectorPanelView methodsFor:'initializing'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   230
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   231
initialize
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   232
    "initialize instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   233
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   234
    super initialize.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   235
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   236
    frames       := OrderedCollection new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   237
    listViews    := OrderedCollection new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   238
    labelViews   := OrderedCollection new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   239
    leftHistory  := OrderedCollection new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   240
    rightHistory := OrderedCollection new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   241
    maxDepth     := self class minDepth.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   242
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   243
    actionBlock := [:el| ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   244
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   245
    hzpView    := VariableHorizontalPanel origin:0.0@0.0 corner:1.0@1.0 in:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   246
    scrollBar  := HorizontalScrollBar origin:0.0@1.0 corner:1.0@1.0 in:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   247
    scrollBar asynchronousOperation.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   248
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   249
    hzpView bottomInset:(scrollBar preferredExtent y).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   250
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   251
    scrollBar topInset:(scrollBar preferredExtent y) negated.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   252
    scrollBar thumbHeight:100.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   253
    scrollBar scrollAction:[:percent | self scrollTo:percent].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   254
    scrollBar scrollRightAction:[self moveContentsLeft:1].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   255
    scrollBar scrollLeftAction:[self moveContentsRight:1].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   256
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   257
    self depth:maxDepth.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   258
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   259
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   260
!InspectorPanelView methodsFor:'menu - labels & actions'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   261
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   262
browse:anIndex
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   263
    self classAtLabel:anIndex do:[:cls| cls browserClass openInClass:cls selector:nil ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   264
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   265
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   266
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   267
browseClassHierarchy:anIndex
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   268
    self classAtLabel:anIndex do:[:cls| cls browserClass browseClassHierarchy:cls ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   269
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   270
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   271
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   272
browseFullClassProtocol:anIndex
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   273
    self classAtLabel:anIndex do:[:cls| cls browserClass browseFullClassProtocol:cls ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   274
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   275
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   276
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   277
classAtLabel:anIndex do:anAction
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   278
    "evaluate action on class assigned to label
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   279
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   280
    |cls|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   281
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   282
    anIndex <= labelViews size ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   283
        (cls := Smalltalk classNamed:((labelViews at:anIndex) label)) notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   284
            anAction value:cls
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   285
        ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   286
    ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   287
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   288
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   289
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   290
labelMenu
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   291
    "popup menu required by any label. Delegate the request to the corresponding label
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   292
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   293
    |sqNr view|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   294
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   295
    view := (WindowGroup lastEventQuerySignal raise) view.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   296
    sqNr := labelViews findFirst:[:v| v == view].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   297
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   298
    sqNr ~~ 0 ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   299
        view := labelViews at:sqNr.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   300
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   301
        view label notEmpty ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   302
            ^ self labelMenu:sqNr
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   303
        ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   304
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   305
    ^ nil
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   306
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   307
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   308
labelMenu:anIndex
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   309
    "popup menu required for a label identified by its sequence number
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   310
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   311
    |menu|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   312
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   313
    menu := PopUpMenu labels:#(
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   314
                              'browse'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   315
                              'browse class hierarchy'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   316
                              'browse full class protocol'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   317
                              )
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   318
                   selectors:#( 
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   319
                              browse:
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   320
                              browseClassHierarchy:
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   321
                              browseFullClassProtocol:
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   322
                              )
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   323
                    receiver:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   324
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   325
   menu args:(Array new:(menu labels size) withAll:anIndex).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   326
 ^ menu
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   327
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   328
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   329
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   330
!InspectorPanelView methodsFor:'menu - views & actions'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   331
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   332
doTrace:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   333
    "place a trace on messages sent to the instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   334
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   335
    |selectors|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   336
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   337
    selectors := self messageMenu:anInstance.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   338
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   339
    selectors notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   340
        self topView withWaitCursorDo:[MessageTracer trace:anInstance selectors:selectors]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   341
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   342
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   343
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   344
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   345
doTraceAll:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   346
    "place a trace on all messages sent to the instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   347
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   348
    self topView withWaitCursorDo:[MessageTracer traceAll:anInstance]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   349
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   350
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   351
doTrap:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   352
    "place a trap on a message sent to the instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   353
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   354
    |selectors|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   355
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   356
    selectors := self messageMenu:anInstance.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   357
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   358
    selectors notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   359
        self topView withWaitCursorDo:[MessageTracer trap:anInstance selectors:selectors]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   360
    ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   361
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   362
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   363
doTrapAll:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   364
    "place a trap on all messages sent to the instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   365
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   366
    self topView withWaitCursorDo:[MessageTracer trapAll:anInstance]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   367
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   368
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   369
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   370
doUntrace:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   371
    "remove all traps and traces to the instance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   372
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   373
    self topView withWaitCursorDo:[MessageTracer untrace:anInstance].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   374
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   375
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   376
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   377
messageMenu:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   378
    "open menu to select messages; on accepted a list of messages is returned
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   379
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   380
    |sll acl lst inset top hzp slv acv dblClcAct btp b1 b2 accepted viewSpacing|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   381
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   382
    top := StandardSystemView new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   383
    top extent:500 @ 400.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   384
    top label:(anInstance printString).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   385
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   386
    (Label origin:(0.0 @  0.0) corner:(0.5 @ 20) in:top) label:'messages'.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   387
    (Label origin:(0.5 @  0.0) corner:(1.0 @ 20) in:top) label:'selected'.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   388
    hzp := VariableHorizontalPanel origin:(0.0 @ 20) corner:(1.0 @ 1.0) in:top.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   389
    btp := HorizontalPanelView origin:(0.0 @1.0) corner:(1.0 @ 1.0) in:top.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   390
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   391
    b1 := Button abortButtonIn:btp.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   392
    b2 := Button okButtonIn:btp.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   393
    accepted := false.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   394
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   395
    b1 action:[accepted := false. top destroy].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   396
    b2 action:[accepted := true.  top destroy].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   397
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   398
    btp horizontalLayout:#fitSpace.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   399
    viewSpacing := top class viewSpacing.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   400
    inset       := (b2 preferredExtent y) + viewSpacing.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   401
    viewSpacing := viewSpacing // 2.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   402
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   403
    hzp bottomInset:inset.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   404
    btp topInset:((inset - viewSpacing) negated).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   405
    btp bottomInset:viewSpacing.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   406
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   407
    slv := ScrollableView for:SelectionInListView
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   408
                miniScrollerV:true
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   409
                       origin:(0.0 @ 0.0)
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   410
                       corner:(0.5 @ 1.0)
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   411
                           in:hzp.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   412
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   413
    acv := ScrollableView for:SelectionInListView
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   414
                miniScrollerV:true
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   415
                       origin:(0.5 @ 0.0)
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   416
                       corner:(1.0 @ 1.0)
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   417
                           in:hzp.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   418
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   419
    slv := slv scrolledView.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   420
    acv := acv scrolledView.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   421
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   422
    sll := (MessageTracer realClassOf:anInstance) selectors.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   423
    acl := OrderedCollection new.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   424
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   425
    (MessageTracer wrappedSelectorsOf:anInstance) do:[:el|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   426
        el notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   427
            acl add:el.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   428
            sll remove:el ifAbsent:nil
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   429
        ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   430
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   431
        
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   432
    slv list:(sll copy).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   433
    acv list:(acl copy).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   434
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   435
    dblClcAct := [:from :to|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   436
        to add:(from selectionValue).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   437
        from removeIndex:(from selection).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   438
        from redraw.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   439
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   440
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   441
    slv doubleClickAction:[:index| dblClcAct value:slv value:acv].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   442
    acv doubleClickAction:[:index| dblClcAct value:acv value:slv].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   443
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   444
    top openModal.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   445
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   446
    accepted ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   447
        ^ nil
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   448
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   449
    lst := acv list.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   450
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   451
"undo existing traps            HACK: removes traps and traces"
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   452
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   453
    acl notEmpty ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   454
        MessageTracer untrace:anInstance
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   455
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   456
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   457
    lst notEmpty ifTrue:[^ lst]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   458
                ifFalse:[^ nil]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   459
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   460
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   461
viewMenu
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   462
    "popup menu required by any view. Delegate the request to the corresponding view
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   463
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   464
    |sqNr view|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   465
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   466
    view := (WindowGroup lastEventQuerySignal raise) view.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   467
    sqNr := listViews findFirst:[:v| v == view].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   468
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   469
    sqNr notNil ifTrue:[^ self viewMenu:sqNr]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   470
               ifFalse:[^ nil]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   471
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   472
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   473
viewMenu:anIndex
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   474
    "popup menu required for a view identified by its sequence number
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   475
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   476
    |view menu inst args lbls txt|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   477
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   478
    view := listViews at:anIndex.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   479
    view hasSelection ifFalse:[^ nil].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   480
    inst := view selectedInstanceVar.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   481
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   482
    menu := PopUpMenu labels:#( 'update' )
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   483
                   selectors:#( #update  )
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   484
                    receiver:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   485
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   486
    menu actionAt:#update put:[
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   487
        view update.
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   488
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   489
        listViews from:(anIndex + 1) do:[:v|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   490
            (view selectedInstanceType) ~~ #directory ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   491
                v inspect:nil
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   492
            ] ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   493
                v inspect:(view selectedInstanceVar).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   494
                view := v.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   495
            ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   496
        ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   497
        self update
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   498
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   499
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   500
    (InspectorList isTraceable:inst) ifFalse:[
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   501
        ^ menu
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   502
    ].
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   503
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   504
    menu  addLabels:#(
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   505
                      '-'
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   506
                      'trace'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   507
                      'trap'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   508
                      'untrace / untrap'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   509
                     )
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   510
          selectors:#(
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   511
                      nil
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   512
                      trace
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   513
                      trap
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   514
                      untrace
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   515
                     ).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   516
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   517
    menu actionAt:#untrace put:[self doUntrace:inst].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   518
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   519
    args := Array new:2 withAll:inst.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   520
    lbls := Array with:'message'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   521
                  with:((Text string:' all ' emphasis:#underline), ' messages').
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   522
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   523
    menu subMenuAt:#trace put:(
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   524
        PopUpMenu labels:lbls selectors:#(doTrace: doTraceAll:) args:args
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   525
    ).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   526
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   527
    menu subMenuAt:#trap put:(
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   528
        PopUpMenu labels:lbls selectors:#(doTrap: doTrapAll:) args:args
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   529
    ).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   530
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   531
  ^ menu
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   532
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   533
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   534
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   535
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   536
!InspectorPanelView methodsFor:'private'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   537
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   538
doItOrAccept:aBlock
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   539
    "handle a doIt or accept action; on success all the folloed views are
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   540
     updated
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   541
    "
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   542
    |index list result instVar|
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   543
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   544
    list    := self findLastValidListWithSelection.
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   545
    result  := aBlock value:list.
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   546
    instVar := list selectedInstanceVar.
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   547
    index   := listViews findLast:[:v|v == list].
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   548
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   549
    (index ~~ 0 and:[index ~~ listViews size]) ifTrue:[
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   550
        index := index + 1.
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   551
        (list selectedInstanceType) == #directory ifTrue:[
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   552
            (listViews at:index) inspect:instVar
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   553
        ] ifFalse:[
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   554
            (listViews at:index) inspect:nil
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   555
        ].
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   556
        self update
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   557
    ].
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   558
    valueChangedAction notNil ifTrue:[
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   559
        valueChangedAction value:instVar
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   560
    ].
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   561
    ^ result
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   562
!
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   563
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   564
findLastValidListWithSelection
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   565
    "returns last valid list with a selection; if no selection exists in any
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   566
     view, the list assigned to the inspected object is returned
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   567
    "
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   568
    |index|
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   569
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   570
    rightHistory notEmpty ifTrue:[
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   571
        ^ rightHistory first
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   572
    ].
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   573
    index := listViews findLast:[:v| v hasSelection ].
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   574
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   575
    index ~~ 0 ifTrue:[
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   576
        ^ listViews at:index
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   577
    ].
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   578
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   579
    leftHistory notEmpty ifTrue:[^ leftHistory last]
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   580
                        ifFalse:[^ listViews at:1]
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   581
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   582
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   583
update
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   584
    "update labels and scrollbar
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   585
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   586
    |pview cview stop index ispObj label|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   587
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   588
"UPDATE LABELS
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   589
"
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   590
    index := 1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   591
    stop  := listViews size.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   592
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   593
    [   cview  := listViews at:index.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   594
        ispObj := cview inspectedObject.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   595
        label  := labelViews at:index.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   596
        index  := index + 1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   597
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   598
        ispObj notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   599
            label label:(ispObj class name asString).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   600
            pview := cview.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   601
        ] ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   602
            [index <= stop] whileTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   603
                (labelViews at:index) label:''.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   604
                index := index + 1
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   605
            ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   606
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   607
            (pview isNil or:[pview selectedInstanceType == #normal]) ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   608
                pview notNil ifTrue:[ispObj := pview selectedInstanceVar].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   609
                label label:ispObj class name asString
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   610
            ] ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   611
                label label:''
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   612
            ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   613
        ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   614
        index > stop
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   615
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   616
    ] whileFalse.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   617
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   618
"UPDATE SCROLLBARS
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   619
"
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   620
    index := listViews size + leftHistory size + rightHistory size.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   621
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   622
    (listViews last) selectedInstanceType notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   623
        index := index + 1
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   624
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   625
    scrollBar thumbHeight:(stop / index) * 100.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   626
    scrollBar thumbOrigin:(100  / index * leftHistory size).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   627
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   628
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   629
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   630
!InspectorPanelView methodsFor:'private frames'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   631
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   632
computeExtentOfFrames
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   633
    "compute the extent of all frames (origin/corner)
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   634
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   635
    |orig corn offset newX|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   636
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   637
    orig := ( 0.0 @ 0.0 ).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   638
    corn := ( 0.0 @ 1.0 ).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   639
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   640
    offset := 1.0 / (frames size).
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   641
    newX   := 0.0.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   642
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   643
    frames do:[:frame|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   644
        (newX := newX + offset) > 1.0 ifTrue:[ newX := 1.0 ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   645
        corn  := newX @ corn y.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   646
        frame origin:orig corner:corn.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   647
        orig  := newX @ orig y.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   648
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   649
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   650
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   651
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   652
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   653
createViewWithoutRedraw
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   654
    "add a new view at end of the panel
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   655
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   656
    |view frame label index|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   657
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   658
    frame := SimpleView in:hzpView.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   659
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   660
    label := Label origin:0.0@0.0 corner:1.0@20 in:frame.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   661
    label  leftInset:15.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   662
    label rightInset:2.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   663
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   664
    view  := ScrollableView for:InspectorListView miniScroller:true origin:0.0@20 
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   665
                         corner:1.0@1.0 in:frame.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   666
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   667
    view := view scrolledView.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   668
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   669
    frames add:frame.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   670
    labelViews add:label.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   671
    listViews  add:view.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   672
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   673
    index := listViews size.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   674
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   675
    index == 1 ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   676
        view includesSelf:true
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   677
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   678
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   679
    label adjust:#left.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   680
    label label:''.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   681
    label level:1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   682
    label menuHolder:self; menuMessage:#labelMenu; menuPerformer:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   683
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   684
    view action:[:el|self singleClickAt:index].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   685
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   686
    view delegate:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   687
    view menuHolder:self; menuMessage:#viewMenu; menuPerformer:self.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   688
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   689
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   690
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   691
!InspectorPanelView methodsFor:'scrolling-basic'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   692
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   693
moveContentsLeft:nTimes
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   694
    "move the contents of all views one position left
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   695
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   696
    |fView stop assoc inspObj pView index|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   697
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   698
    (nTimes < 1 or:[listViews last isEmpty]) ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   699
        ^ self
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   700
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   701
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   702
    index := nTimes.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   703
    stop  := (listViews size) - 1.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   704
    fView := listViews first.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   705
    pView := listViews at:stop.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   706
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   707
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   708
    [   leftHistory add:(fView list).
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   709
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   710
        1 to:stop do:[:i|
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   711
            (listViews at:i) list:(listViews at:(i+1))
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   712
        ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   713
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   714
        rightHistory notEmpty ifTrue:[
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   715
            (listViews last) list:(rightHistory removeLast)
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   716
        ] ifFalse:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   717
            (listViews last) inspect:(pView selectedInstanceVar)
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   718
        ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   719
        ((index := index - 1) == 0 or:[listViews last isEmpty])
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   720
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   721
    ] whileFalse.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   722
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   723
    self update.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   724
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   725
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   726
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   727
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   728
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   729
moveContentsRight:nTimes
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   730
    "move the contents of all views one position right
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   731
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   732
    |view assoc size index lView fView|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   733
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   734
    size := leftHistory size.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   735
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   736
    (nTimes > 0 and:[size ~~ 0]) ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   737
        nTimes > size ifFalse:[index := nTimes]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   738
                       ifTrue:[index := size].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   739
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   740
        size  := listViews size.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   741
        lView := listViews last.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   742
        fView := listViews first.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   743
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   744
        1 to:index do:[:i|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   745
            lView hasSelection ifTrue:[
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   746
                rightHistory add:(lView list)
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   747
            ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   748
            size to:2 by:-1 do:[:i|
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   749
                (listViews at:i) list:(listViews at:(i-1))
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   750
            ].
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   751
            fView list:(leftHistory removeLast)
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   752
        ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   753
        self update
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   754
    ]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   755
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   756
!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   757
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   758
scrollTo:nPercent
39
03af455029eb *** empty log message ***
ca
parents: 35
diff changeset
   759
    "set views and contents dependant on scroll bar
35
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   760
    "
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   761
    |dY no noScr pR|
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   762
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   763
    noScr := listViews size + leftHistory size + rightHistory size.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   764
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   765
    (listViews last) selectedInstanceType notNil ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   766
        noScr := noScr + 1
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   767
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   768
    dY := 100 / noScr.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   769
    pR := nPercent roundTo:dY.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   770
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   771
    no := ((dY * leftHistory size) - pR) / dY.
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   772
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   773
    no == 0 ifTrue:[
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   774
        (nPercent - pR) > 0 ifTrue:[no := -1]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   775
                           ifFalse:[no :=  1]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   776
    ].
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   777
    no < 0 ifTrue:[self moveContentsLeft:(no negated)]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   778
          ifFalse:[self moveContentsRight:no]
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   779
! !
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   780
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   781
!InspectorPanelView class methodsFor:'documentation'!
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   782
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   783
version
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   784
    ^ '$Header$'
6f1565819b63 intitial checkin
ca
parents:
diff changeset
   785
! !