NewInspectorView.st
author tz
Fri, 09 Jan 1998 17:48:57 +0100
changeset 401 30ecf82e3ae7
parent 88 d6dccf1ad344
child 809 6f127dd5e578
permissions -rw-r--r--
checkin from browser
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
     1
"{ NameSpace: NewInspector }"
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
     2
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
     3
VariableVerticalPanel subclass:#InspectorView
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
     4
	instanceVariableNames:'inspectorView userSpace workSpace inspectedObject'
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
     5
	classVariableNames:''
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
     6
	poolDictionaries:''
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
     7
	category:'Inspector'
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
     8
!
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
     9
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    10
!InspectorView class methodsFor:'documentation'!
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    11
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    12
examples
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    13
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    14
"
39
03af455029eb *** empty log message ***
ca
parents: 32
diff changeset
    15
    open an inspector on an array
03af455029eb *** empty log message ***
ca
parents: 32
diff changeset
    16
                                                                        [exBegin]
03af455029eb *** empty log message ***
ca
parents: 32
diff changeset
    17
    |array|
03af455029eb *** empty log message ***
ca
parents: 32
diff changeset
    18
03af455029eb *** empty log message ***
ca
parents: 32
diff changeset
    19
    array := Array new:5.
03af455029eb *** empty log message ***
ca
parents: 32
diff changeset
    20
    array at:1 put:(Array new:400).
03af455029eb *** empty log message ***
ca
parents: 32
diff changeset
    21
    NewInspector::InspectorView inspect:array
03af455029eb *** empty log message ***
ca
parents: 32
diff changeset
    22
                                                                        [exEnd]
32
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    23
"
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    24
! !
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    25
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    26
!InspectorView class methodsFor:'instance creation'!
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    27
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    28
inspect:anInstance
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    29
    "start inspector on an instance
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    30
    "
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    31
    |top isp|
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    32
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    33
    top := StandardSystemView new extent:600@400.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    34
    isp := InspectorView origin:0.0@0.0  corner:1.0@1.0 in:top.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    35
    isp inspect:anInstance.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    36
    top open.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    37
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    38
  ^ isp.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    39
! !
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    40
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    41
!InspectorView methodsFor:'accessing'!
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    42
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    43
inspect:anInstance
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    44
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    45
    inspectedObject := anInstance.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    46
    self topView label:(inspectedObject class name asString).
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    47
    inspectorView inspect:anInstance.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    48
    self updateWorkSpace.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    49
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    50
! !
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    51
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    52
!InspectorView methodsFor:'initialization'!
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    53
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    54
initialize
88
d6dccf1ad344 correctly compute height of the middle workspace
Claus Gittinger <cg@exept.de>
parents: 39
diff changeset
    55
    |view wsHeight|
32
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    56
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    57
    super initialize.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    58
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    59
    view := SimpleView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:self.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    60
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    61
    inspectorView := InspectorPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:view.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    62
    workSpace     := Workspace          origin:0.0 @ 1.0 corner:1.0 @ 1.0 in:view.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    63
    userSpace     := Workspace          origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:self.
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    64
88
d6dccf1ad344 correctly compute height of the middle workspace
Claus Gittinger <cg@exept.de>
parents: 39
diff changeset
    65
    wsHeight := (workSpace preferredExtentForLines:1 cols:10) y.
d6dccf1ad344 correctly compute height of the middle workspace
Claus Gittinger <cg@exept.de>
parents: 39
diff changeset
    66
    workSpace     topInset:wsHeight negated.
d6dccf1ad344 correctly compute height of the middle workspace
Claus Gittinger <cg@exept.de>
parents: 39
diff changeset
    67
    inspectorView bottomInset:wsHeight.
32
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    68
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    69
    userSpace acceptAction:[:theText|inspectorView accept:theText notifying:workSpace].
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    70
    workSpace acceptAction:[:theText|inspectorView accept:theText notifying:workSpace].
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    71
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    72
    userSpace   doItAction:[:theCode|inspectorView doIt:theCode notifying:workSpace].
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    73
    workSpace   doItAction:[:theCode|inspectorView doIt:theCode notifying:workSpace].
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    74
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    75
    inspectorView action:[:el|self updateWorkSpace].
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    76
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    77
    inspectorView valueChangedAction:[:el||lbl|
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    78
        workSpace list:(Array with:(el displayString)).
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    79
    ].
88
d6dccf1ad344 correctly compute height of the middle workspace
Claus Gittinger <cg@exept.de>
parents: 39
diff changeset
    80
d6dccf1ad344 correctly compute height of the middle workspace
Claus Gittinger <cg@exept.de>
parents: 39
diff changeset
    81
    "Modified: 18.3.1997 / 10:57:34 / cg"
32
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    82
! !
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    83
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    84
!InspectorView methodsFor:'update'!
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    85
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    86
updateWorkSpace
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    87
    "update the workSpace
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    88
    "
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    89
    workSpace list:(Array with:(inspectorView selectedInstanceVar displayString)).
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    90
! !
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    91
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    92
!InspectorView class methodsFor:'documentation'!
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    93
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    94
version
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    95
    ^ '$Header$'
9dfc1899e849 intitial checkin
ca
parents:
diff changeset
    96
! !