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
|
10001
|
178 |
ifTrue:
|
|
179 |
[inGenerator do:[:rule | inRules add:rule ]]
|
|
180 |
ifFalse:
|
|
181 |
[inGenerator do:
|
|
182 |
[:rule|
|
|
183 |
rule flattened do:
|
|
184 |
[:each|
|
10457
|
185 |
(filterS isEmptyOrNil
|
10001
|
186 |
or:[each name matches: filterS])
|
|
187 |
ifTrue:
|
|
188 |
[inRules add: each]]]].
|
|
189 |
root := (self
|
|
190 |
listEntryFor:(RBCompositeLintRule rules:inRules name:'Rules'))
|
|
191 |
parent:self listHolder;
|
|
192 |
expand;
|
|
193 |
yourself.
|
|
194 |
root children do:[:e |
|
|
195 |
e expand
|
|
196 |
].
|
|
197 |
self listHolder root:root.
|
|
198 |
listValid := true.
|
|
199 |
|
|
200 |
"Created: / 15-04-2010 / 20:39:30 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
201 |
"Modified: / 16-04-2010 / 09:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
|
202 |
"Modified: / 25-08-2010 / 11:56:39 / Jan Vrany <enter your email here>"
|
10457
|
203 |
"Modified: / 04-08-2011 / 21:21:05 / cg"
|
10001
|
204 |
! !
|
|
205 |
|
|
206 |
!HierarchicalLintRuleList class methodsFor:'documentation'!
|
|
207 |
|
|
208 |
version_CVS
|
10457
|
209 |
^ '$Header: /cvs/stx/stx/libtool/Tools__HierarchicalLintRuleList.st,v 1.3 2011-08-04 19:21:13 cg Exp $'
|
10001
|
210 |
!
|
|
211 |
|
|
212 |
version_SVN
|
|
213 |
^ '§Id: Tools__HierarchicalLintRuleList.st 7617 2010-08-25 12:56:19Z vranyj1 §'
|
|
214 |
! !
|