author | vrany |
Tue, 31 Jul 2012 14:27:40 +0200 | |
changeset 2873 | 384700ae948f |
parent 2622 | 853e24f6b303 |
child 3158 | f8c56a311307 |
child 3984 | 22c47fc24cd7 |
permissions | -rw-r--r-- |
25 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
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 |
" |
|
957 | 12 |
"{ Package: 'stx:libbasic3' }" |
13 |
||
15 | 14 |
MethodChange subclass:#MethodCategoryChange |
2873 | 15 |
instanceVariableNames:'origin' |
235 | 16 |
classVariableNames:'' |
17 |
poolDictionaries:'' |
|
18 |
category:'System-Changes' |
|
15 | 19 |
! |
20 |
||
25 | 21 |
!MethodCategoryChange class methodsFor:'documentation'! |
22 |
||
23 |
copyright |
|
24 |
" |
|
25 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
26 |
All Rights Reserved |
|
27 |
||
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 |
! |
|
36 |
||
45 | 37 |
documentation |
38 |
" |
|
39 |
instances represent method-category changes (as done in the browser). |
|
40 |
They are typically held in a ChangeSet. |
|
235 | 41 |
|
2873 | 42 |
Change origin. |
43 |
||
44 |
When a changeset diff is generated, two MethodChanges that |
|
45 |
represent the same method (code is the same) might differ only in |
|
46 |
category/ Such changes are transformed to MethodCategoruChanges. |
|
47 |
In that case, origin keeps the reference to original MethodChange. |
|
48 |
||
235 | 49 |
[author:] |
50 |
Claus Gittinger |
|
2873 | 51 |
Jan Vrany |
52 |
||
53 |
[instance variables:] |
|
54 |
origin <MethodChange> Change that cause this category |
|
55 |
change to be created. See comment. |
|
56 |
||
57 |
||
45 | 58 |
" |
25 | 59 |
! ! |
60 |
||
2873 | 61 |
!MethodCategoryChange class methodsFor:'others'! |
62 |
||
63 |
version_CVS |
|
64 |
^ '$Header: /cvs/stx/stx/libbasic3/MethodCategoryChange.st,v 1.22 2012-07-31 12:27:40 vrany Exp $' |
|
65 |
! ! |
|
66 |
||
15 | 67 |
!MethodCategoryChange methodsFor:'accessing'! |
68 |
||
69 |
class:cls selector:sel category:cat |
|
1902
20db5f942dbd
changed #class:selector:category:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
70 |
self className:cls name selector:sel category:cat |
15 | 71 |
|
1902
20db5f942dbd
changed #class:selector:category:
Claus Gittinger <cg@exept.de>
parents:
1846
diff
changeset
|
72 |
"Modified: / 12-11-2006 / 15:55:11 / cg" |
85 | 73 |
! |
74 |
||
654 | 75 |
className:clsName selector:sel category:cat |
76 |
className := clsName. |
|
77 |
selector := sel. |
|
852 | 78 |
methodCategory := cat |
654 | 79 |
|
80 |
"Created: / 16.2.1998 / 14:14:16 / cg" |
|
81 |
! |
|
82 |
||
2873 | 83 |
origin |
84 |
^ origin |
|
85 |
! |
|
86 |
||
87 |
origin:aMethodChange |
|
88 |
origin := aMethodChange. |
|
89 |
! |
|
90 |
||
1052 | 91 |
prettyPrintedSource |
1846 | 92 |
^ self sourceForMethod, Character cr |
1052 | 93 |
, ' category:' , methodCategory storeString |
1846 | 94 |
|
95 |
"Modified: / 09-10-2006 / 13:59:15 / cg" |
|
1052 | 96 |
! |
97 |
||
85 | 98 |
source |
1846 | 99 |
^ self sourceForMethod , ' category:' , methodCategory storeString |
852 | 100 |
|
1846 | 101 |
"Modified: / 09-10-2006 / 13:59:10 / cg" |
2873 | 102 |
! |
103 |
||
104 |
source: aString |
|
105 |
| expr | |
|
106 |
||
107 |
expr := Parser parseExpression: aString onError: [ self error: 'Invalid source']. |
|
108 |
expr isMessage ifFalse:[ self error: 'Invalid source' ]. |
|
109 |
expr selector == #'category:' ifFalse:[ self error: 'Invalid source' ]. |
|
110 |
methodCategory := expr arguments first value. |
|
111 |
||
112 |
"Created: / 20-03-2012 / 22:26:50 / Jan Vrany <jan.vrany@fit.cvut.cz>" |
|
852 | 113 |
! ! |
114 |
||
115 |
!MethodCategoryChange methodsFor:'applying'! |
|
116 |
||
117 |
apply |
|
118 |
"apply the change" |
|
85 | 119 |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
120 |
|mthd| |
852 | 121 |
|
122 |
mthd := self changeMethod. |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
123 |
mthd category:methodCategory asSymbol. |
852 | 124 |
|
1915
d23534c8ab03
the method does the change-file-update; NOT me
Claus Gittinger <cg@exept.de>
parents:
1902
diff
changeset
|
125 |
"Modified: / 23-11-2006 / 16:59:09 / cg" |
15 | 126 |
! ! |
127 |
||
2131 | 128 |
!MethodCategoryChange methodsFor:'testing'! |
964
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
129 |
|
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
130 |
isMethodCategoryChange |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
131 |
^ true |
2263 | 132 |
! |
133 |
||
134 |
isMethodCodeChange |
|
135 |
"true if this is a method's code change (not package, category etc.)" |
|
136 |
||
137 |
^ false |
|
964
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
138 |
! ! |
64282b5e5c48
added #isMEthodCategoryChange
Claus Gittinger <cg@exept.de>
parents:
957
diff
changeset
|
139 |
|
2622
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
140 |
!MethodCategoryChange methodsFor:'visiting'! |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
141 |
|
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
142 |
acceptChangeVisitor:aVisitor |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
143 |
^ aVisitor visitMethodCategoryChange:self. |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
144 |
|
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
145 |
"Created: / 25-11-2011 / 17:13:58 / cg" |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
146 |
! ! |
853e24f6b303
visitor support (for monticello);
Claus Gittinger <cg@exept.de>
parents:
2263
diff
changeset
|
147 |
|
235 | 148 |
!MethodCategoryChange class methodsFor:'documentation'! |
149 |
||
150 |
version |
|
2873 | 151 |
^ '$Header: /cvs/stx/stx/libbasic3/MethodCategoryChange.st,v 1.22 2012-07-31 12:27:40 vrany Exp $' |
2263 | 152 |
! |
153 |
||
2873 | 154 |
version_SVN |
155 |
^ '§Id: MethodCategoryChange.st 1909 2012-03-31 00:14:49Z vranyj1 §' |
|
235 | 156 |
! ! |