author | Claus Gittinger <cg@exept.de> |
Tue, 29 Nov 2011 11:21:54 +0100 | |
changeset 10912 | a90f6de79d36 |
parent 10580 | 05d94191950a |
child 11860 | 7049aeccbf41 |
permissions | -rw-r--r-- |
6179 | 1 |
" |
2 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
3 |
All Rights Reserved |
|
4 |
||
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
5592 | 12 |
"{ Package: 'stx:libtool' }" |
5591 | 13 |
|
14 |
"{ NameSpace: Tools }" |
|
15 |
||
16 |
BrowserList subclass:#ClassCategoryList |
|
8700 | 17 |
instanceVariableNames:'categoryList classes allSelected showPseudoCategories' |
5591 | 18 |
classVariableNames:'AdditionalEmptyCategories' |
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-Browsers-New' |
|
21 |
! |
|
22 |
||
23 |
!ClassCategoryList class methodsFor:'documentation'! |
|
24 |
||
6179 | 25 |
copyright |
26 |
" |
|
27 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
28 |
All Rights Reserved |
|
29 |
||
30 |
This software is furnished under a license and may be used |
|
31 |
only in accordance with the terms of that license and with the |
|
32 |
inclusion of the above copyright notice. This software may not |
|
33 |
be provided or otherwise made available to, or used by, any |
|
34 |
other person. No title to or ownership of the software is |
|
35 |
hereby transferred. |
|
36 |
" |
|
37 |
! |
|
38 |
||
5591 | 39 |
documentation |
40 |
" |
|
41 |
embeddable application displaying the class-categories. |
|
42 |
Provides an outputGenerator, which enumerates the classes in |
|
43 |
the selected categories. |
|
44 |
||
45 |
[author:] |
|
46 |
Claus Gittinger (cg@exept.de) |
|
47 |
" |
|
48 |
! ! |
|
49 |
||
50 |
!ClassCategoryList class methodsFor:'interface specs'! |
|
51 |
||
52 |
singleCategoryWindowSpec |
|
53 |
"This resource specification was automatically generated |
|
54 |
by the UIPainter of ST/X." |
|
55 |
||
56 |
"Do not manually edit this!! If it is corrupted, |
|
57 |
the UIPainter may not be able to read the specification." |
|
58 |
||
59 |
" |
|
60 |
UIPainter new openOnClass:ClassCategoryList andSelector:#singleCategoryWindowSpec |
|
61 |
ClassCategoryList new openInterface:#singleCategoryWindowSpec |
|
62 |
" |
|
63 |
||
64 |
<resource: #canvas> |
|
65 |
||
66 |
^ |
|
67 |
#(#FullSpec |
|
5592 | 68 |
#name: #singleCategoryWindowSpec |
69 |
#window: |
|
5591 | 70 |
#(#WindowSpec |
5592 | 71 |
#label: 'ClassCategoryList' |
72 |
#name: 'ClassCategoryList' |
|
73 |
#min: #(#Point 0 0) |
|
74 |
#max: #(#Point 1024 721) |
|
75 |
#bounds: #(#Rectangle 218 175 518 475) |
|
76 |
) |
|
77 |
#component: |
|
5591 | 78 |
#(#SpecCollection |
5592 | 79 |
#collection: #( |
80 |
#(#LabelSpec |
|
81 |
#label: 'ClassCategoryName' |
|
82 |
#name: 'ClassCategoryLabel' |
|
83 |
#layout: #(#LayoutFrame 0 0.0 0 0 0 1.0 25 0) |
|
84 |
#translateLabel: true |
|
85 |
#labelChannel: #classCategoryLabelHolder |
|
86 |
#menu: #menuHolder |
|
87 |
) |
|
88 |
) |
|
5591 | 89 |
|
5592 | 90 |
) |
5591 | 91 |
) |
92 |
! |
|
93 |
||
94 |
windowSpec |
|
95 |
"This resource specification was automatically generated |
|
96 |
by the UIPainter of ST/X." |
|
97 |
||
98 |
"Do not manually edit this!! If it is corrupted, |
|
99 |
the UIPainter may not be able to read the specification." |
|
100 |
||
101 |
" |
|
102 |
UIPainter new openOnClass:ClassCategoryList andSelector:#windowSpec |
|
103 |
ClassCategoryList new openInterface:#windowSpec |
|
104 |
ClassCategoryList open |
|
105 |
" |
|
106 |
||
107 |
<resource: #canvas> |
|
108 |
||
109 |
^ |
|
110 |
#(#FullSpec |
|
6468 | 111 |
#name: #windowSpec |
112 |
#window: |
|
5591 | 113 |
#(#WindowSpec |
6468 | 114 |
#label: 'ClassCategoryList' |
115 |
#name: 'ClassCategoryList' |
|
116 |
#min: #(#Point 0 0) |
|
117 |
#bounds: #(#Rectangle 13 23 313 323) |
|
118 |
) |
|
119 |
#component: |
|
5591 | 120 |
#(#SpecCollection |
6468 | 121 |
#collection: #( |
122 |
#(#SequenceViewSpec |
|
123 |
#name: 'List' |
|
124 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
125 |
#tabable: true |
|
126 |
#model: #selectedCategories |
|
127 |
#menu: #menuHolder |
|
128 |
#hasHorizontalScrollBar: true |
|
129 |
#hasVerticalScrollBar: true |
|
130 |
#miniScrollerHorizontal: true |
|
131 |
#isMultiSelect: true |
|
132 |
#valueChangeSelector: #selectionChangedByClick |
|
133 |
#useIndex: false |
|
134 |
#sequenceList: #categoryList |
|
135 |
#doubleClickChannel: #doubleClickChannel |
|
136 |
#properties: |
|
137 |
#(#PropertyListDictionary |
|
138 |
#dragArgument: nil |
|
139 |
#dropArgument: nil |
|
140 |
#canDropSelector: #canDropContext: |
|
141 |
#dropSelector: #doDropContext: |
|
142 |
) |
|
143 |
) |
|
144 |
) |
|
5591 | 145 |
|
6468 | 146 |
) |
5591 | 147 |
) |
148 |
||
149 |
"Created: / 5.2.2000 / 13:42:11 / cg" |
|
150 |
"Modified: / 18.8.2000 / 20:11:49 / cg" |
|
151 |
! ! |
|
152 |
||
153 |
!ClassCategoryList class methodsFor:'plugIn spec'! |
|
154 |
||
155 |
aspectSelectors |
|
156 |
"This resource specification was automatically generated |
|
157 |
by the UIPainter of ST/X." |
|
158 |
||
159 |
"Do not manually edit this. If it is corrupted, |
|
160 |
the UIPainter may not be able to read the specification." |
|
161 |
||
162 |
"Return a description of exported aspects; |
|
163 |
these can be connected to aspects of an embedding application |
|
164 |
(if this app is embedded in a subCanvas)." |
|
165 |
||
166 |
^ #( |
|
8700 | 167 |
#(#doubleClickChannel #action ) |
168 |
#forceGeneratorTrigger |
|
169 |
#hideUnloadedClasses |
|
170 |
#immediateUpdate |
|
171 |
#inGeneratorHolder |
|
172 |
#menuHolder |
|
173 |
#nameSpaceFilter |
|
174 |
#organizerMode |
|
175 |
#outGeneratorHolder |
|
176 |
#packageFilter |
|
177 |
#selectedCategories |
|
178 |
#selectionChangeCondition |
|
179 |
#slaveMode |
|
180 |
#updateTrigger |
|
10351 | 181 |
#showCoverageInformation |
5591 | 182 |
). |
10351 | 183 |
|
184 |
"Modified: / 20-07-2011 / 14:29:08 / cg" |
|
5591 | 185 |
! ! |
186 |
||
8373 | 187 |
!ClassCategoryList class methodsFor:'special'! |
188 |
||
189 |
addAdditionalCategory:aCategory |
|
190 |
"/ those are simulated - in ST/X, empty categories do not |
|
191 |
"/ really exist; however, during browsing, it makes sense. |
|
192 |
||
193 |
AdditionalEmptyCategories isNil ifTrue:[ |
|
194 |
AdditionalEmptyCategories := Set new. |
|
195 |
]. |
|
196 |
AdditionalEmptyCategories add:aCategory. |
|
197 |
Smalltalk changed:#organization with:(nil -> aCategory). "/ not really ... to force update |
|
198 |
! |
|
199 |
||
200 |
removeAdditionalCategories:aListOfCategories |
|
201 |
"/ those are simulated - in ST/X, empty categories do not |
|
202 |
"/ really exist; however, during browsing, it makes sense. |
|
203 |
||
204 |
AdditionalEmptyCategories isNil ifTrue:[^ self]. |
|
205 |
aListOfCategories do:[:eachCategory | |
|
206 |
AdditionalEmptyCategories remove:eachCategory ifAbsent:nil. |
|
207 |
]. |
|
208 |
||
209 |
Smalltalk changed:#organization "/ not really ... to force update |
|
210 |
! |
|
211 |
||
212 |
removeAllAdditionalCategories |
|
213 |
"/ those are simulated - in ST/X, empty categories do not |
|
214 |
"/ really exist; however, during browsing, it makes sense. |
|
215 |
||
216 |
AdditionalEmptyCategories := nil |
|
8446 | 217 |
! |
218 |
||
219 |
renameAdditionalCategories:oldNames to:newName |
|
220 |
"/ those are simulated - in ST/X, empty categories do not |
|
221 |
"/ really exist; however, during browsing, it makes sense. |
|
222 |
||
223 |
self removeAdditionalCategories:oldNames. |
|
224 |
self addAdditionalCategory:newName. |
|
8373 | 225 |
! ! |
226 |
||
5591 | 227 |
!ClassCategoryList methodsFor:'aspects'! |
228 |
||
229 |
categoryList |
|
230 |
categoryList isNil ifTrue:[ |
|
231 |
categoryList := ValueHolder new. |
|
232 |
]. |
|
233 |
^ categoryList |
|
234 |
||
235 |
"Created: / 25.2.2000 / 02:23:08 / cg" |
|
236 |
! |
|
237 |
||
238 |
categoryList:aValueHolder |
|
239 |
categoryList notNil ifTrue:[ |
|
240 |
categoryList removeDependent:self |
|
241 |
]. |
|
242 |
categoryList := aValueHolder. |
|
243 |
categoryList notNil ifTrue:[ |
|
244 |
categoryList addDependent:self |
|
245 |
]. |
|
246 |
||
247 |
"Created: / 18.8.2000 / 15:21:42 / cg" |
|
248 |
! |
|
249 |
||
250 |
classCategoryLabelHolder |
|
251 |
^ self pseudoListLabelHolder |
|
252 |
! |
|
253 |
||
254 |
selectedCategories |
|
255 |
^ self selectionHolder |
|
256 |
! |
|
257 |
||
258 |
selectedCategories:aValueHolder |
|
259 |
^ self selectionHolder:aValueHolder |
|
260 |
! ! |
|
261 |
||
262 |
!ClassCategoryList methodsFor:'change & update'! |
|
263 |
||
264 |
delayedUpdate:something with:aParameter from:changedObject |
|
6702 | 265 |
|selectedCategories allSelectedBefore |
5591 | 266 |
nameListEntryForALL categoryOfClass wg| |
267 |
||
268 |
selectedCategories := self selectedCategoriesStrings. |
|
269 |
||
270 |
changedObject == Smalltalk ifTrue:[ |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
271 |
((something == #classVariables) |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
272 |
or:[something == #classDefinition]) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
273 |
listValid == true ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
274 |
categoryOfClass := aParameter category. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
275 |
(categoryList value includes:categoryOfClass) ifFalse:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
276 |
self invalidateList. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
277 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
278 |
slaveMode value ~~ true ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
279 |
(selectedCategories includes:categoryOfClass) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
280 |
"/ a selected class has changed |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
281 |
"/ in order to give others a chance to update their list before, |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
282 |
"/ this one is always enqueued for delayed update (even if immediateUpdate is true) |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
283 |
"/ self enqueueDelayedUpdateOutputGenerator |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
284 |
self enqueueMessage:#updateOutputGenerator for:self arguments:#() |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
285 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
286 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
287 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
288 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
289 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
290 |
something == #newClass ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
291 |
categoryOfClass := aParameter category. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
292 |
listValid == false ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
293 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
294 |
]. |
5591 | 295 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
296 |
(categoryList value includes:categoryOfClass) ifFalse:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
297 |
self invalidateList. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
298 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
299 |
|
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
300 |
slaveMode value ~~ true ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
301 |
(selectedCategories includes:categoryOfClass) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
302 |
self enqueueDelayedUpdateOutputGenerator |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
303 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
304 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
305 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
306 |
]. |
5591 | 307 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
308 |
self invalidateList. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
309 |
|
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
310 |
(something == #classRemove |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
311 |
or:[something == #projectOrganization |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
312 |
or:[something == #organization]]) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
313 |
slaveMode value ~~ true ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
314 |
"/ sorry: cannot filter on category (already changed to #removed) |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
315 |
self enqueueDelayedUpdateOutputGenerator |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
316 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
317 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
318 |
^ self |
5591 | 319 |
]. |
320 |
||
321 |
changedObject == ChangeSet ifTrue:[ |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
322 |
"/ remove all other change notifications from the eventQueue |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
323 |
wg := self windowGroup. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
324 |
wg isNil ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
325 |
"/ oops - should no longer be dependent... |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
326 |
changedObject removeDependent:self. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
327 |
] ifFalse:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
328 |
wg sensor |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
329 |
flushEventsFor:self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
330 |
where:[:ev | ev isMessageSendEvent |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
331 |
and:[ev selector == #delayedUpdate:with:from: |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
332 |
and:[(ev arguments at:3) == ChangeSet]]]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
333 |
]. |
5591 | 334 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
335 |
something == #addChange: ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
336 |
"/ only need to invalidate, if that change changes my emphasis |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
337 |
"/ (i.e. if its a new methodChange) |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
338 |
self window topView shown ifFalse:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
339 |
self invalidateList. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
340 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
341 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
342 |
|
5591 | 343 |
"/ self invalidateList. |
344 |
||
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
345 |
aParameter isMethodChange ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
346 |
aParameter changeClass notNil ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
347 |
(ChangeSet current |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
348 |
count:[:chg | chg notNil and:[chg isMethodChange |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
349 |
and:[ chg className = aParameter className ]]]) |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
350 |
== 1 ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
351 |
"/ that methodChange is the first for this method. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
352 |
self colorizeCategoryAsChanged:(aParameter changeClass category). |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
353 |
] |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
354 |
] |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
355 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
356 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
357 |
]. |
5591 | 358 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
359 |
self invalidateList. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
360 |
^ self |
5591 | 361 |
]. |
362 |
||
363 |
changedObject == nameSpaceFilter ifTrue:[ |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
364 |
"/ all might be more or less than before ... |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
365 |
allSelected := false. |
5591 | 366 |
]. |
367 |
changedObject == packageFilter ifTrue:[ |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
368 |
"/ all might be more or less than before ... |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
369 |
allSelected := false. |
5591 | 370 |
]. |
371 |
||
6702 | 372 |
changedObject == self selectedCategories ifTrue:[ |
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
373 |
categoryList isNil ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
374 |
"/ oops - hurry up |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
375 |
self invalidateList. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
376 |
]. |
5591 | 377 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
378 |
nameListEntryForALL := self class nameListEntryForALL. |
5591 | 379 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
380 |
selectedCategories size > 1 ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
381 |
(selectedCategories includes:nameListEntryForALL) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
382 |
self makeSelectionOtherThanAllVisible. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
383 |
] |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
384 |
]. |
5591 | 385 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
386 |
"/ if all selected before AND allSelected after, no need to update the output generator |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
387 |
allSelectedBefore := allSelected ? false. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
388 |
allSelected := selectedCategories includes:nameListEntryForALL. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
389 |
(allSelectedBefore and:[allSelected]) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
390 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
391 |
]. |
5591 | 392 |
]. |
393 |
||
394 |
super delayedUpdate:something with:aParameter from:changedObject |
|
395 |
||
396 |
"Created: / 5.2.2000 / 13:42:12 / cg" |
|
397 |
"Modified: / 12.11.2001 / 19:36:16 / cg" |
|
398 |
! |
|
399 |
||
400 |
forceUpdateList |
|
401 |
self categoryList setValue:#(). |
|
402 |
self updateList. |
|
403 |
self categoryList changed. |
|
404 |
! |
|
405 |
||
406 |
selectionChangedByClick |
|
407 |
"we are not interested in that - get another notification |
|
408 |
via the changed valueHolder" |
|
409 |
||
410 |
"Created: / 11.2.2000 / 11:39:48 / cg" |
|
411 |
! |
|
412 |
||
413 |
update:something with:aParameter from:changedObject |
|
414 |
|categoryOfClass| |
|
415 |
||
416 |
changedObject == Smalltalk ifTrue:[ |
|
8751 | 417 |
(something == #methodInClass |
418 |
or:[ something == #classComment |
|
419 |
or:[ something == #methodDictionary |
|
420 |
or:[ something == #methodTrap |
|
10365 | 421 |
or:[ something == #methodCoverageInfo |
422 |
or:[ something == #methodInClassRemoved ]]]]]) ifTrue:[ |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
423 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
424 |
]. |
8751 | 425 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
426 |
(something == #classVariables |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
427 |
or:[something == #classDefinition]) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
428 |
categoryOfClass := aParameter category. |
6702 | 429 |
(self selectedCategoriesStrings includes:categoryOfClass) ifTrue:[ |
5591 | 430 |
"/ self halt. |
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
431 |
self updateOutputGenerator. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
432 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
433 |
]. |
5591 | 434 |
]. |
435 |
||
436 |
"/ changedObject == ChangeSet ifTrue:[ |
|
437 |
"/ something == #addChange: ifTrue:[ |
|
438 |
"/ ^ self |
|
439 |
"/ ] |
|
440 |
"/ ]. |
|
441 |
||
442 |
super update:something with:aParameter from:changedObject |
|
443 |
||
10365 | 444 |
"Modified: / 20-07-2011 / 18:50:04 / cg" |
5591 | 445 |
! ! |
446 |
||
447 |
!ClassCategoryList methodsFor:'drag & drop'! |
|
448 |
||
6468 | 449 |
canDropContext:aDropContext |
7425
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
450 |
|cat objects droppedClasses| |
5591 | 451 |
|
7425
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
452 |
objects := aDropContext dropObjects collect:[:obj | obj theObject]. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
453 |
(self objectsAreClassFiles:objects) ifTrue:[^ true]. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
454 |
|
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
455 |
(objects conform:[:aClass | aClass isClass]) ifFalse:[^ false]. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
456 |
droppedClasses := objects. |
6468 | 457 |
(droppedClasses contains:[:aClass | aClass isPrivate not]) ifFalse:[^ false]. |
5591 | 458 |
|
459 |
cat := self categoryAtTargetPointOf:aDropContext. |
|
6492 | 460 |
cat isNil ifTrue:[ ^ false ]. |
461 |
cat = '* obsolete *' ifTrue:[ ^ false ]. |
|
5591 | 462 |
|
6468 | 463 |
(droppedClasses contains:[:aClass | aClass category ~= cat]) ifFalse:[^ false]. |
5591 | 464 |
^ true. |
7119 | 465 |
|
7425
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
466 |
"Modified: / 17-10-2006 / 18:28:04 / cg" |
5591 | 467 |
! |
468 |
||
469 |
categoryAtTargetPointOf:aDropContext |
|
470 |
|p categoryListView lineNr cat| |
|
471 |
||
472 |
p := aDropContext targetPoint. |
|
473 |
||
474 |
categoryListView := aDropContext targetWidget. |
|
475 |
||
476 |
lineNr := categoryListView lineAtY:p y. |
|
477 |
lineNr isNil ifTrue:[^ nil]. |
|
478 |
||
479 |
cat := categoryList value at:lineNr. |
|
480 |
cat := cat string. |
|
481 |
cat = self class nameListEntryForALL ifTrue:[^ nil]. |
|
6702 | 482 |
(cat endsWith:(self stringForExtensions)) ifTrue:[ |
483 |
cat := cat copyWithoutLast:(self stringForExtensions size) |
|
484 |
]. |
|
5591 | 485 |
^ cat |
486 |
! |
|
487 |
||
6468 | 488 |
doDropContext:aDropContext |
7425
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
489 |
|cat objects| |
5591 | 490 |
|
7425
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
491 |
objects := aDropContext dropObjects collect:[:aDropObject | aDropObject theObject]. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
492 |
(objects conform:[:something | something isClass]) ifTrue:[ |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
493 |
cat := self categoryAtTargetPointOf:aDropContext. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
494 |
cat notNil ifTrue:[ |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
495 |
self masterApplication moveClasses:objects toCategory:cat. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
496 |
]. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
497 |
^ self |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
498 |
]. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
499 |
(objects conform:[:something | something isFilename]) ifTrue:[ |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
500 |
self dropClassFiles:objects. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
501 |
^ self |
5591 | 502 |
]. |
7119 | 503 |
|
7425
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
504 |
"Modified: / 17-10-2006 / 18:29:25 / cg" |
5591 | 505 |
! ! |
506 |
||
507 |
!ClassCategoryList methodsFor:'generators'! |
|
508 |
||
509 |
makeGenerator |
|
510 |
"return a generator which enumerates the classes from the selected category." |
|
511 |
||
8751 | 512 |
|cats hideUnloadedClasses allName nameSpaceFilter packageFilter |
513 |
showChangedClasses showUnloaded showUndocumented inclusionTest changedClasses| |
|
5591 | 514 |
|
6702 | 515 |
cats := self selectedCategoriesStrings. |
5591 | 516 |
cats size == 0 ifTrue:[ |
6066
dbc820318498
care for nil-category in classes
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
517 |
^ #() |
5591 | 518 |
]. |
519 |
||
520 |
allName := self class nameListEntryForALL. |
|
521 |
||
8345
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
522 |
(cats includes:allName) ifTrue:[ |
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
523 |
inGeneratorHolder value isOrderedCollection ifTrue:[ |
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
524 |
cats := categoryList value copyWithout:allName. |
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
525 |
] |
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
526 |
]. |
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
527 |
|
8734 | 528 |
showChangedClasses := cats includes:(self class nameListEntryForChanged). |
8751 | 529 |
showUnloaded := cats includes:(self class nameListEntryForUnloaded). |
530 |
showUndocumented := cats includes:(self class nameListEntryForUndocumented). |
|
8734 | 531 |
|
5591 | 532 |
hideUnloadedClasses := self hideUnloadedClasses value ? false. |
533 |
nameSpaceFilter := self nameSpaceFilter value. |
|
534 |
nameSpaceFilter notNil ifTrue:[ |
|
6066
dbc820318498
care for nil-category in classes
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
535 |
(nameSpaceFilter includes:allName) ifTrue:[nameSpaceFilter := nil]. |
5591 | 536 |
]. |
537 |
packageFilter := self packageFilter value. |
|
538 |
packageFilter notNil ifTrue:[ |
|
6066
dbc820318498
care for nil-category in classes
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
539 |
(packageFilter includes:allName) ifTrue:[packageFilter := nil]. |
5591 | 540 |
]. |
541 |
||
542 |
(cats includes:allName) ifTrue:[ |
|
6066
dbc820318498
care for nil-category in classes
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
543 |
hideUnloadedClasses ifTrue:[ |
8751 | 544 |
inclusionTest := [:cls | cls isLoaded]. |
545 |
] ifFalse:[ |
|
546 |
inclusionTest := [:cls | true]. |
|
6066
dbc820318498
care for nil-category in classes
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
547 |
]. |
8751 | 548 |
] ifFalse:[ |
549 |
inclusionTest := |
|
550 |
[:cls | |
|
551 |
|cat isLoaded included| |
|
552 |
||
553 |
isLoaded := cls isLoaded. |
|
554 |
included := isLoaded not and:[ showUnloaded ]. |
|
555 |
included ifFalse:[ |
|
556 |
(hideUnloadedClasses not or:[isLoaded]) ifTrue:[ |
|
557 |
cat := cls category ? '* no category *'. |
|
558 |
included := cats includes:cat. |
|
559 |
included ifFalse:[ |
|
560 |
included := showChangedClasses |
|
561 |
and:[ (changedClasses includes:cls theNonMetaclass) |
|
562 |
or:[(changedClasses includes:cls theMetaclass)] ]. |
|
563 |
included ifFalse:[ |
|
9005 | 564 |
included := showUndocumented and:[ isLoaded and:[ (cls theMetaclass includesSelector:#documentation) not ]]. |
8751 | 565 |
]. |
566 |
]. |
|
567 |
]. |
|
568 |
]. |
|
569 |
included |
|
570 |
]. |
|
5591 | 571 |
]. |
572 |
||
8748 | 573 |
^ Iterator on:[:whatToDo | |
8751 | 574 |
showChangedClasses ifTrue:[ changedClasses := ChangeSet current changedClasses ]. |
8734 | 575 |
|
8751 | 576 |
Smalltalk allClassesDo:[:cls | |
577 |
(cls isRealNameSpace) ifFalse:[ |
|
578 |
(inclusionTest value:cls) ifTrue:[ |
|
579 |
(nameSpaceFilter isNil |
|
580 |
or:[self isClass:cls shownWithNameSpaceFilter:nameSpaceFilter]) ifTrue:[ |
|
581 |
(packageFilter isNil |
|
582 |
or:[self isClass:cls shownWithPackageFilter:packageFilter]) ifTrue:[ |
|
583 |
whatToDo value:cls |
|
584 |
] |
|
585 |
] |
|
586 |
]. |
|
587 |
]. |
|
588 |
]. |
|
589 |
]. |
|
5591 | 590 |
|
7504 | 591 |
"Created: / 05-02-2000 / 13:42:12 / cg" |
592 |
"Modified: / 10-11-2006 / 17:13:26 / cg" |
|
5591 | 593 |
! ! |
594 |
||
595 |
!ClassCategoryList methodsFor:'private'! |
|
596 |
||
597 |
colorizeCategoryAsChanged:category |
|
598 |
|colorizedCategoryItem categoryList idx| |
|
599 |
||
600 |
colorizedCategoryItem := self colorizeForChangedCode:category copy asText. |
|
601 |
||
602 |
categoryList := self categoryList value. |
|
603 |
idx := categoryList indexOf:category. |
|
604 |
idx ~~ 0 ifTrue:[ |
|
605 |
((categoryList at:idx) sameStringAndEmphasisAs:colorizedCategoryItem) ifFalse:[ |
|
606 |
categoryList at:idx put:colorizedCategoryItem. |
|
607 |
self categoryList changed. |
|
608 |
] |
|
609 |
]. |
|
610 |
! |
|
611 |
||
612 |
listOfCategories |
|
613 |
|categories hideUnloadedClasses generator nameSpaceFilter packageFilter allName |
|
7504 | 614 |
categoriesWithExtensions categoriesWithChangedCode categoriesWithRemoteChangedCode |
9127 | 615 |
classesInChangeSet classesInRemoteChangeSet |
616 |
numClassesInChangeSet numClasses numUnloaded numUndocumented pseudoEntryColor| |
|
5591 | 617 |
|
618 |
allName := self class nameListEntryForALL. |
|
619 |
||
620 |
hideUnloadedClasses := self hideUnloadedClasses value. |
|
621 |
nameSpaceFilter := self nameSpaceFilter value. |
|
622 |
nameSpaceFilter notNil ifTrue:[ |
|
5950 | 623 |
(nameSpaceFilter includes:allName) ifTrue:[nameSpaceFilter := nil]. |
5591 | 624 |
]. |
625 |
packageFilter := self packageFilter value. |
|
626 |
packageFilter notNil ifTrue:[ |
|
5950 | 627 |
(packageFilter includes:allName) ifTrue:[packageFilter := nil]. |
5591 | 628 |
]. |
629 |
||
8751 | 630 |
numClasses := numUndocumented := numUnloaded := numClassesInChangeSet := 0. |
8734 | 631 |
|
5591 | 632 |
categories := Set new. |
633 |
categoriesWithExtensions := Set new. |
|
634 |
categoriesWithChangedCode := Set new. |
|
7504 | 635 |
categoriesWithRemoteChangedCode := Set new. |
5591 | 636 |
|
6978 | 637 |
classesInChangeSet := ChangeSet current changedClasses. |
638 |
classesInChangeSet := classesInChangeSet collect:[:eachClass | eachClass theNonMetaclass]. |
|
5591 | 639 |
|
7504 | 640 |
classesInRemoteChangeSet := SmallTeam isNil ifTrue:[#()] ifFalse:[ SmallTeam changedClasses ]. |
641 |
classesInRemoteChangeSet := classesInRemoteChangeSet collect:[:each | each theNonMetaclass]. |
|
642 |
||
5591 | 643 |
classes := IdentitySet new. |
644 |
inGeneratorHolder isNil ifTrue:[ |
|
5950 | 645 |
Smalltalk allClassesDo:[:cls | |
8751 | 646 |
|cat isLoaded| |
647 |
||
648 |
(cls isRealNameSpace) ifFalse:[ |
|
649 |
(nameSpaceFilter isNil |
|
650 |
or:[self isClass:cls shownWithNameSpaceFilter:nameSpaceFilter]) ifTrue:[ |
|
651 |
(packageFilter isNil |
|
652 |
or:[self isClass:cls shownWithPackageFilter:packageFilter]) ifTrue:[ |
|
5591 | 653 |
|
8751 | 654 |
isLoaded := cls isLoaded. |
655 |
isLoaded ifTrue:[ |
|
656 |
numUnloaded := numUnloaded + 1. |
|
9005 | 657 |
(cls theMetaclass includesSelector:#documentation) ifFalse:[ |
8751 | 658 |
numUndocumented := numUndocumented + 1. |
659 |
]. |
|
660 |
]. |
|
661 |
||
662 |
(hideUnloadedClasses not or:[isLoaded]) |
|
663 |
ifTrue:[ |
|
8734 | 664 |
numClasses := numClasses + 1. |
665 |
||
6066
dbc820318498
care for nil-category in classes
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
666 |
cat := cls category ? '* no category *'. |
5950 | 667 |
cat isString ifFalse:[self halt:'oops - strange category']. |
668 |
categories add:cat. |
|
669 |
classes add:cls. |
|
5591 | 670 |
|
6978 | 671 |
(classesInChangeSet includes:cls theNonMetaclass) ifTrue:[ |
5950 | 672 |
categoriesWithChangedCode add:cat |
7504 | 673 |
]. |
674 |
(classesInRemoteChangeSet includes:cls theNonMetaclass) ifTrue:[ |
|
675 |
categoriesWithRemoteChangedCode add:cat |
|
676 |
]. |
|
677 |
cls hasExtensions ifTrue:[ |
|
678 |
categoriesWithExtensions add:cat |
|
5950 | 679 |
]. |
680 |
] |
|
681 |
] |
|
682 |
] |
|
683 |
] |
|
684 |
]. |
|
5591 | 685 |
|
5950 | 686 |
"/ those are simulated - in ST/X, empty categories do not |
687 |
"/ really exist; however, during browsing, it makes sense. |
|
688 |
AdditionalEmptyCategories size > 0 ifTrue:[ |
|
689 |
"/ remove those that are present ... |
|
690 |
AdditionalEmptyCategories := AdditionalEmptyCategories select:[:cat | (categories includes:cat) not]. |
|
691 |
categories addAll:AdditionalEmptyCategories. |
|
692 |
]. |
|
5591 | 693 |
] ifFalse:[ |
5950 | 694 |
generator := inGeneratorHolder value. |
695 |
generator isNil ifTrue:[^ #() ]. |
|
8345
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
696 |
generator do:[:cat | categories add:cat string]. |
5591 | 697 |
]. |
698 |
||
699 |
categories := categories asOrderedCollection. |
|
700 |
||
701 |
categories sort. |
|
5950 | 702 |
categories := |
703 |
categories collect:[:cat | |
|
704 |
(categoriesWithChangedCode includes:cat) ifTrue:[ |
|
705 |
(self colorizeForChangedCode:cat copy asText). |
|
706 |
] ifFalse:[ |
|
707 |
(categoriesWithExtensions includes:cat) ifTrue:[ |
|
708 |
(self colorizeForDifferentPackage:cat copy asText) |
|
709 |
"/ cannot add a + here - need separate list for presentation and filter |
|
6702 | 710 |
"/ cat , (self colorizeForDifferentPackage:self stringForExtensions) |
5950 | 711 |
] ifFalse:[ |
7504 | 712 |
(categoriesWithRemoteChangedCode includes:cat) ifTrue:[ |
713 |
(self colorizeForChangedCodeInSmallTeam:cat copy asText). |
|
714 |
] ifFalse:[ |
|
8751 | 715 |
cat |
7504 | 716 |
] |
5950 | 717 |
] |
718 |
] |
|
719 |
]. |
|
8734 | 720 |
|
9127 | 721 |
pseudoEntryColor := self class pseudoEntryForegroundColor. |
722 |
||
8751 | 723 |
numUnloaded > 0 ifTrue:[ |
724 |
"/ dont include count - makeGenerator compares against the un-expanded nameListEntry (sigh - need two lists) |
|
9127 | 725 |
categories addFirst:((self class nameListEntryForUnloaded "bindWith:numClassesInChangeSet") allItalic colorizeAllWith:pseudoEntryColor). |
8751 | 726 |
]. |
727 |
numUndocumented > 0 ifTrue:[ |
|
728 |
"/ dont include count - makeGenerator compares against the un-expanded nameListEntry (sigh - need two lists) |
|
9127 | 729 |
categories addFirst:((self class nameListEntryForUndocumented "bindWith:numClassesInChangeSet") allItalic colorizeAllWith:pseudoEntryColor). |
8751 | 730 |
]. |
8734 | 731 |
numClassesInChangeSet := ChangeSet current changedClasses size. |
732 |
numClassesInChangeSet > 0 ifTrue:[ |
|
733 |
"/ dont include count - makeGenerator compares against the un-expanded nameListEntry (sigh - need two lists) |
|
9127 | 734 |
categories addFirst:((self class nameListEntryForChanged "bindWith:numClassesInChangeSet") allItalic colorizeAllWith:pseudoEntryColor). |
5591 | 735 |
]. |
8734 | 736 |
|
737 |
categories size > 0 ifTrue:[ |
|
738 |
categories size == 1 ifTrue:[ |
|
739 |
self classCategoryLabelHolder value:(categories first) |
|
740 |
]. |
|
9127 | 741 |
categories addFirst:((self class nameListEntryForALL "WithCount bindWith:numClasses") allItalic colorizeAllWith:pseudoEntryColor). |
5591 | 742 |
]. |
8734 | 743 |
|
5591 | 744 |
^ categories |
745 |
||
6950 | 746 |
"Created: / 05-02-2000 / 13:42:12 / cg" |
7504 | 747 |
"Modified: / 10-11-2006 / 17:43:19 / cg" |
5591 | 748 |
! |
749 |
||
750 |
listView |
|
8741 | 751 |
^ self componentAt:#List |
5591 | 752 |
! |
753 |
||
754 |
makeDependent |
|
755 |
Smalltalk addDependent:self. |
|
756 |
ChangeSet addDependent:self. |
|
757 |
||
758 |
"Created: / 5.2.2000 / 13:42:13 / cg" |
|
759 |
! |
|
760 |
||
761 |
makeIndependent |
|
762 |
Smalltalk removeDependent:self. |
|
763 |
ChangeSet removeDependent:self. |
|
764 |
||
765 |
"Created: / 5.2.2000 / 13:42:13 / cg" |
|
766 |
! |
|
767 |
||
768 |
makeItemVisible:item |
|
769 |
|idx listView| |
|
770 |
||
771 |
idx := categoryList value indexOf:item. |
|
772 |
idx ~~ 0 ifTrue:[ |
|
773 |
(listView := self listView) notNil ifTrue:[ |
|
774 |
listView makeLineVisible:idx. |
|
775 |
] |
|
776 |
] |
|
777 |
! |
|
778 |
||
779 |
makeSelectionOtherThanAllVisible |
|
780 |
|selectedCategories item| |
|
781 |
||
782 |
selectedCategories := self selectedCategoriesStrings. |
|
783 |
"/ the first item after the *all* item |
|
784 |
item := (selectedCategories copy remove:self class nameListEntryForALL; yourself) first. |
|
785 |
self makeItemVisible:item. |
|
786 |
! |
|
787 |
||
788 |
release |
|
789 |
super release. |
|
790 |
||
791 |
categoryList removeDependent:self. |
|
792 |
! |
|
793 |
||
794 |
selectedCategoriesStrings |
|
6950 | 795 |
|selectedCategoriesHolder selectedCategories stringForExtensions| |
796 |
||
797 |
stringForExtensions := self stringForExtensions. |
|
5591 | 798 |
|
799 |
selectedCategoriesHolder := self selectedCategories. |
|
800 |
selectedCategories := selectedCategoriesHolder value ? #(). |
|
6950 | 801 |
|
6702 | 802 |
selectedCategories := selectedCategories |
803 |
collect:[:each | |
|
804 |
|s| |
|
805 |
s := each string. |
|
6950 | 806 |
(s endsWith:stringForExtensions) ifTrue:[ |
807 |
s := s copyWithoutLast:(stringForExtensions size). |
|
6702 | 808 |
]. |
809 |
s |
|
810 |
]. |
|
5591 | 811 |
^ selectedCategories |
6950 | 812 |
|
813 |
"Modified: / 23-08-2006 / 11:38:26 / cg" |
|
5591 | 814 |
! |
815 |
||
6702 | 816 |
stringForExtensions |
817 |
^ ' [ + ]' |
|
818 |
! |
|
819 |
||
5591 | 820 |
updateList |
821 |
|oldList newList oldSelection newSelection prevClasses |
|
822 |
selectedCategoriesHolder| |
|
823 |
||
824 |
selectedCategoriesHolder := self selectedCategories. |
|
825 |
oldSelection := selectedCategoriesHolder value ? #(). |
|
826 |
prevClasses := classes copy. |
|
827 |
||
828 |
newList := self listOfCategories. |
|
829 |
oldList := (self categoryList value) ? #(). |
|
830 |
(newList sameContentsAs:oldList whenComparedWith:[:a :b | a sameStringAndEmphasisAs: b]) |
|
831 |
ifFalse:[ |
|
10580 | 832 |
"/ a real change, or only emphasis ? |
833 |
(newList sameContentsAs:oldList whenComparedWith:[:a :b | a asString string = b asString string]) ifTrue:[ |
|
834 |
"/ a real change |
|
835 |
oldSelection size > 0 ifTrue:[ |
|
836 |
selectedCategoriesHolder removeDependent:self. |
|
837 |
selectedCategoriesHolder value:#(). |
|
838 |
selectedCategoriesHolder addDependent:self. |
|
839 |
]. |
|
840 |
categoryList value:newList. |
|
5591 | 841 |
|
10580 | 842 |
oldSelection size > 0 ifTrue:[ |
843 |
newSelection := oldSelection select:[:cat | newList includes:cat]. |
|
844 |
selectedCategoriesHolder value:newSelection. |
|
845 |
] |
|
846 |
] ifFalse:[ |
|
847 |
"/ only emphasis |
|
848 |
categoryList value:newList. |
|
849 |
||
850 |
"/ in case the same categories are present, but classes have changed ... |
|
851 |
(prevClasses isNil or:[(classes identicalContentsAs:prevClasses) not]) ifTrue:[ |
|
852 |
self updateOutputGenerator. |
|
853 |
] |
|
854 |
] |
|
5591 | 855 |
] ifTrue:[ |
10580 | 856 |
"/ in case the same categories are present, but classes have changed ... |
857 |
(prevClasses isNil or:[(classes identicalContentsAs:prevClasses) not]) ifTrue:[ |
|
858 |
self updateOutputGenerator. |
|
859 |
] |
|
5591 | 860 |
]. |
861 |
listValid := true. |
|
862 |
||
10580 | 863 |
"Created: / 05-02-2000 / 13:42:13 / cg" |
864 |
"Modified: / 17-08-2011 / 09:52:13 / cg" |
|
5591 | 865 |
! ! |
866 |
||
867 |
!ClassCategoryList methodsFor:'setup'! |
|
868 |
||
5909 | 869 |
commonPostBuild |
5591 | 870 |
|listView| |
871 |
||
872 |
listView := self listView. |
|
873 |
listView notNil ifTrue:[ |
|
5909 | 874 |
listView scrollWhenUpdating:nil |
5591 | 875 |
]. |
5909 | 876 |
super commonPostBuild |
5591 | 877 |
! ! |
878 |
||
879 |
!ClassCategoryList methodsFor:'special'! |
|
880 |
||
881 |
addAdditionalCategory:aCategory |
|
882 |
"/ those are simulated - in ST/X, empty categories do not |
|
883 |
"/ really exist; however, during browsing, it makes sense. |
|
884 |
||
8373 | 885 |
self class addAdditionalCategory:aCategory |
5591 | 886 |
! |
887 |
||
888 |
removeAdditionalCategories:aListOfCategories |
|
8373 | 889 |
self class removeAdditionalCategories:aListOfCategories |
5591 | 890 |
! |
891 |
||
892 |
removeAllAdditionalCategories |
|
8373 | 893 |
self class removeAllAdditionalCategories |
8446 | 894 |
! |
895 |
||
896 |
renameAdditionalCategories:oldNames to:newName |
|
897 |
"/ those are simulated - in ST/X, empty categories do not |
|
898 |
"/ really exist; however, during browsing, it makes sense. |
|
899 |
||
900 |
self class renameAdditionalCategories:oldNames to:newName |
|
5591 | 901 |
! ! |
902 |
||
903 |
!ClassCategoryList class methodsFor:'documentation'! |
|
904 |
||
905 |
version |
|
10580 | 906 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ClassCategoryList.st,v 1.32 2011-08-18 00:20:52 cg Exp $' |
9005 | 907 |
! |
908 |
||
909 |
version_CVS |
|
10580 | 910 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ClassCategoryList.st,v 1.32 2011-08-18 00:20:52 cg Exp $' |
5591 | 911 |
! ! |