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
|
10480
|
31 |
instanceVariableNames:'ruleHolder rationaleVisibleHolder'
|
|
32 |
classVariableNames:''
|
|
33 |
poolDictionaries:''
|
|
34 |
category:'Interface-Lint'
|
9999
|
35 |
!
|
|
36 |
|
|
37 |
!LintRuleDetail class methodsFor:'documentation'!
|
|
38 |
|
|
39 |
copyright
|
|
40 |
"
|
10094
|
41 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
|
|
42 |
Copyright (c) 2009-2010 eXept Software AG
|
|
43 |
|
|
44 |
Permission is hereby granted, free of charge, to any person
|
|
45 |
obtaining a copy of this software and associated documentation
|
|
46 |
files (the 'Software'), to deal in the Software without
|
|
47 |
restriction, including without limitation the rights to use,
|
|
48 |
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
49 |
copies of the Software, and to permit persons to whom the
|
|
50 |
Software is furnished to do so, subject to the following
|
|
51 |
conditions:
|
9999
|
52 |
|
10094
|
53 |
The above copyright notice and this permission notice shall be
|
|
54 |
included in all copies or substantial portions of the Software.
|
|
55 |
|
|
56 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
|
57 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
58 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
59 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
60 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
61 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
62 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
63 |
OTHER DEALINGS IN THE SOFTWARE.
|
9999
|
64 |
"
|
|
65 |
! !
|
|
66 |
|
|
67 |
!LintRuleDetail class methodsFor:'interface specs'!
|
|
68 |
|
|
69 |
windowSpec
|
|
70 |
"This resource specification was automatically generated
|
|
71 |
by the UIPainter of ST/X."
|
|
72 |
|
|
73 |
"Do not manually edit this!! If it is corrupted,
|
|
74 |
the UIPainter may not be able to read the specification."
|
|
75 |
|
|
76 |
"
|
|
77 |
UIPainter new openOnClass:Tools::LintRuleDetail andSelector:#windowSpec
|
|
78 |
Tools::LintRuleDetail new openInterface:#windowSpec
|
|
79 |
Tools::LintRuleDetail open
|
|
80 |
"
|
|
81 |
|
|
82 |
<resource: #canvas>
|
|
83 |
|
10480
|
84 |
^
|
9999
|
85 |
#(FullSpec
|
10480
|
86 |
name: windowSpec
|
|
87 |
window:
|
9999
|
88 |
(WindowSpec
|
10480
|
89 |
label: 'SmalllintRuleDetail'
|
|
90 |
name: 'SmalllintRuleDetail'
|
|
91 |
min: (Point 10 10)
|
|
92 |
bounds: (Rectangle 0 0 560 300)
|
|
93 |
)
|
|
94 |
component:
|
9999
|
95 |
(SpecCollection
|
10480
|
96 |
collection: (
|
|
97 |
(VerticalPanelViewSpec
|
|
98 |
name: 'Panel'
|
|
99 |
layout: (LayoutFrame 0 0 0 0 0 1 0 1)
|
|
100 |
horizontalLayout: fit
|
|
101 |
verticalLayout: topSpaceFit
|
|
102 |
horizontalSpace: 0
|
|
103 |
verticalSpace: 0
|
|
104 |
component:
|
|
105 |
(SpecCollection
|
|
106 |
collection: (
|
|
107 |
(ViewSpec
|
|
108 |
name: 'Label'
|
|
109 |
component:
|
|
110 |
(SpecCollection
|
|
111 |
collection: (
|
|
112 |
(LabelSpec
|
|
113 |
label: 'Name...'
|
|
114 |
name: 'Name'
|
|
115 |
layout: (LayoutFrame 20 0 0 0 -150 1 30 0)
|
|
116 |
translateLabel: true
|
|
117 |
labelChannel: ruleNameAspect
|
|
118 |
adjust: left
|
|
119 |
)
|
|
120 |
(CheckBoxSpec
|
|
121 |
label: 'Show Rationale'
|
|
122 |
name: 'CheckBox1'
|
|
123 |
layout: (LayoutFrame -150 1 0 0 0 1 30 0)
|
|
124 |
model: rationaleVisibleHolder
|
|
125 |
translateLabel: true
|
|
126 |
)
|
|
127 |
)
|
|
128 |
|
|
129 |
)
|
|
130 |
extent: (Point 560 30)
|
|
131 |
)
|
|
132 |
(HTMLViewSpec
|
|
133 |
name: 'Rationale'
|
|
134 |
level: 0
|
|
135 |
visibilityChannel: rationaleVisibleHolder
|
|
136 |
hasHorizontalScrollBar: true
|
|
137 |
hasVerticalScrollBar: true
|
|
138 |
htmlText: ruleRationaleAspect
|
|
139 |
extent: (Point 300 268)
|
|
140 |
postBuildCallback: setupHTMLView:
|
|
141 |
)
|
|
142 |
)
|
|
143 |
|
|
144 |
)
|
|
145 |
)
|
|
146 |
)
|
|
147 |
|
|
148 |
)
|
9999
|
149 |
)
|
|
150 |
! !
|
|
151 |
|
|
152 |
!LintRuleDetail class methodsFor:'plugIn spec'!
|
|
153 |
|
|
154 |
aspectSelectors
|
|
155 |
"This resource specification was automatically generated
|
|
156 |
by the UIPainter of ST/X."
|
|
157 |
|
|
158 |
"Do not manually edit this. If it is corrupted,
|
|
159 |
the UIPainter may not be able to read the specification."
|
|
160 |
|
|
161 |
"Return a description of exported aspects;
|
|
162 |
these can be connected to aspects of an embedding application
|
|
163 |
(if this app is embedded in a subCanvas)."
|
|
164 |
|
|
165 |
^ #(
|
10480
|
166 |
#ruleHolder
|
9999
|
167 |
).
|
|
168 |
|
|
169 |
! !
|
|
170 |
|
|
171 |
!LintRuleDetail methodsFor:'aspects'!
|
|
172 |
|
10473
|
173 |
rationaleVisibleHolder
|
|
174 |
"return/create the 'rationaleVisibleHolder' value holder (automatically generated)"
|
|
175 |
|
|
176 |
rationaleVisibleHolder isNil ifTrue:[
|
10480
|
177 |
rationaleVisibleHolder := ValueHolder with: false.
|
|
178 |
rationaleVisibleHolder addDependent:self.
|
10473
|
179 |
].
|
|
180 |
^ rationaleVisibleHolder
|
|
181 |
|
|
182 |
"Modified: / 04-08-2011 / 21:39:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
183 |
!
|
|
184 |
|
|
185 |
rationaleVisibleHolder:something
|
|
186 |
"set the 'rationaleVisibleHolder' value holder (automatically generated)"
|
|
187 |
|
|
188 |
|oldValue newValue|
|
|
189 |
|
|
190 |
rationaleVisibleHolder notNil ifTrue:[
|
10480
|
191 |
oldValue := rationaleVisibleHolder value.
|
|
192 |
rationaleVisibleHolder removeDependent:self.
|
10473
|
193 |
].
|
|
194 |
rationaleVisibleHolder := something.
|
|
195 |
rationaleVisibleHolder notNil ifTrue:[
|
10480
|
196 |
rationaleVisibleHolder addDependent:self.
|
10473
|
197 |
].
|
|
198 |
newValue := rationaleVisibleHolder value.
|
|
199 |
oldValue ~~ newValue ifTrue:[
|
10480
|
200 |
self update:#value with:newValue from:rationaleVisibleHolder.
|
10473
|
201 |
].
|
|
202 |
!
|
|
203 |
|
9999
|
204 |
ruleHolder
|
|
205 |
"return/create the 'ruleHolder' value holder (automatically generated)"
|
|
206 |
|
|
207 |
ruleHolder isNil ifTrue:[
|
10480
|
208 |
ruleHolder := ValueHolder new.
|
9999
|
209 |
].
|
|
210 |
^ ruleHolder
|
|
211 |
!
|
|
212 |
|
10473
|
213 |
ruleHolder:something
|
9999
|
214 |
"set the 'ruleHolder' value holder (automatically generated)"
|
|
215 |
|
10473
|
216 |
|oldValue newValue|
|
|
217 |
|
|
218 |
ruleHolder notNil ifTrue:[
|
10480
|
219 |
oldValue := ruleHolder value.
|
|
220 |
ruleHolder removeDependent:self.
|
10473
|
221 |
].
|
|
222 |
ruleHolder := something.
|
|
223 |
ruleHolder notNil ifTrue:[
|
10480
|
224 |
ruleHolder addDependent:self.
|
10473
|
225 |
].
|
|
226 |
newValue := ruleHolder value.
|
|
227 |
oldValue ~~ newValue ifTrue:[
|
10480
|
228 |
self update:#value with:newValue from:ruleHolder.
|
10473
|
229 |
].
|
9999
|
230 |
!
|
|
231 |
|
|
232 |
ruleNameAspect
|
|
233 |
<resource: #uiAspect>
|
|
234 |
|
|
235 |
|holder|
|
|
236 |
|
|
237 |
(holder := builder bindingAt:#ruleNameAspect) isNil ifTrue:[
|
10480
|
238 |
holder := (AspectAdaptor forAspect: #displayString) subjectChannel: self ruleHolder.
|
|
239 |
builder aspectAt:#ruleNameAspect put:holder.
|
9999
|
240 |
"/ holder addDependent:self.
|
|
241 |
"/ holder onChangeSend:#ruleNameAspectChanged to:self.
|
|
242 |
].
|
|
243 |
^ holder.
|
|
244 |
|
|
245 |
"Modified: / 05-02-2010 / 12:51:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
246 |
!
|
|
247 |
|
|
248 |
ruleRationaleAspect
|
|
249 |
<resource: #uiAspect>
|
|
250 |
|
|
251 |
|holder|
|
|
252 |
|
|
253 |
(holder := builder bindingAt:#ruleRationaleAspect) isNil ifTrue:[
|
10480
|
254 |
holder := (AspectAdaptor forAspect: #rationale) subjectChannel: self ruleHolder.
|
|
255 |
builder aspectAt:#ruleRationaleAspect put:holder.
|
9999
|
256 |
"/ holder addDependent:self.
|
|
257 |
"/ holder onChangeSend:#ruleRationaleAspectChanged to:self.
|
|
258 |
].
|
|
259 |
^ holder.
|
|
260 |
|
|
261 |
"Modified: / 05-02-2010 / 12:51:42 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
262 |
! !
|
|
263 |
|
10473
|
264 |
!LintRuleDetail methodsFor:'change & update'!
|
|
265 |
|
|
266 |
update:something with:aParameter from:changedObject
|
|
267 |
"Invoked when an object that I depend upon sends a change notification."
|
|
268 |
|
|
269 |
changedObject == ruleHolder ifTrue:[
|
10480
|
270 |
self updateVisibility.
|
|
271 |
^ self.
|
10473
|
272 |
].
|
|
273 |
changedObject == rationaleVisibleHolder ifTrue:[
|
10480
|
274 |
self updateVisibility.
|
|
275 |
^ self.
|
10473
|
276 |
].
|
|
277 |
super update:something with:aParameter from:changedObject
|
|
278 |
|
|
279 |
"Modified: / 04-08-2011 / 21:31:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
280 |
!
|
|
281 |
|
|
282 |
updateVisibility
|
|
283 |
|
10480
|
284 |
self ruleHolder value notNil
|
|
285 |
ifTrue:[self show]
|
|
286 |
ifFalse:[self hide]
|
10473
|
287 |
|
|
288 |
"Created: / 04-08-2011 / 16:39:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
289 |
! !
|
|
290 |
|
|
291 |
!LintRuleDetail methodsFor:'private'!
|
|
292 |
|
|
293 |
hide
|
|
294 |
|
|
295 |
self visibility: false height: 0
|
|
296 |
|
|
297 |
"Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
298 |
!
|
|
299 |
|
|
300 |
show
|
|
301 |
|
|
302 |
self visibility: true height: (self rationaleVisibleHolder value ifTrue:[130] ifFalse:[30])
|
|
303 |
|
|
304 |
"Created: / 11-03-2010 / 09:07:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
305 |
!
|
|
306 |
|
|
307 |
visibility: visibility height: height
|
|
308 |
| container list detail h |
|
|
309 |
(container := self window container) ifNil:[^self].
|
|
310 |
h := visibility ifFalse:[0] ifTrue:[height].
|
|
311 |
|
|
312 |
container isVisible == visibility ifFalse:
|
10480
|
313 |
[container isVisible: visibility].
|
10473
|
314 |
|
|
315 |
|
|
316 |
list := container container subViews first.
|
|
317 |
detail := container container subViews second.
|
|
318 |
|
|
319 |
(list layout bottomOffset ~= height negated) ifTrue:
|
10480
|
320 |
[list layout:
|
|
321 |
(list layout bottomOffset: height negated; yourself)].
|
10473
|
322 |
(detail layout topOffset ~= height negated) ifTrue:
|
10480
|
323 |
[detail layout:
|
|
324 |
(detail layout topOffset: height negated; yourself)].
|
10473
|
325 |
|
|
326 |
"Created: / 11-03-2010 / 09:51:26 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
10480
|
327 |
! !
|
10473
|
328 |
|
10456
|
329 |
!LintRuleDetail methodsFor:'initialization'!
|
|
330 |
|
|
331 |
setupHTMLView:aView
|
10480
|
332 |
aView painter
|
|
333 |
leftMargin:20;
|
|
334 |
topMargin:5.
|
10456
|
335 |
|
|
336 |
"Created: / 04-08-2011 / 18:00:36 / cg"
|
10473
|
337 |
|
10456
|
338 |
! !
|
|
339 |
|
9999
|
340 |
!LintRuleDetail class methodsFor:'documentation'!
|
|
341 |
|
|
342 |
version_CVS
|
10480
|
343 |
^ '$Header: /cvs/stx/stx/libtool/Tools__LintRuleDetail.st,v 1.5 2011-08-05 06:37:04 cg Exp $'
|
9999
|
344 |
!
|
|
345 |
|
|
346 |
version_SVN
|
|
347 |
^ '§Id: Tools__LintRuleDetail.st 7617 2010-08-25 12:56:19Z vranyj1 §'
|
|
348 |
! !
|