author | Claus Gittinger <cg@exept.de> |
Thu, 08 Nov 2001 14:43:49 +0100 | |
changeset 1096 | 4a949a840bb3 |
parent 1046 | 450ef3136cc3 |
child 1162 | 4af27057a3ce |
permissions | -rw-r--r-- |
3 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
85 | 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 |
Change subclass:#ClassChange |
235 | 16 |
instanceVariableNames:'className' |
17 |
classVariableNames:'' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'System-Changes' |
|
0 | 20 |
! |
21 |
||
634 | 22 |
!ClassChange 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 |
" |
|
45 | 40 |
Abstract superclass for class related changes |
235 | 41 |
|
42 |
[author:] |
|
43 |
Claus Gittinger |
|
9 | 44 |
" |
100 | 45 |
! ! |
46 |
||
634 | 47 |
!ClassChange class methodsFor:'instance creation'! |
85 | 48 |
|
100 | 49 |
class:aClass |
50 |
^ self new class:aClass |
|
51 |
||
52 |
"Created: 3.12.1995 / 14:01:32 / cg" |
|
1096 | 53 |
! |
54 |
||
55 |
class:aClass source:source |
|
56 |
^ self new class:aClass source:source |
|
57 |
||
58 |
"Created: 3.12.1995 / 14:01:32 / cg" |
|
9 | 59 |
! ! |
60 |
||
0 | 61 |
!ClassChange methodsFor:'accessing'! |
62 |
||
850 | 63 |
changeClass |
64 |
"the class of the change (nil if not present)" |
|
65 |
||
66 |
className isNil ifTrue:[^ nil]. |
|
67 |
^ Smalltalk classNamed:className |
|
68 |
! |
|
69 |
||
1040 | 70 |
changeClass:aClass |
71 |
"set the class of the change" |
|
72 |
||
73 |
className := aClass name. |
|
74 |
! |
|
75 |
||
100 | 76 |
class:aClass |
378 | 77 |
"set the class of the change" |
78 |
||
100 | 79 |
className := aClass name. |
80 |
||
81 |
"Created: 3.12.1995 / 14:01:45 / cg" |
|
378 | 82 |
"Modified: 15.7.1996 / 09:28:26 / cg" |
100 | 83 |
! |
84 |
||
1096 | 85 |
class:aClass source:newSource |
86 |
"set both class and source of the change" |
|
87 |
||
88 |
className := aClass name. |
|
89 |
source := newSource. |
|
90 |
||
91 |
"Created: 3.12.1995 / 14:01:45 / cg" |
|
92 |
"Modified: 15.7.1996 / 09:28:26 / cg" |
|
93 |
! |
|
94 |
||
0 | 95 |
className |
378 | 96 |
"return the className of the change" |
97 |
||
0 | 98 |
^ className |
378 | 99 |
|
100 |
"Modified: 15.7.1996 / 09:28:35 / cg" |
|
654 | 101 |
! |
102 |
||
103 |
className:aString |
|
104 |
"set the className of the change" |
|
105 |
||
106 |
className := aString |
|
107 |
||
108 |
"Modified: / 15.7.1996 / 09:28:35 / cg" |
|
109 |
"Created: / 16.2.1998 / 13:05:36 / cg" |
|
0 | 110 |
! ! |
111 |
||
859 | 112 |
!ClassChange methodsFor:'applying'! |
113 |
||
114 |
apply |
|
115 |
"apply the change" |
|
116 |
||
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
117 |
Class nameSpaceQuerySignal answer:(self nameSpace) do:[ |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
118 |
Parser evaluate:(self source) |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
119 |
]. |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
120 |
! |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
121 |
|
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
122 |
nameSpace |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
123 |
|nsName nameSpace| |
859 | 124 |
|
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
125 |
(nsName := self nameSpaceName) notNil ifTrue:[ |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
126 |
^ NameSpace name:nsName. |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
127 |
]. |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
128 |
^ Smalltalk |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
129 |
! |
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
130 |
|
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
131 |
nameSpaceName |
859 | 132 |
(className includes:$:) ifTrue:[ |
133 |
"/ in a namespace |
|
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
134 |
^ className upTo:$:. |
859 | 135 |
]. |
1046
450ef3136cc3
care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents:
1043
diff
changeset
|
136 |
^ nil |
859 | 137 |
! ! |
138 |
||
962 | 139 |
!ClassChange methodsFor:'printing & storing'! |
101 | 140 |
|
141 |
printOn:aStream |
|
801 | 142 |
"append a user printed representation of the receiver to aStream. |
143 |
The format is suitable for a human - not meant to be read back." |
|
144 |
||
911 | 145 |
source isNil ifTrue:[ |
146 |
aStream nextPutAll:'an empty change'. |
|
147 |
^ self |
|
148 |
]. |
|
1043 | 149 |
aStream nextPutAll:(self class name , ' - ' , source string asCollectionOfLines first , '...'). |
101 | 150 |
! ! |
151 |
||
932 | 152 |
!ClassChange methodsFor:'queries'! |
153 |
||
154 |
isClassChange |
|
155 |
^ true |
|
156 |
! ! |
|
157 |
||
634 | 158 |
!ClassChange class methodsFor:'documentation'! |
100 | 159 |
|
160 |
version |
|
1096 | 161 |
^ '$Header: /cvs/stx/stx/libbasic3/ClassChange.st,v 1.28 2001-11-08 13:43:36 cg Exp $' |
100 | 162 |
! ! |