author | Claus Gittinger <cg@exept.de> |
Wed, 17 Mar 2004 17:17:37 +0100 | |
changeset 1385 | 495fc9f2c9da |
parent 1290 | 5d97b96b1237 |
child 1510 | ce7253f6f687 |
permissions | -rw-r--r-- |
3 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
38 | 3 |
All Rights Reserved |
3 | 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 |
" |
|
0 | 12 |
|
932 | 13 |
"{ Package: 'stx:libbasic3' }" |
14 |
||
0 | 15 |
Object subclass:#Change |
1147 | 16 |
instanceVariableNames:'source timeOfChangeIfKnown' |
235 | 17 |
classVariableNames:'' |
18 |
poolDictionaries:'' |
|
19 |
category:'System-Changes' |
|
0 | 20 |
! |
21 |
||
633 | 22 |
!Change class methodsFor:'documentation'! |
9 | 23 |
|
24 |
copyright |
|
25 |
" |
|
26 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
38 | 27 |
All Rights Reserved |
9 | 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 |
documentation |
|
39 |
" |
|
40 |
abstract superclass for all kind of changes - managed in changeSets. |
|
235 | 41 |
|
42 |
[author:] |
|
43 |
Claus Gittinger |
|
9 | 44 |
" |
45 |
! ! |
|
46 |
||
647 | 47 |
!Change methodsFor:'accessing'! |
48 |
||
850 | 49 |
changeClass |
50 |
"the class of the change (nil if not present)" |
|
51 |
||
52 |
^ nil |
|
53 |
||
54 |
! |
|
55 |
||
56 |
changeSelector |
|
57 |
^ nil |
|
58 |
||
59 |
"Created: / 6.2.1998 / 13:29:35 / cg" |
|
60 |
! |
|
61 |
||
647 | 62 |
className |
63 |
"the className of the change" |
|
64 |
||
65 |
^ nil |
|
66 |
||
67 |
"Modified: / 15.7.1996 / 09:26:34 / cg" |
|
68 |
"Created: / 6.2.1998 / 13:06:56 / cg" |
|
69 |
! |
|
70 |
||
909 | 71 |
file |
72 |
^ nil "/ to be added as instvar |
|
73 |
! |
|
74 |
||
75 |
file:aFile position:anInteger |
|
76 |
^ self "/ to be added |
|
77 |
! |
|
78 |
||
79 |
objectType:aSymbol |
|
80 |
^ self "/ to be added as instvar |
|
81 |
! |
|
82 |
||
1052 | 83 |
prettyPrintedSource |
84 |
"return the prettyPrinted or normal source of the change" |
|
85 |
||
86 |
^ self source |
|
87 |
! |
|
88 |
||
647 | 89 |
selector |
90 |
^ nil |
|
91 |
||
92 |
"Created: / 6.2.1998 / 13:29:35 / cg" |
|
787 | 93 |
! |
94 |
||
95 |
source |
|
96 |
"return the source of the change" |
|
97 |
||
1096 | 98 |
|s| |
99 |
||
100 |
source isNil ifTrue:[ |
|
1385
495fc9f2c9da
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
1290
diff
changeset
|
101 |
s := String writeStream. |
1096 | 102 |
self printOn:s. |
103 |
^ s contents. |
|
104 |
]. |
|
787 | 105 |
^ source |
106 |
||
107 |
"Modified: 15.7.1996 / 09:26:34 / cg" |
|
108 |
! |
|
109 |
||
110 |
source:someString |
|
111 |
"set the source of the change" |
|
112 |
||
1290 | 113 |
"/ debugging only ... |
114 |
someString isString ifFalse:[ |
|
115 |
(someString respondsTo:#string) ifFalse:[ |
|
116 |
self halt:'argument should be string-like' |
|
117 |
] |
|
118 |
]. |
|
787 | 119 |
source := someString |
120 |
||
121 |
"Modified: / 15.7.1996 / 09:26:34 / cg" |
|
122 |
"Created: / 16.2.1998 / 13:05:16 / cg" |
|
1147 | 123 |
! |
124 |
||
125 |
timeOfChangeIfKnown |
|
126 |
^ timeOfChangeIfKnown |
|
127 |
! |
|
128 |
||
129 |
timeStamp:aTimestamp |
|
130 |
timeOfChangeIfKnown := aTimestamp |
|
647 | 131 |
! ! |
132 |
||
849 | 133 |
!Change methodsFor:'applying'! |
134 |
||
135 |
apply |
|
136 |
"apply the change" |
|
137 |
||
138 |
self subclassResponsibility |
|
139 |
! ! |
|
140 |
||
1234 | 141 |
!Change methodsFor:'change notification'! |
142 |
||
143 |
sendChangeNotificationThroughSmalltalk |
|
144 |
"intentionally left blank" |
|
145 |
! ! |
|
146 |
||
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
147 |
!Change methodsFor:'comparing'! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
148 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
149 |
isForSameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
150 |
"return true, if the given change represents a change for the same |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
151 |
thingy as the receiver (i.e. same method, same definition etc.)." |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
152 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
153 |
^ false |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
154 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
155 |
! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
156 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
157 |
sameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
158 |
"return true, if the given change represents the same change as the receiver." |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
159 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
160 |
^ false |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
161 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
162 |
! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
163 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
164 |
sameSourceAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
165 |
"return true, if the given change has the same source as the receiver." |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
166 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
167 |
|sourceA sourceB| |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
168 |
|
852 | 169 |
(sourceA := self source) = (sourceB := changeB source) ifTrue:[^ true]. |
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
170 |
|
988 | 171 |
sourceA := sourceA withoutTrailingSeparators asCollectionOfLines. |
172 |
sourceB := sourceB withoutTrailingSeparators asCollectionOfLines. |
|
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
173 |
sourceA size ~~ sourceB size ifTrue:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
174 |
sourceA := sourceA collect:[:line | line withTabsExpanded withoutTrailingSeparators]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
175 |
sourceB := sourceB collect:[:line | line withTabsExpanded withoutTrailingSeparators]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
176 |
^ sourceA = sourceB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
177 |
! ! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
783
diff
changeset
|
178 |
|
778 | 179 |
!Change methodsFor:'printing & storing'! |
180 |
||
897 | 181 |
printStringWithoutClassName |
778 | 182 |
|s| |
183 |
||
1385
495fc9f2c9da
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
1290
diff
changeset
|
184 |
s := String writeStream. |
897 | 185 |
self printWithoutClassNameOn:s. |
778 | 186 |
^ s contents |
187 |
! |
|
188 |
||
897 | 189 |
printWithoutClassNameOn:aStream |
778 | 190 |
self printOn:aStream |
191 |
||
192 |
||
193 |
! ! |
|
194 |
||
651 | 195 |
!Change methodsFor:'queries'! |
196 |
||
1175 | 197 |
isClassCategoryChange |
198 |
^ false |
|
199 |
||
200 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
201 |
! |
|
202 |
||
932 | 203 |
isClassChange |
204 |
^ false |
|
205 |
||
206 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
207 |
! |
|
208 |
||
777 | 209 |
isClassCommentChange |
210 |
^ false |
|
211 |
||
212 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
213 |
! |
|
214 |
||
771 | 215 |
isClassDefinitionChange |
216 |
^ false |
|
217 |
||
218 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
219 |
! |
|
220 |
||
798 | 221 |
isClassInstVarDefinitionChange |
222 |
^ false |
|
223 |
||
224 |
! |
|
225 |
||
1234 | 226 |
isClassRemoveChange |
227 |
^ false |
|
228 |
||
229 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
230 |
! |
|
231 |
||
232 |
isClassRenameChange |
|
233 |
^ false |
|
234 |
||
235 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
236 |
! |
|
237 |
||
773 | 238 |
isDoIt |
239 |
^ false |
|
240 |
||
241 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
242 |
! |
|
243 |
||
964
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
244 |
isMethodCategoryChange |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
245 |
^ false |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
246 |
! |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
932
diff
changeset
|
247 |
|
1234 | 248 |
isMethodCategoryRenameChange |
249 |
^ false |
|
250 |
||
251 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
252 |
! |
|
253 |
||
651 | 254 |
isMethodChange |
255 |
^ false |
|
256 |
||
257 |
"Created: / 7.2.1998 / 19:26:50 / cg" |
|
783 | 258 |
! |
259 |
||
1225 | 260 |
isMethodDefinitionChange |
261 |
^ false |
|
262 |
! |
|
263 |
||
1163
4886886a78b7
#isMethodRemoveChange query added
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
264 |
isMethodRemoveChange |
4886886a78b7
#isMethodRemoveChange query added
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
265 |
^ false |
4886886a78b7
#isMethodRemoveChange query added
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
266 |
! |
4886886a78b7
#isMethodRemoveChange query added
Claus Gittinger <cg@exept.de>
parents:
1147
diff
changeset
|
267 |
|
783 | 268 |
isPrimitiveChange |
269 |
^ false |
|
270 |
||
271 |
! |
|
272 |
||
273 |
isPrimitiveDefinitionsChange |
|
274 |
^ false |
|
275 |
||
276 |
! |
|
277 |
||
278 |
isPrimitiveFunctionsChange |
|
279 |
^ false |
|
280 |
||
281 |
! |
|
282 |
||
283 |
isPrimitiveVariablesChange |
|
284 |
^ false |
|
285 |
||
651 | 286 |
! ! |
287 |
||
633 | 288 |
!Change class methodsFor:'documentation'! |
235 | 289 |
|
290 |
version |
|
1385
495fc9f2c9da
replaced '' writeStream by String writeStream
Claus Gittinger <cg@exept.de>
parents:
1290
diff
changeset
|
291 |
^ '$Header: /cvs/stx/stx/libbasic3/Change.st,v 1.41 2004-03-17 16:17:37 cg Exp $' |
235 | 292 |
! ! |