32
|
1 |
"{ NameSpace: NewInspector }"
|
|
2 |
|
|
3 |
VariableVerticalPanel subclass:#InspectorView
|
|
4 |
instanceVariableNames:'inspectorView userSpace workSpace inspectedObject'
|
|
5 |
classVariableNames:''
|
|
6 |
poolDictionaries:''
|
|
7 |
category:'Inspector'
|
|
8 |
!
|
|
9 |
|
|
10 |
!InspectorView class methodsFor:'documentation'!
|
|
11 |
|
|
12 |
examples
|
|
13 |
|
|
14 |
"
|
39
|
15 |
open an inspector on an array
|
|
16 |
[exBegin]
|
|
17 |
|array|
|
|
18 |
|
|
19 |
array := Array new:5.
|
|
20 |
array at:1 put:(Array new:400).
|
|
21 |
NewInspector::InspectorView inspect:array
|
|
22 |
[exEnd]
|
32
|
23 |
"
|
|
24 |
! !
|
|
25 |
|
|
26 |
!InspectorView class methodsFor:'instance creation'!
|
|
27 |
|
|
28 |
inspect:anInstance
|
|
29 |
"start inspector on an instance
|
|
30 |
"
|
|
31 |
|top isp|
|
|
32 |
|
|
33 |
top := StandardSystemView new extent:600@400.
|
|
34 |
isp := InspectorView origin:0.0@0.0 corner:1.0@1.0 in:top.
|
|
35 |
isp inspect:anInstance.
|
|
36 |
top open.
|
|
37 |
|
|
38 |
^ isp.
|
|
39 |
! !
|
|
40 |
|
|
41 |
!InspectorView methodsFor:'accessing'!
|
|
42 |
|
|
43 |
inspect:anInstance
|
|
44 |
|
|
45 |
inspectedObject := anInstance.
|
|
46 |
self topView label:(inspectedObject class name asString).
|
|
47 |
inspectorView inspect:anInstance.
|
|
48 |
self updateWorkSpace.
|
|
49 |
|
|
50 |
! !
|
|
51 |
|
|
52 |
!InspectorView methodsFor:'initialization'!
|
|
53 |
|
|
54 |
initialize
|
|
55 |
|view|
|
|
56 |
|
|
57 |
super initialize.
|
|
58 |
|
|
59 |
view := SimpleView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:self.
|
|
60 |
|
|
61 |
inspectorView := InspectorPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:view.
|
|
62 |
workSpace := Workspace origin:0.0 @ 1.0 corner:1.0 @ 1.0 in:view.
|
|
63 |
userSpace := Workspace origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:self.
|
|
64 |
|
|
65 |
workSpace topInset:-18.
|
|
66 |
inspectorView bottomInset:18.
|
|
67 |
|
|
68 |
userSpace acceptAction:[:theText|inspectorView accept:theText notifying:workSpace].
|
|
69 |
workSpace acceptAction:[:theText|inspectorView accept:theText notifying:workSpace].
|
|
70 |
|
|
71 |
userSpace doItAction:[:theCode|inspectorView doIt:theCode notifying:workSpace].
|
|
72 |
workSpace doItAction:[:theCode|inspectorView doIt:theCode notifying:workSpace].
|
|
73 |
|
|
74 |
inspectorView action:[:el|self updateWorkSpace].
|
|
75 |
|
|
76 |
inspectorView valueChangedAction:[:el||lbl|
|
|
77 |
workSpace list:(Array with:(el displayString)).
|
|
78 |
].
|
|
79 |
! !
|
|
80 |
|
|
81 |
!InspectorView methodsFor:'update'!
|
|
82 |
|
|
83 |
updateWorkSpace
|
|
84 |
"update the workSpace
|
|
85 |
"
|
|
86 |
workSpace list:(Array with:(inspectorView selectedInstanceVar displayString)).
|
|
87 |
! !
|
|
88 |
|
|
89 |
!InspectorView class methodsFor:'documentation'!
|
|
90 |
|
|
91 |
version
|
|
92 |
^ '$Header$'
|
|
93 |
! !
|