NewInspectorView.st
author ca
Fri, 15 Aug 1997 17:36:02 +0200
changeset 281 aabb4037f6a3
parent 88 d6dccf1ad344
child 809 6f127dd5e578
permissions -rw-r--r--
window spec

"{ NameSpace: NewInspector }"

VariableVerticalPanel subclass:#InspectorView
	instanceVariableNames:'inspectorView userSpace workSpace inspectedObject'
	classVariableNames:''
	poolDictionaries:''
	category:'Inspector'
!

!InspectorView class methodsFor:'documentation'!

examples

"
    open an inspector on an array
                                                                        [exBegin]
    |array|

    array := Array new:5.
    array at:1 put:(Array new:400).
    NewInspector::InspectorView inspect:array
                                                                        [exEnd]
"
! !

!InspectorView class methodsFor:'instance creation'!

inspect:anInstance
    "start inspector on an instance
    "
    |top isp|

    top := StandardSystemView new extent:600@400.
    isp := InspectorView origin:0.0@0.0  corner:1.0@1.0 in:top.
    isp inspect:anInstance.
    top open.

  ^ isp.
! !

!InspectorView methodsFor:'accessing'!

inspect:anInstance

    inspectedObject := anInstance.
    self topView label:(inspectedObject class name asString).
    inspectorView inspect:anInstance.
    self updateWorkSpace.

! !

!InspectorView methodsFor:'initialization'!

initialize
    |view wsHeight|

    super initialize.

    view := SimpleView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:self.

    inspectorView := InspectorPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:view.
    workSpace     := Workspace          origin:0.0 @ 1.0 corner:1.0 @ 1.0 in:view.
    userSpace     := Workspace          origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:self.

    wsHeight := (workSpace preferredExtentForLines:1 cols:10) y.
    workSpace     topInset:wsHeight negated.
    inspectorView bottomInset:wsHeight.

    userSpace acceptAction:[:theText|inspectorView accept:theText notifying:workSpace].
    workSpace acceptAction:[:theText|inspectorView accept:theText notifying:workSpace].

    userSpace   doItAction:[:theCode|inspectorView doIt:theCode notifying:workSpace].
    workSpace   doItAction:[:theCode|inspectorView doIt:theCode notifying:workSpace].

    inspectorView action:[:el|self updateWorkSpace].

    inspectorView valueChangedAction:[:el||lbl|
        workSpace list:(Array with:(el displayString)).
    ].

    "Modified: 18.3.1997 / 10:57:34 / cg"
! !

!InspectorView methodsFor:'update'!

updateWorkSpace
    "update the workSpace
    "
    workSpace list:(Array with:(inspectorView selectedInstanceVar displayString)).
! !

!InspectorView class methodsFor:'documentation'!

version
    ^ '$Header$'
! !