author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Thu, 12 May 2016 08:33:55 +0200 | |
branch | jv |
changeset 16571 | cf319f2e56d0 |
parent 15843 | 1c2cf683dbd2 |
parent 16526 | 1510e5d4c2ad |
child 17379 | 028adf14bc05 |
permissions | -rw-r--r-- |
9999 | 1 |
" |
10094 | 2 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
3 |
Copyright (c) 2009-2010 eXept Software AG |
|
9999 | 4 |
|
10094 | 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. |
|
9999 | 25 |
" |
26 |
"{ Package: 'stx:libtool' }" |
|
27 |
||
28 |
"{ NameSpace: Tools }" |
|
29 |
||
30 |
ApplicationModel subclass:#LintRuleDetail |
|
14898
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
31 |
instanceVariableNames:'ruleHolder rationaleVisibleHolder rationalView |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
32 |
selectedMethodsHolder' |
10480 | 33 |
classVariableNames:'' |
34 |
poolDictionaries:'' |
|
35 |
category:'Interface-Lint' |
|
9999 | 36 |
! |
37 |
||
38 |
!LintRuleDetail class methodsFor:'documentation'! |
|
39 |
||
40 |
copyright |
|
41 |
" |
|
10094 | 42 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
43 |
Copyright (c) 2009-2010 eXept Software AG |
|
44 |
||
45 |
Permission is hereby granted, free of charge, to any person |
|
46 |
obtaining a copy of this software and associated documentation |
|
47 |
files (the 'Software'), to deal in the Software without |
|
48 |
restriction, including without limitation the rights to use, |
|
49 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
50 |
copies of the Software, and to permit persons to whom the |
|
51 |
Software is furnished to do so, subject to the following |
|
52 |
conditions: |
|
9999 | 53 |
|
10094 | 54 |
The above copyright notice and this permission notice shall be |
55 |
included in all copies or substantial portions of the Software. |
|
56 |
||
57 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
58 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
59 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
60 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
61 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
62 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
63 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
64 |
OTHER DEALINGS IN THE SOFTWARE. |
|
9999 | 65 |
" |
66 |
! ! |
|
67 |
||
10672 | 68 |
!LintRuleDetail class methodsFor:'help specs'! |
69 |
||
70 |
flyByHelpSpec |
|
71 |
"This resource specification was automatically generated |
|
72 |
by the UIHelpTool of ST/X." |
|
73 |
||
74 |
"Do not manually edit this!! If it is corrupted, |
|
75 |
the UIHelpTool may not be able to read the specification." |
|
76 |
||
77 |
" |
|
78 |
UIHelpTool openOnClass:Tools::LintRuleDetail |
|
79 |
" |
|
80 |
||
81 |
<resource: #help> |
|
82 |
||
83 |
^ super flyByHelpSpec addPairsFrom:#( |
|
84 |
||
85 |
#ruleName |
|
86 |
'Click to browse the lint rule' |
|
87 |
||
88 |
) |
|
89 |
||
90 |
"Created: / 07-09-2011 / 04:08:11 / cg" |
|
91 |
! ! |
|
92 |
||
9999 | 93 |
!LintRuleDetail class methodsFor:'interface specs'! |
94 |
||
95 |
windowSpec |
|
96 |
"This resource specification was automatically generated |
|
97 |
by the UIPainter of ST/X." |
|
98 |
||
99 |
"Do not manually edit this!! If it is corrupted, |
|
100 |
the UIPainter may not be able to read the specification." |
|
101 |
||
102 |
" |
|
103 |
UIPainter new openOnClass:Tools::LintRuleDetail andSelector:#windowSpec |
|
104 |
Tools::LintRuleDetail new openInterface:#windowSpec |
|
105 |
Tools::LintRuleDetail open |
|
106 |
" |
|
107 |
||
108 |
<resource: #canvas> |
|
109 |
||
10500 | 110 |
^ |
9999 | 111 |
#(FullSpec |
10500 | 112 |
name: windowSpec |
113 |
window: |
|
9999 | 114 |
(WindowSpec |
10500 | 115 |
label: 'SmalllintRuleDetail' |
116 |
name: 'SmalllintRuleDetail' |
|
117 |
min: (Point 10 10) |
|
118 |
bounds: (Rectangle 0 0 560 300) |
|
119 |
) |
|
120 |
component: |
|
9999 | 121 |
(SpecCollection |
10500 | 122 |
collection: ( |
123 |
(VerticalPanelViewSpec |
|
124 |
name: 'Panel' |
|
125 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1) |
|
126 |
horizontalLayout: fit |
|
127 |
verticalLayout: topSpaceFit |
|
128 |
horizontalSpace: 0 |
|
129 |
verticalSpace: 0 |
|
11299
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
130 |
ignoreInvisibleComponents: true |
10500 | 131 |
component: |
132 |
(SpecCollection |
|
133 |
collection: ( |
|
134 |
(ViewSpec |
|
135 |
name: 'Label' |
|
11299
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
136 |
visibilityChannel: false |
10500 | 137 |
component: |
138 |
(SpecCollection |
|
139 |
collection: ( |
|
10672 | 140 |
(LinkButtonSpec |
141 |
name: 'Button1' |
|
142 |
layout: (LayoutFrame 0 0 0 0 -150 1 30 0) |
|
143 |
activeHelpKey: ruleName |
|
10500 | 144 |
translateLabel: true |
145 |
labelChannel: ruleNameAspect |
|
146 |
adjust: left |
|
10672 | 147 |
model: browseLintRule |
10500 | 148 |
) |
149 |
(CheckBoxSpec |
|
150 |
label: 'Show Rationale' |
|
151 |
name: 'CheckBox1' |
|
152 |
layout: (LayoutFrame -150 1 0 0 0 1 30 0) |
|
153 |
model: rationaleVisibleHolder |
|
154 |
translateLabel: true |
|
155 |
) |
|
156 |
) |
|
157 |
||
158 |
) |
|
159 |
extent: (Point 560 30) |
|
160 |
) |
|
161 |
(HTMLViewSpec |
|
162 |
name: 'Rationale' |
|
163 |
level: 0 |
|
164 |
visibilityChannel: rationaleVisibleHolder |
|
165 |
hasHorizontalScrollBar: true |
|
166 |
hasVerticalScrollBar: true |
|
11299
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
167 |
backgroundColor: (Color 86.9993133440147 86.9993133440147 86.9993133440147) |
10500 | 168 |
htmlText: ruleRationaleAspect |
169 |
extent: (Point 560 270) |
|
170 |
postBuildCallback: setupHTMLView: |
|
171 |
) |
|
172 |
) |
|
173 |
||
174 |
) |
|
175 |
) |
|
176 |
) |
|
177 |
||
178 |
) |
|
9999 | 179 |
) |
180 |
! ! |
|
181 |
||
182 |
!LintRuleDetail class methodsFor:'plugIn spec'! |
|
183 |
||
184 |
aspectSelectors |
|
185 |
"This resource specification was automatically generated |
|
186 |
by the UIPainter of ST/X." |
|
187 |
||
188 |
"Do not manually edit this. If it is corrupted, |
|
189 |
the UIPainter may not be able to read the specification." |
|
190 |
||
191 |
"Return a description of exported aspects; |
|
192 |
these can be connected to aspects of an embedding application |
|
193 |
(if this app is embedded in a subCanvas)." |
|
194 |
||
195 |
^ #( |
|
10663
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
196 |
#ruleHolder |
11306 | 197 |
#ruleRationaleAspect |
14898
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
198 |
#selectedMethodsHolder |
9999 | 199 |
). |
200 |
||
11306 | 201 |
"Modified: / 01-03-2012 / 16:31:04 / cg" |
9999 | 202 |
! ! |
203 |
||
10672 | 204 |
!LintRuleDetail methodsFor:'actions'! |
205 |
||
206 |
browseLintRule |
|
207 |
|rule ruleClass sel| |
|
208 |
||
209 |
rule := self ruleHolder value. |
|
210 |
rule isNil ifTrue:[^ self]. |
|
211 |
ruleClass := rule class. |
|
212 |
(ruleClass implements:#rationale) ifTrue:[ |
|
213 |
sel := #rationale. |
|
214 |
]. |
|
13014
64e77f92badd
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
11314
diff
changeset
|
215 |
UserPreferences systemBrowserClass |
10672 | 216 |
openInClass:ruleClass selector:sel |
217 |
||
218 |
"Created: / 07-09-2011 / 04:09:38 / cg" |
|
219 |
! ! |
|
220 |
||
9999 | 221 |
!LintRuleDetail methodsFor:'aspects'! |
222 |
||
10473 | 223 |
rationaleVisibleHolder |
224 |
"return/create the 'rationaleVisibleHolder' value holder (automatically generated)" |
|
225 |
||
226 |
rationaleVisibleHolder isNil ifTrue:[ |
|
11299
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
227 |
rationaleVisibleHolder := ValueHolder with: true "false". |
10500 | 228 |
rationaleVisibleHolder addDependent:self. |
10473 | 229 |
]. |
230 |
^ rationaleVisibleHolder |
|
231 |
||
232 |
"Modified: / 04-08-2011 / 21:39:51 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11299
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
233 |
"Modified: / 01-03-2012 / 08:50:20 / cg" |
10473 | 234 |
! |
235 |
||
236 |
rationaleVisibleHolder:something |
|
237 |
"set the 'rationaleVisibleHolder' value holder (automatically generated)" |
|
238 |
||
239 |
|oldValue newValue| |
|
240 |
||
241 |
rationaleVisibleHolder notNil ifTrue:[ |
|
10500 | 242 |
oldValue := rationaleVisibleHolder value. |
243 |
rationaleVisibleHolder removeDependent:self. |
|
10473 | 244 |
]. |
245 |
rationaleVisibleHolder := something. |
|
246 |
rationaleVisibleHolder notNil ifTrue:[ |
|
10500 | 247 |
rationaleVisibleHolder addDependent:self. |
10473 | 248 |
]. |
249 |
newValue := rationaleVisibleHolder value. |
|
250 |
oldValue ~~ newValue ifTrue:[ |
|
10500 | 251 |
self update:#value with:newValue from:rationaleVisibleHolder. |
10473 | 252 |
]. |
253 |
! |
|
254 |
||
9999 | 255 |
ruleHolder |
256 |
"return/create the 'ruleHolder' value holder (automatically generated)" |
|
257 |
||
258 |
ruleHolder isNil ifTrue:[ |
|
11299
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
259 |
ruleHolder := ValueHolder new. |
9999 | 260 |
]. |
261 |
^ ruleHolder |
|
11299
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
262 |
|
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
263 |
"Modified: / 01-03-2012 / 08:51:03 / cg" |
9999 | 264 |
! |
265 |
||
10473 | 266 |
ruleHolder:something |
9999 | 267 |
"set the 'ruleHolder' value holder (automatically generated)" |
268 |
||
10473 | 269 |
|oldValue newValue| |
270 |
||
271 |
ruleHolder notNil ifTrue:[ |
|
11306 | 272 |
oldValue := ruleHolder value. |
273 |
ruleHolder removeDependent:self. |
|
10473 | 274 |
]. |
275 |
ruleHolder := something. |
|
276 |
ruleHolder notNil ifTrue:[ |
|
11306 | 277 |
ruleHolder addDependent:self. |
10473 | 278 |
]. |
279 |
newValue := ruleHolder value. |
|
280 |
oldValue ~~ newValue ifTrue:[ |
|
11306 | 281 |
self update:#value with:newValue from:ruleHolder. |
10473 | 282 |
]. |
11306 | 283 |
|
284 |
"Modified: / 01-03-2012 / 15:29:30 / cg" |
|
9999 | 285 |
! |
286 |
||
287 |
ruleNameAspect |
|
288 |
<resource: #uiAspect> |
|
289 |
||
290 |
|holder| |
|
291 |
||
292 |
(holder := builder bindingAt:#ruleNameAspect) isNil ifTrue:[ |
|
10672 | 293 |
holder := BlockValue |
10673 | 294 |
with:[:h | |
295 |
"/ h displayString , ' ' , (('[browse]' actionForAll:[ self browseLintRule]) colorizeAllWith:Color blue) |
|
16526 | 296 |
(h ? '') displayString asActionLinkTo:[ self browseLintRule ] |
10673 | 297 |
] |
10672 | 298 |
argument: self ruleHolder. |
299 |
builder aspectAt:#ruleNameAspect put:holder. |
|
9999 | 300 |
]. |
301 |
^ holder. |
|
302 |
||
303 |
"Modified: / 05-02-2010 / 12:51:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11299
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
304 |
"Modified: / 01-03-2012 / 08:44:23 / cg" |
9999 | 305 |
! |
306 |
||
307 |
ruleRationaleAspect |
|
308 |
<resource: #uiAspect> |
|
309 |
||
310 |
|holder| |
|
311 |
||
312 |
(holder := builder bindingAt:#ruleRationaleAspect) isNil ifTrue:[ |
|
11306 | 313 |
"cannot use a BlockValue linked on the ruleHolder for the |
314 |
ruleRationaleAspect, because the ruleHolder maight be changed dynamically |
|
315 |
via the aspect-linking mechanism" |
|
316 |
"/ holder := (AspectAdaptor forAspect: #rationale) subjectChannel: self ruleHolder. |
|
317 |
holder := '' asValue. |
|
10672 | 318 |
builder aspectAt:#ruleRationaleAspect put:holder. |
9999 | 319 |
]. |
320 |
^ holder. |
|
321 |
||
322 |
"Modified: / 05-02-2010 / 12:51:42 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11306 | 323 |
"Modified: / 01-03-2012 / 15:29:16 / cg" |
14898
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
324 |
! |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
325 |
|
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
326 |
selectedMethodsHolder |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
327 |
"return/create the 'selectedMethodsHolder' value holder (automatically generated)" |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
328 |
|
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
329 |
selectedMethodsHolder isNil ifTrue:[ |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
330 |
selectedMethodsHolder := #() asValue. |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
331 |
selectedMethodsHolder addDependent:self. |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
332 |
]. |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
333 |
^ selectedMethodsHolder |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
334 |
! |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
335 |
|
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
336 |
selectedMethodsHolder:something |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
337 |
"set the 'selectedMethodsHolder' value holder (automatically generated)" |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
338 |
|
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
339 |
|oldValue newValue| |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
340 |
|
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
341 |
selectedMethodsHolder notNil ifTrue:[ |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
342 |
oldValue := selectedMethodsHolder value. |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
343 |
selectedMethodsHolder removeDependent:self. |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
344 |
]. |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
345 |
selectedMethodsHolder := something. |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
346 |
selectedMethodsHolder notNil ifTrue:[ |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
347 |
selectedMethodsHolder addDependent:self. |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
348 |
]. |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
349 |
newValue := selectedMethodsHolder value. |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
350 |
oldValue ~= newValue ifTrue:[ |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
351 |
self update:#value with:newValue from:selectedMethodsHolder. |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
352 |
]. |
9999 | 353 |
! ! |
354 |
||
10473 | 355 |
!LintRuleDetail methodsFor:'change & update'! |
356 |
||
357 |
update:something with:aParameter from:changedObject |
|
358 |
"Invoked when an object that I depend upon sends a change notification." |
|
359 |
||
360 |
changedObject == ruleHolder ifTrue:[ |
|
10500 | 361 |
self updateVisibility. |
11306 | 362 |
self updateRule. |
10500 | 363 |
^ self. |
10473 | 364 |
]. |
365 |
changedObject == rationaleVisibleHolder ifTrue:[ |
|
10500 | 366 |
self updateVisibility. |
367 |
^ self. |
|
10473 | 368 |
]. |
14898
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
369 |
changedObject == selectedMethodsHolder ifTrue:[ |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
370 |
"/ cg: preparations to show method-specific text in rationale/detail |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
371 |
"/ view. Not yet done... |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
372 |
]. |
c786afd145ce
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
13014
diff
changeset
|
373 |
|
10473 | 374 |
super update:something with:aParameter from:changedObject |
375 |
||
376 |
"Modified: / 04-08-2011 / 21:31:13 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11306 | 377 |
"Modified: / 01-03-2012 / 15:27:38 / cg" |
378 |
! |
|
379 |
||
380 |
updateRule |
|
381 |
"cannot use a BlockValue linked on the ruleHolder for the |
|
382 |
ruleRationaleAspect, because the ruleHolder maight be changed dynamically |
|
383 |
via the aspect-linking mechanism" |
|
384 |
||
385 |
|rule| |
|
386 |
||
387 |
rule := self ruleHolder value. |
|
11314 | 388 |
self ruleRationaleAspect value: (rule isNil ifTrue:[''] ifFalse:[rule rationaleWithAnchor]). |
11306 | 389 |
|
390 |
"Created: / 01-03-2012 / 15:28:18 / cg" |
|
10473 | 391 |
! |
392 |
||
393 |
updateVisibility |
|
394 |
||
10480 | 395 |
self ruleHolder value notNil |
10663
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
396 |
ifTrue:[self show] |
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
397 |
ifFalse:[self hide]. |
10473 | 398 |
|
399 |
"Created: / 04-08-2011 / 16:39:09 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10663
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
400 |
"Modified: / 04-09-2011 / 20:18:48 / cg" |
10473 | 401 |
! ! |
402 |
||
10500 | 403 |
!LintRuleDetail methodsFor:'initialization'! |
404 |
||
405 |
setupHTMLView:aView |
|
10671 | 406 |
rationalView := aView. |
15837
95f2b67f68e8
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
14898
diff
changeset
|
407 |
rationalView linkActionPerformer:self. |
10500 | 408 |
aView painter |
10671 | 409 |
leftMargin:20; |
410 |
topMargin:5. |
|
10500 | 411 |
|
412 |
"Created: / 04-08-2011 / 18:00:36 / cg" |
|
413 |
! ! |
|
414 |
||
10473 | 415 |
!LintRuleDetail methodsFor:'private'! |
416 |
||
10671 | 417 |
heightWhenNotShowingRationale |
418 |
^ 30 |
|
419 |
||
420 |
"Created: / 07-09-2011 / 04:02:34 / cg" |
|
421 |
! |
|
422 |
||
423 |
heightWhenShowingRationale |
|
424 |
^ 100 |
|
425 |
||
426 |
"Created: / 07-09-2011 / 04:02:24 / cg" |
|
427 |
! |
|
428 |
||
10473 | 429 |
hide |
430 |
||
431 |
self visibility: false height: 0 |
|
432 |
||
433 |
"Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
434 |
! |
|
435 |
||
436 |
show |
|
10671 | 437 |
self |
438 |
visibility: true |
|
439 |
height: (self rationaleVisibleHolder value |
|
440 |
ifTrue:[ self heightWhenShowingRationale ] |
|
441 |
ifFalse:[ self heightWhenNotShowingRationale ]) |
|
10473 | 442 |
|
443 |
"Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
10671 | 444 |
"Modified: / 07-09-2011 / 04:03:07 / cg" |
10473 | 445 |
! |
446 |
||
447 |
visibility: visibility height: height |
|
448 |
| container list detail h | |
|
10663
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
449 |
|
11299
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
450 |
"/ cg: the whole conatiner-container access chains below is ugly - use a name to access components. |
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
451 |
"/ and also: there is no layout in list, so the code does crash. |
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
452 |
"/ I disabled the whole visibility stuff. |
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
453 |
^ self. |
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
454 |
|
10663
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
455 |
(container := self window container) isNil ifTrue:[^self]. |
10473 | 456 |
h := visibility ifFalse:[0] ifTrue:[height]. |
457 |
||
10663
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
458 |
container isVisible == visibility ifFalse: [ |
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
459 |
container isVisible: visibility |
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
460 |
]. |
10473 | 461 |
|
462 |
list := container container subViews first. |
|
463 |
detail := container container subViews second. |
|
464 |
||
10663
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
465 |
(list layout bottomOffset ~= height negated) ifTrue:[ |
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
466 |
list layout: (list layout bottomOffset: height negated; yourself) |
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
467 |
]. |
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
468 |
(detail layout topOffset ~= height negated) ifTrue:[ |
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
469 |
detail layout: (detail layout topOffset: height negated; yourself) |
32e84728c885
comment/format in: #updateVisibility
Claus Gittinger <cg@exept.de>
parents:
10500
diff
changeset
|
470 |
]. |
10473 | 471 |
|
472 |
"Created: / 11-03-2010 / 09:51:26 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
11299
3e8397061396
fix: visibility switch and rationale did not work
Claus Gittinger <cg@exept.de>
parents:
10673
diff
changeset
|
473 |
"Modified: / 01-03-2012 / 10:35:51 / cg" |
10480 | 474 |
! ! |
10473 | 475 |
|
9999 | 476 |
!LintRuleDetail class methodsFor:'documentation'! |
477 |
||
10672 | 478 |
version |
15837
95f2b67f68e8
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
14898
diff
changeset
|
479 |
^ '$Header$' |
10672 | 480 |
! |
481 |
||
9999 | 482 |
version_CVS |
15837
95f2b67f68e8
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
14898
diff
changeset
|
483 |
^ '$Header$' |
9999 | 484 |
! |
485 |
||
486 |
version_SVN |
|
15837
95f2b67f68e8
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
14898
diff
changeset
|
487 |
^ '$Id$' |
9999 | 488 |
! ! |
13014
64e77f92badd
class: Tools::LintRuleDetail
Claus Gittinger <cg@exept.de>
parents:
11314
diff
changeset
|
489 |