author | Merge Script |
Sun, 15 May 2016 06:58:33 +0200 | |
branch | jv |
changeset 16596 | f111c3082dd1 |
parent 16445 | 6bc184e74f9c |
parent 16589 | dd0be6051d87 |
child 17132 | 17d361c666c2 |
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 |
^ |
|
16589 | 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 28 0) |
|
148 |
model: filterHolder |
|
149 |
immediateAccept: true |
|
150 |
acceptOnReturn: true |
|
151 |
acceptOnTab: true |
|
152 |
acceptOnPointerLeave: true |
|
153 |
emptyFieldReplacementText: 'Search...' |
|
10000 | 154 |
) |
16589 | 155 |
(SelectionInListModelViewSpec |
156 |
name: 'RuleList' |
|
157 |
layout: (LayoutFrame 0 0 28 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 |
) |
|
10000 | 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 |
|
16438 | 195 |
label: 'Run this Rule Again' |
196 |
itemValue: runRuleAgain |
|
197 |
) |
|
198 |
(MenuItem |
|
10000 | 199 |
label: '-' |
200 |
) |
|
201 |
(MenuItem |
|
16438 | 202 |
label: 'Inspect Rule' |
203 |
itemValue: menuInspectRule |
|
204 |
) |
|
205 |
(MenuItem |
|
206 |
label: 'Browse Rule Class' |
|
207 |
itemValue: menuBrowseRuleClass |
|
10000 | 208 |
) |
209 |
) |
|
210 |
nil |
|
211 |
nil |
|
212 |
) |
|
213 |
! ! |
|
214 |
||
215 |
!LintRuleList class methodsFor:'plugIn spec'! |
|
216 |
||
217 |
aspectSelectors |
|
218 |
"This resource specification was automatically generated |
|
219 |
by the UIPainter of ST/X." |
|
220 |
||
221 |
"Do not manually edit this. If it is corrupted, |
|
222 |
the UIPainter may not be able to read the specification." |
|
223 |
||
224 |
"Return a description of exported aspects; |
|
225 |
these can be connected to aspects of an embedding application |
|
226 |
(if this app is embedded in a subCanvas)." |
|
227 |
||
228 |
^ #( |
|
16589 | 229 |
#environmentHolder |
10000 | 230 |
#inGeneratorHolder |
13798 | 231 |
#listSelection |
10000 | 232 |
#modeHolder |
233 |
#outGeneratorHolder |
|
234 |
#selectionHolder |
|
235 |
). |
|
236 |
||
237 |
! ! |
|
238 |
||
239 |
!LintRuleList methodsFor:'accessing'! |
|
240 |
||
241 |
mode |
|
242 |
||
243 |
^self modeHolder value |
|
244 |
||
245 |
"Created: / 25-08-2010 / 11:33:51 / Jan Vrany <enter your email here>" |
|
246 |
! |
|
247 |
||
248 |
selection |
|
249 |
||
250 |
| sel | |
|
251 |
sel := self selectionHolder value. |
|
252 |
sel ifNil:[sel := Set new]. |
|
253 |
^sel |
|
254 |
||
255 |
"Created: / 25-08-2010 / 13:26:58 / Jan Vrany <enter your email here>" |
|
256 |
! |
|
257 |
||
258 |
selection: aCollectionOrNil |
|
259 |
||
260 |
| sel | |
|
261 |
sel := aCollectionOrNil |
|
262 |
ifNil:[Set new] |
|
263 |
ifNotNil:[aCollectionOrNil asSet]. |
|
264 |
||
13798 | 265 |
self selectionHolder value: sel. |
10000 | 266 |
|
267 |
"Created: / 25-08-2010 / 13:28:43 / Jan Vrany <enter your email here>" |
|
268 |
"Modified: / 25-08-2010 / 15:29:35 / Jan Vrany <enter your email here>" |
|
13798 | 269 |
"Modified: / 27-02-2013 / 23:33:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 270 |
! ! |
271 |
||
272 |
!LintRuleList methodsFor:'aspects'! |
|
273 |
||
274 |
filterHolder |
|
275 |
"return/create the 'filterHolder' value holder (automatically generated)" |
|
276 |
||
277 |
filterHolder isNil ifTrue:[ |
|
14978 | 278 |
filterHolder := LastNameFilter asValue. |
10000 | 279 |
filterHolder addDependent:self. |
280 |
]. |
|
281 |
^ filterHolder |
|
282 |
! |
|
283 |
||
284 |
filterHolder:something |
|
285 |
"set the 'filterHolder' value holder (automatically generated)" |
|
286 |
||
287 |
|oldValue newValue| |
|
288 |
||
289 |
filterHolder notNil ifTrue:[ |
|
290 |
oldValue := filterHolder value. |
|
291 |
filterHolder removeDependent:self. |
|
292 |
]. |
|
293 |
filterHolder := something. |
|
294 |
filterHolder notNil ifTrue:[ |
|
295 |
filterHolder addDependent:self. |
|
296 |
]. |
|
297 |
newValue := filterHolder value. |
|
298 |
oldValue ~~ newValue ifTrue:[ |
|
299 |
self update:#value with:newValue from:filterHolder. |
|
300 |
]. |
|
301 |
! |
|
302 |
||
303 |
listHolder |
|
304 |
"return/create the 'ruleList' value holder (automatically generated)" |
|
305 |
||
306 |
listHolder isNil ifTrue:[ |
|
307 |
listHolder := ValueHolder new. |
|
308 |
]. |
|
309 |
^ listHolder |
|
310 |
! |
|
311 |
||
312 |
listSelection |
|
313 |
"return/create the 'listSelection' value holder (automatically generated)" |
|
314 |
||
315 |
listSelection isNil ifTrue:[ |
|
316 |
listSelection := ValueHolder new. |
|
317 |
listSelection addDependent:self. |
|
318 |
]. |
|
319 |
^ listSelection |
|
320 |
! |
|
321 |
||
322 |
listSelection:something |
|
323 |
"set the 'listSelection' value holder (automatically generated)" |
|
324 |
||
325 |
|oldValue newValue| |
|
326 |
||
327 |
listSelection notNil ifTrue:[ |
|
328 |
oldValue := listSelection value. |
|
329 |
listSelection removeDependent:self. |
|
330 |
]. |
|
331 |
listSelection := something. |
|
332 |
listSelection notNil ifTrue:[ |
|
333 |
listSelection addDependent:self. |
|
334 |
]. |
|
335 |
newValue := listSelection value. |
|
336 |
oldValue ~~ newValue ifTrue:[ |
|
337 |
self update:#value with:newValue from:listSelection. |
|
338 |
]. |
|
339 |
! |
|
340 |
||
341 |
modeHolder |
|
16438 | 342 |
"the mode - can run in select or in display modes. |
343 |
select is to choose a set of rules; |
|
344 |
display for presentation of results (in a browser). |
|
345 |
See documentation for details" |
|
346 |
||
347 |
modeHolder isNil ifTrue:[ |
|
348 |
modeHolder := ValueHolder with: #display |
|
349 |
]. |
|
10000 | 350 |
^modeHolder |
351 |
||
352 |
"Modified: / 15-04-2010 / 20:56:36 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
353 |
! |
|
354 |
||
355 |
modeHolder:aValueModel |
|
16438 | 356 |
"the mode - can run in select or in display modes. |
357 |
select is to choose a set of rules; |
|
358 |
display for presentation of results (in a browser). |
|
359 |
See documentation for details" |
|
360 |
||
10000 | 361 |
modeHolder := aValueModel. |
362 |
! |
|
363 |
||
364 |
selectedLintRules |
|
365 |
^ self selectionHolder |
|
366 |
||
367 |
"Created: / 02-02-2010 / 20:43:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
368 |
! |
|
369 |
||
370 |
selectedLintRules: anObject |
|
371 |
^ self selectionHolder: anObject |
|
372 |
||
373 |
"Created: / 02-02-2010 / 20:43:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
374 |
! ! |
|
375 |
||
376 |
!LintRuleList methodsFor:'change & update'! |
|
377 |
||
378 |
delayedUpdate:something with:aParameter from:changedObject |
|
379 |
"Invoked when an object that I depend upon sends a change notification." |
|
380 |
||
381 |
changedObject == filterHolder ifTrue:[ |
|
14978 | 382 |
LastNameFilter := filterHolder value. |
10000 | 383 |
self updateList. |
384 |
^ self. |
|
385 |
]. |
|
386 |
||
387 |
(changedObject == listSelection) ifTrue:[ |
|
388 |
listValid ifFalse:[ |
|
389 |
self updateList. |
|
390 |
]. |
|
391 |
^ self selectionChanged |
|
392 |
]. |
|
393 |
||
10499 | 394 |
(changedObject == selectionHolder) ifTrue:[ |
13798 | 395 |
listView notNil ifTrue:[ |
396 |
listView invalidate |
|
397 |
]. |
|
10499 | 398 |
^self. |
399 |
]. |
|
400 |
||
401 |
||
10000 | 402 |
super delayedUpdate:something with:aParameter from:changedObject |
403 |
||
404 |
"Created: / 26-08-2010 / 11:43:33 / Jan Vrany <enter your email here>" |
|
13798 | 405 |
"Modified: / 27-02-2013 / 23:40:02 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10499 | 406 |
! |
407 |
||
14855 | 408 |
enqueueDelayedUpdateList |
409 |
super enqueueDelayedUpdateList |
|
410 |
! |
|
411 |
||
10499 | 412 |
selectionChanged |
413 |
||
16426 | 414 |
| 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
|
415 |
|
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
|
416 |
super selectionChanged. |
14786
6761e919308a
Bugfix in selection handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14755
diff
changeset
|
417 |
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
|
418 |
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
|
419 |
selection isEmptyOrNil ifTrue:[ |
16426 | 420 |
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
|
421 |
] ifFalse:[ |
16426 | 422 |
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
|
423 |
]. |
16426 | 424 |
self selectionHolder value: newSelection. |
14855 | 425 |
"/ 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
|
426 |
]. |
10499 | 427 |
|
428 |
"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
|
429 |
"Modified: / 17-10-2014 / 00:01:21 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 430 |
! ! |
431 |
||
432 |
!LintRuleList methodsFor:'event processing'! |
|
433 |
||
434 |
buttonPress:button x:x y:y view:aView |
|
435 |
||
436 |
| itemIndex item | |
|
437 |
||
16438 | 438 |
(button == 1 and:[self modeHolder value == #select]) ifFalse:[ |
439 |
^ aView buttonPress:button x:x y:y |
|
440 |
]. |
|
10000 | 441 |
|
442 |
itemIndex := aView yVisibleToLineNr:y. |
|
14755 | 443 |
itemIndex isNil ifTrue:[^self]. |
10000 | 444 |
itemIndex == 0 ifTrue:[^self]. |
445 |
itemIndex > aView list size ifTrue:[^self]. |
|
446 |
item := aView list at: itemIndex. |
|
447 |
||
448 |
((aView left + x) between: (item x) and: (item x + 16)) |
|
449 |
ifFalse:[^aView buttonPress:button x:x y:y]. |
|
450 |
||
451 |
item checked: item checked not. |
|
452 |
aView invalidate |
|
453 |
||
454 |
"Created: / 08-12-2009 / 14:12:38 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
14755 | 455 |
"Modified: / 13-10-2014 / 18:38:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 456 |
! |
457 |
||
458 |
handlesButtonPress:button inView:aView |
|
14923
7c189a24693c
class: Tools::LintRuleList
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14855
diff
changeset
|
459 |
^ listView == aView |
7c189a24693c
class: Tools::LintRuleList
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14855
diff
changeset
|
460 |
and:[ button == 1 |
7c189a24693c
class: Tools::LintRuleList
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14855
diff
changeset
|
461 |
and:[ self modeHolder value == #select ] ] |
10000 | 462 |
|
463 |
"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
|
464 |
"Modified: / 27-11-2014 / 09:18:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 465 |
! ! |
466 |
||
467 |
!LintRuleList methodsFor:'generators'! |
|
468 |
||
469 |
makeGenerator |
|
470 |
||
16426 | 471 |
self modeHolder value == #display ifTrue:[ |
472 |
^ Iterator |
|
473 |
on: [:whatToDo| |
|
474 |
self listSelection value ? #() do:[:each| |
|
475 |
each failedClasses do:whatToDo |
|
476 |
] |
|
477 |
] |
|
478 |
]. |
|
479 |
^ Iterator |
|
480 |
on: [:whatToDo| |
|
481 |
self selection do:[:rule| whatToDo value: rule] |
|
482 |
]. |
|
10000 | 483 |
|
484 |
"Modified: / 16-04-2010 / 12:13:08 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
485 |
"Modified: / 25-08-2010 / 13:39:51 / Jan Vrany <enter your email here>" |
|
486 |
! ! |
|
487 |
||
488 |
!LintRuleList methodsFor:'hooks'! |
|
489 |
||
490 |
commonPostOpen |
|
12035 | 491 |
super commonPostOpen. |
10000 | 492 |
self updateOutputGenerator. |
493 |
||
494 |
"Created: / 16-04-2010 / 11:53:34 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
495 |
! |
|
496 |
||
497 |
postBuildList: aView |
|
498 |
||
499 |
listView := aView scrolledView. |
|
500 |
listView delegate: self. |
|
501 |
||
502 |
"Created: / 08-12-2009 / 14:10:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
503 |
! ! |
|
504 |
||
505 |
!LintRuleList methodsFor:'initialization'! |
|
506 |
||
507 |
initialize |
|
14033
a8387e4a0a78
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13798
diff
changeset
|
508 |
| menu | |
10000 | 509 |
|
510 |
super initialize. |
|
16438 | 511 |
|
512 |
menuHolder := |
|
513 |
[ |
|
514 |
menu := self menuFor: #menu. |
|
515 |
menu isArray ifTrue:[ menu := Menu decodeFromLiteralArray: menu ]. |
|
516 |
menu |
|
517 |
]. |
|
518 |
||
14855 | 519 |
"/ self selection: Set new. |
10000 | 520 |
|
521 |
"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
|
522 |
"Modified: / 24-02-2014 / 12:00:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 523 |
! ! |
524 |
||
525 |
!LintRuleList methodsFor:'menu actions'! |
|
526 |
||
16438 | 527 |
menuBrowseRuleClass |
528 |
| selection | |
|
10000 | 529 |
|
16438 | 530 |
selection := self listSelection value. |
531 |
selection size = 1 ifTrue:[selection anyOne rule class browse]. |
|
532 |
selection size > 1 ifTrue:[SystemBrowser |
|
533 |
browseClasses:(selection collect:[:e|e rule class]) |
|
534 |
label:'Rule classes']. |
|
535 |
! |
|
536 |
||
537 |
menuInspectRule |
|
10000 | 538 |
| selection | |
16438 | 539 |
|
10000 | 540 |
selection := self listSelection value. |
541 |
selection size = 1 ifTrue:[selection anyOne rule inspect]. |
|
542 |
selection size > 1 ifTrue:[(selection collect:[:e|e rule]) inspect]. |
|
16438 | 543 |
! |
10000 | 544 |
|
16438 | 545 |
runRuleAgain |
546 |
self selectedLintRules value do:[:eachRule | |
|
547 |
eachRule run. |
|
548 |
]. |
|
16442 | 549 |
"/ self updateList. |
550 |
self updateOutputGenerator |
|
10000 | 551 |
! ! |
552 |
||
553 |
!LintRuleList methodsFor:'private'! |
|
554 |
||
555 |
listEntryFor: anRBLintRule |
|
556 |
||
557 |
| entry | |
|
558 |
entry := ListEntry new |
|
559 |
rule: anRBLintRule; |
|
560 |
application: self; |
|
561 |
expand; |
|
562 |
yourself. |
|
563 |
^entry |
|
564 |
||
565 |
"Created: / 15-04-2010 / 18:59:16 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
566 |
"Modified: / 25-08-2010 / 14:15:46 / Jan Vrany <enter your email here>" |
|
567 |
! |
|
568 |
||
569 |
makeDependent |
|
570 |
||
571 |
"nothing to do" |
|
572 |
||
573 |
"Created: / 02-02-2010 / 20:23:31 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
574 |
! |
|
575 |
||
576 |
makeIndependent |
|
577 |
||
578 |
"nothing to do" |
|
579 |
||
580 |
"Created: / 02-02-2010 / 20:23:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
581 |
! |
|
582 |
||
583 |
rules: rules includes: rule |
|
584 |
||
585 |
^rules contains: |
|
586 |
[:each| |
|
587 |
each class == rule class and: |
|
588 |
[each name = rule name]] |
|
589 |
||
590 |
"Created: / 26-08-2010 / 12:04:04 / Jan Vrany <enter your email here>" |
|
591 |
! |
|
592 |
||
14855 | 593 |
setListValid:aBoolean |
14945 | 594 |
"/ listValid ifTrue:[ |
595 |
"/ aBoolean ifFalse:[self halt]. |
|
596 |
"/ ]. |
|
14855 | 597 |
listValid := aBoolean. |
598 |
! |
|
599 |
||
10000 | 600 |
updateList |
601 |
|generator filterS newList| |
|
602 |
||
603 |
generator := self inGeneratorHolder value. |
|
604 |
filterS := self filterHolder value. |
|
10455 | 605 |
filterS notEmptyOrNil ifTrue:[ |
606 |
(filterS startsWith: $*) ifFalse:[filterS := '*' , filterS]. |
|
607 |
(filterS endsWith: $*) ifFalse:[filterS := filterS , '*'] |
|
608 |
]. |
|
609 |
(generator isNil and:[self mode == #display]) ifTrue:[ |
|
610 |
generator := RBCompositeLintRule allRules flattened |
|
611 |
]. |
|
10000 | 612 |
newList := OrderedCollection new. |
613 |
generator do:[:rule | |
|
10455 | 614 |
rule flattened do: [:rule| |
14667 | 615 |
(filterS isEmptyOrNil |
14786
6761e919308a
Bugfix in selection handling.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14755
diff
changeset
|
616 |
or:[(rule name matches: filterS) |
14667 | 617 |
or:[rule class name matches: filterS]]) |
10455 | 618 |
ifTrue:[ |
619 |
newList add: (self listEntryFor:rule) |
|
620 |
] |
|
621 |
] |
|
622 |
]. |
|
11381 | 623 |
newList sort:[:a :b | a name < b name]. |
10000 | 624 |
self listHolder value:newList. |
14855 | 625 |
self setListValid:true. |
10000 | 626 |
|
627 |
"Modified: / 22-07-2009 / 15:58:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
628 |
"Modified: / 25-08-2010 / 13:35:58 / Jan Vrany <enter your email here>" |
|
11381 | 629 |
"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
|
630 |
"Modified: / 16-10-2014 / 23:57:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 631 |
! ! |
632 |
||
10499 | 633 |
!LintRuleList methodsFor:'queries'! |
634 |
||
635 |
supportsSearch |
|
636 |
||
637 |
^false |
|
638 |
||
639 |
"Created: / 04-08-2011 / 23:04:39 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
640 |
! ! |
|
641 |
||
10000 | 642 |
!LintRuleList methodsFor:'selection'! |
643 |
||
644 |
selectionAdd: rule |
|
645 |
||
646 |
self selection: |
|
647 |
(self selection addAll: rule flattened; yourself) |
|
648 |
||
649 |
"Created: / 25-08-2010 / 13:34:57 / Jan Vrany <enter your email here>" |
|
650 |
! |
|
651 |
||
652 |
selectionIncludes: rule |
|
653 |
||
654 |
^self rules: self selection includes: rule |
|
655 |
||
656 |
"Created: / 25-08-2010 / 13:30:14 / Jan Vrany <enter your email here>" |
|
657 |
"Modified: / 26-08-2010 / 12:04:19 / Jan Vrany <enter your email here>" |
|
658 |
! |
|
659 |
||
660 |
selectionRemove: rule |
|
661 |
||
662 |
| sel rules | |
|
663 |
sel := self selection. |
|
664 |
rules := rule flattened. |
|
665 |
sel := sel reject: |
|
666 |
[:each|self rules: rules includes: each]. |
|
667 |
self selection: sel |
|
668 |
||
669 |
"Created: / 25-08-2010 / 13:35:08 / Jan Vrany <enter your email here>" |
|
670 |
"Modified: / 26-08-2010 / 12:05:06 / Jan Vrany <enter your email here>" |
|
671 |
! ! |
|
672 |
||
673 |
!LintRuleList::ListEntry class methodsFor:'instance creation'! |
|
674 |
||
675 |
change: aChange |
|
676 |
||
677 |
^self new change: aChange |
|
678 |
||
679 |
"Created: / 24-07-2009 / 22:43:41 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
680 |
! |
|
681 |
||
682 |
change: aChange application: anApplicationModel |
|
683 |
||
684 |
^self new change: aChange; application: anApplicationModel |
|
685 |
||
686 |
"Created: / 05-12-2009 / 14:16:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
687 |
! |
|
688 |
||
689 |
change: aChange parent: aChangeList |
|
690 |
||
691 |
^self new change: aChange; parent: aChangeList |
|
692 |
||
693 |
"Created: / 25-07-2009 / 23:33:00 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
694 |
! ! |
|
695 |
||
696 |
!LintRuleList::ListEntry methodsFor:'accessing'! |
|
697 |
||
698 |
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
|
699 |
^ application notNil ifTrue:[application] ifFalse:[super application] |
10000 | 700 |
|
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
|
701 |
"Modified: / 28-03-2014 / 10:36:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 702 |
! |
703 |
||
704 |
application:anApplicationModel |
|
705 |
application := anApplicationModel. |
|
706 |
! |
|
707 |
||
708 |
checked |
|
709 |
||
710 |
^rule isComposite |
|
711 |
ifTrue:[self children anySatisfy:[:each|each checked]] |
|
712 |
ifFalse:[self application selectionIncludes: rule] |
|
713 |
||
714 |
"Modified: / 15-04-2010 / 20:59:52 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
715 |
"Modified: / 25-08-2010 / 13:29:33 / Jan Vrany <enter your email here>" |
|
716 |
! |
|
717 |
||
718 |
checked:aBoolean |
|
719 |
||
720 |
| app | |
|
721 |
app := self application. |
|
722 |
aBoolean |
|
723 |
ifTrue: [app selectionAdd: rule] |
|
724 |
ifFalse:[app selectionRemove: rule] |
|
725 |
||
726 |
"Modified: / 15-04-2010 / 19:06:15 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
727 |
"Modified: / 25-08-2010 / 13:35:29 / Jan Vrany <enter your email here>" |
|
728 |
! |
|
729 |
||
730 |
checkedRule |
|
731 |
||
732 |
self checked ifFalse:[^nil]. |
|
733 |
||
734 |
rule isComposite |
|
735 |
ifTrue: |
|
736 |
[^rule copy |
|
737 |
rules: (self children |
|
738 |
collect:[:entry|entry checkedRule] |
|
739 |
thenReject:[:rule|rule isNil]); |
|
740 |
yourself] |
|
741 |
ifFalse: |
|
742 |
[^rule] |
|
743 |
||
744 |
"Created: / 16-04-2010 / 12:06:28 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
745 |
! |
|
746 |
||
747 |
children |
|
14671 | 748 |
children ifNil:[ |
749 |
rule isComposite ifTrue: [ |
|
750 |
| app | |
|
751 |
||
752 |
app := self application. |
|
753 |
children := rule rules collect:[:eachRule | (app listEntryFor:eachRule) parent:self] |
|
754 |
] ifFalse: [ |
|
755 |
children := #() |
|
756 |
] |
|
757 |
]. |
|
10000 | 758 |
|
759 |
^ children |
|
760 |
||
761 |
"Created: / 25-07-2009 / 23:32:39 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
762 |
"Modified: / 15-04-2010 / 20:40:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
763 |
! |
|
764 |
||
765 |
failedClasses |
|
766 |
||
767 |
^rule failedClasses |
|
768 |
||
769 |
"Created: / 15-04-2010 / 19:10:55 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
770 |
! |
|
771 |
||
772 |
failedMethods |
|
773 |
||
774 |
^rule failedMethods |
|
775 |
||
776 |
"Created: / 15-04-2010 / 19:10:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
777 |
! |
|
778 |
||
779 |
failedMethodsInAnyOf: classes meta: meta |
|
780 |
||
781 |
^rule failedMethodsInAnyOf: classes meta: meta |
|
782 |
||
783 |
"Created: / 15-04-2010 / 19:11:35 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
784 |
! |
|
785 |
||
786 |
label |
|
787 |
||
788 |
^rule displayString. |
|
789 |
||
790 |
"Modified: / 15-04-2010 / 18:44:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
791 |
! |
|
792 |
||
793 |
name |
|
794 |
||
795 |
^rule name |
|
796 |
||
797 |
"Created: / 15-04-2010 / 19:12:19 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
798 |
! |
|
799 |
||
800 |
rationale |
|
11315 | 801 |
^ rule rationaleWithAnchor |
10000 | 802 |
|
803 |
"Created: / 15-04-2010 / 19:10:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11315 | 804 |
"Modified: / 01-03-2012 / 20:58:50 / cg" |
10000 | 805 |
! |
806 |
||
11317 | 807 |
rationaleWithAnchor |
808 |
^ rule rationaleWithAnchor |
|
809 |
||
810 |
"Created: / 15-04-2010 / 19:10:20 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
811 |
"Modified: / 01-03-2012 / 20:58:50 / cg" |
|
812 |
"Created: / 02-03-2012 / 01:04:40 / cg" |
|
813 |
! |
|
814 |
||
10000 | 815 |
rule |
816 |
^ rule |
|
817 |
! |
|
818 |
||
819 |
rule:anRBLintRule |
|
820 |
rule := anRBLintRule. |
|
821 |
! |
|
822 |
||
823 |
x |
|
824 |
^ x ? 0 |
|
825 |
||
826 |
"Modified: / 15-04-2010 / 20:48:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
827 |
! ! |
|
828 |
||
829 |
!LintRuleList::ListEntry methodsFor:'displaying'! |
|
830 |
||
831 |
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
|
832 |
| cx icon app mode | |
10000 | 833 |
|
834 |
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
|
835 |
app := self application. |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
836 |
mode := app mode. |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
837 |
mode ~~ #display ifTrue:[ |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
838 |
mode == #select ifTrue:[ |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
839 |
icon := self checked |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
840 |
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
|
841 |
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
|
842 |
] ifFalse:[ |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
843 |
icon := self checked |
7905f58cb037
Do now allow ruleset editing in ruleset selection dialog.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
14671
diff
changeset
|
844 |
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
|
845 |
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
|
846 |
]. |
10000 | 847 |
icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2). |
11386 | 848 |
cx := cx + 22."experimental value - this looks good" |
849 |
]. |
|
10000 | 850 |
|
851 |
super displayLabel:aLabel h:lH on:aGC x:cx y:y h:h |
|
852 |
||
11386 | 853 |
"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
|
854 |
"Modified: / 08-10-2014 / 22:56:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 855 |
! |
856 |
||
15151 | 857 |
displayLabel:aLabel h:lH on:aGC x:newX y:y h:h isHighlightedAsSelected:isHighlightedAsSelected |
858 |
| cx icon app mode | |
|
859 |
||
860 |
cx := x := newX. |
|
861 |
app := self application. |
|
862 |
mode := app mode. |
|
863 |
mode ~~ #display ifTrue:[ |
|
864 |
mode == #select ifTrue:[ |
|
865 |
icon := self checked |
|
866 |
ifTrue:[app class checkedIcon] |
|
867 |
ifFalse:[app class uncheckedIcon]. |
|
868 |
] ifFalse:[ |
|
869 |
icon := self checked |
|
870 |
ifTrue:[app class checkedIconDisabled] |
|
871 |
ifFalse:[app class uncheckedIconDisabled]. |
|
872 |
]. |
|
873 |
icon displayOn: aGC x: cx y: y + (h / 2) - (icon height / 2). |
|
874 |
cx := cx + 22."experimental value - this looks good" |
|
875 |
]. |
|
876 |
||
877 |
super displayLabel:aLabel h:lH on:aGC x:cx y:y h:h isHighlightedAsSelected:isHighlightedAsSelected |
|
878 |
||
879 |
"Modified (format): / 07-03-2012 / 20:08:02 / cg" |
|
880 |
"Modified: / 08-10-2014 / 22:56:33 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
881 |
! |
|
882 |
||
13320
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
883 |
displayOn:aGCOrStream |
10000 | 884 |
|
13320
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
885 |
"/ 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
|
886 |
"/ 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
|
887 |
(aGCOrStream isStream) ifFalse:[ |
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
888 |
^ super displayOn:aGCOrStream |
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
889 |
]. |
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
890 |
|
13798 | 891 |
rule displayOn:aGCOrStream |
10000 | 892 |
|
893 |
"Created: / 15-04-2010 / 19:13:06 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
13798 | 894 |
"Modified: / 29-11-2013 / 12:59:23 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
10000 | 895 |
! ! |
896 |
||
897 |
!LintRuleList class methodsFor:'documentation'! |
|
898 |
||
11300
b9accf9080e4
better rationale (link to class)
Claus Gittinger <cg@exept.de>
parents:
11297
diff
changeset
|
899 |
version |
16426 | 900 |
^ '$Header$' |
11300
b9accf9080e4
better rationale (link to class)
Claus Gittinger <cg@exept.de>
parents:
11297
diff
changeset
|
901 |
! |
b9accf9080e4
better rationale (link to class)
Claus Gittinger <cg@exept.de>
parents:
11297
diff
changeset
|
902 |
|
10000 | 903 |
version_CVS |
16426 | 904 |
^ '$Header$' |
10000 | 905 |
! |
906 |
||
907 |
version_SVN |
|
16426 | 908 |
^ '$Id$' |
10000 | 909 |
! ! |
13320
3dd1b4cb9c39
Refactor to implement #displayOn:aGcOrStream instead of #displayString
Stefan Vogel <sv@exept.de>
parents:
12035
diff
changeset
|
910 |