author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Sat, 21 Sep 2019 18:31:45 +0100 | |
changeset 185 | bb863cb24c1a |
parent 151 | bc7626f46210 |
child 211 | 2bf7c99e6efa |
permissions | -rw-r--r-- |
110 | 1 |
" |
2 |
jv:vdb - Visual / VM Debugger |
|
3 |
Copyright (C) 2015-now Jan Vrany |
|
4 |
||
5 |
This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License' |
|
6 |
||
7 |
You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/ |
|
8 |
" |
|
9 |
"{ Package: 'jv:vdb' }" |
|
10 |
||
11 |
"{ NameSpace: Smalltalk }" |
|
12 |
||
13 |
VDBAbstractTreeApplication subclass:#VDBRegisterListApplication |
|
14 |
instanceVariableNames:'registerListHolder selectedRegisterHolder' |
|
15 |
classVariableNames:'' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'VDB-UI-Others' |
|
18 |
! |
|
19 |
||
20 |
!VDBRegisterListApplication class methodsFor:'documentation'! |
|
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
jv:vdb - Visual / VM Debugger |
|
25 |
Copyright (C) 2015-now Jan Vrany |
|
26 |
||
27 |
This software is licensed under 'Creative Commons Attribution-NonCommercial 4.0 International License' |
|
28 |
||
29 |
You may find a full license text in LICENSE.txt or at http://creativecommons.org/licenses/by-nc/4.0/ |
|
30 |
" |
|
31 |
! ! |
|
32 |
||
33 |
!VDBRegisterListApplication class methodsFor:'accessing'! |
|
34 |
||
115
0dd989ce3ae7
Cleanup default window titles
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
112
diff
changeset
|
35 |
defaultWindowTitle |
0dd989ce3ae7
Cleanup default window titles
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
112
diff
changeset
|
36 |
^ self resources string:'Registers' |
110 | 37 |
|
38 |
"Created: / 11-07-2017 / 16:37:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
112
d293d117e978
Add register view to frame details application (`VDBFrameApplication`)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
110
diff
changeset
|
39 |
"Modified: / 01-10-2018 / 12:08:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
110 | 40 |
! ! |
41 |
||
42 |
!VDBRegisterListApplication class methodsFor:'interface specs'! |
|
43 |
||
44 |
columnsSpec |
|
45 |
"This resource specification was automatically generated |
|
46 |
by the DataSetBuilder of ST/X." |
|
47 |
||
48 |
"Do not manually edit this!! If it is corrupted, |
|
49 |
the DataSetBuilder may not be able to read the specification." |
|
50 |
||
51 |
" |
|
52 |
DataSetBuilder new openOnClass:VDBFrameApplication andSelector:#columnsSpec |
|
53 |
" |
|
54 |
||
55 |
<resource: #tableColumns> |
|
56 |
||
57 |
^#( |
|
58 |
(DataSetColumnSpec |
|
59 |
label: 'Value' |
|
60 |
labelAlignment: left |
|
61 |
labelButtonType: Button |
|
62 |
width: 1.0 |
|
63 |
height: heightOfFirstRow |
|
64 |
menuFromApplication: false |
|
65 |
printSelector: value |
|
66 |
backgroundSelector: backgroundColor |
|
67 |
showRowSeparator: false |
|
68 |
showColSeparator: false |
|
69 |
) |
|
70 |
) |
|
71 |
||
72 |
! ! |
|
73 |
||
74 |
!VDBRegisterListApplication class methodsFor:'plugIn spec'! |
|
75 |
||
76 |
aspectSelectors |
|
77 |
"This resource specification was automatically generated |
|
78 |
by the UIPainter of ST/X." |
|
79 |
||
80 |
"Do not manually edit this. If it is corrupted, |
|
81 |
the UIPainter may not be able to read the specification." |
|
82 |
||
83 |
"Return a description of exported aspects; |
|
84 |
these can be connected to aspects of an embedding application |
|
85 |
(if this app is embedded in a subCanvas)." |
|
86 |
||
87 |
^ #( |
|
88 |
#debuggerHolder |
|
89 |
#registerListHolder |
|
90 |
#selectedRegisterHolder |
|
91 |
). |
|
92 |
||
93 |
"Modified: / 27-09-2018 / 20:32:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
94 |
! ! |
|
95 |
||
96 |
!VDBRegisterListApplication class methodsFor:'startup-web applications'! |
|
97 |
||
98 |
initialPageSpec |
|
99 |
"this is only required for web-applications" |
|
100 |
||
101 |
^ self shouldImplement |
|
102 |
! |
|
103 |
||
104 |
pageSpecs |
|
105 |
"this is only required for web-applications" |
|
106 |
||
107 |
^ self shouldImplement |
|
108 |
! ! |
|
109 |
||
110 |
!VDBRegisterListApplication methodsFor:'aspects'! |
|
111 |
||
112 |
backgroundColorFor: aVDBRegisterPresenter |
|
113 |
^ aVDBRegisterPresenter register hasChanged |
|
114 |
ifTrue:[ Color yellow lighter lighter ] |
|
115 |
ifFalse:[ nil ] |
|
116 |
||
117 |
"Created: / 01-02-2018 / 09:08:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
118 |
"Modified: / 27-09-2018 / 20:41:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
119 |
! |
|
120 |
||
121 |
registerListHolder |
|
122 |
"return/create the 'variableObjectListHolder' value holder (automatically generated)" |
|
123 |
||
124 |
registerListHolder isNil ifTrue:[ |
|
125 |
registerListHolder := ValueHolder with: #(). |
|
126 |
registerListHolder addDependent:self. |
|
127 |
]. |
|
128 |
^ registerListHolder |
|
129 |
||
130 |
"Created: / 27-09-2018 / 20:31:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
131 |
! |
|
132 |
||
133 |
registerListHolder:something |
|
134 |
"set the 'variableObjectListHolder' value holder (automatically generated)" |
|
135 |
||
136 |
|oldValue newValue| |
|
137 |
||
138 |
registerListHolder notNil ifTrue:[ |
|
139 |
oldValue := registerListHolder value. |
|
140 |
registerListHolder removeDependent:self. |
|
141 |
]. |
|
142 |
registerListHolder := something. |
|
143 |
registerListHolder notNil ifTrue:[ |
|
144 |
registerListHolder addDependent:self. |
|
145 |
]. |
|
146 |
newValue := registerListHolder value. |
|
147 |
oldValue ~~ newValue ifTrue:[ |
|
148 |
self update:#value with:newValue from:registerListHolder. |
|
149 |
]. |
|
150 |
||
151 |
"Created: / 27-09-2018 / 20:31:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
152 |
! |
|
153 |
||
154 |
selectedRegisterHolder |
|
155 |
"return/create the 'selectedVariableHolder' value holder (automatically generated)" |
|
156 |
||
157 |
selectedRegisterHolder isNil ifTrue:[ |
|
158 |
selectedRegisterHolder := ValueHolder new. |
|
159 |
selectedRegisterHolder addDependent:self. |
|
160 |
]. |
|
161 |
^ selectedRegisterHolder |
|
162 |
||
163 |
"Created: / 27-09-2018 / 20:31:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
164 |
! |
|
165 |
||
166 |
selectedRegisterHolder:something |
|
167 |
"set the 'selectedVariableHolder' value holder (automatically generated)" |
|
168 |
||
169 |
| oldValue newValue | |
|
170 |
||
171 |
selectedRegisterHolder notNil ifTrue:[ |
|
172 |
oldValue := selectedRegisterHolder value. |
|
173 |
selectedRegisterHolder removeDependent:self. |
|
174 |
]. |
|
175 |
selectedRegisterHolder := something. |
|
176 |
selectedRegisterHolder notNil ifTrue:[ |
|
177 |
selectedRegisterHolder addDependent:self. |
|
178 |
]. |
|
179 |
newValue := selectedRegisterHolder value. |
|
180 |
oldValue ~~ newValue ifTrue:[ |
|
181 |
self |
|
182 |
update:#value |
|
183 |
with:newValue |
|
184 |
from:selectedRegisterHolder. |
|
185 |
]. |
|
186 |
||
187 |
"Created: / 27-09-2018 / 20:31:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
188 |
! ! |
|
189 |
||
190 |
!VDBRegisterListApplication methodsFor:'change & update'! |
|
191 |
||
192 |
update:aspect with:param from:sender |
|
193 |
"Invoked when an object that I depend upon sends a change notification." |
|
194 |
||
195 |
sender == registerListHolder ifTrue:[ |
|
151
bc7626f46210
Performance: do not update contents of windows when not needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
196 |
self enqueueDelayedUpdateContents. |
110 | 197 |
^ self. |
198 |
]. |
|
199 |
super update:aspect with:param from:sender |
|
200 |
||
151
bc7626f46210
Performance: do not update contents of windows when not needed
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
115
diff
changeset
|
201 |
"Modified: / 14-02-2019 / 16:31:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
110 | 202 |
! ! |
203 |
||
204 |
!VDBRegisterListApplication methodsFor:'change & update-delayed'! |
|
205 |
||
206 |
delayedUpdateInternalList |
|
207 |
| registers registerPs | |
|
208 |
||
209 |
registers := self registerListHolder value ? #(). |
|
210 |
registerPs := registers collect:[ :reg | VDBRegisterPresenter new setRegister: reg ]. |
|
211 |
self internalListHolder root |
|
212 |
children: registerPs; |
|
213 |
expand. |
|
214 |
||
215 |
"Modified: / 28-09-2018 / 06:50:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
216 |
! |
|
217 |
||
218 |
delayedUpdateSelection |
|
219 |
| internalSelection | |
|
220 |
||
221 |
internalSelection := self internalSelectionHolder value. |
|
222 |
internalSelection notNil ifTrue:[ |
|
223 |
self selectedRegisterHolder value: internalSelection register |
|
224 |
] ifFalse:[ |
|
225 |
self selectedRegisterHolder value: nil |
|
226 |
]. |
|
227 |
||
228 |
"Modified: / 27-09-2018 / 21:08:04 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
229 |
! ! |
|
230 |
||
231 |
!VDBRegisterListApplication methodsFor:'drag & drop'! |
|
232 |
||
233 |
dropObjects:aCollectionOfDropObjects |
|
234 |
"drop manager wants to drop. |
|
235 |
This is ony sent, if #canDrop: returned true. |
|
236 |
Must be redefined in order for drop to work." |
|
237 |
||
238 |
^ self shouldImplement |
|
239 |
! ! |
|
240 |
||
241 |
!VDBRegisterListApplication methodsFor:'event handling'! |
|
242 |
||
243 |
onStoppedEvent: aGDBStoppedEvent |
|
244 |
self enqueueDelayedInvalidateInternalList |
|
245 |
||
246 |
"Created: / 01-02-2018 / 23:14:05 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
247 |
! ! |
|
248 |
||
249 |
!VDBRegisterListApplication methodsFor:'initialization & release'! |
|
250 |
||
251 |
subscribe |
|
252 |
"Register for debugger events. To be overrided by subclasses" |
|
253 |
||
254 |
debugger announcer |
|
255 |
when: GDBStoppedEvent send: #onStoppedEvent: to: self |
|
256 |
||
257 |
"Created: / 01-02-2018 / 23:07:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
258 |
! ! |
|
259 |
||
260 |
!VDBRegisterListApplication class methodsFor:'documentation'! |
|
261 |
||
262 |
version_HG |
|
263 |
||
264 |
^ '$Changeset: <not expanded> $' |
|
265 |
! ! |
|
266 |