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