51 |
51 |
52 |items m idx| |
52 |items m idx| |
53 |
53 |
54 inspectedObject isNameSpace ifTrue:[ |
54 inspectedObject isNameSpace ifTrue:[ |
55 items := #( |
55 items := #( |
56 ('copy key' doCopyKey ) |
56 ('Copy Key' doCopyKey ) |
57 ('-') |
57 ('-') |
58 ('inspect' doInspect ) |
58 ('Inspect' doInspect ) |
59 ('inspect key' doInspectKey ) |
59 ('Inspect Key' doInspectKey ) |
60 ('basicInspect' doBasicInspect ) |
60 ('BasicInspect' doBasicInspect ) |
61 ('inspect hierarchical' doNewInspect ) |
61 ('Inspect Hierarchical' doNewInspect ) |
62 ('-') |
62 ('-') |
63 ('ref chains' showReferences ) |
63 ('Ref chains' showReferences ) |
64 ('references to key' showKeyReferences ) |
64 ('References to Key' showKeyReferences ) |
65 ('-') |
65 ('-') |
66 ('add key' doAddKey ) |
66 ('Browse' browse ) |
67 ('remove key' doRemoveKey ) |
67 ('-') |
|
68 ('Add Key' doAddKey ) |
|
69 ('Remove Key' doRemoveKey ) |
68 ('-') |
70 ('-') |
69 ). |
71 ). |
70 |
72 |
71 hideClassVars == true ifTrue:[ |
73 hideClassVars == true ifTrue:[ |
72 items := items , #( |
74 items := items , #( |
73 ('show classVars' doShowClassVars ) |
75 ('Show classVars' doShowClassVars ) |
74 ). |
76 ). |
75 ] ifFalse:[ |
77 ] ifFalse:[ |
76 items := items , #( |
78 items := items , #( |
77 ('hide classVars' doHideClassVars ) |
79 ('Hide classVars' doHideClassVars ) |
78 ). |
80 ). |
79 ]. |
81 ]. |
80 hideClasses == true ifTrue:[ |
82 hideClasses == true ifTrue:[ |
81 items := items , #( |
83 items := items , #( |
82 ('show classes' doShowClasses ) |
84 ('Show classes' doShowClasses ) |
83 ). |
85 ). |
84 ] ifFalse:[ |
86 ] ifFalse:[ |
85 items := items , #( |
87 items := items , #( |
86 ('hide classes' doHideClasses ) |
88 ('Hide classes' doHideClasses ) |
87 ). |
89 ). |
88 ]. |
90 ]. |
89 hideAliases == true ifTrue:[ |
91 hideAliases == true ifTrue:[ |
90 items := items , #( |
92 items := items , #( |
91 ('show aliases' doShowAliases ) |
93 ('Show aliases' doShowAliases ) |
92 ). |
94 ). |
93 ] ifFalse:[ |
95 ] ifFalse:[ |
94 items := items , #( |
96 items := items , #( |
95 ('hide aliases' doHideAliases ) |
97 ('Hide aliases' doHideAliases ) |
96 ). |
98 ). |
97 ] |
99 ] |
98 ] ifFalse:[ |
100 ] ifFalse:[ |
99 items := #( |
101 items := #( |
100 ('copy key' doCopyKey ) |
102 ('Copy Key' doCopyKey ) |
101 ('-') |
103 ('-') |
102 ('inspect' doInspect ) |
104 ('Inspect' doInspect ) |
103 ('inspect key' doInspectKey ) |
105 ('Inspect Key' doInspectKey ) |
104 ('basicInspect' doBasicInspect ) |
106 ('BasicInspect' doBasicInspect ) |
105 ('inspect hierarchical' doNewInspect ) |
107 ('Inspect Hierarchical' doNewInspect ) |
106 ('-') |
108 ('-') |
107 ('ref chains' showReferences ) |
109 ('Ref chains' showReferences ) |
108 ('-') |
110 ('-') |
109 ('add key' doAddKey ) |
111 ('Browse' browse ) |
110 ('remove key' doRemoveKey ) |
112 ('Browse class hierarchy' browseClassHierarchy ) |
|
113 ('Browse full class protocol' browseFullClassProtocol) |
|
114 ('-') |
|
115 ('Add Key' doAddKey ) |
|
116 ('Remove Key' doRemoveKey ) |
111 ). |
117 ). |
112 ]. |
118 ]. |
113 |
119 |
114 monitorProcess isNil ifTrue:[ |
120 monitorProcess isNil ifTrue:[ |
115 items := items , #( |
121 items := items , #( |
116 ('-') |
122 ('-') |
117 ('start monitor' doStartMonitor ) |
123 ('Start Monitor' doStartMonitor ) |
118 ). |
124 ). |
119 ] ifFalse:[ |
125 ] ifFalse:[ |
120 items := items , #( |
126 items := items , #( |
121 ('-') |
127 ('-') |
122 ('stop monitor' doStopMonitor ) |
128 ('Stop Monitor' doStopMonitor ) |
123 ). |
129 ). |
124 ]. |
130 ]. |
|
131 |
|
132 items := items , #( |
|
133 ('-') |
|
134 ('Update' doUpdate ) |
|
135 ). |
125 |
136 |
126 m := PopUpMenu itemList:items resources:resources. |
137 m := PopUpMenu itemList:items resources:resources. |
127 |
138 |
128 selectionIndex isNil ifTrue:[ |
139 selectionIndex isNil ifTrue:[ |
129 m disableAll:#(doInspect doInspectKey doBasicInspect doNewInspect |
140 m disableAll:#(doInspect doInspectKey doBasicInspect doNewInspect |
140 "Modified: / 21.5.1998 / 13:25:10 / cg" |
151 "Modified: / 21.5.1998 / 13:25:10 / cg" |
141 ! ! |
152 ! ! |
142 |
153 |
143 !DictionaryInspectorView methodsFor:'menu actions'! |
154 !DictionaryInspectorView methodsFor:'menu actions'! |
144 |
155 |
|
156 browse |
|
157 |cls| |
|
158 |
|
159 cls := self selection class theNonMetaclass. |
|
160 "/ cls isNameSpace ifTrue:[ |
|
161 "/ self halt. |
|
162 "/ ]. |
|
163 cls browserClass openInClass:cls selector:nil |
|
164 ! |
|
165 |
145 doAddKey |
166 doAddKey |
146 "add a key" |
167 "add a key" |
147 |
168 |
148 |keyName key val l| |
169 |keyName key val l| |
149 |
170 |
150 keyName := Dialog request:'key to add:' initialAnswer:''. |
171 keyName := Dialog request:'Key to add (storeString):' initialAnswer:''. |
151 keyName notEmpty ifTrue:[ |
172 keyName notEmpty ifTrue:[ |
152 key := keyName asSymbol. |
173 key := Object readFrom:keyName onError:[ self information:'Bad input.'. ^ self]. |
153 (inspectedObject includesKey:key) ifFalse:[ |
174 (inspectedObject includesKey:key) ifFalse:[ |
154 val := Dialog request:'value to add:' initialAnswer:''. |
175 val := Dialog request:'Value to add (storeString):' initialAnswer:''. |
155 val notNil ifTrue:[ |
176 val notNil ifTrue:[ |
156 val := Object readFromString:val onError:nil. |
177 val := Object readFrom:val onError:[ self information:'Bad input.'. ^ self]. |
157 ]. |
178 ]. |
|
179 |
158 inspectedObject at:key put:val. |
180 inspectedObject at:key put:val. |
159 selectionIndex := selectedLine := nil. |
181 selectionIndex := selectedLine := nil. |
160 inspectedObject changed. |
182 inspectedObject changed. |
161 l := listView firstLineShown. |
183 l := listView firstLineShown. |
162 self reinspect. "force list update" |
184 self reinspect. "force list update" |