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