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