author | Claus Gittinger <cg@exept.de> |
Mon, 20 Aug 2018 10:11:25 +0200 | |
changeset 4346 | 6604af2f1554 |
parent 3506 | 3a43f8d990cd |
child 3838 | 474d8ec95b33 |
permissions | -rw-r--r-- |
798 | 1 |
" |
2 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
3 |
All Rights Reserved |
|
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 |
" |
|
1096 | 12 |
"{ Package: 'stx:libbasic3' }" |
13 |
||
653 | 14 |
ClassChange subclass:#ClassRenameChange |
1096 | 15 |
instanceVariableNames:'oldName' |
653 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
18 |
category:'System-Changes' |
|
19 |
! |
|
20 |
||
21 |
!ClassRenameChange class methodsFor:'documentation'! |
|
22 |
||
798 | 23 |
copyright |
24 |
" |
|
25 |
COPYRIGHT (c) 1998 by eXept Software AG |
|
26 |
All Rights Reserved |
|
653 | 27 |
|
798 | 28 |
This software is furnished under a license and may be used |
29 |
only in accordance with the terms of that license and with the |
|
30 |
inclusion of the above copyright notice. This software may not |
|
31 |
be provided or otherwise made available to, or used by, any |
|
32 |
other person. No title to or ownership of the software is |
|
33 |
hereby transferred. |
|
34 |
" |
|
35 |
||
1162 | 36 |
! |
37 |
||
38 |
documentation |
|
39 |
" |
|
40 |
instances represent a class-has-been-renamed change. |
|
41 |
They are typically held in a ChangeSet. |
|
42 |
||
43 |
[author:] |
|
44 |
Claus Gittinger |
|
45 |
" |
|
653 | 46 |
! ! |
47 |
||
48 |
!ClassRenameChange methodsFor:'accessing'! |
|
49 |
||
1234 | 50 |
oldName |
51 |
"return the value of the instance variable 'oldName' (automatically generated)" |
|
52 |
||
53 |
^ oldName |
|
54 |
! |
|
55 |
||
1096 | 56 |
oldName:oldNameArg newName:newNameArg |
57 |
className := newNameArg. |
|
58 |
oldName := oldNameArg |
|
653 | 59 |
|
60 |
"Created: / 16.2.1998 / 14:22:38 / cg" |
|
61 |
! ! |
|
62 |
||
3469 | 63 |
!ClassRenameChange methodsFor:'applying'! |
64 |
||
65 |
apply |
|
66 |
"apply the change" |
|
67 |
||
68 |
|class| |
|
69 |
||
70 |
"JV@2012-07-31: Here, must test agains __OLD__ class" |
|
71 |
||
72 |
class := Smalltalk at: oldName asSymbol. |
|
73 |
class isNil ifTrue:[ |
|
74 |
self changeClass notNil ifTrue:[ |
|
75 |
"Previously applied change?" |
|
76 |
^self. |
|
77 |
]. |
|
78 |
self error:('Cannot apply change for missing class: ' , className) mayProceed:true. |
|
79 |
^ self |
|
80 |
]. |
|
81 |
class autoload. "Most changes cannot be applied to unloaded classes" |
|
82 |
Class nameSpaceQuerySignal answer:self nameSpace do:[ |
|
83 |
Parser evaluate:(self source) |
|
84 |
]. |
|
85 |
||
86 |
"Created: / 31-07-2012 / 18:58:46 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
87 |
! ! |
|
88 |
||
653 | 89 |
!ClassRenameChange methodsFor:'printing'! |
90 |
||
91 |
printOn:aStream |
|
3181 | 92 |
aStream nextPutAll:'Smalltalk renameClass: '; |
1096 | 93 |
nextPutAll:oldName; |
3181 | 94 |
nextPutAll:' to: '; |
1096 | 95 |
nextPutAll:className storeString |
653 | 96 |
|
97 |
"Created: / 16.2.1998 / 14:23:35 / cg" |
|
98 |
! ! |
|
99 |
||
3506
3a43f8d990cd
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
3469
diff
changeset
|
100 |
!ClassRenameChange methodsFor:'testing'! |
1234 | 101 |
|
102 |
isClassRenameChange |
|
103 |
^ true |
|
104 |
! ! |
|
105 |
||
653 | 106 |
!ClassRenameChange class methodsFor:'documentation'! |
107 |
||
108 |
version |
|
3506
3a43f8d990cd
category change for isXXX testers;
Claus Gittinger <cg@exept.de>
parents:
3469
diff
changeset
|
109 |
^ '$Header: /cvs/stx/stx/libbasic3/ClassRenameChange.st,v 1.8 2014-02-19 13:06:05 cg Exp $' |
653 | 110 |
! ! |
3181 | 111 |