author | Jan Vrany <jan.vrany@labware.com> |
Fri, 01 Sep 2023 22:32:10 +0100 | |
branch | jv |
changeset 19646 | 235fea37201a |
parent 19631 | 7351a219f202 |
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 |
|
19630
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
4 |
Copyright (c) 2022 LabWare |
10001 | 5 |
|
10093 | 6 |
Permission is hereby granted, free of charge, to any person |
7 |
obtaining a copy of this software and associated documentation |
|
8 |
files (the 'Software'), to deal in the Software without |
|
9 |
restriction, including without limitation the rights to use, |
|
10 |
copy, modify, merge, publish, distribute, sublicense, and/or sell |
|
11 |
copies of the Software, and to permit persons to whom the |
|
12 |
Software is furnished to do so, subject to the following |
|
13 |
conditions: |
|
14 |
||
15 |
The above copyright notice and this permission notice shall be |
|
16 |
included in all copies or substantial portions of the Software. |
|
17 |
||
18 |
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, |
|
19 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES |
|
20 |
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
|
21 |
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT |
|
22 |
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, |
|
23 |
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
|
24 |
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
|
25 |
OTHER DEALINGS IN THE SOFTWARE. |
|
10001 | 26 |
" |
27 |
"{ Package: 'stx:libtool' }" |
|
28 |
||
29 |
"{ NameSpace: Tools }" |
|
30 |
||
31 |
LintRuleList subclass:#HierarchicalLintRuleList |
|
32 |
instanceVariableNames:'' |
|
33 |
classVariableNames:'' |
|
34 |
poolDictionaries:'' |
|
35 |
category:'Interface-Lint' |
|
36 |
! |
|
37 |
||
38 |
!HierarchicalLintRuleList class methodsFor:'documentation'! |
|
39 |
||
40 |
copyright |
|
41 |
" |
|
10093 | 42 |
Copyright (c) 2007-2010 Jan Vrany, SWING Research Group, Czech Technical University in Prague |
43 |
Copyright (c) 2009-2010 eXept Software AG |
|
19630
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
44 |
Copyright (c) 2022 LabWare |
10093 | 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 |
|
19630
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
107 |
emptyFieldReplacementText: 'Search pattern, prefix with # to match rule tags' |
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 |
) |
|
19630
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
126 |
|
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
127 |
"Modified: / 26-07-2022 / 11:47:47 / Jan Vrany <jan.vrany@labware.com>" |
16590 | 128 |
! ! |
129 |
||
130 |
!HierarchicalLintRuleList class methodsFor:'plugIn spec'! |
|
131 |
||
132 |
aspectSelectors |
|
133 |
"This resource specification was automatically generated |
|
134 |
by the UIPainter of ST/X." |
|
135 |
||
136 |
"Do not manually edit this. If it is corrupted, |
|
137 |
the UIPainter may not be able to read the specification." |
|
138 |
||
139 |
"Return a description of exported aspects; |
|
140 |
these can be connected to aspects of an embedding application |
|
141 |
(if this app is embedded in a subCanvas)." |
|
142 |
||
143 |
^ #( |
|
144 |
#environmentHolder |
|
145 |
#inGeneratorHolder |
|
146 |
#listSelection |
|
147 |
#modeHolder |
|
148 |
#outGeneratorHolder |
|
149 |
#selectionHolder |
|
150 |
). |
|
151 |
||
10001 | 152 |
! ! |
153 |
||
154 |
!HierarchicalLintRuleList methodsFor:'aspects'! |
|
155 |
||
156 |
listHolder |
|
157 |
listHolder isNil ifTrue:[ |
|
158 |
listHolder := (HierarchicalList new) |
|
159 |
showRoot:false; |
|
160 |
application:self; |
|
161 |
yourself |
|
162 |
]. |
|
163 |
^ listHolder |
|
164 |
||
165 |
"Created: / 15-04-2010 / 20:32:29 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
166 |
! ! |
|
167 |
||
168 |
!HierarchicalLintRuleList methodsFor:'private'! |
|
169 |
||
19630
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
170 |
updateListUsingFilter: filterBlockOrNil |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
171 |
|inGenerator newList root| |
10001 | 172 |
|
173 |
inGenerator := self inGeneratorHolder value. |
|
174 |
(inGenerator isNil and: [self mode == #display]) |
|
175 |
ifTrue:[inGenerator := RBCompositeLintRule allRules rules ]. |
|
19630
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
176 |
newList := OrderedCollection new. |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
177 |
filterBlockOrNil isNil ifTrue:[ |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
178 |
inGenerator do:[:rule | newList add:rule ] |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
179 |
] ifFalse:[ |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
180 |
inGenerator do:[:rule| |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
181 |
rule flattened do:[:each| |
19631
7351a219f202
Oops, fix bug in Lint rules filtering introduced in commit fe29ed10a99d
Jan Vrany <jan.vrany@labware.com>
parents:
19630
diff
changeset
|
182 |
(filterBlockOrNil value: each value: 2) ifTrue: [ |
19630
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
183 |
newList add: each |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
184 |
] |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
185 |
] |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
186 |
]. |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
187 |
]. |
10001 | 188 |
root := (self |
19630
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
189 |
listEntryFor:(RBCompositeLintRule rules:newList name:'Rules')) |
10001 | 190 |
parent:self listHolder; |
191 |
expand; |
|
192 |
yourself. |
|
193 |
root children do:[:e | |
|
194 |
e expand |
|
195 |
]. |
|
196 |
self listHolder root:root. |
|
14854
f7adeb3685e7
class: Tools::HierarchicalLintRuleList
Claus Gittinger <cg@exept.de>
parents:
14668
diff
changeset
|
197 |
self setListValid:true. |
10001 | 198 |
|
19630
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
199 |
"Created: / 26-07-2022 / 11:45:09 / Jan Vrany <jan.vrany@labware.com>" |
19631
7351a219f202
Oops, fix bug in Lint rules filtering introduced in commit fe29ed10a99d
Jan Vrany <jan.vrany@labware.com>
parents:
19630
diff
changeset
|
200 |
"Modified: / 17-08-2022 / 12:07:20 / Jan Vrany <jan.vrany@labware.com>" |
10001 | 201 |
! ! |
202 |
||
203 |
!HierarchicalLintRuleList class methodsFor:'documentation'! |
|
204 |
||
205 |
version_CVS |
|
16590 | 206 |
^ '$Header$' |
10001 | 207 |
! |
208 |
||
19630
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
209 |
version_HG |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
210 |
|
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
211 |
^ '$Changeset: <not expanded> $' |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
212 |
! |
fe29ed10a99d
Allow to filter using lint rule tags
Jan Vrany <jan.vrany@labware.com>
parents:
16596
diff
changeset
|
213 |
|
10001 | 214 |
version_SVN |
16590 | 215 |
^ '$Id$' |
10001 | 216 |
! ! |
13443
7533db07ff7a
class: Tools::HierarchicalLintRuleList
Claus Gittinger <cg@exept.de>
parents:
11392
diff
changeset
|
217 |