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