author | Claus Gittinger <cg@exept.de> |
Wed, 09 May 2018 09:58:25 +0200 | |
changeset 1046 | 2c62588b53ed |
parent 1040 | 8c397b8defca |
permissions | -rw-r--r-- |
1025 | 1 |
"{ Encoding: utf8 }" |
2 |
||
47 | 3 |
"{ Package: 'stx:goodies/monticello' }" |
4 |
||
1025 | 5 |
"{ NameSpace: Smalltalk }" |
6 |
||
47 | 7 |
Object subclass:#MCDefinition |
8 |
instanceVariableNames:'' |
|
9 |
classVariableNames:'Instances' |
|
10 |
poolDictionaries:'' |
|
617 | 11 |
category:'SCM-Monticello-Base' |
47 | 12 |
! |
13 |
||
14 |
||
15 |
!MCDefinition class methodsFor:'as yet unclassified'! |
|
16 |
||
17 |
clearInstances |
|
244 | 18 |
|
19 |
Instances := nil |
|
20 |
||
21 |
"Modified: / 18-08-2009 / 10:14:13 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
47 | 22 |
! |
23 |
||
244 | 24 |
instanceLike: aDefinition |
145
a76be9988b5d
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
25 |
|
244 | 26 |
Instances ifNil: [ Instances := WeakIdentitySet new ]. |
27 |
Instances do: |
|
28 |
[:each|each = aDefinition ifTrue:[^each]]. |
|
29 |
Instances add: aDefinition. |
|
30 |
^aDefinition. |
|
31 |
||
1025 | 32 |
"Instances := nil" |
33 |
||
244 | 34 |
"Modified: / 18-08-2009 / 10:18:15 / Jan Vrany <vranyj1@fel.cvut.cz>" |
47 | 35 |
! ! |
36 |
||
37 |
!MCDefinition methodsFor:'accessing'! |
|
38 |
||
39 |
provisions |
|
40 |
^ #() |
|
41 |
! |
|
42 |
||
43 |
requirements |
|
44 |
^ #() |
|
45 |
! ! |
|
46 |
||
47 |
!MCDefinition methodsFor:'annotations'! |
|
48 |
||
49 |
annotations |
|
50 |
^self annotations: Preferences defaultAnnotationRequests |
|
51 |
! |
|
52 |
||
53 |
annotations: requests |
|
54 |
"Answer a string for an annotation pane, trying to fulfill the annotation requests. |
|
55 |
These might include anything that |
|
56 |
Preferences defaultAnnotationRequests |
|
57 |
might return. Which includes anything in |
|
58 |
Preferences annotationInfo |
|
59 |
To edit these, use:" |
|
60 |
"Preferences editAnnotations" |
|
61 |
||
62 |
^String streamContents: [ :s | self printAnnotations: requests on: s ]. |
|
63 |
! |
|
64 |
||
65 |
printAnnotations: requests on: aStream |
|
66 |
"Add a string for an annotation pane, trying to fulfill the annotation requests. |
|
67 |
These might include anything that |
|
68 |
Preferences defaultAnnotationRequests |
|
69 |
might return. Which includes anything in |
|
70 |
Preferences annotationInfo |
|
71 |
To edit these, use:" |
|
72 |
"Preferences editAnnotations" |
|
73 |
||
74 |
aStream nextPutAll: 'not yet implemented' |
|
75 |
! ! |
|
76 |
||
77 |
!MCDefinition methodsFor:'comparing'! |
|
78 |
||
244 | 79 |
< aMCMethodDefinition |
80 |
||
81 |
^self <= aMCMethodDefinition |
|
82 |
and: [(self = aMCMethodDefinition) not] |
|
83 |
||
84 |
"Created: / 18-08-2009 / 10:25:23 / Jan Vrany <vranyj1@fel.cvut.cz>" |
|
145
a76be9988b5d
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
85 |
! |
a76be9988b5d
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
86 |
|
47 | 87 |
<= other |
88 |
^ self sortKey <= other sortKey |
|
89 |
! |
|
90 |
||
91 |
= aDefinition |
|
92 |
^ self isRevisionOf: aDefinition |
|
93 |
! |
|
94 |
||
95 |
description |
|
96 |
self subclassResponsibility |
|
97 |
! |
|
98 |
||
99 |
fullTimeStamp |
|
244 | 100 |
^Timestamp current |
47 | 101 |
! |
102 |
||
103 |
hash |
|
104 |
^ self description hash |
|
105 |
! |
|
106 |
||
107 |
isRevisionOf: aDefinition |
|
244 | 108 |
^ (aDefinition isKindOf: MCDefinition) and: [aDefinition description = self description] |
47 | 109 |
! |
110 |
||
111 |
isSameRevisionAs: aDefinition |
|
112 |
^ self = aDefinition |
|
113 |
! |
|
114 |
||
115 |
sortKey |
|
116 |
self subclassResponsibility |
|
117 |
! ! |
|
118 |
||
244 | 119 |
!MCDefinition methodsFor:'converting'! |
120 |
||
1040 | 121 |
addChangesTo:aChangeSet |
122 |
"some MCDefinitions will result in multiple changes |
|
123 |
(i.e. ClassDefinitionChange might also generate a comment change). |
|
124 |
The default here is to add the one major change (which was also generated in the past). |
|
125 |
Warning: callers of asChange should change their mind and use this." |
|
126 |
||
127 |
aChangeSet add:self asChange |
|
128 |
! |
|
129 |
||
244 | 130 |
asChange |
131 |
"raise an error: must be redefined in concrete subclass(es)" |
|
132 |
||
133 |
^ self subclassResponsibility |
|
134 |
! ! |
|
135 |
||
47 | 136 |
!MCDefinition methodsFor:'installing'! |
137 |
||
138 |
load |
|
139 |
||
140 |
! |
|
141 |
||
142 |
loadOver: aDefinition |
|
143 |
self load |
|
144 |
||
145 |
! |
|
146 |
||
147 |
postload |
|
148 |
! |
|
149 |
||
150 |
postloadOver: aDefinition |
|
151 |
self postload |
|
152 |
! |
|
153 |
||
154 |
unload |
|
155 |
! ! |
|
156 |
||
157 |
!MCDefinition methodsFor:'printing'! |
|
158 |
||
159 |
printOn: aStream |
|
160 |
super printOn: aStream. |
|
161 |
aStream nextPutAll: '(', self summary, ')' |
|
162 |
! |
|
163 |
||
164 |
summary |
|
165 |
self subclassResponsibility |
|
166 |
! ! |
|
167 |
||
168 |
!MCDefinition methodsFor:'testing'! |
|
169 |
||
170 |
isClassDefinition |
|
171 |
^false |
|
172 |
! |
|
173 |
||
174 |
isClassDefinitionExtension |
|
175 |
"Answer true if this definition extends the regular class definition" |
|
176 |
^false |
|
177 |
! |
|
178 |
||
179 |
isMethodDefinition |
|
180 |
^false |
|
181 |
! |
|
182 |
||
183 |
isOrganizationDefinition |
|
184 |
^false |
|
244 | 185 |
! |
186 |
||
187 |
isOverrideDefinition |
|
188 |
^false |
|
189 |
||
190 |
"Created: / 08-11-2010 / 17:29:12 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
47 | 191 |
! ! |
192 |
||
193 |
!MCDefinition class methodsFor:'documentation'! |
|
194 |
||
195 |
version |
|
1025 | 196 |
^ '$Header$' |
145
a76be9988b5d
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
197 |
! |
a76be9988b5d
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
198 |
|
a76be9988b5d
more porting (but still unfinished)
Claus Gittinger <cg@exept.de>
parents:
47
diff
changeset
|
199 |
version_CVS |
1025 | 200 |
^ '$Header$' |
244 | 201 |
! |
202 |
||
203 |
version_SVN |
|
1025 | 204 |
^ '$Id$' |
47 | 205 |
! ! |
1025 | 206 |