author | Patrik Svestka <patrik.svestka@gmail.com> |
Tue, 09 Nov 2021 13:59:48 +0100 | |
branch | jv |
changeset 19618 | 76c562829409 |
parent 18532 | cccb41254edf |
permissions | -rw-r--r-- |
11665 | 1 |
" |
2 |
COPYRIGHT (c) 2006 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 |
"{ Package: 'stx:libtool' }" |
|
13 |
||
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
ApplicationModel subclass:#ProjectCheckerBrowser |
|
17 |
instanceVariableNames:'projectCheckerHolder problemSelectionHolder problemListHolder |
|
12538 | 18 |
infoPanel accepted showCancel' |
11665 | 19 |
classVariableNames:'' |
20 |
poolDictionaries:'' |
|
21 |
category:'System-Support-Projects' |
|
22 |
! |
|
23 |
||
24 |
!ProjectCheckerBrowser class methodsFor:'documentation'! |
|
25 |
||
26 |
copyright |
|
27 |
" |
|
28 |
COPYRIGHT (c) 2006 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 |
documentation |
|
41 |
" |
|
42 |
A simple tool to browse issues found by ProjectChecker. |
|
43 |
||
44 |
[author:] |
|
45 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
|
46 |
||
47 |
[instance variables:] |
|
48 |
||
49 |
[class variables:] |
|
50 |
||
51 |
[see also:] |
|
52 |
ProjectChecker |
|
53 |
||
54 |
" |
|
55 |
! ! |
|
56 |
||
57 |
!ProjectCheckerBrowser class methodsFor:'interface specs'! |
|
58 |
||
59 |
windowSpec |
|
60 |
"This resource specification was automatically generated |
|
61 |
by the UIPainter of ST/X." |
|
62 |
||
63 |
"Do not manually edit this!! If it is corrupted, |
|
64 |
the UIPainter may not be able to read the specification." |
|
65 |
||
66 |
" |
|
67 |
UIPainter new openOnClass:Tools::ProjectCheckerBrowser andSelector:#windowSpec |
|
68 |
Tools::ProjectCheckerBrowser new openInterface:#windowSpec |
|
69 |
Tools::ProjectCheckerBrowser open |
|
70 |
" |
|
71 |
||
72 |
<resource: #canvas> |
|
73 |
||
74 |
^ |
|
75 |
#(FullSpec |
|
76 |
name: windowSpec |
|
77 |
window: |
|
78 |
(WindowSpec |
|
79 |
label: 'Package Issues' |
|
80 |
name: 'Package Issues' |
|
12556
06a86d00d2db
class: Tools::ProjectCheckerBrowser
Claus Gittinger <cg@exept.de>
parents:
12538
diff
changeset
|
81 |
bounds: (Rectangle 0 0 581 467) |
11665 | 82 |
) |
83 |
component: |
|
84 |
(SpecCollection |
|
85 |
collection: ( |
|
86 |
(VariableVerticalPanelSpec |
|
87 |
name: 'VariableVerticalPanel1' |
|
88 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1) |
|
89 |
component: |
|
90 |
(SpecCollection |
|
91 |
collection: ( |
|
92 |
(ViewSpec |
|
93 |
name: 'ListPanel' |
|
94 |
component: |
|
95 |
(SpecCollection |
|
96 |
collection: ( |
|
97 |
(SubCanvasSpec |
|
98 |
name: 'InfoPanel' |
|
99 |
layout: (LayoutFrame 0 0 0 0 0 1 40 0) |
|
100 |
level: 0 |
|
101 |
initiallyInvisible: true |
|
102 |
hasHorizontalScrollBar: false |
|
103 |
hasVerticalScrollBar: false |
|
104 |
clientKey: infoPanel |
|
105 |
createNewBuilder: false |
|
106 |
) |
|
107 |
(SelectionInListModelViewSpec |
|
108 |
name: 'List' |
|
109 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
110 |
model: problemSelectionHolder |
|
111 |
hasHorizontalScrollBar: true |
|
112 |
hasVerticalScrollBar: true |
|
113 |
listModel: problemListHolder |
|
114 |
useIndex: false |
|
115 |
highlightMode: line |
|
116 |
) |
|
117 |
) |
|
118 |
||
119 |
) |
|
120 |
) |
|
121 |
(ViewSpec |
|
122 |
name: 'Detail' |
|
123 |
component: |
|
124 |
(SpecCollection |
|
125 |
collection: ( |
|
126 |
(HTMLViewSpec |
|
127 |
name: 'Description' |
|
128 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
129 |
level: 0 |
|
130 |
hasHorizontalScrollBar: true |
|
131 |
hasVerticalScrollBar: true |
|
12538 | 132 |
htmlText: problemDescriptionTextHolder |
11665 | 133 |
postBuildCallback: setupHTMLView: |
134 |
) |
|
135 |
) |
|
136 |
||
137 |
) |
|
138 |
) |
|
139 |
) |
|
140 |
||
141 |
) |
|
12556
06a86d00d2db
class: Tools::ProjectCheckerBrowser
Claus Gittinger <cg@exept.de>
parents:
12538
diff
changeset
|
142 |
handles: (Any 0.421052631578947 1.0) |
11665 | 143 |
) |
144 |
(HorizontalPanelViewSpec |
|
145 |
name: 'ButtonPanel' |
|
12538 | 146 |
layout: (LayoutFrame 0 0 -30 1 -16 1 0 1) |
11665 | 147 |
horizontalLayout: fit |
148 |
verticalLayout: center |
|
149 |
horizontalSpace: 3 |
|
150 |
verticalSpace: 3 |
|
151 |
component: |
|
152 |
(SpecCollection |
|
153 |
collection: ( |
|
154 |
(ActionButtonSpec |
|
155 |
label: 'Check Again' |
|
156 |
name: 'CheckAgain' |
|
157 |
translateLabel: true |
|
158 |
model: doCheckAgain |
|
12538 | 159 |
extent: (Point 139 22) |
11665 | 160 |
) |
161 |
(ActionButtonSpec |
|
162 |
label: 'Close' |
|
163 |
name: 'CloseButton' |
|
12538 | 164 |
visibilityChannel: doNotShowCancel |
11665 | 165 |
translateLabel: true |
166 |
model: doClose |
|
12538 | 167 |
extent: (Point 139 22) |
168 |
) |
|
169 |
(ActionButtonSpec |
|
170 |
label: 'Done' |
|
171 |
name: 'Button1' |
|
172 |
visibilityChannel: showCancel |
|
173 |
translateLabel: true |
|
174 |
model: doClose |
|
175 |
extent: (Point 139 22) |
|
176 |
) |
|
177 |
(ActionButtonSpec |
|
178 |
label: 'Cancel' |
|
179 |
name: 'Button2' |
|
180 |
visibilityChannel: showCancel |
|
181 |
translateLabel: true |
|
182 |
model: doCancel |
|
183 |
extent: (Point 139 22) |
|
11665 | 184 |
) |
185 |
) |
|
186 |
||
187 |
) |
|
12538 | 188 |
keepSpaceForOSXResizeHandleH: true |
11665 | 189 |
) |
190 |
) |
|
191 |
||
192 |
) |
|
193 |
) |
|
194 |
! ! |
|
195 |
||
196 |
!ProjectCheckerBrowser methodsFor:'accessing'! |
|
197 |
||
12538 | 198 |
accepted |
199 |
^ accepted ? true |
|
200 |
! |
|
201 |
||
202 |
doNotShowCancel |
|
203 |
^ self showCancel not |
|
204 |
! |
|
205 |
||
11665 | 206 |
problemList: problems |
207 |
||
208 |
self problemListHolder value: problems |
|
209 |
||
210 |
"Created: / 13-02-2012 / 17:03:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
211 |
! |
|
212 |
||
213 |
projectChecker |
|
214 |
||
215 |
^self projectCheckerHolder value |
|
216 |
||
217 |
"Created: / 13-02-2012 / 17:03:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
218 |
! |
|
219 |
||
220 |
projectChecker: value |
|
221 |
||
222 |
self projectCheckerHolder value: value |
|
223 |
||
224 |
"Created: / 13-02-2012 / 17:03:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
12538 | 225 |
! |
226 |
||
227 |
showCancel |
|
228 |
^ showCancel ? false |
|
229 |
! |
|
230 |
||
231 |
showCancel:something |
|
232 |
showCancel := something. |
|
11665 | 233 |
! ! |
234 |
||
235 |
!ProjectCheckerBrowser methodsFor:'actions'! |
|
236 |
||
12538 | 237 |
doCancel |
238 |
<resource: #uiCallback> |
|
239 |
||
240 |
accepted := false. |
|
241 |
AbortSignal raiseRequest |
|
242 |
! |
|
243 |
||
11665 | 244 |
doCheckAgain |
245 |
<resource: #uiCallback> |
|
246 |
||
247 |
self infoPanel showProgressLabeled: (resources string: 'Checking...') while:[ |
|
248 |
| checker | |
|
249 |
||
250 |
checker := self projectChecker. |
|
251 |
checker check. |
|
252 |
self problemListHolder value: checker problems. |
|
253 |
checker problems isEmptyOrNil ifTrue:[ |
|
254 |
self infoPanel |
|
255 |
reset; |
|
256 |
showMessage: (resources string: 'Excellent, no problems found!!'); |
|
257 |
addButtonWithLabel:(resources string:'Close') action:[self doClose] |
|
258 |
||
259 |
] |
|
260 |
] |
|
261 |
||
262 |
"Modified: / 26-07-2012 / 10:50:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
263 |
! |
|
264 |
||
265 |
doClose |
|
266 |
<resource: #uiCallback> |
|
267 |
||
268 |
self closeRequest |
|
269 |
||
270 |
"Modified: / 25-07-2012 / 17:47:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
271 |
! |
|
272 |
||
273 |
doFix: index |
|
274 |
<resource: #uiCallback> |
|
275 |
||
276 |
[ |
|
277 |
self problemSelectionHolder value doFix: index |
|
278 |
] on: UserNotification do:[:not| |
|
279 |
self infoPanel showMessage: not description. |
|
12593
16d3f58e90bc
class: Tools::ProjectCheckerBrowser
Claus Gittinger <cg@exept.de>
parents:
12556
diff
changeset
|
280 |
]. |
16d3f58e90bc
class: Tools::ProjectCheckerBrowser
Claus Gittinger <cg@exept.de>
parents:
12556
diff
changeset
|
281 |
(self builder componentAt:'List') invalidate. |
11665 | 282 |
|
283 |
"Created: / 26-07-2012 / 10:06:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
284 |
! ! |
|
285 |
||
286 |
!ProjectCheckerBrowser methodsFor:'aspects'! |
|
287 |
||
288 |
infoPanel |
|
289 |
infoPanel isNil ifTrue:[ |
|
290 |
infoPanel := InlineMessageDialog new |
|
291 |
]. |
|
292 |
^ infoPanel |
|
293 |
||
294 |
"Created: / 09-02-2012 / 19:23:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
295 |
! |
|
296 |
||
12538 | 297 |
infoText |
298 |
^ resources string:'Select a problem in the above list to get detail information and a hint for repair'. |
|
299 |
! |
|
300 |
||
11665 | 301 |
problemDescriptionAspect |
302 |
<resource: #uiAspect> |
|
303 |
||
304 |
|holder| |
|
305 |
||
306 |
(holder := builder bindingAt:#problemDescriptionAspect) isNil ifTrue:[ |
|
307 |
holder := (AspectAdaptor forAspect: #descriptionAndFixes) |
|
308 |
subjectChannel: self problemSelectionHolder. |
|
12538 | 309 |
builder aspectAt:#problemDescriptionAspect put:holder. |
11665 | 310 |
]. |
311 |
^ holder. |
|
312 |
||
313 |
"Modified: / 26-07-2012 / 09:44:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
314 |
! |
|
315 |
||
12538 | 316 |
problemDescriptionTextHolder |
317 |
<resource: #uiAspect> |
|
318 |
||
319 |
|holder| |
|
320 |
||
321 |
(holder := builder bindingAt:#problemDescriptionTextHolder) isNil ifTrue:[ |
|
322 |
holder := ValueHolder with:(self infoText). |
|
323 |
builder aspectAt:#problemDescriptionTextHolder put:holder. |
|
324 |
]. |
|
325 |
^ holder. |
|
326 |
! |
|
327 |
||
11665 | 328 |
problemListHolder |
329 |
<resource: #uiAspect> |
|
330 |
||
331 |
problemListHolder isNil ifTrue:[ |
|
332 |
problemListHolder := ValueHolder new. |
|
333 |
]. |
|
334 |
^ problemListHolder. |
|
335 |
||
336 |
"Modified: / 13-02-2012 / 18:47:47 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
337 |
! |
|
338 |
||
339 |
problemSelectionHolder |
|
340 |
<resource: #uiAspect> |
|
341 |
||
342 |
problemSelectionHolder isNil ifTrue:[ |
|
343 |
problemSelectionHolder := ValueHolder new. |
|
12538 | 344 |
problemSelectionHolder onChangeSend:#problemSelectionChanged to:self. |
11665 | 345 |
]. |
346 |
^ problemSelectionHolder. |
|
347 |
! |
|
348 |
||
349 |
projectCheckerHolder |
|
350 |
"return/create the 'projectCheckerHolder' value holder (automatically generated)" |
|
351 |
||
352 |
projectCheckerHolder isNil ifTrue:[ |
|
353 |
projectCheckerHolder := ValueHolder new. |
|
354 |
projectCheckerHolder addDependent:self. |
|
355 |
]. |
|
356 |
^ projectCheckerHolder |
|
357 |
! |
|
358 |
||
359 |
projectCheckerHolder:something |
|
360 |
"set the 'projectCheckerHolder' value holder (automatically generated)" |
|
361 |
||
362 |
|oldValue newValue| |
|
363 |
||
364 |
projectCheckerHolder notNil ifTrue:[ |
|
365 |
oldValue := projectCheckerHolder value. |
|
366 |
projectCheckerHolder removeDependent:self. |
|
367 |
]. |
|
368 |
projectCheckerHolder := something. |
|
369 |
projectCheckerHolder notNil ifTrue:[ |
|
370 |
projectCheckerHolder addDependent:self. |
|
371 |
]. |
|
372 |
newValue := projectCheckerHolder value. |
|
373 |
oldValue ~~ newValue ifTrue:[ |
|
374 |
self update:#value with:newValue from:projectCheckerHolder. |
|
375 |
]. |
|
376 |
! ! |
|
377 |
||
378 |
!ProjectCheckerBrowser methodsFor:'change & update'! |
|
379 |
||
12538 | 380 |
problemSelectionChanged |
381 |
self problemDescriptionTextHolder value: |
|
382 |
(self problemSelectionHolder value notNil |
|
383 |
ifTrue:[self problemDescriptionAspect value] |
|
384 |
ifFalse:[self infoText]) |
|
385 |
! |
|
386 |
||
11665 | 387 |
update:something with:aParameter from:changedObject |
388 |
"Invoked when an object that I depend upon sends a change notification." |
|
389 |
||
390 |
"stub code automatically generated - please change as required" |
|
391 |
||
392 |
changedObject == projectCheckerHolder ifTrue:[ |
|
393 |
self updateFromProjectCheckerHolder. |
|
394 |
^ self. |
|
395 |
]. |
|
396 |
super update:something with:aParameter from:changedObject |
|
397 |
! |
|
398 |
||
399 |
updateFromProjectCheckerHolder |
|
400 |
||
401 |
self problemListHolder value: self projectChecker problems. |
|
402 |
||
403 |
"Modified: / 25-07-2012 / 18:01:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
404 |
! ! |
|
405 |
||
406 |
!ProjectCheckerBrowser methodsFor:'hooks'! |
|
407 |
||
408 |
setupHTMLView:aView |
|
15836
3ba55c85ef87
class: Tools::ProjectCheckerBrowser
Claus Gittinger <cg@exept.de>
parents:
12593
diff
changeset
|
409 |
aView linkActionPerformer:self. |
11665 | 410 |
aView painter |
411 |
leftMargin:20; |
|
412 |
topMargin:5. |
|
413 |
||
414 |
"Created: / 23-02-2012 / 14:04:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
415 |
! ! |
|
416 |
||
417 |
!ProjectCheckerBrowser class methodsFor:'documentation'! |
|
418 |
||
419 |
version |
|
15836
3ba55c85ef87
class: Tools::ProjectCheckerBrowser
Claus Gittinger <cg@exept.de>
parents:
12593
diff
changeset
|
420 |
^ '$Header$' |
11665 | 421 |
! |
422 |
||
423 |
version_CVS |
|
15836
3ba55c85ef87
class: Tools::ProjectCheckerBrowser
Claus Gittinger <cg@exept.de>
parents:
12593
diff
changeset
|
424 |
^ '$Header$' |
11665 | 425 |
! |
426 |
||
12650
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12626
diff
changeset
|
427 |
version_HG |
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12626
diff
changeset
|
428 |
|
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12626
diff
changeset
|
429 |
^ '$Changeset: <not expanded> $' |
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12626
diff
changeset
|
430 |
! |
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12626
diff
changeset
|
431 |
|
11665 | 432 |
version_SVN |
15836
3ba55c85ef87
class: Tools::ProjectCheckerBrowser
Claus Gittinger <cg@exept.de>
parents:
12593
diff
changeset
|
433 |
^ '$Id$' |
11665 | 434 |
! ! |
12538 | 435 |