1 " |
|
2 COPYRIGHT (c) 1997 by eXept Software AG |
|
3 All Rights Reserved |
|
4 |
|
5 This software is furnished under a license and may be used |
|
6 only in accordance with the terms of that license and with the |
|
7 inclusion of the above copyright notice. This software may not |
|
8 be provided or otherwise made available to, or used by, any |
|
9 other person. No title to or ownership of the software is |
|
10 hereby transferred. |
|
11 " |
|
12 |
|
13 |
|
14 |
|
15 "{ NameSpace: NewInspector }" |
|
16 |
|
17 VariableVerticalPanel subclass:#InspectorView |
|
18 instanceVariableNames:'inspectorView userSpace workSpace inspectedObject' |
|
19 classVariableNames:'' |
|
20 poolDictionaries:'' |
|
21 category:'Interface-Inspector' |
|
22 ! |
|
23 |
|
24 !InspectorView class methodsFor:'documentation'! |
|
25 |
|
26 copyright |
|
27 " |
|
28 COPYRIGHT (c) 1997 by eXept Software AG |
|
29 All Rights Reserved |
|
30 |
|
31 This software is furnished under a license and may be used |
|
32 only in accordance with the terms of that license and with the |
|
33 inclusion of the above copyright notice. This software may not |
|
34 be provided or otherwise made available to, or used by, any |
|
35 other person. No title to or ownership of the software is |
|
36 hereby transferred. |
|
37 " |
|
38 |
|
39 |
|
40 ! |
|
41 |
|
42 documentation |
|
43 " |
|
44 a new (multipane) inspector; |
|
45 open with: |
|
46 NewInspector::InspectorView inspect:someObject |
|
47 |
|
48 install as standard inspector: |
|
49 Smalltalk at:#Inspector put:(NewInspector::InspectorView) |
|
50 |
|
51 [open with:] |
|
52 NewInspector::InspectorView |
|
53 inspect:(Array with:#hello with:'hello' with:#(1 2 3) asSortedCollection with:Display) |
|
54 |
|
55 [author:] |
|
56 Claus Atzkern |
|
57 " |
|
58 ! |
|
59 |
|
60 examples |
|
61 |
|
62 " |
|
63 open an inspector on an array |
|
64 [exBegin] |
|
65 |array| |
|
66 |
|
67 array := Array new:5. |
|
68 array at:1 put:(Array new:400). |
|
69 NewInspector::InspectorView inspect:array |
|
70 [exEnd] |
|
71 " |
|
72 ! ! |
|
73 |
|
74 !InspectorView class methodsFor:'instance creation'! |
|
75 |
|
76 inspect:anObject |
|
77 "start inspector on an instance |
|
78 " |
|
79 ^ self openOn:anObject |
|
80 ! |
|
81 |
|
82 openOn:anObject |
|
83 "start an inspector on some object |
|
84 " |
|
85 |
|
86 |top isp| |
|
87 |
|
88 top := StandardSystemView new extent:600@400. |
|
89 isp := InspectorView origin:0.0@0.0 corner:1.0@1.0 in:top. |
|
90 isp inspect:anObject. |
|
91 top open. |
|
92 |
|
93 ^ isp. |
|
94 ! ! |
|
95 |
|
96 !InspectorView methodsFor:'accessing'! |
|
97 |
|
98 inspect:anInstance |
|
99 |
|
100 inspectedObject := anInstance. |
|
101 self topView label:(inspectedObject class name asString). |
|
102 inspectorView inspect:anInstance. |
|
103 self updateWorkSpace. |
|
104 |
|
105 ! ! |
|
106 |
|
107 !InspectorView methodsFor:'initialization'! |
|
108 |
|
109 initialize |
|
110 |view wsHeight| |
|
111 |
|
112 super initialize. |
|
113 |
|
114 view := SimpleView origin:0.0 @ 0.0 corner:1.0 @ 0.5 in:self. |
|
115 |
|
116 inspectorView := InspectorPanelView origin:0.0 @ 0.0 corner:1.0 @ 1.0 in:view. |
|
117 workSpace := Workspace origin:0.0 @ 1.0 corner:1.0 @ 1.0 in:view. |
|
118 userSpace := Workspace origin:0.0 @ 0.5 corner:1.0 @ 1.0 in:self. |
|
119 |
|
120 wsHeight := (workSpace preferredExtentForLines:1 cols:10) y. |
|
121 workSpace topInset:wsHeight negated. |
|
122 inspectorView bottomInset:wsHeight. |
|
123 |
|
124 userSpace acceptAction:[:theText|inspectorView accept:theText notifying:workSpace]. |
|
125 workSpace acceptAction:[:theText|inspectorView accept:theText notifying:workSpace]. |
|
126 |
|
127 userSpace doItAction:[:theCode|inspectorView doIt:theCode notifying:workSpace]. |
|
128 workSpace doItAction:[:theCode|inspectorView doIt:theCode notifying:workSpace]. |
|
129 |
|
130 inspectorView action:[:el|self updateWorkSpace]. |
|
131 |
|
132 inspectorView valueChangedAction:[:el||lbl| |
|
133 workSpace list:(Array with:(el displayString)). |
|
134 ]. |
|
135 |
|
136 "Modified: 18.3.1997 / 10:57:34 / cg" |
|
137 ! ! |
|
138 |
|
139 !InspectorView methodsFor:'update'! |
|
140 |
|
141 updateWorkSpace |
|
142 "update the workSpace |
|
143 " |
|
144 workSpace list:(Array with:(inspectorView selectedInstanceVar displayString)). |
|
145 ! ! |
|
146 |
|
147 !InspectorView class methodsFor:'documentation'! |
|
148 |
|
149 version |
|
150 ^ '$Header$' |
|
151 ! ! |
|