author | Claus Gittinger <cg@exept.de> |
Wed, 09 Feb 2011 14:03:29 +0100 | |
changeset 9750 | 1b2ef761d2d0 |
parent 9463 | c341b4dfa4bd |
child 10351 | fc931f04ae12 |
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 |
|
5591 | 181 |
). |
182 |
! ! |
|
183 |
||
8373 | 184 |
!ClassCategoryList class methodsFor:'special'! |
185 |
||
186 |
addAdditionalCategory:aCategory |
|
187 |
"/ those are simulated - in ST/X, empty categories do not |
|
188 |
"/ really exist; however, during browsing, it makes sense. |
|
189 |
||
190 |
AdditionalEmptyCategories isNil ifTrue:[ |
|
191 |
AdditionalEmptyCategories := Set new. |
|
192 |
]. |
|
193 |
AdditionalEmptyCategories add:aCategory. |
|
194 |
Smalltalk changed:#organization with:(nil -> aCategory). "/ not really ... to force update |
|
195 |
! |
|
196 |
||
197 |
removeAdditionalCategories:aListOfCategories |
|
198 |
"/ those are simulated - in ST/X, empty categories do not |
|
199 |
"/ really exist; however, during browsing, it makes sense. |
|
200 |
||
201 |
AdditionalEmptyCategories isNil ifTrue:[^ self]. |
|
202 |
aListOfCategories do:[:eachCategory | |
|
203 |
AdditionalEmptyCategories remove:eachCategory ifAbsent:nil. |
|
204 |
]. |
|
205 |
||
206 |
Smalltalk changed:#organization "/ not really ... to force update |
|
207 |
! |
|
208 |
||
209 |
removeAllAdditionalCategories |
|
210 |
"/ those are simulated - in ST/X, empty categories do not |
|
211 |
"/ really exist; however, during browsing, it makes sense. |
|
212 |
||
213 |
AdditionalEmptyCategories := nil |
|
8446 | 214 |
! |
215 |
||
216 |
renameAdditionalCategories:oldNames to:newName |
|
217 |
"/ those are simulated - in ST/X, empty categories do not |
|
218 |
"/ really exist; however, during browsing, it makes sense. |
|
219 |
||
220 |
self removeAdditionalCategories:oldNames. |
|
221 |
self addAdditionalCategory:newName. |
|
8373 | 222 |
! ! |
223 |
||
5591 | 224 |
!ClassCategoryList methodsFor:'aspects'! |
225 |
||
226 |
categoryList |
|
227 |
categoryList isNil ifTrue:[ |
|
228 |
categoryList := ValueHolder new. |
|
229 |
]. |
|
230 |
^ categoryList |
|
231 |
||
232 |
"Created: / 25.2.2000 / 02:23:08 / cg" |
|
233 |
! |
|
234 |
||
235 |
categoryList:aValueHolder |
|
236 |
categoryList notNil ifTrue:[ |
|
237 |
categoryList removeDependent:self |
|
238 |
]. |
|
239 |
categoryList := aValueHolder. |
|
240 |
categoryList notNil ifTrue:[ |
|
241 |
categoryList addDependent:self |
|
242 |
]. |
|
243 |
||
244 |
"Created: / 18.8.2000 / 15:21:42 / cg" |
|
245 |
! |
|
246 |
||
247 |
classCategoryLabelHolder |
|
248 |
^ self pseudoListLabelHolder |
|
249 |
! |
|
250 |
||
251 |
selectedCategories |
|
252 |
^ self selectionHolder |
|
253 |
! |
|
254 |
||
255 |
selectedCategories:aValueHolder |
|
256 |
^ self selectionHolder:aValueHolder |
|
257 |
! ! |
|
258 |
||
259 |
!ClassCategoryList methodsFor:'change & update'! |
|
260 |
||
261 |
delayedUpdate:something with:aParameter from:changedObject |
|
6702 | 262 |
|selectedCategories allSelectedBefore |
5591 | 263 |
nameListEntryForALL categoryOfClass wg| |
264 |
||
265 |
selectedCategories := self selectedCategoriesStrings. |
|
266 |
||
267 |
changedObject == Smalltalk ifTrue:[ |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
268 |
((something == #classVariables) |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
269 |
or:[something == #classDefinition]) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
270 |
listValid == true ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
271 |
categoryOfClass := aParameter category. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
272 |
(categoryList value includes:categoryOfClass) ifFalse:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
273 |
self invalidateList. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
274 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
275 |
slaveMode value ~~ true ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
276 |
(selectedCategories includes:categoryOfClass) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
277 |
"/ a selected class has changed |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
278 |
"/ 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
|
279 |
"/ 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
|
280 |
"/ self enqueueDelayedUpdateOutputGenerator |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
281 |
self enqueueMessage:#updateOutputGenerator for:self arguments:#() |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
282 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
283 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
284 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
285 |
^ self |
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 |
something == #newClass ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
288 |
categoryOfClass := aParameter category. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
289 |
listValid == false ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
290 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
291 |
]. |
5591 | 292 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
293 |
(categoryList value includes:categoryOfClass) ifFalse:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
294 |
self invalidateList. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
295 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
296 |
|
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
297 |
slaveMode value ~~ true ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
298 |
(selectedCategories includes:categoryOfClass) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
299 |
self enqueueDelayedUpdateOutputGenerator |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
300 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
301 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
302 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
303 |
]. |
5591 | 304 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
305 |
self invalidateList. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
306 |
|
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
307 |
(something == #classRemove |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
308 |
or:[something == #projectOrganization |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
309 |
or:[something == #organization]]) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
310 |
slaveMode value ~~ true ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
311 |
"/ sorry: cannot filter on category (already changed to #removed) |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
312 |
self enqueueDelayedUpdateOutputGenerator |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
313 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
314 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
315 |
^ self |
5591 | 316 |
]. |
317 |
||
318 |
changedObject == ChangeSet ifTrue:[ |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
319 |
"/ remove all other change notifications from the eventQueue |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
320 |
wg := self windowGroup. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
321 |
wg isNil ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
322 |
"/ oops - should no longer be dependent... |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
323 |
changedObject removeDependent:self. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
324 |
] ifFalse:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
325 |
wg sensor |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
326 |
flushEventsFor:self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
327 |
where:[:ev | ev isMessageSendEvent |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
328 |
and:[ev selector == #delayedUpdate:with:from: |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
329 |
and:[(ev arguments at:3) == ChangeSet]]]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
330 |
]. |
5591 | 331 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
332 |
something == #addChange: ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
333 |
"/ only need to invalidate, if that change changes my emphasis |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
334 |
"/ (i.e. if its a new methodChange) |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
335 |
self window topView shown ifFalse:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
336 |
self invalidateList. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
337 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
338 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
339 |
|
5591 | 340 |
"/ self invalidateList. |
341 |
||
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
342 |
aParameter isMethodChange ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
343 |
aParameter changeClass notNil ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
344 |
(ChangeSet current |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
345 |
count:[:chg | chg notNil and:[chg isMethodChange |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
346 |
and:[ chg className = aParameter className ]]]) |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
347 |
== 1 ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
348 |
"/ that methodChange is the first for this method. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
349 |
self colorizeCategoryAsChanged:(aParameter changeClass category). |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
350 |
] |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
351 |
] |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
352 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
353 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
354 |
]. |
5591 | 355 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
356 |
self invalidateList. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
357 |
^ self |
5591 | 358 |
]. |
359 |
||
360 |
changedObject == nameSpaceFilter ifTrue:[ |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
361 |
"/ all might be more or less than before ... |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
362 |
allSelected := false. |
5591 | 363 |
]. |
364 |
changedObject == packageFilter ifTrue:[ |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
365 |
"/ all might be more or less than before ... |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
366 |
allSelected := false. |
5591 | 367 |
]. |
368 |
||
6702 | 369 |
changedObject == self selectedCategories ifTrue:[ |
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
370 |
categoryList isNil ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
371 |
"/ oops - hurry up |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
372 |
self invalidateList. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
373 |
]. |
5591 | 374 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
375 |
nameListEntryForALL := self class nameListEntryForALL. |
5591 | 376 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
377 |
selectedCategories size > 1 ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
378 |
(selectedCategories includes:nameListEntryForALL) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
379 |
self makeSelectionOtherThanAllVisible. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
380 |
] |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
381 |
]. |
5591 | 382 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
383 |
"/ 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
|
384 |
allSelectedBefore := allSelected ? false. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
385 |
allSelected := selectedCategories includes:nameListEntryForALL. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
386 |
(allSelectedBefore and:[allSelected]) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
387 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
388 |
]. |
5591 | 389 |
]. |
390 |
||
391 |
super delayedUpdate:something with:aParameter from:changedObject |
|
392 |
||
393 |
"Created: / 5.2.2000 / 13:42:12 / cg" |
|
394 |
"Modified: / 12.11.2001 / 19:36:16 / cg" |
|
395 |
! |
|
396 |
||
397 |
forceUpdateList |
|
398 |
self categoryList setValue:#(). |
|
399 |
self updateList. |
|
400 |
self categoryList changed. |
|
401 |
! |
|
402 |
||
403 |
selectionChangedByClick |
|
404 |
"we are not interested in that - get another notification |
|
405 |
via the changed valueHolder" |
|
406 |
||
407 |
"Created: / 11.2.2000 / 11:39:48 / cg" |
|
408 |
! |
|
409 |
||
410 |
update:something with:aParameter from:changedObject |
|
411 |
|categoryOfClass| |
|
412 |
||
413 |
changedObject == Smalltalk ifTrue:[ |
|
8751 | 414 |
(something == #methodInClass |
415 |
or:[ something == #classComment |
|
416 |
or:[ something == #methodDictionary |
|
417 |
or:[ something == #methodTrap |
|
418 |
or:[ something == #methodInClassRemoved ]]]]) ifTrue:[ |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
419 |
^ self |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
420 |
]. |
8751 | 421 |
|
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
422 |
(something == #classVariables |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
423 |
or:[something == #classDefinition]) ifTrue:[ |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
424 |
categoryOfClass := aParameter category. |
6702 | 425 |
(self selectedCategoriesStrings includes:categoryOfClass) ifTrue:[ |
5591 | 426 |
"/ self halt. |
6677
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
427 |
self updateOutputGenerator. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
428 |
]. |
bae57592a094
ignore some updates - speedup
Claus Gittinger <cg@exept.de>
parents:
6492
diff
changeset
|
429 |
]. |
5591 | 430 |
]. |
431 |
||
432 |
"/ changedObject == ChangeSet ifTrue:[ |
|
433 |
"/ something == #addChange: ifTrue:[ |
|
434 |
"/ ^ self |
|
435 |
"/ ] |
|
436 |
"/ ]. |
|
437 |
||
438 |
super update:something with:aParameter from:changedObject |
|
439 |
||
440 |
"Modified: / 5.11.2001 / 14:31:18 / cg" |
|
441 |
! ! |
|
442 |
||
443 |
!ClassCategoryList methodsFor:'drag & drop'! |
|
444 |
||
6468 | 445 |
canDropContext:aDropContext |
7425
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
446 |
|cat objects droppedClasses| |
5591 | 447 |
|
7425
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
448 |
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
|
449 |
(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
|
450 |
|
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
451 |
(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
|
452 |
droppedClasses := objects. |
6468 | 453 |
(droppedClasses contains:[:aClass | aClass isPrivate not]) ifFalse:[^ false]. |
5591 | 454 |
|
455 |
cat := self categoryAtTargetPointOf:aDropContext. |
|
6492 | 456 |
cat isNil ifTrue:[ ^ false ]. |
457 |
cat = '* obsolete *' ifTrue:[ ^ false ]. |
|
5591 | 458 |
|
6468 | 459 |
(droppedClasses contains:[:aClass | aClass category ~= cat]) ifFalse:[^ false]. |
5591 | 460 |
^ true. |
7119 | 461 |
|
7425
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
462 |
"Modified: / 17-10-2006 / 18:28:04 / cg" |
5591 | 463 |
! |
464 |
||
465 |
categoryAtTargetPointOf:aDropContext |
|
466 |
|p categoryListView lineNr cat| |
|
467 |
||
468 |
p := aDropContext targetPoint. |
|
469 |
||
470 |
categoryListView := aDropContext targetWidget. |
|
471 |
||
472 |
lineNr := categoryListView lineAtY:p y. |
|
473 |
lineNr isNil ifTrue:[^ nil]. |
|
474 |
||
475 |
cat := categoryList value at:lineNr. |
|
476 |
cat := cat string. |
|
477 |
cat = self class nameListEntryForALL ifTrue:[^ nil]. |
|
6702 | 478 |
(cat endsWith:(self stringForExtensions)) ifTrue:[ |
479 |
cat := cat copyWithoutLast:(self stringForExtensions size) |
|
480 |
]. |
|
5591 | 481 |
^ cat |
482 |
! |
|
483 |
||
6468 | 484 |
doDropContext:aDropContext |
7425
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
485 |
|cat objects| |
5591 | 486 |
|
7425
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
487 |
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
|
488 |
(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
|
489 |
cat := self categoryAtTargetPointOf:aDropContext. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
490 |
cat notNil ifTrue:[ |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
491 |
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
|
492 |
]. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
493 |
^ self |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
494 |
]. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
495 |
(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
|
496 |
self dropClassFiles:objects. |
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
497 |
^ self |
5591 | 498 |
]. |
7119 | 499 |
|
7425
9e029102ef55
drag&drop:allow dropping st-files from the windows explorer
Claus Gittinger <cg@exept.de>
parents:
7119
diff
changeset
|
500 |
"Modified: / 17-10-2006 / 18:29:25 / cg" |
5591 | 501 |
! ! |
502 |
||
503 |
!ClassCategoryList methodsFor:'generators'! |
|
504 |
||
505 |
makeGenerator |
|
506 |
"return a generator which enumerates the classes from the selected category." |
|
507 |
||
8751 | 508 |
|cats hideUnloadedClasses allName nameSpaceFilter packageFilter |
509 |
showChangedClasses showUnloaded showUndocumented inclusionTest changedClasses| |
|
5591 | 510 |
|
6702 | 511 |
cats := self selectedCategoriesStrings. |
5591 | 512 |
cats size == 0 ifTrue:[ |
6066
dbc820318498
care for nil-category in classes
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
513 |
^ #() |
5591 | 514 |
]. |
515 |
||
516 |
allName := self class nameListEntryForALL. |
|
517 |
||
8345
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
518 |
(cats includes:allName) ifTrue:[ |
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
519 |
inGeneratorHolder value isOrderedCollection ifTrue:[ |
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
520 |
cats := categoryList value copyWithout:allName. |
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
521 |
] |
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
522 |
]. |
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
523 |
|
8734 | 524 |
showChangedClasses := cats includes:(self class nameListEntryForChanged). |
8751 | 525 |
showUnloaded := cats includes:(self class nameListEntryForUnloaded). |
526 |
showUndocumented := cats includes:(self class nameListEntryForUndocumented). |
|
8734 | 527 |
|
5591 | 528 |
hideUnloadedClasses := self hideUnloadedClasses value ? false. |
529 |
nameSpaceFilter := self nameSpaceFilter value. |
|
530 |
nameSpaceFilter notNil ifTrue:[ |
|
6066
dbc820318498
care for nil-category in classes
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
531 |
(nameSpaceFilter includes:allName) ifTrue:[nameSpaceFilter := nil]. |
5591 | 532 |
]. |
533 |
packageFilter := self packageFilter value. |
|
534 |
packageFilter notNil ifTrue:[ |
|
6066
dbc820318498
care for nil-category in classes
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
535 |
(packageFilter includes:allName) ifTrue:[packageFilter := nil]. |
5591 | 536 |
]. |
537 |
||
538 |
(cats includes:allName) ifTrue:[ |
|
6066
dbc820318498
care for nil-category in classes
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
539 |
hideUnloadedClasses ifTrue:[ |
8751 | 540 |
inclusionTest := [:cls | cls isLoaded]. |
541 |
] ifFalse:[ |
|
542 |
inclusionTest := [:cls | true]. |
|
6066
dbc820318498
care for nil-category in classes
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
543 |
]. |
8751 | 544 |
] ifFalse:[ |
545 |
inclusionTest := |
|
546 |
[:cls | |
|
547 |
|cat isLoaded included| |
|
548 |
||
549 |
isLoaded := cls isLoaded. |
|
550 |
included := isLoaded not and:[ showUnloaded ]. |
|
551 |
included ifFalse:[ |
|
552 |
(hideUnloadedClasses not or:[isLoaded]) ifTrue:[ |
|
553 |
cat := cls category ? '* no category *'. |
|
554 |
included := cats includes:cat. |
|
555 |
included ifFalse:[ |
|
556 |
included := showChangedClasses |
|
557 |
and:[ (changedClasses includes:cls theNonMetaclass) |
|
558 |
or:[(changedClasses includes:cls theMetaclass)] ]. |
|
559 |
included ifFalse:[ |
|
9005 | 560 |
included := showUndocumented and:[ isLoaded and:[ (cls theMetaclass includesSelector:#documentation) not ]]. |
8751 | 561 |
]. |
562 |
]. |
|
563 |
]. |
|
564 |
]. |
|
565 |
included |
|
566 |
]. |
|
5591 | 567 |
]. |
568 |
||
8748 | 569 |
^ Iterator on:[:whatToDo | |
8751 | 570 |
showChangedClasses ifTrue:[ changedClasses := ChangeSet current changedClasses ]. |
8734 | 571 |
|
8751 | 572 |
Smalltalk allClassesDo:[:cls | |
573 |
(cls isRealNameSpace) ifFalse:[ |
|
574 |
(inclusionTest value:cls) ifTrue:[ |
|
575 |
(nameSpaceFilter isNil |
|
576 |
or:[self isClass:cls shownWithNameSpaceFilter:nameSpaceFilter]) ifTrue:[ |
|
577 |
(packageFilter isNil |
|
578 |
or:[self isClass:cls shownWithPackageFilter:packageFilter]) ifTrue:[ |
|
579 |
whatToDo value:cls |
|
580 |
] |
|
581 |
] |
|
582 |
]. |
|
583 |
]. |
|
584 |
]. |
|
585 |
]. |
|
5591 | 586 |
|
7504 | 587 |
"Created: / 05-02-2000 / 13:42:12 / cg" |
588 |
"Modified: / 10-11-2006 / 17:13:26 / cg" |
|
5591 | 589 |
! ! |
590 |
||
591 |
!ClassCategoryList methodsFor:'private'! |
|
592 |
||
593 |
colorizeCategoryAsChanged:category |
|
594 |
|colorizedCategoryItem categoryList idx| |
|
595 |
||
596 |
colorizedCategoryItem := self colorizeForChangedCode:category copy asText. |
|
597 |
||
598 |
categoryList := self categoryList value. |
|
599 |
idx := categoryList indexOf:category. |
|
600 |
idx ~~ 0 ifTrue:[ |
|
601 |
((categoryList at:idx) sameStringAndEmphasisAs:colorizedCategoryItem) ifFalse:[ |
|
602 |
categoryList at:idx put:colorizedCategoryItem. |
|
603 |
self categoryList changed. |
|
604 |
] |
|
605 |
]. |
|
606 |
! |
|
607 |
||
608 |
listOfCategories |
|
609 |
|categories hideUnloadedClasses generator nameSpaceFilter packageFilter allName |
|
7504 | 610 |
categoriesWithExtensions categoriesWithChangedCode categoriesWithRemoteChangedCode |
9127 | 611 |
classesInChangeSet classesInRemoteChangeSet |
612 |
numClassesInChangeSet numClasses numUnloaded numUndocumented pseudoEntryColor| |
|
5591 | 613 |
|
614 |
allName := self class nameListEntryForALL. |
|
615 |
||
616 |
hideUnloadedClasses := self hideUnloadedClasses value. |
|
617 |
nameSpaceFilter := self nameSpaceFilter value. |
|
618 |
nameSpaceFilter notNil ifTrue:[ |
|
5950 | 619 |
(nameSpaceFilter includes:allName) ifTrue:[nameSpaceFilter := nil]. |
5591 | 620 |
]. |
621 |
packageFilter := self packageFilter value. |
|
622 |
packageFilter notNil ifTrue:[ |
|
5950 | 623 |
(packageFilter includes:allName) ifTrue:[packageFilter := nil]. |
5591 | 624 |
]. |
625 |
||
8751 | 626 |
numClasses := numUndocumented := numUnloaded := numClassesInChangeSet := 0. |
8734 | 627 |
|
5591 | 628 |
categories := Set new. |
629 |
categoriesWithExtensions := Set new. |
|
630 |
categoriesWithChangedCode := Set new. |
|
7504 | 631 |
categoriesWithRemoteChangedCode := Set new. |
5591 | 632 |
|
6978 | 633 |
classesInChangeSet := ChangeSet current changedClasses. |
634 |
classesInChangeSet := classesInChangeSet collect:[:eachClass | eachClass theNonMetaclass]. |
|
5591 | 635 |
|
7504 | 636 |
classesInRemoteChangeSet := SmallTeam isNil ifTrue:[#()] ifFalse:[ SmallTeam changedClasses ]. |
637 |
classesInRemoteChangeSet := classesInRemoteChangeSet collect:[:each | each theNonMetaclass]. |
|
638 |
||
5591 | 639 |
classes := IdentitySet new. |
640 |
inGeneratorHolder isNil ifTrue:[ |
|
5950 | 641 |
Smalltalk allClassesDo:[:cls | |
8751 | 642 |
|cat isLoaded| |
643 |
||
644 |
(cls isRealNameSpace) ifFalse:[ |
|
645 |
(nameSpaceFilter isNil |
|
646 |
or:[self isClass:cls shownWithNameSpaceFilter:nameSpaceFilter]) ifTrue:[ |
|
647 |
(packageFilter isNil |
|
648 |
or:[self isClass:cls shownWithPackageFilter:packageFilter]) ifTrue:[ |
|
5591 | 649 |
|
8751 | 650 |
isLoaded := cls isLoaded. |
651 |
isLoaded ifTrue:[ |
|
652 |
numUnloaded := numUnloaded + 1. |
|
9005 | 653 |
(cls theMetaclass includesSelector:#documentation) ifFalse:[ |
8751 | 654 |
numUndocumented := numUndocumented + 1. |
655 |
]. |
|
656 |
]. |
|
657 |
||
658 |
(hideUnloadedClasses not or:[isLoaded]) |
|
659 |
ifTrue:[ |
|
8734 | 660 |
numClasses := numClasses + 1. |
661 |
||
6066
dbc820318498
care for nil-category in classes
Claus Gittinger <cg@exept.de>
parents:
5950
diff
changeset
|
662 |
cat := cls category ? '* no category *'. |
5950 | 663 |
cat isString ifFalse:[self halt:'oops - strange category']. |
664 |
categories add:cat. |
|
665 |
classes add:cls. |
|
5591 | 666 |
|
6978 | 667 |
(classesInChangeSet includes:cls theNonMetaclass) ifTrue:[ |
5950 | 668 |
categoriesWithChangedCode add:cat |
7504 | 669 |
]. |
670 |
(classesInRemoteChangeSet includes:cls theNonMetaclass) ifTrue:[ |
|
671 |
categoriesWithRemoteChangedCode add:cat |
|
672 |
]. |
|
673 |
cls hasExtensions ifTrue:[ |
|
674 |
categoriesWithExtensions add:cat |
|
5950 | 675 |
]. |
676 |
] |
|
677 |
] |
|
678 |
] |
|
679 |
] |
|
680 |
]. |
|
5591 | 681 |
|
5950 | 682 |
"/ those are simulated - in ST/X, empty categories do not |
683 |
"/ really exist; however, during browsing, it makes sense. |
|
684 |
AdditionalEmptyCategories size > 0 ifTrue:[ |
|
685 |
"/ remove those that are present ... |
|
686 |
AdditionalEmptyCategories := AdditionalEmptyCategories select:[:cat | (categories includes:cat) not]. |
|
687 |
categories addAll:AdditionalEmptyCategories. |
|
688 |
]. |
|
5591 | 689 |
] ifFalse:[ |
5950 | 690 |
generator := inGeneratorHolder value. |
691 |
generator isNil ifTrue:[^ #() ]. |
|
8345
b2e8f543ec50
being a categoryList with a fixed given list
Claus Gittinger <cg@exept.de>
parents:
7504
diff
changeset
|
692 |
generator do:[:cat | categories add:cat string]. |
5591 | 693 |
]. |
694 |
||
695 |
categories := categories asOrderedCollection. |
|
696 |
||
697 |
categories sort. |
|
5950 | 698 |
categories := |
699 |
categories collect:[:cat | |
|
700 |
(categoriesWithChangedCode includes:cat) ifTrue:[ |
|
701 |
(self colorizeForChangedCode:cat copy asText). |
|
702 |
] ifFalse:[ |
|
703 |
(categoriesWithExtensions includes:cat) ifTrue:[ |
|
704 |
(self colorizeForDifferentPackage:cat copy asText) |
|
705 |
"/ cannot add a + here - need separate list for presentation and filter |
|
6702 | 706 |
"/ cat , (self colorizeForDifferentPackage:self stringForExtensions) |
5950 | 707 |
] ifFalse:[ |
7504 | 708 |
(categoriesWithRemoteChangedCode includes:cat) ifTrue:[ |
709 |
(self colorizeForChangedCodeInSmallTeam:cat copy asText). |
|
710 |
] ifFalse:[ |
|
8751 | 711 |
cat |
7504 | 712 |
] |
5950 | 713 |
] |
714 |
] |
|
715 |
]. |
|
8734 | 716 |
|
9127 | 717 |
pseudoEntryColor := self class pseudoEntryForegroundColor. |
718 |
||
8751 | 719 |
numUnloaded > 0 ifTrue:[ |
720 |
"/ dont include count - makeGenerator compares against the un-expanded nameListEntry (sigh - need two lists) |
|
9127 | 721 |
categories addFirst:((self class nameListEntryForUnloaded "bindWith:numClassesInChangeSet") allItalic colorizeAllWith:pseudoEntryColor). |
8751 | 722 |
]. |
723 |
numUndocumented > 0 ifTrue:[ |
|
724 |
"/ dont include count - makeGenerator compares against the un-expanded nameListEntry (sigh - need two lists) |
|
9127 | 725 |
categories addFirst:((self class nameListEntryForUndocumented "bindWith:numClassesInChangeSet") allItalic colorizeAllWith:pseudoEntryColor). |
8751 | 726 |
]. |
8734 | 727 |
numClassesInChangeSet := ChangeSet current changedClasses size. |
728 |
numClassesInChangeSet > 0 ifTrue:[ |
|
729 |
"/ dont include count - makeGenerator compares against the un-expanded nameListEntry (sigh - need two lists) |
|
9127 | 730 |
categories addFirst:((self class nameListEntryForChanged "bindWith:numClassesInChangeSet") allItalic colorizeAllWith:pseudoEntryColor). |
5591 | 731 |
]. |
8734 | 732 |
|
733 |
categories size > 0 ifTrue:[ |
|
734 |
categories size == 1 ifTrue:[ |
|
735 |
self classCategoryLabelHolder value:(categories first) |
|
736 |
]. |
|
9127 | 737 |
categories addFirst:((self class nameListEntryForALL "WithCount bindWith:numClasses") allItalic colorizeAllWith:pseudoEntryColor). |
5591 | 738 |
]. |
8734 | 739 |
|
5591 | 740 |
^ categories |
741 |
||
6950 | 742 |
"Created: / 05-02-2000 / 13:42:12 / cg" |
7504 | 743 |
"Modified: / 10-11-2006 / 17:43:19 / cg" |
5591 | 744 |
! |
745 |
||
746 |
listView |
|
8741 | 747 |
^ self componentAt:#List |
5591 | 748 |
! |
749 |
||
750 |
makeDependent |
|
751 |
Smalltalk addDependent:self. |
|
752 |
ChangeSet addDependent:self. |
|
753 |
||
754 |
"Created: / 5.2.2000 / 13:42:13 / cg" |
|
755 |
! |
|
756 |
||
757 |
makeIndependent |
|
758 |
Smalltalk removeDependent:self. |
|
759 |
ChangeSet removeDependent:self. |
|
760 |
||
761 |
"Created: / 5.2.2000 / 13:42:13 / cg" |
|
762 |
! |
|
763 |
||
764 |
makeItemVisible:item |
|
765 |
|idx listView| |
|
766 |
||
767 |
idx := categoryList value indexOf:item. |
|
768 |
idx ~~ 0 ifTrue:[ |
|
769 |
(listView := self listView) notNil ifTrue:[ |
|
770 |
listView makeLineVisible:idx. |
|
771 |
] |
|
772 |
] |
|
773 |
! |
|
774 |
||
775 |
makeSelectionOtherThanAllVisible |
|
776 |
|selectedCategories item| |
|
777 |
||
778 |
selectedCategories := self selectedCategoriesStrings. |
|
779 |
"/ the first item after the *all* item |
|
780 |
item := (selectedCategories copy remove:self class nameListEntryForALL; yourself) first. |
|
781 |
self makeItemVisible:item. |
|
782 |
! |
|
783 |
||
784 |
release |
|
785 |
super release. |
|
786 |
||
787 |
categoryList removeDependent:self. |
|
788 |
! |
|
789 |
||
790 |
selectedCategoriesStrings |
|
6950 | 791 |
|selectedCategoriesHolder selectedCategories stringForExtensions| |
792 |
||
793 |
stringForExtensions := self stringForExtensions. |
|
5591 | 794 |
|
795 |
selectedCategoriesHolder := self selectedCategories. |
|
796 |
selectedCategories := selectedCategoriesHolder value ? #(). |
|
6950 | 797 |
|
6702 | 798 |
selectedCategories := selectedCategories |
799 |
collect:[:each | |
|
800 |
|s| |
|
801 |
s := each string. |
|
6950 | 802 |
(s endsWith:stringForExtensions) ifTrue:[ |
803 |
s := s copyWithoutLast:(stringForExtensions size). |
|
6702 | 804 |
]. |
805 |
s |
|
806 |
]. |
|
5591 | 807 |
^ selectedCategories |
6950 | 808 |
|
809 |
"Modified: / 23-08-2006 / 11:38:26 / cg" |
|
5591 | 810 |
! |
811 |
||
6702 | 812 |
stringForExtensions |
813 |
^ ' [ + ]' |
|
814 |
! |
|
815 |
||
5591 | 816 |
updateList |
817 |
|oldList newList oldSelection newSelection prevClasses |
|
818 |
selectedCategoriesHolder| |
|
819 |
||
820 |
selectedCategoriesHolder := self selectedCategories. |
|
821 |
oldSelection := selectedCategoriesHolder value ? #(). |
|
822 |
prevClasses := classes copy. |
|
823 |
||
824 |
newList := self listOfCategories. |
|
825 |
oldList := (self categoryList value) ? #(). |
|
826 |
(newList sameContentsAs:oldList whenComparedWith:[:a :b | a sameStringAndEmphasisAs: b]) |
|
827 |
ifFalse:[ |
|
828 |
oldSelection size > 0 ifTrue:[ |
|
829 |
selectedCategoriesHolder removeDependent:self. |
|
830 |
selectedCategoriesHolder value:#(). |
|
831 |
selectedCategoriesHolder addDependent:self. |
|
832 |
]. |
|
833 |
categoryList value:newList. |
|
834 |
||
835 |
oldSelection size > 0 ifTrue:[ |
|
836 |
newSelection := oldSelection select:[:cat | newList includes:cat]. |
|
837 |
selectedCategoriesHolder value:newSelection. |
|
838 |
] |
|
839 |
] ifTrue:[ |
|
840 |
"/ in case the same categories are present, but classes have changed ... |
|
841 |
(prevClasses isNil or:[(classes identicalContentsAs:prevClasses) not]) ifTrue:[ |
|
842 |
self updateOutputGenerator. |
|
843 |
] |
|
844 |
]. |
|
845 |
listValid := true. |
|
846 |
||
847 |
"Created: / 5.2.2000 / 13:42:13 / cg" |
|
848 |
"Modified: / 18.8.2000 / 15:52:22 / cg" |
|
849 |
! ! |
|
850 |
||
851 |
!ClassCategoryList methodsFor:'setup'! |
|
852 |
||
5909 | 853 |
commonPostBuild |
5591 | 854 |
|listView| |
855 |
||
856 |
listView := self listView. |
|
857 |
listView notNil ifTrue:[ |
|
5909 | 858 |
listView scrollWhenUpdating:nil |
5591 | 859 |
]. |
5909 | 860 |
super commonPostBuild |
5591 | 861 |
! ! |
862 |
||
863 |
!ClassCategoryList methodsFor:'special'! |
|
864 |
||
865 |
addAdditionalCategory:aCategory |
|
866 |
"/ those are simulated - in ST/X, empty categories do not |
|
867 |
"/ really exist; however, during browsing, it makes sense. |
|
868 |
||
8373 | 869 |
self class addAdditionalCategory:aCategory |
5591 | 870 |
! |
871 |
||
872 |
removeAdditionalCategories:aListOfCategories |
|
8373 | 873 |
self class removeAdditionalCategories:aListOfCategories |
5591 | 874 |
! |
875 |
||
876 |
removeAllAdditionalCategories |
|
8373 | 877 |
self class removeAllAdditionalCategories |
8446 | 878 |
! |
879 |
||
880 |
renameAdditionalCategories:oldNames to:newName |
|
881 |
"/ those are simulated - in ST/X, empty categories do not |
|
882 |
"/ really exist; however, during browsing, it makes sense. |
|
883 |
||
884 |
self class renameAdditionalCategories:oldNames to:newName |
|
5591 | 885 |
! ! |
886 |
||
887 |
!ClassCategoryList class methodsFor:'documentation'! |
|
888 |
||
889 |
version |
|
9463 | 890 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ClassCategoryList.st,v 1.29 2010-05-07 12:27:27 cg Exp $' |
9005 | 891 |
! |
892 |
||
893 |
version_CVS |
|
9463 | 894 |
^ '$Header: /cvs/stx/stx/libtool/Tools_ClassCategoryList.st,v 1.29 2010-05-07 12:27:27 cg Exp $' |
5591 | 895 |
! ! |