author | Claus Gittinger <cg@exept.de> |
Fri, 18 May 2018 04:26:05 +0200 | |
changeset 18134 | d345dd754f11 |
parent 17992 | 436e9dce9cbe |
permissions | -rw-r--r-- |
17992 | 1 |
"{ Encoding: utf8 }" |
2 |
||
10001 | 3 |
" |
10093 | 4 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
5 |
Copyright (c) 2009-2010 eXept Software AG |
|
10001 | 6 |
|
10093 | 7 |
Permission is hereby granted, free of charge, to any person |
8 |
obtaining a copy of this software and associated documentation |
|
9 |
files (the 'Software'), to deal in the Software without |
|
10 |
restriction, including without limitation the rights to use, |
|
11 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
12 |
copies of the Software, and to permit persons to whom the |
|
13 |
Software is furnished to do so, subject to the following |
|
14 |
conditions: |
|
15 |
||
16 |
The above copyright notice and this permission notice shall be |
|
17 |
included in all copies or substantial portions of the Software. |
|
18 |
||
19 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
20 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
21 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
22 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
23 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
24 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
25 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
26 |
OTHER DEALINGS IN THE SOFTWARE. |
|
10001 | 27 |
" |
28 |
"{ Package: 'stx:libtool' }" |
|
29 |
||
30 |
"{ NameSpace: Tools }" |
|
31 |
||
32 |
LintRuleList subclass:#HierarchicalLintRuleList |
|
33 |
instanceVariableNames:'' |
|
34 |
classVariableNames:'' |
|
35 |
poolDictionaries:'' |
|
36 |
category:'Interface-Lint' |
|
37 |
! |
|
38 |
||
39 |
!HierarchicalLintRuleList class methodsFor:'documentation'! |
|
40 |
||
41 |
copyright |
|
42 |
" |
|
10093 | 43 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
44 |
Copyright (c) 2009-2010 eXept Software AG |
|
45 |
||
46 |
Permission is hereby granted, free of charge, to any person |
|
47 |
obtaining a copy of this software and associated documentation |
|
48 |
files (the 'Software'), to deal in the Software without |
|
49 |
restriction, including without limitation the rights to use, |
|
50 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
51 |
copies of the Software, and to permit persons to whom the |
|
52 |
Software is furnished to do so, subject to the following |
|
53 |
conditions: |
|
10001 | 54 |
|
10093 | 55 |
The above copyright notice and this permission notice shall be |
56 |
included in all copies or substantial portions of the Software. |
|
57 |
||
58 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
59 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
60 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
61 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
62 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
63 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
64 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
65 |
OTHER DEALINGS IN THE SOFTWARE. |
|
10001 | 66 |
" |
67 |
! ! |
|
68 |
||
69 |
!HierarchicalLintRuleList class methodsFor:'interface specs'! |
|
70 |
||
71 |
windowSpec |
|
72 |
"This resource specification was automatically generated |
|
73 |
by the UIPainter of ST/X." |
|
74 |
||
75 |
"Do not manually edit this!! If it is corrupted, |
|
76 |
the UIPainter may not be able to read the specification." |
|
77 |
||
78 |
" |
|
79 |
UIPainter new openOnClass:Tools::HierarchicalLintRuleList andSelector:#windowSpec |
|
80 |
Tools::HierarchicalLintRuleList new openInterface:#windowSpec |
|
81 |
Tools::HierarchicalLintRuleList open |
|
82 |
" |
|
83 |
||
84 |
<resource: #canvas> |
|
85 |
||
86 |
^ |
|
16590 | 87 |
#(FullSpec |
88 |
name: windowSpec |
|
89 |
window: |
|
90 |
(WindowSpec |
|
91 |
label: 'SmallLintRuleList' |
|
92 |
name: 'SmallLintRuleList' |
|
93 |
min: (Point 10 10) |
|
94 |
bounds: (Rectangle 0 0 300 300) |
|
95 |
) |
|
96 |
component: |
|
97 |
(SpecCollection |
|
98 |
collection: ( |
|
99 |
(InputFieldSpec |
|
100 |
name: 'RuleFilter' |
|
101 |
layout: (LayoutFrame 0 0 0 0 0 1 30 0) |
|
102 |
model: filterHolder |
|
103 |
immediateAccept: true |
|
104 |
acceptOnReturn: true |
|
105 |
acceptOnTab: true |
|
106 |
acceptOnPointerLeave: true |
|
107 |
emptyFieldReplacementText: 'Rule Search' |
|
10001 | 108 |
) |
16590 | 109 |
(HierarchicalListViewSpec |
110 |
name: 'RuleList' |
|
111 |
layout: (LayoutFrame 0 0 30 0 0 1 0 1) |
|
112 |
model: listSelection |
|
113 |
hasHorizontalScrollBar: true |
|
114 |
hasVerticalScrollBar: true |
|
115 |
listModel: listHolder |
|
116 |
useIndex: false |
|
117 |
highlightMode: line |
|
118 |
showLines: false |
|
119 |
useDefaultIcons: false |
|
120 |
postBuildCallback: postBuildList: |
|
121 |
) |
|
122 |
) |
|
123 |
||
124 |
) |
|
125 |
) |
|
126 |
! ! |
|
127 |
||
128 |
!HierarchicalLintRuleList class methodsFor:'plugIn spec'! |
|
129 |
||
130 |
aspectSelectors |
|
131 |
"This resource specification was automatically generated |
|
132 |
by the UIPainter of ST/X." |
|
133 |
||
134 |
"Do not manually edit this. If it is corrupted, |
|
135 |
the UIPainter may not be able to read the specification." |
|
136 |
||
137 |
"Return a description of exported aspects; |
|
138 |
these can be connected to aspects of an embedding application |
|
139 |
(if this app is embedded in a subCanvas)." |
|
140 |
||
141 |
^ #( |
|
142 |
#environmentHolder |
|
143 |
#inGeneratorHolder |
|
144 |
#listSelection |
|
145 |
#modeHolder |
|
146 |
#outGeneratorHolder |
|
147 |
#selectionHolder |
|
148 |
). |
|
149 |
||
10001 | 150 |
! ! |
151 |
||
152 |
!HierarchicalLintRuleList methodsFor:'aspects'! |
|
153 |
||
154 |
listHolder |
|
155 |
listHolder isNil ifTrue:[ |
|
156 |
listHolder := (HierarchicalList new) |
|
157 |
showRoot:false; |
|
158 |
application:self; |
|
159 |
yourself |
|
160 |
]. |
|
161 |
^ listHolder |
|
162 |
||
163 |
"Created: / 15-04-2010 / 20:32:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
164 |
! ! |
|
165 |
||
166 |
!HierarchicalLintRuleList methodsFor:'private'! |
|
167 |
||
168 |
updateList |
|
169 |
|inGenerator filterS inRules root| |
|
170 |
||
17992 | 171 |
RBCompositeLintRule isNil ifTrue:[ |
172 |
^ self. |
|
173 |
]. |
|
174 |
||
10001 | 175 |
inGenerator := self inGeneratorHolder value. |
176 |
filterS := self filterHolder value. |
|
10457 | 177 |
filterS notEmptyOrNil ifTrue:[ |
178 |
(filterS startsWith: $*) ifFalse:[filterS := '*' , filterS]. |
|
179 |
(filterS endsWith: $*) ifFalse:[filterS := filterS , '*'] |
|
180 |
]. |
|
10001 | 181 |
(inGenerator isNil and: [self mode == #display]) |
182 |
ifTrue:[inGenerator := RBCompositeLintRule allRules rules ]. |
|
183 |
inRules := OrderedCollection new. |
|
10457 | 184 |
filterS isEmptyOrNil |
11392 | 185 |
ifTrue:[ |
186 |
inGenerator do:[:rule | inRules add:rule ]] |
|
187 |
ifFalse:[ |
|
188 |
inGenerator do:[:rule| |
|
189 |
rule flattened do:[:each| |
|
14668
2f6b48f6902a
class: Tools::HierarchicalLintRuleList
Claus Gittinger <cg@exept.de>
parents:
14035
diff
changeset
|
190 |
((each name matches: filterS caseSensitive: false) |
2f6b48f6902a
class: Tools::HierarchicalLintRuleList
Claus Gittinger <cg@exept.de>
parents:
14035
diff
changeset
|
191 |
or:[ (each class name matches: filterS caseSensitive: false) ]) |
11392 | 192 |
ifTrue: [inRules add: each]]]]. |
10001 | 193 |
root := (self |
194 |
listEntryFor:(RBCompositeLintRule rules:inRules name:'Rules')) |
|
195 |
parent:self listHolder; |
|
196 |
expand; |
|
197 |
yourself. |
|
198 |
root children do:[:e | |
|
199 |
e expand |
|
200 |
]. |
|
201 |
self listHolder root:root. |
|
14854
f7adeb3685e7
class: Tools::HierarchicalLintRuleList
Claus Gittinger <cg@exept.de>
parents:
14668
diff
changeset
|
202 |
self setListValid:true. |
10001 | 203 |
|
204 |
"Created: / 15-04-2010 / 20:39:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
205 |
"Modified: / 16-04-2010 / 09:51:44 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
17362 | 206 |
"Modified: / 25-08-2010 / 11:56:39 / Jan Vrany" |
11392 | 207 |
"Modified: / 08-03-2012 / 03:11:19 / cg" |
10001 | 208 |
! ! |
209 |
||
210 |
!HierarchicalLintRuleList class methodsFor:'documentation'! |
|
211 |
||
212 |
version_CVS |
|
16590 | 213 |
^ '$Header$' |
10001 | 214 |
! |
215 |
||
216 |
version_SVN |
|
16590 | 217 |
^ '$Id$' |
10001 | 218 |
! ! |
13443
7533db07ff7a
class: Tools::HierarchicalLintRuleList
Claus Gittinger <cg@exept.de>
parents:
11392
diff
changeset
|
219 |