author | Claus Gittinger <cg@exept.de> |
Wed, 05 Jun 2019 14:16:59 +0200 | |
changeset 18805 | f6df57c6dbfb |
parent 18117 | a0e33e7fe5cd |
child 18956 | 2331d73715c7 |
permissions | -rw-r--r-- |
18117 | 1 |
"{ Encoding: utf8 }" |
2 |
||
10000 | 3 |
" |
10096 | 4 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
5 |
Copyright (c) 2009-2010 eXept Software AG |
|
10000 | 6 |
|
10096 | 7 |
Permission is hereby granted, free of charge, to any person |
8 |
obtaining a copy of this software and associated documentation |
|
9 |
files (the 'Software'), to deal in the Software without |
|
10 |
restriction, including without limitation the rights to use, |
|
11 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
12 |
copies of the Software, and to permit persons to whom the |
|
13 |
Software is furnished to do so, subject to the following |
|
14 |
conditions: |
|
15 |
||
16 |
The above copyright notice and this permission notice shall be |
|
17 |
included in all copies or substantial portions of the Software. |
|
18 |
||
19 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
20 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
21 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
22 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
23 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
24 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
25 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
26 |
OTHER DEALINGS IN THE SOFTWARE. |
|
10000 | 27 |
" |
28 |
"{ Package: 'stx:libtool' }" |
|
29 |
||
30 |
"{ NameSpace: Tools }" |
|
31 |
||
32 |
BrowserList subclass:#LintRuleList |
|
33 |
instanceVariableNames:'listHolder filterHolder modeHolder listSelection listView |
|
34 |
initialSelectionHolder' |
|
14978 | 35 |
classVariableNames:'LastNameFilter' |
10000 | 36 |
poolDictionaries:'' |
37 |
category:'Interface-Lint' |
|
38 |
! |
|
39 |
||
40 |
HierarchicalItem subclass:#ListEntry |
|
41 |
instanceVariableNames:'x rule application' |
|
42 |
classVariableNames:'' |
|
43 |
poolDictionaries:'' |
|
44 |
privateIn:LintRuleList |
|
45 |
! |
|
46 |
||
47 |
!LintRuleList class methodsFor:'documentation'! |
|
48 |
||
49 |
copyright |
|
50 |
" |
|
10096 | 51 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
52 |
Copyright (c) 2009-2010 eXept Software AG |
|
53 |
||
54 |
Permission is hereby granted, free of charge, to any person |
|
55 |
obtaining a copy of this software and associated documentation |
|
56 |
files (the 'Software'), to deal in the Software without |
|
57 |
restriction, including without limitation the rights to use, |
|
58 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
59 |
copies of the Software, and to permit persons to whom the |
|
60 |
Software is furnished to do so, subject to the following |
|
61 |
conditions: |
|
10000 | 62 |
|
10096 | 63 |
The above copyright notice and this permission notice shall be |
64 |
included in all copies or substantial portions of the Software. |
|
65 |
||
66 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
67 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
68 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
69 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
70 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
71 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
72 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
73 |
OTHER DEALINGS IN THE SOFTWARE. |
|
10000 | 74 |
" |
14754
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
75 |
! |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
76 |
|
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
77 |
documentation |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
78 |
" |
17298 | 79 |
Embeddable list to display a set of SmallLint rules. |
80 |
(this is embedded in the browser when showing lint check outcomes) |
|
14754
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
81 |
|
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
82 |
Supports 3 modes (controlled by modeHolder) |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
83 |
#display - only display given set of rules. |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
84 |
#displaySelection - display set of rules and indicate which one is selected |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
85 |
by check mark. Does NOT ALLOW to change selection |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
86 |
(add remove tools) |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
87 |
#select - display set of rules and DO ALLOW to change the selection |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
88 |
(add / remove rules) by clicking to check icon |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
89 |
|
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
90 |
[author:] |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
91 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
92 |
|
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
93 |
[instance variables:] |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
94 |
|
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
95 |
[class variables:] |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
96 |
|
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
97 |
[see also:] |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
98 |
|
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
99 |
" |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
100 |
! |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
101 |
|
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
102 |
examples |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
103 |
" |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
104 |
Starting the application: |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
105 |
[exBegin] |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
106 |
Tools::LintRuleList open |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
107 |
|
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
108 |
[exEnd] |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
109 |
|
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
110 |
more examples to be added: |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
111 |
[exBegin] |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
112 |
... add code fragment for |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
113 |
... executable example here ... |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
114 |
[exEnd] |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
115 |
" |
10000 | 116 |
! ! |
117 |
||
118 |
!LintRuleList class methodsFor:'interface specs'! |
|
119 |
||
120 |
windowSpec |
|
121 |
"This resource specification was automatically generated |
|
122 |
by the UIPainter of ST/X." |
|
123 |
||
124 |
"Do not manually edit this!! If it is corrupted, |
|
125 |
the UIPainter may not be able to read the specification." |
|
126 |
||
127 |
" |
|
128 |
UIPainter new openOnClass:Tools::LintRuleList andSelector:#windowSpec |
|
129 |
Tools::LintRuleList new openInterface:#windowSpec |
|
130 |
Tools::LintRuleList open |
|
131 |
" |
|
132 |
||
133 |
<resource: #canvas> |
|
134 |
||
135 |
^ |
|
16589 | 136 |
#(FullSpec |
137 |
name: windowSpec |
|
138 |
window: |
|
139 |
(WindowSpec |
|
140 |
label: 'SmallLintRuleList' |
|
141 |
name: 'SmallLintRuleList' |
|
142 |
min: (Point 10 10) |
|
143 |
bounds: (Rectangle 0 0 300 300) |
|
144 |
) |
|
145 |
component: |
|
146 |
(SpecCollection |
|
147 |
collection: ( |
|
148 |
(InputFieldSpec |
|
149 |
name: 'RuleFilter' |
|
150 |
layout: (LayoutFrame 0 0 0 0 0 1 28 0) |
|
151 |
model: filterHolder |
|
152 |
immediateAccept: true |
|
153 |
acceptOnReturn: true |
|
154 |
acceptOnTab: true |
|
155 |
acceptOnPointerLeave: true |
|
156 |
emptyFieldReplacementText: 'Search...' |
|
10000 | 157 |
) |
16589 | 158 |
(SelectionInListModelViewSpec |
159 |
name: 'RuleList' |
|
160 |
layout: (LayoutFrame 0 0 28 0 0 1 0 1) |
|
161 |
model: listSelection |
|
162 |
menu: menuHolder |
|
163 |
hasHorizontalScrollBar: true |
|
164 |
hasVerticalScrollBar: true |
|
165 |
listModel: listHolder |
|
166 |
multipleSelectOk: true |
|
167 |
useIndex: false |
|
168 |
highlightMode: line |
|
169 |
postBuildCallback: postBuildList: |
|
170 |
) |
|
171 |
) |
|
172 |
||
173 |
) |
|
174 |
) |
|
10000 | 175 |
! ! |
176 |
||
177 |
!LintRuleList class methodsFor:'menu specs'! |
|
178 |
||
179 |
menu |
|
180 |
"This resource specification was automatically generated |
|
181 |
by the MenuEditor of ST/X." |
|
182 |
||
183 |
"Do not manually edit this!! If it is corrupted, |
|
184 |
the MenuEditor may not be able to read the specification." |
|
185 |
||
11381 | 186 |
|
10000 | 187 |
" |
11381 | 188 |
MenuEditor new openOnClass:Tools::LintRuleList andSelector:#menu |
189 |
(Menu new fromLiteralArrayEncoding:(Tools::LintRuleList menu)) startUp |
|
10000 | 190 |
" |
191 |
||
192 |
<resource: #menu> |
|
193 |
||
194 |
^ |
|
195 |
#(Menu |
|
196 |
( |
|
197 |
(MenuItem |
|
16438 | 198 |
label: 'Run this Rule Again' |
199 |
itemValue: runRuleAgain |
|
200 |
) |
|
201 |
(MenuItem |
|
10000 | 202 |
label: '-' |
203 |
) |
|
204 |
(MenuItem |
|
16438 | 205 |
label: 'Inspect Rule' |
206 |
itemValue: menuInspectRule |
|
207 |
) |
|
208 |
(MenuItem |
|
209 |
label: 'Browse Rule Class' |
|
210 |
itemValue: menuBrowseRuleClass |
|
10000 | 211 |
) |
212 |
) |
|
213 |
nil |
|
214 |
nil |
|
215 |
) |
|
216 |
! ! |
|
217 |
||
218 |
!LintRuleList class methodsFor:'plugIn spec'! |
|
219 |
||
220 |
aspectSelectors |
|
221 |
"This resource specification was automatically generated |
|
222 |
by the UIPainter of ST/X." |
|
223 |
||
224 |
"Do not manually edit this. If it is corrupted, |
|
225 |
the UIPainter may not be able to read the specification." |
|
226 |
||
227 |
"Return a description of exported aspects; |
|
228 |
these can be connected to aspects of an embedding application |
|
229 |
(if this app is embedded in a subCanvas)." |
|
230 |
||
231 |
^ #( |
|
16589 | 232 |
#environmentHolder |
10000 | 233 |
#inGeneratorHolder |
13798 | 234 |
#listSelection |
10000 | 235 |
#modeHolder |
236 |
#outGeneratorHolder |
|
237 |
#selectionHolder |
|
238 |
). |
|
239 |
||
240 |
! ! |
|
241 |
||
242 |
!LintRuleList methodsFor:'accessing'! |
|
243 |
||
244 |
mode |
|
245 |
||
246 |
^self modeHolder value |
|
247 |
||
17361 | 248 |
"Created: / 25-08-2010 / 11:33:51 / Jan Vrany" |
10000 | 249 |
! |
250 |
||
251 |
selection |
|
252 |
||
253 |
| sel | |
|
254 |
sel := self selectionHolder value. |
|
255 |
sel ifNil:[sel := Set new]. |
|
256 |
^sel |
|
257 |
||
17361 | 258 |
"Created: / 25-08-2010 / 13:26:58 / Jan Vrany" |
10000 | 259 |
! |
260 |
||
261 |
selection: aCollectionOrNil |
|
262 |
||
263 |
| sel | |
|
264 |
sel := aCollectionOrNil |
|
265 |
ifNil:[Set new] |
|
266 |
ifNotNil:[aCollectionOrNil asSet]. |
|
267 |
||
13798 | 268 |
self selectionHolder value: sel. |
10000 | 269 |
|
17361 | 270 |
"Created: / 25-08-2010 / 13:28:43 / Jan Vrany" |
271 |
"Modified: / 25-08-2010 / 15:29:35 / Jan Vrany" |
|
13798 | 272 |
"Modified: / 27-02-2013 / 23:33:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 273 |
! ! |
274 |
||
275 |
!LintRuleList methodsFor:'aspects'! |
|
276 |
||
277 |
filterHolder |
|
278 |
"return/create the 'filterHolder' value holder (automatically generated)" |
|
279 |
||
280 |
filterHolder isNil ifTrue:[ |
|
14978 | 281 |
filterHolder := LastNameFilter asValue. |
10000 | 282 |
filterHolder addDependent:self. |
283 |
]. |
|
284 |
^ filterHolder |
|
285 |
! |
|
286 |
||
287 |
filterHolder:something |
|
288 |
"set the 'filterHolder' value holder (automatically generated)" |
|
289 |
||
290 |
|oldValue newValue| |
|
291 |
||
292 |
filterHolder notNil ifTrue:[ |
|
293 |
oldValue := filterHolder value. |
|
294 |
filterHolder removeDependent:self. |
|
295 |
]. |
|
296 |
filterHolder := something. |
|
297 |
filterHolder notNil ifTrue:[ |
|
298 |
filterHolder addDependent:self. |
|
299 |
]. |
|
300 |
newValue := filterHolder value. |
|
301 |
oldValue ~~ newValue ifTrue:[ |
|
302 |
self update:#value with:newValue from:filterHolder. |
|
303 |
]. |
|
304 |
! |
|
305 |
||
306 |
listHolder |
|
307 |
"return/create the 'ruleList' value holder (automatically generated)" |
|
308 |
||
309 |
listHolder isNil ifTrue:[ |
|
310 |
listHolder := ValueHolder new. |
|
311 |
]. |
|
312 |
^ listHolder |
|
313 |
! |
|
314 |
||
315 |
listSelection |
|
316 |
"return/create the 'listSelection' value holder (automatically generated)" |
|
317 |
||
318 |
listSelection isNil ifTrue:[ |
|
319 |
listSelection := ValueHolder new. |
|
320 |
listSelection addDependent:self. |
|
321 |
]. |
|
322 |
^ listSelection |
|
323 |
! |
|
324 |
||
325 |
listSelection:something |
|
326 |
"set the 'listSelection' value holder (automatically generated)" |
|
327 |
||
328 |
|oldValue newValue| |
|
329 |
||
330 |
listSelection notNil ifTrue:[ |
|
331 |
oldValue := listSelection value. |
|
332 |
listSelection removeDependent:self. |
|
333 |
]. |
|
334 |
listSelection := something. |
|
335 |
listSelection notNil ifTrue:[ |
|
336 |
listSelection addDependent:self. |
|
337 |
]. |
|
338 |
newValue := listSelection value. |
|
339 |
oldValue ~~ newValue ifTrue:[ |
|
340 |
self update:#value with:newValue from:listSelection. |
|
341 |
]. |
|
342 |
! |
|
343 |
||
344 |
modeHolder |
|
16438 | 345 |
"the mode - can run in select or in display modes. |
346 |
select is to choose a set of rules; |
|
347 |
display for presentation of results (in a browser). |
|
348 |
See documentation for details" |
|
349 |
||
350 |
modeHolder isNil ifTrue:[ |
|
351 |
modeHolder := ValueHolder with: #display |
|
352 |
]. |
|
10000 | 353 |
^modeHolder |
354 |
||
355 |
"Modified: / 15-04-2010 / 20:56:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
356 |
! |
|
357 |
||
358 |
modeHolder:aValueModel |
|
16438 | 359 |
"the mode - can run in select or in display modes. |
360 |
select is to choose a set of rules; |
|
361 |
display for presentation of results (in a browser). |
|
362 |
See documentation for details" |
|
363 |
||
10000 | 364 |
modeHolder := aValueModel. |
365 |
! |
|
366 |
||
367 |
selectedLintRules |
|
368 |
^ self selectionHolder |
|
369 |
||
370 |
"Created: / 02-02-2010 / 20:43:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
371 |
! |
|
372 |
||
373 |
selectedLintRules: anObject |
|
374 |
^ self selectionHolder: anObject |
|
375 |
||
376 |
"Created: / 02-02-2010 / 20:43:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
377 |
! ! |
|
378 |
||
379 |
!LintRuleList methodsFor:'change & update'! |
|
380 |
||
381 |
delayedUpdate:something with:aParameter from:changedObject |
|
382 |
"Invoked when an object that I depend upon sends a change notification." |
|
383 |
||
384 |
changedObject == filterHolder ifTrue:[ |
|
14978 | 385 |
LastNameFilter := filterHolder value. |
10000 | 386 |
self updateList. |
387 |
^ self. |
|
388 |
]. |
|
389 |
||
390 |
(changedObject == listSelection) ifTrue:[ |
|
391 |
listValid ifFalse:[ |
|
392 |
self updateList. |
|
393 |
]. |
|
394 |
^ self selectionChanged |
|
395 |
]. |
|
396 |
||
10499 | 397 |
(changedObject == selectionHolder) ifTrue:[ |
13798 | 398 |
listView notNil ifTrue:[ |
399 |
listView invalidate |
|
400 |
]. |
|
10499 | 401 |
^self. |
402 |
]. |
|
403 |
||
404 |
||
10000 | 405 |
super delayedUpdate:something with:aParameter from:changedObject |
406 |
||
17361 | 407 |
"Created: / 26-08-2010 / 11:43:33 / Jan Vrany" |
13798 | 408 |
"Modified: / 27-02-2013 / 23:40:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10499 | 409 |
! |
410 |
||
14855 | 411 |
enqueueDelayedUpdateList |
412 |
super enqueueDelayedUpdateList |
|
413 |
! |
|
414 |
||
10499 | 415 |
selectionChanged |
416 |
||
16426 | 417 |
| selection newSelection | |
14169
d983f6273b6d
Fixed LintRileList>>selectionChanged so it works both in browser and in dialog. Bit hacky.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14165
diff
changeset
|
418 |
|
d983f6273b6d
Fixed LintRileList>>selectionChanged so it works both in browser and in dialog. Bit hacky.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14165
diff
changeset
|
419 |
super selectionChanged. |
14786
6761e919308a
Bugfix in selection handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14755
diff
changeset
|
420 |
self mode == #display ifTrue:[ |
14169
d983f6273b6d
Fixed LintRileList>>selectionChanged so it works both in browser and in dialog. Bit hacky.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14165
diff
changeset
|
421 |
selection := self listSelection value. |
d983f6273b6d
Fixed LintRileList>>selectionChanged so it works both in browser and in dialog. Bit hacky.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14165
diff
changeset
|
422 |
selection isEmptyOrNil ifTrue:[ |
16426 | 423 |
newSelection := selection |
14169
d983f6273b6d
Fixed LintRileList>>selectionChanged so it works both in browser and in dialog. Bit hacky.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14165
diff
changeset
|
424 |
] ifFalse:[ |
16426 | 425 |
newSelection := selection collect:[:entry|entry rule] |
14169
d983f6273b6d
Fixed LintRileList>>selectionChanged so it works both in browser and in dialog. Bit hacky.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14165
diff
changeset
|
426 |
]. |
16426 | 427 |
self selectionHolder value: newSelection. |
14855 | 428 |
"/ listView invalidate |
14169
d983f6273b6d
Fixed LintRileList>>selectionChanged so it works both in browser and in dialog. Bit hacky.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14165
diff
changeset
|
429 |
]. |
10499 | 430 |
|
431 |
"Created: / 05-08-2011 / 00:10:45 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14786
6761e919308a
Bugfix in selection handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14755
diff
changeset
|
432 |
"Modified: / 17-10-2014 / 00:01:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 433 |
! ! |
434 |
||
435 |
!LintRuleList methodsFor:'event processing'! |
|
436 |
||
437 |
buttonPress:button x:x y:y view:aView |
|
438 |
||
439 |
| itemIndex item | |
|
440 |
||
16438 | 441 |
(button == 1 and:[self modeHolder value == #select]) ifFalse:[ |
442 |
^ aView buttonPress:button x:x y:y |
|
443 |
]. |
|
10000 | 444 |
|
445 |
itemIndex := aView yVisibleToLineNr:y. |
|
14755 | 446 |
itemIndex isNil ifTrue:[^self]. |
10000 | 447 |
itemIndex == 0 ifTrue:[^self]. |
448 |
itemIndex > aView list size ifTrue:[^self]. |
|
449 |
item := aView list at: itemIndex. |
|
450 |
||
451 |
((aView left + x) between: (item x) and: (item x + 16)) |
|
452 |
ifFalse:[^aView buttonPress:button x:x y:y]. |
|
453 |
||
454 |
item checked: item checked not. |
|
455 |
aView invalidate |
|
456 |
||
457 |
"Created: / 08-12-2009 / 14:12:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14755 | 458 |
"Modified: / 13-10-2014 / 18:38:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 459 |
! |
460 |
||
461 |
handlesButtonPress:button inView:aView |
|
14923
7c189a24693c
class: Tools::LintRuleList
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14855
diff
changeset
|
462 |
^ listView == aView |
7c189a24693c
class: Tools::LintRuleList
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14855
diff
changeset
|
463 |
and:[ button == 1 |
7c189a24693c
class: Tools::LintRuleList
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14855
diff
changeset
|
464 |
and:[ self modeHolder value == #select ] ] |
10000 | 465 |
|
466 |
"Created: / 08-12-2009 / 14:08:49 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14923
7c189a24693c
class: Tools::LintRuleList
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14855
diff
changeset
|
467 |
"Modified: / 27-11-2014 / 09:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 468 |
! ! |
469 |
||
470 |
!LintRuleList methodsFor:'generators'! |
|
471 |
||
472 |
makeGenerator |
|
473 |
||
16426 | 474 |
self modeHolder value == #display ifTrue:[ |
475 |
^ Iterator |
|
476 |
on: [:whatToDo| |
|
477 |
self listSelection value ? #() do:[:each| |
|
16875 | 478 |
"/ classes removed (in the meanwhile), but still referenced by name in the lintResults |
479 |
"/ may lead to nil being enumerated here... |
|
480 |
each failedClasses nonNilElementsDo:whatToDo |
|
16426 | 481 |
] |
482 |
] |
|
483 |
]. |
|
484 |
^ Iterator |
|
485 |
on: [:whatToDo| |
|
486 |
self selection do:[:rule| whatToDo value: rule] |
|
487 |
]. |
|
10000 | 488 |
|
489 |
"Modified: / 16-04-2010 / 12:13:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
17361 | 490 |
"Modified: / 25-08-2010 / 13:39:51 / Jan Vrany" |
10000 | 491 |
! ! |
492 |
||
493 |
!LintRuleList methodsFor:'hooks'! |
|
494 |
||
495 |
commonPostOpen |
|
12035 | 496 |
super commonPostOpen. |
10000 | 497 |
self updateOutputGenerator. |
498 |
||
499 |
"Created: / 16-04-2010 / 11:53:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
500 |
! |
|
501 |
||
502 |
postBuildList: aView |
|
18117 | 503 |
"I want to see the events of the list" |
10000 | 504 |
|
505 |
listView := aView scrolledView. |
|
506 |
listView delegate: self. |
|
507 |
||
508 |
"Created: / 08-12-2009 / 14:10:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
509 |
! ! |
|
510 |
||
511 |
!LintRuleList methodsFor:'initialization'! |
|
512 |
||
513 |
initialize |
|
14033
a8387e4a0a78
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13798
diff
changeset
|
514 |
| menu | |
10000 | 515 |
|
516 |
super initialize. |
|
16438 | 517 |
|
518 |
menuHolder := |
|
519 |
[ |
|
520 |
menu := self menuFor: #menu. |
|
521 |
menu isArray ifTrue:[ menu := Menu decodeFromLiteralArray: menu ]. |
|
522 |
menu |
|
523 |
]. |
|
524 |
||
14855 | 525 |
"/ self selection: Set new. |
10000 | 526 |
|
17361 | 527 |
"Modified: / 25-08-2010 / 15:24:45 / Jan Vrany" |
14033
a8387e4a0a78
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13798
diff
changeset
|
528 |
"Modified: / 24-02-2014 / 12:00:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 529 |
! ! |
530 |
||
531 |
!LintRuleList methodsFor:'menu actions'! |
|
532 |
||
16438 | 533 |
menuBrowseRuleClass |
534 |
| selection | |
|
10000 | 535 |
|
16438 | 536 |
selection := self listSelection value. |
537 |
selection size = 1 ifTrue:[selection anyOne rule class browse]. |
|
538 |
selection size > 1 ifTrue:[SystemBrowser |
|
539 |
browseClasses:(selection collect:[:e|e rule class]) |
|
540 |
label:'Rule classes']. |
|
541 |
! |
|
542 |
||
543 |
menuInspectRule |
|
10000 | 544 |
| selection | |
16438 | 545 |
|
10000 | 546 |
selection := self listSelection value. |
547 |
selection size = 1 ifTrue:[selection anyOne rule inspect]. |
|
548 |
selection size > 1 ifTrue:[(selection collect:[:e|e rule]) inspect]. |
|
16438 | 549 |
! |
10000 | 550 |
|
16438 | 551 |
runRuleAgain |
552 |
self selectedLintRules value do:[:eachRule | |
|
553 |
eachRule run. |
|
554 |
]. |
|
16442 | 555 |
"/ self updateList. |
556 |
self updateOutputGenerator |
|
10000 | 557 |
! ! |
558 |
||
559 |
!LintRuleList methodsFor:'private'! |
|
560 |
||
561 |
listEntryFor: anRBLintRule |
|
562 |
||
563 |
| entry | |
|
564 |
entry := ListEntry new |
|
565 |
rule: anRBLintRule; |
|
566 |
application: self; |
|
567 |
expand; |
|
568 |
yourself. |
|
569 |
^entry |
|
570 |
||
571 |
"Created: / 15-04-2010 / 18:59:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
17361 | 572 |
"Modified: / 25-08-2010 / 14:15:46 / Jan Vrany" |
10000 | 573 |
! |
574 |
||
575 |
makeDependent |
|
576 |
||
577 |
"nothing to do" |
|
578 |
||
579 |
"Created: / 02-02-2010 / 20:23:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
580 |
! |
|
581 |
||
582 |
makeIndependent |
|
583 |
||
584 |
"nothing to do" |
|
585 |
||
586 |
"Created: / 02-02-2010 / 20:23:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
587 |
! |
|
588 |
||
589 |
rules: rules includes: rule |
|
590 |
||
591 |
^rules contains: |
|
592 |
[:each| |
|
593 |
each class == rule class and: |
|
594 |
[each name = rule name]] |
|
595 |
||
17361 | 596 |
"Created: / 26-08-2010 / 12:04:04 / Jan Vrany" |
10000 | 597 |
! |
598 |
||
14855 | 599 |
setListValid:aBoolean |
14945 | 600 |
"/ listValid ifTrue:[ |
601 |
"/ aBoolean ifFalse:[self halt]. |
|
602 |
"/ ]. |
|
14855 | 603 |
listValid := aBoolean. |
604 |
! |
|
605 |
||
10000 | 606 |
updateList |
607 |
|generator filterS newList| |
|
608 |
||
609 |
generator := self inGeneratorHolder value. |
|
610 |
filterS := self filterHolder value. |
|
10455 | 611 |
filterS notEmptyOrNil ifTrue:[ |
612 |
(filterS startsWith: $*) ifFalse:[filterS := '*' , filterS]. |
|
613 |
(filterS endsWith: $*) ifFalse:[filterS := filterS , '*'] |
|
614 |
]. |
|
615 |
(generator isNil and:[self mode == #display]) ifTrue:[ |
|
616 |
generator := RBCompositeLintRule allRules flattened |
|
617 |
]. |
|
10000 | 618 |
newList := OrderedCollection new. |
619 |
generator do:[:rule | |
|
10455 | 620 |
rule flattened do: [:rule| |
14667 | 621 |
(filterS isEmptyOrNil |
17009 | 622 |
or:[(rule name matches: filterS caseSensitive:false) |
623 |
or:[rule class name matches: filterS caseSensitive:false]]) |
|
10455 | 624 |
ifTrue:[ |
625 |
newList add: (self listEntryFor:rule) |
|
626 |
] |
|
627 |
] |
|
628 |
]. |
|
16872 | 629 |
newList |
630 |
sort:[:a :b | |
|
631 |
|sevA sevB| |
|
632 |
||
633 |
sevA := a rule severityAsInteger. |
|
634 |
sevB := b rule severityAsInteger. |
|
635 |
(sevA > sevB) |
|
636 |
or:[ (sevA == sevB) and:[a rule name < b rule name]]. |
|
637 |
]. |
|
638 |
"/ newList sort:[:a :b | a name < b name]. |
|
10000 | 639 |
self listHolder value:newList. |
14855 | 640 |
self setListValid:true. |
10000 | 641 |
|
642 |
"Modified: / 22-07-2009 / 15:58:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
17361 | 643 |
"Modified: / 25-08-2010 / 13:35:58 / Jan Vrany" |
11381 | 644 |
"Modified: / 07-03-2012 / 18:06:50 / cg" |
14786
6761e919308a
Bugfix in selection handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14755
diff
changeset
|
645 |
"Modified: / 16-10-2014 / 23:57:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 646 |
! ! |
647 |
||
10499 | 648 |
!LintRuleList methodsFor:'queries'! |
649 |
||
650 |
supportsSearch |
|
651 |
||
652 |
^false |
|
653 |
||
654 |
"Created: / 04-08-2011 / 23:04:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
655 |
! ! |
|
656 |
||
10000 | 657 |
!LintRuleList methodsFor:'selection'! |
658 |
||
659 |
selectionAdd: rule |
|
660 |
||
661 |
self selection: |
|
662 |
(self selection addAll: rule flattened; yourself) |
|
663 |
||
17361 | 664 |
"Created: / 25-08-2010 / 13:34:57 / Jan Vrany" |
10000 | 665 |
! |
666 |
||
667 |
selectionIncludes: rule |
|
668 |
||
669 |
^self rules: self selection includes: rule |
|
670 |
||
17361 | 671 |
"Created: / 25-08-2010 / 13:30:14 / Jan Vrany" |
672 |
"Modified: / 26-08-2010 / 12:04:19 / Jan Vrany" |
|
10000 | 673 |
! |
674 |
||
675 |
selectionRemove: rule |
|
676 |
||
677 |
| sel rules | |
|
678 |
sel := self selection. |
|
679 |
rules := rule flattened. |
|
680 |
sel := sel reject: |
|
681 |
[:each|self rules: rules includes: each]. |
|
682 |
self selection: sel |
|
683 |
||
17361 | 684 |
"Created: / 25-08-2010 / 13:35:08 / Jan Vrany" |
685 |
"Modified: / 26-08-2010 / 12:05:06 / Jan Vrany" |
|
10000 | 686 |
! ! |
687 |
||
688 |
!LintRuleList::ListEntry class methodsFor:'instance creation'! |
|
689 |
||
690 |
change: aChange |
|
691 |
||
692 |
^self new change: aChange |
|
693 |
||
694 |
"Created: / 24-07-2009 / 22:43:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
695 |
! |
|
696 |
||
697 |
change: aChange application: anApplicationModel |
|
698 |
||
699 |
^self new change: aChange; application: anApplicationModel |
|
700 |
||
701 |
"Created: / 05-12-2009 / 14:16:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
702 |
! |
|
703 |
||
704 |
change: aChange parent: aChangeList |
|
705 |
||
706 |
^self new change: aChange; parent: aChangeList |
|
707 |
||
708 |
"Created: / 25-07-2009 / 23:33:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
709 |
! ! |
|
710 |
||
711 |
!LintRuleList::ListEntry methodsFor:'accessing'! |
|
712 |
||
713 |
application |
|
14169
d983f6273b6d
Fixed LintRileList>>selectionChanged so it works both in browser and in dialog. Bit hacky.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14165
diff
changeset
|
714 |
^ application notNil ifTrue:[application] ifFalse:[super application] |
10000 | 715 |
|
14169
d983f6273b6d
Fixed LintRileList>>selectionChanged so it works both in browser and in dialog. Bit hacky.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14165
diff
changeset
|
716 |
"Modified: / 28-03-2014 / 10:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 717 |
! |
718 |
||
719 |
application:anApplicationModel |
|
720 |
application := anApplicationModel. |
|
721 |
! |
|
722 |
||
723 |
checked |
|
724 |
||
725 |
^rule isComposite |
|
726 |
ifTrue:[self children anySatisfy:[:each|each checked]] |
|
727 |
ifFalse:[self application selectionIncludes: rule] |
|
728 |
||
729 |
"Modified: / 15-04-2010 / 20:59:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
17361 | 730 |
"Modified: / 25-08-2010 / 13:29:33 / Jan Vrany" |
10000 | 731 |
! |
732 |
||
733 |
checked:aBoolean |
|
734 |
||
735 |
| app | |
|
736 |
app := self application. |
|
737 |
aBoolean |
|
738 |
ifTrue: [app selectionAdd: rule] |
|
739 |
ifFalse:[app selectionRemove: rule] |
|
740 |
||
741 |
"Modified: / 15-04-2010 / 19:06:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
17361 | 742 |
"Modified: / 25-08-2010 / 13:35:29 / Jan Vrany" |
10000 | 743 |
! |
744 |
||
745 |
checkedRule |
|
746 |
||
747 |
self checked ifFalse:[^nil]. |
|
748 |
||
749 |
rule isComposite |
|
750 |
ifTrue: |
|
751 |
[^rule copy |
|
752 |
rules: (self children |
|
753 |
collect:[:entry|entry checkedRule] |
|
754 |
thenReject:[:rule|rule isNil]); |
|
755 |
yourself] |
|
756 |
ifFalse: |
|
757 |
[^rule] |
|
758 |
||
759 |
"Created: / 16-04-2010 / 12:06:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
760 |
! |
|
761 |
||
762 |
children |
|
14671 | 763 |
children ifNil:[ |
764 |
rule isComposite ifTrue: [ |
|
765 |
| app | |
|
766 |
||
767 |
app := self application. |
|
768 |
children := rule rules collect:[:eachRule | (app listEntryFor:eachRule) parent:self] |
|
769 |
] ifFalse: [ |
|
770 |
children := #() |
|
771 |
] |
|
772 |
]. |
|
10000 | 773 |
|
774 |
^ children |
|
775 |
||
776 |
"Created: / 25-07-2009 / 23:32:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
777 |
"Modified: / 15-04-2010 / 20:40:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
778 |
! |
|
779 |
||
780 |
failedClasses |
|
781 |
||
782 |
^rule failedClasses |
|
783 |
||
784 |
"Created: / 15-04-2010 / 19:10:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
785 |
! |
|
786 |
||
787 |
failedMethods |
|
788 |
||
789 |
^rule failedMethods |
|
790 |
||
791 |
"Created: / 15-04-2010 / 19:10:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
792 |
! |
|
793 |
||
794 |
failedMethodsInAnyOf: classes meta: meta |
|
795 |
||
796 |
^rule failedMethodsInAnyOf: classes meta: meta |
|
797 |
||
798 |
"Created: / 15-04-2010 / 19:11:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
799 |
! |
|
800 |
||
801 |
label |
|
16872 | 802 |
|s severity| |
803 |
||
804 |
s := rule displayString. |
|
805 |
(severity := rule severity) == #warning ifTrue:[ |
|
806 |
^ s withColor:Color orange. |
|
807 |
]. |
|
808 |
severity == #error ifTrue:[ |
|
809 |
^ s withColor:Color red. |
|
810 |
]. |
|
811 |
severity == #information ifFalse:[ |
|
812 |
self halt. |
|
813 |
]. |
|
814 |
^ s |
|
10000 | 815 |
|
816 |
"Modified: / 15-04-2010 / 18:44:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
817 |
! |
|
818 |
||
819 |
name |
|
820 |
||
821 |
^rule name |
|
822 |
||
823 |
"Created: / 15-04-2010 / 19:12:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
824 |
! |
|
825 |
||
826 |
rationale |
|
11315 | 827 |
^ rule rationaleWithAnchor |
10000 | 828 |
|
829 |
"Created: / 15-04-2010 / 19:10:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11315 | 830 |
"Modified: / 01-03-2012 / 20:58:50 / cg" |
10000 | 831 |
! |
832 |
||
11317 | 833 |
rationaleWithAnchor |
834 |
^ rule rationaleWithAnchor |
|
835 |
||
836 |
"Created: / 15-04-2010 / 19:10:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
837 |
"Modified: / 01-03-2012 / 20:58:50 / cg" |
|
838 |
"Created: / 02-03-2012 / 01:04:40 / cg" |
|
839 |
! |
|
840 |
||
10000 | 841 |
rule |
842 |
^ rule |
|
843 |
! |
|
844 |
||
845 |
rule:anRBLintRule |
|
846 |
rule := anRBLintRule. |
|
847 |
! |
|
848 |
||
849 |
x |
|
850 |
^ x ? 0 |
|
851 |
||
852 |
"Modified: / 15-04-2010 / 20:48:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
853 |
! ! |
|
854 |
||
855 |
!LintRuleList::ListEntry methodsFor:'displaying'! |
|
856 |
||
857 |
displayLabel:aLabel h:lH on:aGC x:newX y:y h:h |
|
16872 | 858 |
self displayLabel:aLabel h:lH on:aGC x:newX y:y h:h isHighlightedAsSelected:false |
10000 | 859 |
! |
860 |
||
15151 | 861 |
displayLabel:aLabel h:lH on:aGC x:newX y:y h:h isHighlightedAsSelected:isHighlightedAsSelected |
862 |
| cx icon app mode | |
|
863 |
||
864 |
cx := x := newX. |
|
865 |
app := self application. |
|
866 |
mode := app mode. |
|
867 |
mode ~~ #display ifTrue:[ |
|
868 |
mode == #select ifTrue:[ |
|
869 |
icon := self checked |
|
870 |
ifTrue:[app class checkedIcon] |
|
871 |
ifFalse:[app class uncheckedIcon]. |
|
872 |
] ifFalse:[ |
|
873 |
icon := self checked |
|
874 |
ifTrue:[app class checkedIconDisabled] |
|
875 |
ifFalse:[app class uncheckedIconDisabled]. |
|
876 |
]. |
|
877 |
icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2). |
|
878 |
cx := cx + 22."experimental value - this looks good" |
|
879 |
]. |
|
880 |
||
881 |
super displayLabel:aLabel h:lH on:aGC x:cx y:y h:h isHighlightedAsSelected:isHighlightedAsSelected |
|
882 |
||
883 |
"Modified (format): / 07-03-2012 / 20:08:02 / cg" |
|
884 |
"Modified: / 08-10-2014 / 22:56:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
885 |
! |
|
886 |
||
13320
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
887 |
displayOn:aGCOrStream |
10000 | 888 |
|
13320
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
889 |
"/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
17429 | 890 |
"/ old ST80 means: draw-yourself on a GC. |
13320
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
891 |
(aGCOrStream isStream) ifFalse:[ |
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
892 |
^ super displayOn:aGCOrStream |
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
893 |
]. |
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
894 |
|
13798 | 895 |
rule displayOn:aGCOrStream |
10000 | 896 |
|
897 |
"Created: / 15-04-2010 / 19:13:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13798 | 898 |
"Modified: / 29-11-2013 / 12:59:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
17429 | 899 |
"Modified (comment): / 22-02-2017 / 16:49:46 / cg" |
10000 | 900 |
! ! |
901 |
||
902 |
!LintRuleList class methodsFor:'documentation'! |
|
903 |
||
11300
b9accf9080e4
better rationale (link to class)
Claus Gittinger <cg@exept.de>
parents:
11297
diff
changeset
|
904 |
version |
16426 | 905 |
^ '$Header$' |
11300
b9accf9080e4
better rationale (link to class)
Claus Gittinger <cg@exept.de>
parents:
11297
diff
changeset
|
906 |
! |
b9accf9080e4
better rationale (link to class)
Claus Gittinger <cg@exept.de>
parents:
11297
diff
changeset
|
907 |
|
10000 | 908 |
version_CVS |
16426 | 909 |
^ '$Header$' |
10000 | 910 |
! |
911 |
||
912 |
version_SVN |
|
16426 | 913 |
^ '$Id$' |
10000 | 914 |
! ! |
13320
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
915 |