author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 21 Mar 2012 17:50:14 +0000 | |
branch | jv |
changeset 12205 | f210b6224ef0 |
parent 12170 | 6c9c4b7981ee |
child 12401 | 4714b9640528 |
permissions | -rw-r--r-- |
10001 | 1 |
" |
10093 | 2 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
3 |
Copyright (c) 2009-2010 eXept Software AG |
|
10001 | 4 |
|
10093 | 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. |
|
10001 | 25 |
" |
26 |
"{ Package: 'stx:libtool' }" |
|
27 |
||
28 |
"{ NameSpace: Tools }" |
|
29 |
||
30 |
LintRuleList subclass:#HierarchicalLintRuleList |
|
31 |
instanceVariableNames:'' |
|
32 |
classVariableNames:'' |
|
33 |
poolDictionaries:'' |
|
34 |
category:'Interface-Lint' |
|
35 |
! |
|
36 |
||
37 |
!HierarchicalLintRuleList class methodsFor:'documentation'! |
|
38 |
||
39 |
copyright |
|
40 |
" |
|
10093 | 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: |
|
10001 | 52 |
|
10093 | 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. |
|
10001 | 64 |
" |
65 |
! ! |
|
66 |
||
67 |
!HierarchicalLintRuleList 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::HierarchicalLintRuleList andSelector:#windowSpec |
|
78 |
Tools::HierarchicalLintRuleList new openInterface:#windowSpec |
|
79 |
Tools::HierarchicalLintRuleList open |
|
80 |
" |
|
81 |
||
82 |
<resource: #canvas> |
|
83 |
||
84 |
^ |
|
85 |
#(FullSpec |
|
86 |
name: windowSpec |
|
87 |
window: |
|
88 |
(WindowSpec |
|
89 |
label: 'SmallLintRuleList' |
|
90 |
name: 'SmallLintRuleList' |
|
91 |
min: (Point 10 10) |
|
92 |
bounds: (Rectangle 0 0 300 300) |
|
93 |
) |
|
94 |
component: |
|
95 |
(SpecCollection |
|
96 |
collection: ( |
|
97 |
(HierarchicalListViewSpec |
|
98 |
name: 'RuleList' |
|
99 |
layout: (LayoutFrame 0 0 23 0 0 1 0 1) |
|
100 |
model: listSelection |
|
101 |
hasHorizontalScrollBar: true |
|
102 |
hasVerticalScrollBar: true |
|
103 |
listModel: listHolder |
|
104 |
useIndex: false |
|
105 |
highlightMode: line |
|
106 |
showLines: false |
|
107 |
useDefaultIcons: false |
|
108 |
postBuildCallback: postBuildList: |
|
109 |
) |
|
110 |
(InputFieldSpec |
|
111 |
name: 'RuleFilter' |
|
112 |
layout: (LayoutFrame 0 0 0 0 0 1 22 0) |
|
113 |
model: filterHolder |
|
114 |
immediateAccept: true |
|
115 |
acceptOnReturn: true |
|
116 |
acceptOnTab: true |
|
117 |
acceptOnPointerLeave: true |
|
118 |
emptyFieldReplacementText: 'Rule Search' |
|
119 |
) |
|
120 |
) |
|
121 |
||
122 |
) |
|
123 |
) |
|
124 |
! ! |
|
125 |
||
126 |
!HierarchicalLintRuleList class methodsFor:'plugIn spec'! |
|
127 |
||
128 |
aspectSelectors |
|
129 |
"This resource specification was automatically generated |
|
130 |
by the UIPainter of ST/X." |
|
131 |
||
132 |
"Do not manually edit this. If it is corrupted, |
|
133 |
the UIPainter may not be able to read the specification." |
|
134 |
||
135 |
"Return a description of exported aspects; |
|
136 |
these can be connected to aspects of an embedding application |
|
137 |
(if this app is embedded in a subCanvas)." |
|
138 |
||
139 |
^ #( |
|
140 |
#inGeneratorHolder |
|
141 |
#listSelection |
|
142 |
#modeHolder |
|
143 |
#outGeneratorHolder |
|
144 |
#selectionHolder |
|
145 |
). |
|
146 |
||
147 |
! ! |
|
148 |
||
149 |
!HierarchicalLintRuleList methodsFor:'aspects'! |
|
150 |
||
151 |
listHolder |
|
152 |
listHolder isNil ifTrue:[ |
|
153 |
listHolder := (HierarchicalList new) |
|
154 |
showRoot:false; |
|
155 |
application:self; |
|
156 |
yourself |
|
157 |
]. |
|
158 |
^ listHolder |
|
159 |
||
160 |
"Created: / 15-04-2010 / 20:32:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
161 |
! ! |
|
162 |
||
163 |
!HierarchicalLintRuleList methodsFor:'private'! |
|
164 |
||
165 |
updateList |
|
166 |
|inGenerator filterS inRules root| |
|
167 |
||
168 |
inGenerator := self inGeneratorHolder value. |
|
169 |
filterS := self filterHolder value. |
|
10457 | 170 |
filterS notEmptyOrNil ifTrue:[ |
171 |
(filterS startsWith: $*) ifFalse:[filterS := '*' , filterS]. |
|
172 |
(filterS endsWith: $*) ifFalse:[filterS := filterS , '*'] |
|
173 |
]. |
|
10001 | 174 |
(inGenerator isNil and: [self mode == #display]) |
175 |
ifTrue:[inGenerator := RBCompositeLintRule allRules rules ]. |
|
176 |
inRules := OrderedCollection new. |
|
10457 | 177 |
filterS isEmptyOrNil |
12205 | 178 |
ifTrue:[ |
179 |
inGenerator do:[:rule | inRules add:rule ]] |
|
180 |
ifFalse:[ |
|
181 |
inGenerator do:[:rule| |
|
182 |
rule flattened do:[:each| |
|
183 |
(each name matches: filterS ignoreCase: true) |
|
184 |
ifTrue: [inRules add: each]]]]. |
|
10001 | 185 |
root := (self |
186 |
listEntryFor:(RBCompositeLintRule rules:inRules name:'Rules')) |
|
187 |
parent:self listHolder; |
|
188 |
expand; |
|
189 |
yourself. |
|
190 |
root children do:[:e | |
|
191 |
e expand |
|
192 |
]. |
|
193 |
self listHolder root:root. |
|
194 |
listValid := true. |
|
195 |
||
196 |
"Created: / 15-04-2010 / 20:39:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
197 |
"Modified: / 16-04-2010 / 09:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
198 |
"Modified: / 25-08-2010 / 11:56:39 / Jan Vrany <enter your email here>" |
|
12205 | 199 |
"Modified: / 08-03-2012 / 03:11:19 / cg" |
10001 | 200 |
! ! |
201 |
||
202 |
!HierarchicalLintRuleList class methodsFor:'documentation'! |
|
203 |
||
204 |
version_CVS |
|
12205 | 205 |
^ '§Header: /cvs/stx/stx/libtool/Tools__HierarchicalLintRuleList.st,v 1.4 2012/03/08 02:44:52 cg Exp §' |
10001 | 206 |
! |
207 |
||
208 |
version_SVN |
|
12205 | 209 |
^ '$Id: Tools__HierarchicalLintRuleList.st 7952 2012-03-21 17:50:14Z vranyj1 $' |
12170
6c9c4b7981ee
branch jv-experiments merged back
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
210 |
! ! |
6c9c4b7981ee
branch jv-experiments merged back
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12128
diff
changeset
|
211 |