author | Claus Gittinger <cg@exept.de> |
Mon, 15 Jul 2019 15:36:02 +0200 | |
changeset 4462 | 94580bcf9981 |
parent 4432 | 6d0966d3ccf2 |
permissions | -rw-r--r-- |
4432 | 1 |
"{ Encoding: utf8 }" |
2 |
||
3522 | 3 |
"{ Package: 'stx:libbasic3' }" |
4 |
||
4432 | 5 |
"{ NameSpace: Smalltalk }" |
6 |
||
3522 | 7 |
ClassChange subclass:#ClassInitializeChange |
8 |
instanceVariableNames:'' |
|
9 |
classVariableNames:'' |
|
10 |
poolDictionaries:'' |
|
11 |
category:'System-Changes' |
|
12 |
! |
|
13 |
||
14 |
!ClassInitializeChange class methodsFor:'documentation'! |
|
15 |
||
16 |
documentation |
|
17 |
" |
|
18 |
Change for class initialization chunk. Unlike DoItChange, |
|
19 |
ClassInitializeChange handles namespaces and private classes |
|
20 |
properly. |
|
21 |
||
22 |
[author:] |
|
23 |
Jan Vrany <jan.vrany@fit.cvut.cz> |
|
24 |
||
25 |
[instance variables:] |
|
26 |
||
27 |
[class variables:] |
|
28 |
||
29 |
[see also:] |
|
30 |
||
31 |
" |
|
32 |
! ! |
|
33 |
||
34 |
!ClassInitializeChange methodsFor:'accessing'! |
|
35 |
||
36 |
source |
|
37 |
"return the source of the change" |
|
38 |
||
39 |
source isNil ifTrue:[ |
|
40 |
^ String streamContents:[ :s | |
|
41 |
(nameSpaceName notNil and:[ nameSpaceName ~= 'Smalltalk' ]) ifTrue:[ |
|
42 |
s nextPutAll: '"{ NameSpace: '; nextPutAll: nameSpaceName; nextPutAll: ' }"'; cr; cr. |
|
43 |
s nextPutAll: self className; nextPutAll: ' initialize!!'; cr. |
|
44 |
]. |
|
45 |
] |
|
46 |
]. |
|
47 |
^ source |
|
48 |
||
49 |
"Created: / 21-03-2014 / 17:43:30 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
50 |
! ! |
|
51 |
||
52 |
!ClassInitializeChange methodsFor:'applying'! |
|
53 |
||
54 |
apply |
|
55 |
"apply the change" |
|
56 |
||
57 |
| class | |
|
58 |
||
59 |
class := self changeClass. |
|
60 |
class isNil ifTrue:[ |
|
4432 | 61 |
self error:('Class %1 does not (yet?) exist' bindWith: self fullClassName). |
3522 | 62 |
^ self. |
63 |
]. |
|
64 |
class initialize. |
|
65 |
||
66 |
"Created: / 21-03-2014 / 17:38:37 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
4432 | 67 |
"Modified: / 28-05-2019 / 07:34:43 / Claus Gittinger" |
3522 | 68 |
! ! |
69 |
||
3532 | 70 |
!ClassInitializeChange methodsFor:'comparing'! |
71 |
||
72 |
sameAs:changeB |
|
73 |
"return true, if the given change represents the same change as the receiver." |
|
74 |
||
75 |
^ (changeB isKindOf: self class) |
|
76 |
and:[ self fullClassName = changeB fullClassName ] |
|
77 |
||
78 |
"Created: / 26-03-2014 / 17:41:25 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
79 |
! ! |
|
80 |
||
3681
026411d4acce
class: ClassInitializeChange
Claus Gittinger <cg@exept.de>
parents:
3532
diff
changeset
|
81 |
!ClassInitializeChange methodsFor:'printing & storing'! |
026411d4acce
class: ClassInitializeChange
Claus Gittinger <cg@exept.de>
parents:
3532
diff
changeset
|
82 |
|
026411d4acce
class: ClassInitializeChange
Claus Gittinger <cg@exept.de>
parents:
3532
diff
changeset
|
83 |
printOn:aStream |
026411d4acce
class: ClassInitializeChange
Claus Gittinger <cg@exept.de>
parents:
3532
diff
changeset
|
84 |
aStream nextPutAll:self source |
026411d4acce
class: ClassInitializeChange
Claus Gittinger <cg@exept.de>
parents:
3532
diff
changeset
|
85 |
! ! |
026411d4acce
class: ClassInitializeChange
Claus Gittinger <cg@exept.de>
parents:
3532
diff
changeset
|
86 |
|
3532 | 87 |
!ClassInitializeChange methodsFor:'testing'! |
88 |
||
89 |
isClassInitializeChange |
|
90 |
^ true |
|
91 |
! ! |
|
92 |
||
3522 | 93 |
!ClassInitializeChange class methodsFor:'documentation'! |
94 |
||
95 |
version |
|
4432 | 96 |
^ '$Header$' |
3522 | 97 |
! |
98 |
||
99 |
version_CVS |
|
4432 | 100 |
^ '$Header$' |
3522 | 101 |
! ! |
102 |