author | Claus Gittinger <cg@exept.de> |
Tue, 07 Dec 1999 15:19:29 +0100 | |
changeset 850 | 5efe4b98c509 |
parent 849 | d31825895bb2 |
child 852 | 1acd7d3ed3fc |
permissions | -rw-r--r-- |
4 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
25 | 3 |
All Rights Reserved |
4 | 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 |
|
13 |
ClassChange subclass:#MethodChange |
|
654 | 14 |
instanceVariableNames:'selector methodCategory privacy' |
235 | 15 |
classVariableNames:'' |
16 |
poolDictionaries:'' |
|
17 |
category:'System-Changes' |
|
0 | 18 |
! |
19 |
||
25 | 20 |
!MethodChange class methodsFor:'documentation'! |
21 |
||
22 |
copyright |
|
23 |
" |
|
24 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
25 |
All Rights Reserved |
|
10 | 26 |
|
25 | 27 |
This software is furnished under a license and may be used |
28 |
only in accordance with the terms of that license and with the |
|
29 |
inclusion of the above copyright notice. This software may not |
|
30 |
be provided or otherwise made available to, or used by, any |
|
31 |
other person. No title to or ownership of the software is |
|
32 |
hereby transferred. |
|
33 |
" |
|
34 |
! |
|
35 |
||
45 | 36 |
documentation |
37 |
" |
|
38 |
instances represent method-changes (as done in the browser). |
|
39 |
They are typically held in a ChangeSet. |
|
235 | 40 |
|
41 |
[author:] |
|
42 |
Claus Gittinger |
|
45 | 43 |
" |
25 | 44 |
! ! |
10 | 45 |
|
0 | 46 |
!MethodChange class methodsFor:'instance creation'! |
47 |
||
102
3f85fe87cc58
include category in methodChanges
Claus Gittinger <cg@exept.de>
parents:
85
diff
changeset
|
48 |
class:cls selector:sel source:src category:cat |
3f85fe87cc58
include category in methodChanges
Claus Gittinger <cg@exept.de>
parents:
85
diff
changeset
|
49 |
^ self basicNew class:cls selector:sel source:src category:cat |
0 | 50 |
! ! |
51 |
||
52 |
!MethodChange methodsFor:'accessing'! |
|
53 |
||
850 | 54 |
changeSelector |
55 |
^ selector |
|
56 |
||
57 |
"Created: / 6.2.1998 / 13:29:25 / cg" |
|
58 |
! |
|
59 |
||
102
3f85fe87cc58
include category in methodChanges
Claus Gittinger <cg@exept.de>
parents:
85
diff
changeset
|
60 |
class:cls selector:sel source:src category:cat |
0 | 61 |
className := cls name. |
62 |
selector := sel. |
|
102
3f85fe87cc58
include category in methodChanges
Claus Gittinger <cg@exept.de>
parents:
85
diff
changeset
|
63 |
source := src. |
3f85fe87cc58
include category in methodChanges
Claus Gittinger <cg@exept.de>
parents:
85
diff
changeset
|
64 |
methodCategory := cat |
648 | 65 |
! |
66 |
||
654 | 67 |
className:clsName selector:sel source:src category:cat |
68 |
className := clsName. |
|
69 |
selector := sel. |
|
70 |
source := src. |
|
71 |
methodCategory := cat |
|
72 |
||
73 |
"Created: / 16.2.1998 / 12:29:49 / cg" |
|
74 |
! |
|
75 |
||
76 |
className:clsName selector:sel source:src category:cat privacy:priv |
|
77 |
className := clsName. |
|
78 |
selector := sel. |
|
79 |
source := src. |
|
80 |
methodCategory := cat. |
|
81 |
privacy := priv. |
|
82 |
||
83 |
"Created: / 16.2.1998 / 12:29:49 / cg" |
|
84 |
"Modified: / 16.2.1998 / 14:28:12 / cg" |
|
85 |
! |
|
86 |
||
652 | 87 |
methodCategory |
88 |
^ methodCategory |
|
89 |
||
90 |
"Created: / 7.2.1998 / 19:47:53 / cg" |
|
91 |
! |
|
92 |
||
648 | 93 |
selector |
94 |
^ selector |
|
95 |
||
96 |
"Created: / 6.2.1998 / 13:29:25 / cg" |
|
0 | 97 |
! ! |
98 |
||
849 | 99 |
!MethodChange methodsFor:'applying'! |
100 |
||
101 |
apply |
|
102 |
"apply the change" |
|
103 |
||
104 |
|class| |
|
105 |
||
106 |
class := Smalltalk classNamed:className. |
|
107 |
class compile:source classified:methodCategory logged:true. |
|
108 |
||
109 |
||
110 |
! ! |
|
111 |
||
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
112 |
!MethodChange methodsFor:'comparing'! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
113 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
114 |
isForSameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
115 |
"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:
779
diff
changeset
|
116 |
thingy as the receiver (i.e. same method, same definition etc.)." |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
117 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
118 |
"/ I am a methodChange - B must be as well. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
119 |
changeB isMethodChange ifFalse:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
120 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
121 |
className ~= changeB className ifTrue:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
122 |
selector ~= changeB selector ifTrue:[^ false]. |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
123 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
124 |
^ true |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
125 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
126 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
127 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
128 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
129 |
! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
130 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
131 |
sameAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
132 |
"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:
779
diff
changeset
|
133 |
|
798 | 134 |
(self isForSameAs:changeB) ifFalse:[^ false]. |
784
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
135 |
^ self sameSourceAs:changeB |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
136 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
137 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
138 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
139 |
|
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
140 |
! ! |
1e50cc7fd07d
added compare methods #sameAs: and #isForSameAs:
Claus Gittinger <cg@exept.de>
parents:
779
diff
changeset
|
141 |
|
0 | 142 |
!MethodChange methodsFor:'printing'! |
143 |
||
7 | 144 |
printOn:aStream |
800 | 145 |
"append a user printed representation of the receiver to aStream. |
146 |
The format is suitable for a human - not meant to be read back." |
|
147 |
||
7 | 148 |
aStream nextPutAll:className; |
800 | 149 |
space; |
150 |
nextPutAll:selector |
|
779 | 151 |
! |
152 |
||
153 |
printWithoutClassOn:aStream |
|
154 |
(className endsWith:' class') ifTrue:[ |
|
155 |
aStream nextPutAll:'class ' |
|
156 |
]. |
|
157 |
aStream nextPutAll:selector |
|
0 | 158 |
! ! |
235 | 159 |
|
652 | 160 |
!MethodChange methodsFor:'queries'! |
161 |
||
162 |
isMethodChange |
|
163 |
^ true |
|
164 |
||
165 |
"Created: / 7.2.1998 / 19:26:59 / cg" |
|
166 |
! ! |
|
167 |
||
235 | 168 |
!MethodChange class methodsFor:'documentation'! |
169 |
||
170 |
version |
|
850 | 171 |
^ '$Header: /cvs/stx/stx/libbasic3/MethodChange.st,v 1.22 1999-12-07 14:19:29 cg Exp $' |
235 | 172 |
! ! |