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