author | Claus Gittinger <cg@exept.de> |
Wed, 22 Aug 2018 15:37:08 +0200 | |
changeset 18348 | b3cdcd31f2cf |
parent 14020 | 6d318d3f52fd |
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 |
ProjectList subclass:#HierarchicalProjectList |
|
17 |
instanceVariableNames:'hierarchicalProjectTree selectedProjectItems packageIcon |
|
18 |
hierarchicalProjectList hierarchicalProjectSelection |
|
19 |
packageToItemDictionary' |
|
20 |
classVariableNames:'' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'Interface-Browsers-New' |
|
23 |
! |
|
24 |
||
6690 | 25 |
HierarchicalItemWithLabel subclass:#ProjectItem |
26 |
instanceVariableNames:'packageID' |
|
5670
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
27 |
classVariableNames:'' |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
28 |
poolDictionaries:'' |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
29 |
privateIn:HierarchicalProjectList |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
30 |
! |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
31 |
|
5591 | 32 |
!HierarchicalProjectList class methodsFor:'documentation'! |
33 |
||
6179 | 34 |
copyright |
35 |
" |
|
36 |
COPYRIGHT (c) 2004 by eXept Software AG |
|
37 |
All Rights Reserved |
|
38 |
||
39 |
This software is furnished under a license and may be used |
|
40 |
only in accordance with the terms of that license and with the |
|
41 |
inclusion of the above copyright notice. This software may not |
|
42 |
be provided or otherwise made available to, or used by, any |
|
43 |
other person. No title to or ownership of the software is |
|
44 |
hereby transferred. |
|
45 |
" |
|
46 |
! |
|
47 |
||
5591 | 48 |
documentation |
49 |
" |
|
50 |
Like a ClassList, but shows classes hierarchical. |
|
51 |
||
52 |
If topClassHolders value is non-nil, only that classes hierarchy |
|
53 |
is shown. |
|
54 |
||
55 |
embeddable application displaying the classes as listed by |
|
56 |
the inputGenerator. |
|
57 |
Provides an outputGenerator, which enumerates the classes and |
|
58 |
their protocols (method-categories) in the selected classes. |
|
59 |
||
60 |
[author:] |
|
61 |
Claus Gittinger (cg@exept.de) |
|
62 |
" |
|
63 |
||
64 |
||
65 |
! ! |
|
66 |
||
67 |
!HierarchicalProjectList class methodsFor:'interface specs'! |
|
68 |
||
69 |
windowSpec |
|
70 |
"This resource specification was automatically generated |
|
71 |
by the UIPainter of ST/X." |
|
72 |
||
73 |
"Do not manually edit this!! If it is corrupted, |
|
74 |
the UIPainter may not be able to read the specification." |
|
75 |
||
76 |
" |
|
77 |
UIPainter new openOnClass:HierarchicalProjectList andSelector:#windowSpec |
|
78 |
HierarchicalProjectList new openInterface:#windowSpec |
|
79 |
HierarchicalProjectList open |
|
80 |
" |
|
81 |
||
82 |
<resource: #canvas> |
|
83 |
||
84 |
^ |
|
85 |
#(#FullSpec |
|
9468 | 86 |
#name: #windowSpec |
87 |
#window: |
|
5591 | 88 |
#(#WindowSpec |
9468 | 89 |
#label: 'ProjectList' |
90 |
#name: 'ProjectList' |
|
91 |
#min: #(#Point 0 0) |
|
92 |
#bounds: #(#Rectangle 16 46 316 346) |
|
93 |
) |
|
94 |
#component: |
|
5591 | 95 |
#(#SpecCollection |
9468 | 96 |
#collection: #( |
97 |
#(#HierarchicalListViewSpec |
|
98 |
#name: 'HierarchicalListView1' |
|
99 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
100 |
#tabable: true |
|
101 |
#model: #hierarchicalProjectSelection |
|
102 |
#menu: #menuHolder |
|
103 |
#hasHorizontalScrollBar: true |
|
104 |
#hasVerticalScrollBar: true |
|
105 |
#miniScrollerHorizontal: true |
|
106 |
#listModel: #hierarchicalProjectList |
|
107 |
#multipleSelectOk: true |
|
108 |
#highlightMode: #line |
|
109 |
#doubleClickSelector: #doubleClicked: |
|
110 |
#indicatorSelector: #indicatorPressed: |
|
111 |
#properties: |
|
112 |
#(#PropertyListDictionary |
|
113 |
#dragArgument: nil |
|
114 |
#dropArgument: nil |
|
115 |
#canDropSelector: #canDrop: |
|
116 |
#dropSelector: #doDrop: |
|
117 |
) |
|
118 |
) |
|
119 |
) |
|
5591 | 120 |
|
9468 | 121 |
) |
5591 | 122 |
) |
123 |
! |
|
124 |
||
125 |
xxwindowSpec |
|
126 |
"This resource specification was automatically generated |
|
127 |
by the UIPainter of ST/X." |
|
128 |
||
129 |
"Do not manually edit this!! If it is corrupted, |
|
130 |
the UIPainter may not be able to read the specification." |
|
131 |
||
132 |
" |
|
133 |
UIPainter new openOnClass:HierarchicalProjectList andSelector:#windowSpec |
|
134 |
HierarchicalProjectList new openInterface:#windowSpec |
|
135 |
HierarchicalProjectList open |
|
136 |
" |
|
137 |
||
138 |
<resource: #canvas> |
|
139 |
||
140 |
^ |
|
141 |
#(#FullSpec |
|
5592 | 142 |
#name: #windowSpec |
143 |
#window: |
|
5591 | 144 |
#(#WindowSpec |
5592 | 145 |
#label: 'ProjectList' |
146 |
#name: 'ProjectList' |
|
147 |
#min: #(#Point 0 0) |
|
148 |
#max: #(#Point 1024 721) |
|
149 |
#bounds: #(#Rectangle 12 22 312 322) |
|
150 |
) |
|
151 |
#component: |
|
5591 | 152 |
#(#SpecCollection |
5592 | 153 |
#collection: #( |
154 |
#(#SelectionInTreeViewSpec |
|
155 |
#name: 'List' |
|
156 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
157 |
#model: #selectedProjectItems |
|
158 |
#menu: #menuHolder |
|
159 |
#hasHorizontalScrollBar: true |
|
160 |
#hasVerticalScrollBar: true |
|
161 |
#miniScrollerHorizontal: true |
|
162 |
#showRoot: false |
|
163 |
#showDirectoryIndicator: true |
|
164 |
#isMultiSelect: true |
|
165 |
#valueChangeSelector: #selectionChangedByClick |
|
166 |
#hierarchicalList: #hierarchicalProjectTree |
|
167 |
#childrenSelector: #actionToRetrieveChildren |
|
168 |
#highlightMode: #line |
|
169 |
#doubleClickChannel: #doubleClickChannel |
|
170 |
) |
|
171 |
#(#HierarchicalListViewSpec |
|
172 |
#name: 'HierarchicalListView1' |
|
173 |
#layout: #(#LayoutFrame 0 0.0 0 0.0 0 1.0 0 1.0) |
|
174 |
#tabable: true |
|
175 |
#hasHorizontalScrollBar: true |
|
176 |
#hasVerticalScrollBar: true |
|
177 |
#miniScrollerHorizontal: true |
|
178 |
#listModel: #hierarchicalProjectList |
|
179 |
#multipleSelectOk: true |
|
180 |
#highlightMode: #line |
|
181 |
#doubleClickSelector: #doubleClicked: |
|
182 |
#indicatorSelector: #indicatorPressed: |
|
183 |
"/ #showLeftIndicators: false |
|
184 |
) |
|
185 |
) |
|
5591 | 186 |
|
5592 | 187 |
) |
5591 | 188 |
) |
189 |
! ! |
|
190 |
||
191 |
!HierarchicalProjectList class methodsFor:'plugIn spec'! |
|
192 |
||
193 |
aspectSelectors |
|
194 |
"This resource specification was automatically generated |
|
195 |
by the UIPainter of ST/X." |
|
196 |
||
197 |
"Do not manually edit this. If it is corrupted, |
|
198 |
the UIPainter may not be able to read the specification." |
|
199 |
||
200 |
"Return a description of exported aspects; |
|
201 |
these can be connected to aspects of an embedding application |
|
202 |
(if this app is embedded in a subCanvas)." |
|
203 |
||
204 |
^ #( |
|
14020
6d318d3f52fd
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13498
diff
changeset
|
205 |
environmentHolder |
10349 | 206 |
#(#doubleClickChannel #action ) |
207 |
#forceGeneratorTrigger |
|
208 |
#hideUnloadedClasses |
|
209 |
#immediateUpdate |
|
210 |
#inGeneratorHolder |
|
211 |
#menuHolder |
|
212 |
#organizerMode |
|
213 |
#outGeneratorHolder |
|
214 |
#selectedProjects |
|
215 |
#selectionChangeCondition |
|
216 |
#slaveMode |
|
217 |
#updateTrigger |
|
218 |
#showCoverageInformation |
|
5591 | 219 |
). |
220 |
||
10349 | 221 |
"Modified: / 20-07-2011 / 14:29:26 / cg" |
14020
6d318d3f52fd
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13498
diff
changeset
|
222 |
"Modified: / 24-02-2014 / 10:37:54 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
5591 | 223 |
! ! |
224 |
||
225 |
!HierarchicalProjectList methodsFor:'aspects'! |
|
226 |
||
227 |
generateHierarchicalProjectTree |
|
228 |
|anchor| |
|
229 |
||
230 |
self projectList value isNil ifTrue:[ |
|
231 |
self updateList. |
|
232 |
self projectList value isNil ifTrue:[ |
|
233 |
^ nil. |
|
234 |
] |
|
235 |
]. |
|
236 |
||
237 |
anchor := ProjectItem new. |
|
238 |
anchor package:''. |
|
239 |
anchor label:nil. |
|
240 |
||
241 |
packageToItemDictionary := IdentityDictionary new. |
|
242 |
packageToItemDictionary at:'' asSymbol put:anchor. |
|
243 |
||
244 |
self projectList value do:[:eachPackageString | |
|
245 |
|package| |
|
246 |
||
247 |
package := eachPackageString asSymbol. |
|
248 |
(packageToItemDictionary includesKey:package) ifFalse:[ |
|
249 |
self addPackage:package |
|
250 |
]. |
|
251 |
]. |
|
252 |
||
13498
b8d845e42988
Added `environment` instance variable to Tools__NewSystemBrowser and
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12710
diff
changeset
|
253 |
"/ environment allClassesDo:[:eachClass | |
5591 | 254 |
"/ |package| |
255 |
"/ |
|
256 |
"/ package := eachClass package asSymbol. |
|
257 |
"/ (packageToItemDictionary includesKey:package) ifFalse:[ |
|
258 |
"/ self addPackage:package |
|
259 |
"/ ]. |
|
260 |
"/ ]. |
|
261 |
anchor recursiveSortChildren:[:i1 :i2 | i1 label asLowercase < i2 label asLowercase]. |
|
262 |
anchor expand. |
|
263 |
||
264 |
^ anchor |
|
265 |
! |
|
266 |
||
267 |
hierarchicalProjectList |
|
268 |
|anchor | |
|
269 |
||
270 |
hierarchicalProjectList isNil ifTrue:[ |
|
271 |
hierarchicalProjectList := HierarchicalList new. |
|
272 |
hierarchicalProjectList showRoot:false. |
|
273 |
||
274 |
(self slaveMode value ~~ true) ifTrue:[ |
|
275 |
anchor := self generateHierarchicalProjectTree. |
|
276 |
hierarchicalProjectList root:anchor. |
|
277 |
listValid := true |
|
278 |
] ifFalse:[ |
|
279 |
listValid := false |
|
280 |
] |
|
281 |
]. |
|
282 |
^ hierarchicalProjectList |
|
283 |
! |
|
284 |
||
285 |
hierarchicalProjectSelection |
|
286 |
hierarchicalProjectSelection isNil ifTrue:[ |
|
287 |
hierarchicalProjectSelection := #() asValue. |
|
288 |
hierarchicalProjectSelection addDependent:self. |
|
289 |
]. |
|
290 |
^ hierarchicalProjectSelection. |
|
291 |
! |
|
292 |
||
293 |
updateTreeSelection |
|
294 |
"/ must expand items as required |
|
295 |
|itemsToSelect oldSelection newSelection| |
|
296 |
||
297 |
itemsToSelect := OrderedCollection new. |
|
298 |
||
299 |
(self selectedProjects value ? #()) do:[:eachSelectedProject | |
|
6910
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
300 |
|item child| |
5591 | 301 |
|
6910
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
302 |
item := hierarchicalProjectList root. |
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
303 |
item notNil ifTrue:[ |
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
304 |
(eachSelectedProject asCollectionOfSubstringsSeparatedByAny:':/') do:[:part | |
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
305 |
item expand. |
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
306 |
child := item detect:[:child | child label = part] ifNone:nil. |
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
307 |
child notNil ifTrue:[ |
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
308 |
item := child. |
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
309 |
]. |
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
310 |
]. |
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
311 |
itemsToSelect add:child. |
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
312 |
]. |
5591 | 313 |
]. |
314 |
oldSelection := hierarchicalProjectSelection value. |
|
315 |
newSelection := itemsToSelect collect:[:eachItem | hierarchicalProjectList identityIndexOf:eachItem]. |
|
316 |
oldSelection ~= newSelection ifTrue:[ |
|
6910
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
317 |
hierarchicalProjectSelection value:newSelection. |
5591 | 318 |
]. |
6910
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
319 |
|
bab240275ae0
code cleanup - remove old obsolete Project code
Claus Gittinger <cg@exept.de>
parents:
6715
diff
changeset
|
320 |
"Modified: / 17-08-2006 / 09:56:32 / cg" |
5591 | 321 |
! ! |
322 |
||
323 |
!HierarchicalProjectList methodsFor:'change & update'! |
|
324 |
||
325 |
delayedUpdate:something with:aParameter from:changedObject |
|
326 |
|cls sel oldMethod newMethod newPackage| |
|
327 |
||
328 |
self inSlaveModeOrInvisible ifTrue:[ |
|
329 |
super delayedUpdate:something with:aParameter from:changedObject. |
|
330 |
^ self. |
|
331 |
]. |
|
332 |
||
333 |
"/ (self slaveMode value == true) ifTrue:[ |
|
334 |
"/ super delayedUpdate:something with:aParameter from:changedObject. |
|
335 |
"/ ^ self |
|
336 |
"/ ]. |
|
337 |
||
338 |
changedObject == updateTrigger ifTrue:[ |
|
339 |
hierarchicalProjectList := nil. |
|
340 |
self hierarchicalProjectList. |
|
341 |
self updateTreeSelection. |
|
342 |
^ self |
|
343 |
]. |
|
344 |
||
345 |
changedObject == slaveMode ifTrue:[ |
|
346 |
listValid ~~ true ifTrue:[ |
|
347 |
self enqueueDelayedUpdateList |
|
348 |
]. |
|
349 |
"/ self invalidateList. |
|
350 |
self updateTreeSelection. |
|
351 |
^ self |
|
352 |
]. |
|
353 |
||
354 |
changedObject == hierarchicalProjectSelection ifTrue:[ |
|
355 |
self updateSelectionFromTree. |
|
356 |
^ self |
|
357 |
]. |
|
358 |
"/ changedObject == self selectedProjects ifTrue:[ |
|
359 |
"/ "/ update the trees selection as appropriate |
|
360 |
"/ self updateTreeSelection. |
|
361 |
"/ ]. |
|
362 |
changedObject == projectList ifTrue:[ |
|
363 |
"/ update the tree |
|
364 |
self hierarchicalProjectList root:(self generateHierarchicalProjectTree). |
|
365 |
^ self. |
|
366 |
]. |
|
367 |
||
368 |
super delayedUpdate:something with:aParameter from:changedObject |
|
369 |
||
370 |
"Created: / 17.2.2000 / 23:41:02 / cg" |
|
371 |
"Modified: / 26.2.2000 / 01:21:49 / cg" |
|
372 |
! |
|
373 |
||
374 |
enqueueDelayedAddPackage:package |
|
6715 | 375 |
(NewSystemBrowser synchronousUpdate == true |
376 |
or:[ immediateUpdate value == true ]) |
|
377 |
ifTrue:[ |
|
378 |
self addPackage:package. |
|
379 |
^ self |
|
5591 | 380 |
]. |
381 |
^ self |
|
6715 | 382 |
enqueueMessage:#addPackage: |
383 |
for:self |
|
384 |
arguments:(Array with:package) |
|
5591 | 385 |
! |
386 |
||
387 |
update:something with:aParameter from:changedObject |
|
388 |
something == #methodTrap ifTrue:[ |
|
12553
23dedf939d07
class: Tools::HierarchicalProjectList
Claus Gittinger <cg@exept.de>
parents:
10349
diff
changeset
|
389 |
"/ don't care for that. |
23dedf939d07
class: Tools::HierarchicalProjectList
Claus Gittinger <cg@exept.de>
parents:
10349
diff
changeset
|
390 |
^ self. |
5591 | 391 |
]. |
392 |
changedObject == organizerMode ifTrue:[ |
|
12553
23dedf939d07
class: Tools::HierarchicalProjectList
Claus Gittinger <cg@exept.de>
parents:
10349
diff
changeset
|
393 |
"/ don't care for that. |
23dedf939d07
class: Tools::HierarchicalProjectList
Claus Gittinger <cg@exept.de>
parents:
10349
diff
changeset
|
394 |
^ self. |
5591 | 395 |
]. |
396 |
super update:something with:aParameter from:changedObject |
|
397 |
! |
|
398 |
||
399 |
updateSelectionFromTree |
|
400 |
|treeSelection| |
|
401 |
||
402 |
treeSelection := hierarchicalProjectSelection value |
|
403 |
collect:[:eachIndex | |item| |
|
404 |
item := hierarchicalProjectList at:eachIndex ifAbsent:nil. |
|
405 |
item package |
|
406 |
]. |
|
407 |
||
408 |
treeSelection asSet ~= (self selectedProjects value ? #()) asSet ifTrue:[ |
|
409 |
self selectedProjects value:treeSelection. |
|
410 |
] |
|
411 |
! ! |
|
412 |
||
413 |
!HierarchicalProjectList methodsFor:'private'! |
|
414 |
||
415 |
addPackage:package |
|
416 |
|i p pp l parentPackage parentItem idx| |
|
417 |
||
418 |
i:= packageToItemDictionary at:package asSymbol ifAbsent:nil. |
|
419 |
i isNil ifTrue:[ |
|
12710
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
420 |
i := ProjectItem new. |
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
421 |
i package:package. |
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
422 |
packageToItemDictionary at:package asSymbol put:i. |
5591 | 423 |
|
12710
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
424 |
package size > 0 ifTrue:[ |
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
425 |
"/ find the parent ... |
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
426 |
p := package asCollectionOfSubstringsSeparatedByAny:':/.'. |
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
427 |
pp := p copyButLast:1. |
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
428 |
l := (pp asStringWith:$/) size. |
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
429 |
parentPackage := package copyTo:l. |
5591 | 430 |
|
12710
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
431 |
parentItem := self addPackage:parentPackage asSymbol . |
5591 | 432 |
|
12710
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
433 |
parentPackage size == 0 ifTrue:[ |
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
434 |
idx := 1. |
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
435 |
] ifFalse:[ |
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
436 |
idx := parentPackage size + 2 |
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
437 |
]. |
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
438 |
i label:(package copyFrom:idx). |
5591 | 439 |
|
12710
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
440 |
parentItem add:i sortBlock:[:i1 :i2 | i1 label asLowercase < i2 label asLowercase]. |
5591 | 441 |
|
12710
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
442 |
"/ TODO: special items for classes, resources etc. |
5591 | 443 |
|
12710
94aac7b5d592
Changed usage of deprecated #copyWithoutLast: to #copyButLast:
Stefan Vogel <sv@exept.de>
parents:
12553
diff
changeset
|
444 |
] |
5591 | 445 |
]. |
446 |
^ i |
|
447 |
! |
|
448 |
||
449 |
release |
|
450 |
super release. |
|
451 |
||
452 |
hierarchicalProjectSelection removeDependent:self. |
|
453 |
! ! |
|
454 |
||
455 |
!HierarchicalProjectList methodsFor:'user actions'! |
|
456 |
||
457 |
doubleClicked:anIndex |
|
458 |
|item| |
|
459 |
||
460 |
item := hierarchicalProjectList at:anIndex ifAbsent:nil. |
|
461 |
item isNil ifTrue:[ |
|
462 |
^ self |
|
463 |
]. |
|
464 |
||
465 |
(item canExpand not or:[item isExpanded]) ifTrue:[ |
|
466 |
doubleClickChannel notNil ifTrue:[ |
|
467 |
doubleClickChannel value:anIndex. |
|
468 |
]. |
|
469 |
^ self |
|
470 |
]. |
|
471 |
||
472 |
item expand. |
|
473 |
! |
|
474 |
||
475 |
indicatorPressed:anIndex |
|
476 |
|item sensor| |
|
477 |
||
478 |
item := hierarchicalProjectList at:anIndex ifAbsent:nil. |
|
479 |
||
480 |
item isNil ifTrue:[ |
|
481 |
^ self |
|
482 |
]. |
|
483 |
||
484 |
sensor := self window sensor. |
|
485 |
(sensor ctrlDown or:[sensor shiftDown]) ifTrue:[ |
|
486 |
item recursiveToggleExpand |
|
487 |
] ifFalse:[ |
|
488 |
item toggleExpand |
|
489 |
]. |
|
490 |
! ! |
|
491 |
||
5793 | 492 |
!HierarchicalProjectList::ProjectItem methodsFor:'accessing'! |
5670
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
493 |
|
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
494 |
children |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
495 |
children isNil ifTrue:[ |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
496 |
children := #() |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
497 |
]. |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
498 |
^ children |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
499 |
! |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
500 |
|
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
501 |
icon |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
502 |
^ SystemBrowser packageIcon |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
503 |
! |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
504 |
|
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
505 |
label:aString |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
506 |
label ~= aString ifTrue:[ |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
507 |
label := aString. |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
508 |
self changed:#label |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
509 |
]. |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
510 |
! |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
511 |
|
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
512 |
package |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
513 |
^ packageID |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
514 |
! |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
515 |
|
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
516 |
package:prefixOrPackageID |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
517 |
packageID := prefixOrPackageID |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
518 |
! ! |
e5c8a8e964dc
oops - private class got lost
Claus Gittinger <cg@exept.de>
parents:
5592
diff
changeset
|
519 |
|
5591 | 520 |
!HierarchicalProjectList class methodsFor:'documentation'! |
521 |
||
522 |
version |
|
14020
6d318d3f52fd
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13498
diff
changeset
|
523 |
^ '$Header: /cvs/stx/stx/libtool/Tools_HierarchicalProjectList.st,v 1.14 2014-02-25 10:40:58 vrany Exp $' |
9468 | 524 |
! |
525 |
||
526 |
version_CVS |
|
14020
6d318d3f52fd
Refactoring of NavigatorModel's environment.
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
13498
diff
changeset
|
527 |
^ '$Header: /cvs/stx/stx/libtool/Tools_HierarchicalProjectList.st,v 1.14 2014-02-25 10:40:58 vrany Exp $' |
5591 | 528 |
! ! |
12553
23dedf939d07
class: Tools::HierarchicalProjectList
Claus Gittinger <cg@exept.de>
parents:
10349
diff
changeset
|
529 |