10002
|
1 |
"
|
10095
|
2 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague
|
|
3 |
Copyright (c) 2009-2010 eXept Software AG
|
10002
|
4 |
|
10095
|
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.
|
10002
|
25 |
"
|
|
26 |
"{ Package: 'stx:libtool' }"
|
|
27 |
|
|
28 |
"{ NameSpace: Tools }"
|
|
29 |
|
|
30 |
SimpleDialog subclass:#LintRuleSelectionDialog
|
|
31 |
instanceVariableNames:'selectedRulesHolder selectionHolder variablePanel relativeCorners
|
|
32 |
detailsShown listSelection'
|
|
33 |
classVariableNames:''
|
|
34 |
poolDictionaries:''
|
|
35 |
category:'Interface-Lint'
|
|
36 |
!
|
|
37 |
|
|
38 |
!LintRuleSelectionDialog class methodsFor:'documentation'!
|
|
39 |
|
|
40 |
copyright
|
|
41 |
"
|
10095
|
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:
|
10002
|
53 |
|
10095
|
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.
|
10002
|
65 |
"
|
|
66 |
!
|
|
67 |
|
|
68 |
documentation
|
|
69 |
"
|
|
70 |
documentation to be added.
|
|
71 |
|
|
72 |
[author:]
|
|
73 |
Jan Vrany (jv@neso)
|
|
74 |
|
|
75 |
[instance variables:]
|
|
76 |
|
|
77 |
[class variables:]
|
|
78 |
|
|
79 |
[see also:]
|
|
80 |
|
|
81 |
"
|
|
82 |
!
|
|
83 |
|
|
84 |
examples
|
|
85 |
"
|
|
86 |
Starting the application:
|
|
87 |
[exBegin]
|
|
88 |
Tools::LintRuleSelectionDialog open
|
|
89 |
|
|
90 |
[exEnd]
|
|
91 |
|
|
92 |
more examples to be added:
|
|
93 |
[exBegin]
|
|
94 |
... add code fragment for
|
|
95 |
... executable example here ...
|
|
96 |
[exEnd]
|
|
97 |
"
|
|
98 |
! !
|
|
99 |
|
|
100 |
!LintRuleSelectionDialog class methodsFor:'interface specs'!
|
|
101 |
|
|
102 |
windowSpec
|
|
103 |
"This resource specification was automatically generated
|
|
104 |
by the UIPainter of ST/X."
|
|
105 |
|
|
106 |
"Do not manually edit this!! If it is corrupted,
|
|
107 |
the UIPainter may not be able to read the specification."
|
|
108 |
|
|
109 |
"
|
|
110 |
UIPainter new openOnClass:Tools::LintRuleSelectionDialog andSelector:#windowSpec
|
|
111 |
Tools::LintRuleSelectionDialog new openInterface:#windowSpec
|
|
112 |
Tools::LintRuleSelectionDialog open
|
|
113 |
"
|
|
114 |
|
|
115 |
<resource: #canvas>
|
|
116 |
|
|
117 |
^
|
|
118 |
#(FullSpec
|
|
119 |
name: windowSpec
|
|
120 |
window:
|
|
121 |
(WindowSpec
|
|
122 |
label: 'Select Lint Rules'
|
|
123 |
name: 'Select Lint Rules'
|
|
124 |
min: (Point 10 10)
|
|
125 |
bounds: (Rectangle 0 0 600 400)
|
|
126 |
)
|
|
127 |
component:
|
|
128 |
(SpecCollection
|
|
129 |
collection: (
|
|
130 |
(VariableHorizontalPanelSpec
|
|
131 |
name: 'RulesAndDescriptions'
|
|
132 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1)
|
|
133 |
showHandle: true
|
|
134 |
snapMode: both
|
|
135 |
handlePosition: right
|
|
136 |
component:
|
|
137 |
(SpecCollection
|
|
138 |
collection: (
|
|
139 |
(SubCanvasSpec
|
|
140 |
name: 'RuleList'
|
|
141 |
hasHorizontalScrollBar: false
|
|
142 |
hasVerticalScrollBar: false
|
|
143 |
majorKey: #'Tools::HierarchicalLintRuleList'
|
|
144 |
subAspectHolders:
|
|
145 |
(Array
|
|
146 |
|
|
147 |
(SubChannelInfoSpec
|
|
148 |
subAspect: inGeneratorHolder
|
|
149 |
aspect: allRulesHolder
|
|
150 |
)
|
|
151 |
(SubChannelInfoSpec
|
|
152 |
subAspect: listSelection
|
|
153 |
aspect: listSelection
|
|
154 |
)
|
|
155 |
|
|
156 |
(SubChannelInfoSpec
|
|
157 |
subAspect: modeHolder
|
|
158 |
aspect: modeHolder
|
|
159 |
)
|
|
160 |
(SubChannelInfoSpec
|
|
161 |
subAspect: outGeneratorHolder
|
|
162 |
aspect: selectedRulesHolder
|
|
163 |
)
|
|
164 |
|
|
165 |
(SubChannelInfoSpec
|
|
166 |
subAspect: selectionHolder
|
|
167 |
aspect: selectionHolder
|
|
168 |
)
|
|
169 |
)
|
|
170 |
createNewApplication: true
|
|
171 |
createNewBuilder: true
|
|
172 |
)
|
|
173 |
(SubCanvasSpec
|
|
174 |
name: 'RuleDesc'
|
|
175 |
hasHorizontalScrollBar: false
|
|
176 |
hasVerticalScrollBar: false
|
|
177 |
majorKey: #'Tools::LintRuleDetail'
|
|
178 |
subAspectHolders:
|
|
179 |
(Array
|
|
180 |
|
|
181 |
(SubChannelInfoSpec
|
|
182 |
subAspect: ruleHolder
|
|
183 |
aspect: selectedRuleHolder
|
|
184 |
)
|
|
185 |
)
|
|
186 |
createNewApplication: true
|
|
187 |
createNewBuilder: true
|
|
188 |
)
|
|
189 |
)
|
|
190 |
|
|
191 |
)
|
|
192 |
handles: (Any 0.99 1.0)
|
|
193 |
postBuildCallback: postBuildVariablePanel:
|
|
194 |
)
|
|
195 |
(HorizontalPanelViewSpec
|
|
196 |
name: 'BottonPanel'
|
|
197 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1)
|
|
198 |
horizontalLayout: fitSpace
|
|
199 |
verticalLayout: center
|
|
200 |
horizontalSpace: 3
|
|
201 |
verticalSpace: 3
|
|
202 |
reverseOrderIfOKAtLeft: true
|
|
203 |
component:
|
|
204 |
(SpecCollection
|
|
205 |
collection: (
|
|
206 |
(ActionButtonSpec
|
|
207 |
label: 'Cancel'
|
|
208 |
name: 'CancelButton'
|
|
209 |
translateLabel: true
|
|
210 |
model: doCancel
|
|
211 |
extent: (Point 295 22)
|
|
212 |
)
|
|
213 |
(ActionButtonSpec
|
|
214 |
label: 'OK'
|
|
215 |
name: 'OKButton'
|
|
216 |
translateLabel: true
|
|
217 |
model: doAccept
|
|
218 |
extent: (Point 296 22)
|
|
219 |
)
|
|
220 |
)
|
|
221 |
|
|
222 |
)
|
|
223 |
)
|
|
224 |
)
|
|
225 |
|
|
226 |
)
|
|
227 |
)
|
|
228 |
! !
|
|
229 |
|
|
230 |
!LintRuleSelectionDialog methodsFor:'accessing'!
|
|
231 |
|
|
232 |
selection
|
|
233 |
|
|
234 |
^self selectionHolder value
|
|
235 |
|
|
236 |
"Created: / 25-08-2010 / 14:10:03 / Jan Vrany <enter your email here>"
|
|
237 |
!
|
|
238 |
|
|
239 |
selection: anObject
|
|
240 |
|
|
241 |
self selectionHolder value: anObject
|
|
242 |
|
|
243 |
"Created: / 25-08-2010 / 14:09:40 / Jan Vrany <enter your email here>"
|
|
244 |
!
|
|
245 |
|
|
246 |
selectionAsRule
|
|
247 |
|
|
248 |
^RBCompositeLintRule rules: self selection name: 'Selected rules'
|
|
249 |
|
|
250 |
"Created: / 25-08-2010 / 14:10:58 / Jan Vrany <enter your email here>"
|
|
251 |
! !
|
|
252 |
|
|
253 |
!LintRuleSelectionDialog methodsFor:'actions'!
|
|
254 |
|
|
255 |
hideResultView
|
|
256 |
|
|
257 |
detailsShown == true ifFalse:[^self].
|
|
258 |
|
|
259 |
variablePanel shown ifFalse:[^self].
|
|
260 |
|
|
261 |
relativeCorners := variablePanel relativeCorners.
|
|
262 |
|
|
263 |
variablePanel
|
|
264 |
relativeCorners:#( 0.99 1.0 );
|
|
265 |
resizeSubviews.
|
|
266 |
detailsShown := false.
|
|
267 |
|
|
268 |
"Created: / 10-02-2007 / 11:39:10 / janfrog"
|
|
269 |
"Modified: / 24-07-2010 / 15:30:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
270 |
!
|
|
271 |
|
|
272 |
showResultView
|
|
273 |
detailsShown == true ifTrue:[^self].
|
|
274 |
variablePanel
|
|
275 |
relativeCorners:relativeCorners ? #(0.5 1.0);
|
|
276 |
resizeSubviews.
|
|
277 |
detailsShown := true.
|
|
278 |
|
|
279 |
"Created: / 10-02-2007 / 11:38:26 / janfrog"
|
|
280 |
"Modified: / 24-07-2010 / 15:30:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
281 |
! !
|
|
282 |
|
|
283 |
!LintRuleSelectionDialog methodsFor:'aspects'!
|
|
284 |
|
|
285 |
allRulesHolder
|
|
286 |
|
|
287 |
^[(RBCompositeLintRule allRules) rules]
|
|
288 |
|
|
289 |
"Created: / 15-04-2010 / 20:09:09 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
290 |
!
|
|
291 |
|
|
292 |
listSelection
|
|
293 |
"return/create the 'listSelection' value holder (automatically generated)"
|
|
294 |
|
|
295 |
listSelection isNil ifTrue:[
|
|
296 |
listSelection := ValueHolder new.
|
|
297 |
].
|
|
298 |
^ listSelection
|
|
299 |
!
|
|
300 |
|
|
301 |
listSelection:something
|
|
302 |
"set the 'listSelection' value holder (automatically generated)"
|
|
303 |
|
|
304 |
listSelection := something.
|
|
305 |
!
|
|
306 |
|
|
307 |
modeHolder
|
|
308 |
|
|
309 |
^[#select]
|
|
310 |
|
|
311 |
"Created: / 15-04-2010 / 20:13:51 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
312 |
!
|
|
313 |
|
|
314 |
selectionHolder
|
|
315 |
"return/create the 'selectionHolder' value holder (automatically generated)"
|
|
316 |
|
|
317 |
selectionHolder isNil ifTrue:[
|
|
318 |
selectionHolder := ValueHolder new.
|
|
319 |
].
|
|
320 |
^ selectionHolder
|
|
321 |
! !
|
|
322 |
|
|
323 |
!LintRuleSelectionDialog methodsFor:'callbacks - post build'!
|
|
324 |
|
|
325 |
postBuildVariablePanel: aPanel
|
|
326 |
|
|
327 |
variablePanel := aPanel.
|
|
328 |
|
|
329 |
"Created: / 24-07-2010 / 15:05:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
330 |
! !
|
|
331 |
|
|
332 |
!LintRuleSelectionDialog class methodsFor:'documentation'!
|
|
333 |
|
|
334 |
version_CVS
|
10095
|
335 |
^ '$Header: /cvs/stx/stx/libtool/Tools__LintRuleSelectionDialog.st,v 1.2 2011-07-03 18:10:21 cg Exp $'
|
10002
|
336 |
!
|
|
337 |
|
|
338 |
version_SVN
|
|
339 |
^ '§Id: Tools__LintRuleSelectionDialog.st 7617 2010-08-25 12:56:19Z vranyj1 §'
|
|
340 |
! !
|