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