author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 21 Mar 2012 17:50:14 +0000 | |
branch | jv |
changeset 12205 | f210b6224ef0 |
parent 12128 | a7ff7d66ee85 |
child 12401 | 4714b9640528 |
permissions | -rw-r--r-- |
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: ( |
|
12205 | 130 |
(VariableVerticalPanelSpec |
131 |
name: 'VariableVerticalPanel1' |
|
10002 | 132 |
layout: (LayoutFrame 0 0 0 0 0 1 -30 1) |
133 |
component: |
|
134 |
(SpecCollection |
|
135 |
collection: ( |
|
136 |
(SubCanvasSpec |
|
137 |
name: 'RuleList' |
|
138 |
hasHorizontalScrollBar: false |
|
139 |
hasVerticalScrollBar: false |
|
140 |
majorKey: #'Tools::HierarchicalLintRuleList' |
|
141 |
subAspectHolders: |
|
142 |
(Array |
|
143 |
||
144 |
(SubChannelInfoSpec |
|
145 |
subAspect: inGeneratorHolder |
|
146 |
aspect: allRulesHolder |
|
147 |
) |
|
148 |
(SubChannelInfoSpec |
|
149 |
subAspect: listSelection |
|
150 |
aspect: listSelection |
|
151 |
) |
|
152 |
||
153 |
(SubChannelInfoSpec |
|
154 |
subAspect: modeHolder |
|
155 |
aspect: modeHolder |
|
156 |
) |
|
157 |
(SubChannelInfoSpec |
|
158 |
subAspect: outGeneratorHolder |
|
159 |
aspect: selectedRulesHolder |
|
160 |
) |
|
161 |
||
162 |
(SubChannelInfoSpec |
|
163 |
subAspect: selectionHolder |
|
164 |
aspect: selectionHolder |
|
165 |
) |
|
166 |
) |
|
167 |
createNewApplication: true |
|
168 |
createNewBuilder: true |
|
169 |
) |
|
170 |
(SubCanvasSpec |
|
171 |
name: 'RuleDesc' |
|
172 |
hasHorizontalScrollBar: false |
|
173 |
hasVerticalScrollBar: false |
|
174 |
majorKey: #'Tools::LintRuleDetail' |
|
175 |
subAspectHolders: |
|
176 |
(Array |
|
177 |
||
178 |
(SubChannelInfoSpec |
|
179 |
subAspect: ruleHolder |
|
12205 | 180 |
aspect: listSelection |
10002 | 181 |
) |
182 |
) |
|
183 |
createNewApplication: true |
|
184 |
createNewBuilder: true |
|
185 |
) |
|
186 |
) |
|
187 |
||
188 |
) |
|
12205 | 189 |
handles: (Any 0.808108108108108 1.0) |
10002 | 190 |
) |
191 |
(HorizontalPanelViewSpec |
|
192 |
name: 'BottonPanel' |
|
193 |
layout: (LayoutFrame 0 0 -30 1 0 1 0 1) |
|
194 |
horizontalLayout: fitSpace |
|
195 |
verticalLayout: center |
|
196 |
horizontalSpace: 3 |
|
197 |
verticalSpace: 3 |
|
198 |
reverseOrderIfOKAtLeft: true |
|
199 |
component: |
|
200 |
(SpecCollection |
|
201 |
collection: ( |
|
202 |
(ActionButtonSpec |
|
203 |
label: 'Cancel' |
|
204 |
name: 'CancelButton' |
|
205 |
translateLabel: true |
|
206 |
model: doCancel |
|
207 |
extent: (Point 295 22) |
|
208 |
) |
|
209 |
(ActionButtonSpec |
|
210 |
label: 'OK' |
|
211 |
name: 'OKButton' |
|
212 |
translateLabel: true |
|
213 |
model: doAccept |
|
12205 | 214 |
isDefault: true |
215 |
defaultable: true |
|
10002 | 216 |
extent: (Point 296 22) |
217 |
) |
|
218 |
) |
|
219 |
||
220 |
) |
|
221 |
) |
|
222 |
) |
|
223 |
||
224 |
) |
|
225 |
) |
|
12205 | 226 |
|
227 |
"Modified: / 01-03-2012 / 10:50:28 / cg" |
|
10002 | 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 |
|
12205 | 335 |
^ '§Header: /cvs/stx/stx/libtool/Tools__LintRuleSelectionDialog.st,v 1.3 2012/03/01 09:55:40 cg Exp §' |
10002 | 336 |
! |
337 |
||
338 |
version_SVN |
|
12205 | 339 |
^ '$Id: Tools__LintRuleSelectionDialog.st 7952 2012-03-21 17:50:14Z vranyj1 $' |
12123
4bde08cebd48
trunk branched into /branches/jv
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
10095
diff
changeset
|
340 |
! ! |