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