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