author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 19 Jul 2017 09:42:32 +0200 | |
branch | jv |
changeset 17619 | edb119820fcb |
parent 15950 | 23be8cf85415 |
permissions | -rw-r--r-- |
2626 | 1 |
" |
2 |
COPYRIGHT (c) 2000 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 |
" |
|
12650
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
12 |
"{ Package: 'stx:libtool' }" |
2626 | 13 |
|
15950 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
2613 | 16 |
HierarchicalList subclass:#HierarchicalClassRevisionList |
17 |
instanceVariableNames:'itemComputationList semaphoreCritical itemTask currentItemInTask |
|
18 |
dataColl' |
|
19 |
classVariableNames:'Lobby' |
|
20 |
poolDictionaries:'' |
|
21 |
category:'Interface-Browsers-Support' |
|
22 |
! |
|
23 |
||
2625 | 24 |
!HierarchicalClassRevisionList class methodsFor:'documentation'! |
25 |
||
2626 | 26 |
copyright |
27 |
" |
|
28 |
COPYRIGHT (c) 2000 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 |
||
40 |
! |
|
41 |
||
2625 | 42 |
documentation |
43 |
" |
|
44 |
This is not yet finished (work in progress) - do not use. |
|
45 |
||
46 |
[author:] |
|
47 |
Pierre Schwarz (ps@exept.de) |
|
48 |
||
49 |
[see also:] |
|
50 |
||
51 |
[instance variables:] |
|
52 |
||
53 |
[class variables:] |
|
54 |
" |
|
55 |
||
56 |
! ! |
|
2613 | 57 |
|
58 |
!HierarchicalClassRevisionList class methodsFor:'instance creation'! |
|
59 |
||
60 |
new |
|
61 |
||
62 |
^ super new initialize |
|
63 |
! ! |
|
64 |
||
65 |
!HierarchicalClassRevisionList methodsFor:'accessing'! |
|
66 |
||
67 |
dataColl |
|
68 |
"return the value of the instance variable 'classRevisionColl' (automatically generated)" |
|
69 |
||
70 |
^ dataColl |
|
71 |
! |
|
72 |
||
73 |
dataColl:something |
|
74 |
"set the value of the instance variable 'classRevisionColl' (automatically generated)" |
|
75 |
||
76 |
dataColl := something. |
|
77 |
! |
|
78 |
||
79 |
icons |
|
80 |
" |
|
81 |
||
82 |
<return: Dictionary of: Symbol->Image> |
|
83 |
" |
|
84 |
|icons| |
|
85 |
||
86 |
icons := Dictionary new. |
|
87 |
icons at:#loadedRevision put:(Smalltalk imageFromFileNamed:'red_ball.xpm' forClass:self class). |
|
88 |
icons at:#unloadedRevision put:(Smalltalk imageFromFileNamed:'green_ball.xpm' forClass:self class). |
|
89 |
icons at:#unloadedClassItem put:(Smalltalk imageFromFileNamed:'small_folder_yellow_grey1.xpm' forClass:self class). |
|
90 |
icons at:#loadingClassItem put:(Smalltalk imageFromFileNamed:'small_folder_yellow_search.xpm' forClass:self class). |
|
91 |
icons at:#loadedClassItem put:(Smalltalk imageFromFileNamed:'small_folder_yellow.xpm' forClass:self class). |
|
92 |
^icons |
|
93 |
||
94 |
||
95 |
! |
|
96 |
||
97 |
itemComputationList |
|
98 |
||
99 |
^ itemComputationList ifNil:[itemComputationList := IdentitySet new] |
|
100 |
||
101 |
! |
|
102 |
||
103 |
semaphoreCritical |
|
104 |
"return the value of the instance variable 'semaphoreCritical' (automatically generated)" |
|
105 |
||
106 |
^ semaphoreCritical ifNil:[semaphoreCritical := RecursionLock new] |
|
107 |
||
108 |
! ! |
|
109 |
||
110 |
!HierarchicalClassRevisionList methodsFor:'finalization'! |
|
111 |
||
112 |
disposed |
|
113 |
||
114 |
self stopItemTask. |
|
115 |
Lobby unregister:self. |
|
116 |
||
117 |
||
118 |
! ! |
|
119 |
||
120 |
!HierarchicalClassRevisionList methodsFor:'initialization'! |
|
121 |
||
122 |
initialize |
|
123 |
||
124 |
self showRoot:false. |
|
125 |
dataColl := OrderedCollection new. |
|
126 |
self root:ClassItemRootForRevision new. |
|
127 |
Lobby ifNil:[ |
|
128 |
Lobby := Registry new. |
|
129 |
]. |
|
130 |
Lobby register:self. |
|
131 |
||
132 |
! ! |
|
133 |
||
134 |
!HierarchicalClassRevisionList methodsFor:'protocol'! |
|
135 |
||
136 |
getDataForItem: anItem |
|
137 |
||
138 |
self semaphoreCritical critical:[ |
|
139 |
|theList| |
|
140 |
currentItemInTask == anItem ifTrue:[^self]. |
|
141 |
(theList := self itemComputationList) removeIdentical:anItem ifAbsent:[nil]. |
|
142 |
theList add:anItem. |
|
143 |
self startItemTask] |
|
144 |
||
145 |
! |
|
146 |
||
147 |
itemTaskCycle |
|
148 |
||
149 |
|theItem| |
|
150 |
||
151 |
[ |
|
152 |
theItem := nil. |
|
153 |
self semaphoreCritical critical:[ |
|
154 |
self itemComputationList notEmpty |
|
155 |
ifTrue:[theItem := self itemComputationList remove:(self itemComputationList last) ifAbsent:[nil]] |
|
156 |
]. |
|
157 |
(theItem notNil and:[theItem needsChildren])ifTrue:[ |
|
158 |
currentItemInTask:=theItem. |
|
159 |
theItem computeRevisions. |
|
160 |
currentItemInTask:=nil |
|
161 |
]. |
|
162 |
theItem notNil |
|
163 |
] whileTrue. |
|
164 |
||
165 |
! |
|
166 |
||
167 |
newData: aClassRevisionColl |
|
168 |
||
169 |
dataColl := aClassRevisionColl. |
|
170 |
self root:ClassItemRootForRevision new. |
|
171 |
||
172 |
||
173 |
! |
|
174 |
||
175 |
startItemTask |
|
176 |
||
177 |
self semaphoreCritical critical:[ |
|
178 |
itemTask ifNil:[ |
|
179 |
itemTask := Process for:[ |
|
180 |
self itemTaskCycle |
|
181 |
] |
|
182 |
priority:(Processor userBackgroundPriority). |
|
183 |
itemTask addExitAction:[itemTask := nil]. |
|
184 |
itemTask resume. |
|
185 |
]. |
|
186 |
]. |
|
187 |
||
188 |
! |
|
189 |
||
190 |
stopItemTask |
|
191 |
|task| |
|
192 |
||
193 |
self semaphoreCritical critical:[ |
|
194 |
(task := itemTask) notNil ifTrue:[ |
|
195 |
itemTask := nil. |
|
196 |
Exception handle:[:ex|] do:[ |
|
197 |
task terminateWithAllSubprocesses. |
|
198 |
task waitUntilTerminated. |
|
199 |
] |
|
200 |
] |
|
201 |
]. |
|
202 |
||
203 |
||
204 |
! ! |
|
205 |
||
206 |
!HierarchicalClassRevisionList class methodsFor:'documentation'! |
|
207 |
||
208 |
version |
|
12125 | 209 |
^ '$Header: /cvs/stx/stx/libtool/HierarchicalClassRevisionList.st,v 1.3 2000/02/18 14:08:26 cg Exp $' |
12650
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
210 |
! |
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
211 |
|
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
212 |
version_HG |
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
213 |
|
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
214 |
^ '$Changeset: <not expanded> $' |
12125 | 215 |
! ! |
12650
e0f607754b9a
Merged 18d06283743d and ff31bac2fd1b (branch default - CVS HEAD)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
12125
diff
changeset
|
216 |