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