ClassChange.st
author Claus Gittinger <cg@exept.de>
Mon, 06 Mar 2006 09:56:50 +0100
changeset 1469 7ddc832d7612
parent 1305 3aa4dc506e56
child 1492 69d6894f0d81
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     1
"
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     2
 COPYRIGHT (c) 1993 by Claus Gittinger
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
     3
	      All Rights Reserved
3
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     4
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     5
 This software is furnished under a license and may be used
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     6
 only in accordance with the terms of that license and with the
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     8
 be provided or otherwise made available to, or used by, any
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
     9
 other person.  No title to or ownership of the software is
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
    10
 hereby transferred.
263f814933d4 *** empty log message ***
claus
parents: 0
diff changeset
    11
"
0
470788421600 Initial revision
claus
parents:
diff changeset
    12
932
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
    13
"{ Package: 'stx:libbasic3' }"
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
    14
0
470788421600 Initial revision
claus
parents:
diff changeset
    15
Change subclass:#ClassChange
1233
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
    16
	instanceVariableNames:'className package'
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    17
	classVariableNames:''
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    18
	poolDictionaries:''
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    19
	category:'System-Changes'
0
470788421600 Initial revision
claus
parents:
diff changeset
    20
!
470788421600 Initial revision
claus
parents:
diff changeset
    21
634
eb5a3f4f4539 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
    22
!ClassChange class methodsFor:'documentation'!
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    23
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    24
copyright
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    25
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    26
 COPYRIGHT (c) 1993 by Claus Gittinger
38
claus
parents: 10
diff changeset
    27
	      All Rights Reserved
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    28
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    29
 This software is furnished under a license and may be used
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    30
 only in accordance with the terms of that license and with the
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    31
 inclusion of the above copyright notice.   This software may not
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    32
 be provided or otherwise made available to, or used by, any
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    33
 other person.  No title to or ownership of the software is
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    34
 hereby transferred.
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    35
"
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    36
!
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    37
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    38
documentation
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    39
"
45
claus
parents: 39
diff changeset
    40
    Abstract superclass for class related changes
1162
4af27057a3ce comment
Claus Gittinger <cg@exept.de>
parents: 1096
diff changeset
    41
    They are typically held in a ChangeSet.
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    42
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    43
    [author:]
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    44
        Claus Gittinger
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    45
"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    46
! !
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    47
634
eb5a3f4f4539 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
    48
!ClassChange class methodsFor:'instance creation'!
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    49
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    50
class:aClass
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    51
    ^ self new class:aClass
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    52
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    53
    "Created: 3.12.1995 / 14:01:32 / cg"
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    54
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    55
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    56
class:aClass source:source
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    57
    ^ self new class:aClass source:source
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    58
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    59
    "Created: 3.12.1995 / 14:01:32 / cg"
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    60
! !
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    61
0
470788421600 Initial revision
claus
parents:
diff changeset
    62
!ClassChange methodsFor:'accessing'!
470788421600 Initial revision
claus
parents:
diff changeset
    63
850
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    64
changeClass
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    65
    "the class of the change (nil if not present)"
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    66
1305
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    67
    |cls|
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
    68
1305
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    69
    cls := Smalltalk classNamed:(self className).
1201
f3966132ad65 care for namespace setting
Claus Gittinger <cg@exept.de>
parents: 1197
diff changeset
    70
1305
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    71
"/    |className ns cls|
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    72
"/
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    73
"/    className := self className.
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    74
"/    className isNil ifTrue:[^ nil].
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    75
"/
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    76
"/    ns := (Class nameSpaceQuerySignal query) ? Smalltalk.
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    77
"/    ns isNameSpace ifFalse:[
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    78
"/        ns := Smalltalk
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    79
"/    ].
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    80
"/
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    81
"/    cls := ns classNamed:className.
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    82
"/    cls isNil ifTrue:[
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    83
"/        ns ~~ Smalltalk ifTrue:[
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    84
"/            cls := Smalltalk classNamed:className
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    85
"/        ].
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
    86
"/    ].
1201
f3966132ad65 care for namespace setting
Claus Gittinger <cg@exept.de>
parents: 1197
diff changeset
    87
    ^ cls
850
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    88
!
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    89
1040
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
    90
changeClass:aClass
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
    91
    "set the class of the change"
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
    92
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
    93
    className := aClass name.
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
    94
!
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
    95
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    96
class:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    97
    "set the class of the change"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    98
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    99
    className := aClass name.
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   101
    "Created: 3.12.1995 / 14:01:45 / cg"
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   102
    "Modified: 15.7.1996 / 09:28:26 / cg"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   103
!
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   104
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   105
class:aClass source:newSource
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   106
    "set both class and source of the change"
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   107
1286
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   108
    self className:(aClass name) source:newSource
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   109
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   110
1305
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   111
classBaseName 
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   112
    "return the className of the change"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   113
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   114
    ^ self cutNameSpaceOf:className
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   115
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   116
    "Modified: 15.7.1996 / 09:28:35 / cg"
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   117
!
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   118
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   119
className:aString 
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   120
    "set the className of the change"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   121
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   122
    className := aString
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   123
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   124
    "Modified: / 15.7.1996 / 09:28:35 / cg"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   125
    "Created: / 16.2.1998 / 13:05:36 / cg"
1233
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   126
!
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   127
1286
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   128
className:newClassName source:newSource
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   129
    "set both className and source of the change"
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   130
1469
7ddc832d7612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
   131
    self assert:(newSource isString).
7ddc832d7612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
   132
    self assert:(newClassName isString).
7ddc832d7612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
   133
1286
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   134
    className := newClassName.
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   135
    source := newSource.
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   136
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   137
    "Created: 3.12.1995 / 14:01:45 / cg"
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   138
    "Modified: 15.7.1996 / 09:28:26 / cg"
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   139
!
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 1233
diff changeset
   140
1305
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   141
classNameWithoutNamespace
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   142
    "return the className of the change"
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   143
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   144
    ^ self cutNameSpaceOf:className
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   145
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   146
    "Modified: 15.7.1996 / 09:28:35 / cg"
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   147
!
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   148
1233
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   149
package
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   150
    "return the value of the instance variable 'package' (automatically generated)"
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   151
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   152
    ^ package
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   153
!
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   154
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   155
package:something
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   156
    "set the value of the instance variable 'package' (automatically generated)"
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   157
4eef6fafcffb james' package changes
james
parents: 1203
diff changeset
   158
    package := something.
0
470788421600 Initial revision
claus
parents:
diff changeset
   159
! !
470788421600 Initial revision
claus
parents:
diff changeset
   160
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   161
!ClassChange methodsFor:'applying'!
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   162
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   163
apply
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   164
    "apply the change"
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   165
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   166
    Parser evaluate:(self source)
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   167
"/    |ns|
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   168
"/
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   169
"/    ns := Class nameSpaceQuerySignal isHandled 
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   170
"/            ifTrue:[ Class nameSpaceQuerySignal query ]
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   171
"/            ifFalse:[ self nameSpace ].
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   172
"/
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   173
"/    Class nameSpaceQuerySignal answer:ns do:[
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   174
"/        Parser evaluate:(self source)
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   175
"/    ].
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   176
!
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   177
1305
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   178
className
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   179
    |ns|
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   180
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   181
    "/ used to be ^ className;
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   182
    "/
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   183
    "/ now include a translation from vw namespace to stx nameSpace
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   184
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   185
    ns := self nameSpaceName.
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   186
    (ns isNil or:[ns = 'Smalltalk']) ifTrue:[^ className].
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   187
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   188
    ^ ns , '::' , (self classNameWithoutNamespace)
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   189
!
3aa4dc506e56 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1304
diff changeset
   190
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   191
fullClassName
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   192
    |ns|
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   193
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   194
    "/ used to be ^ className;
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   195
    "/
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   196
    "/ now include a translation from vw namespace to stx nameSpace
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   197
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   198
    ns := self nameSpaceName.
1304
737056524bd2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   199
    (ns isNil or:[ns = 'Smalltalk']) ifTrue:[^ self className].
737056524bd2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   200
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   201
    ^ ns , '::' , self className
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   202
!
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   203
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   204
nameSpace
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   205
    |nsName nameSpace|
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   206
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   207
    (nsName := self nameSpaceName) notNil ifTrue:[
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   208
        ^ NameSpace name:nsName.
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   209
    ].
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   210
    ^ Smalltalk
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   211
!
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   212
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   213
nameSpaceName
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   214
    |ns cnm idx|
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   215
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   216
    (className includes:$:) ifTrue:[
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   217
        "/ in a namespace
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   218
        ^ className upTo:$:.
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   219
    ].
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   220
    (idx := className indexOf:$.) ~~ 0 ifTrue:[
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   221
        "/ in a namespace
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   222
        ns := className copyTo:(idx - 1).
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   223
        cnm := className copyFrom:(idx + 1).
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   224
        "cheat: VW namespaces"
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   225
        ^ self nameSpaceForVWNamespace:ns class:cnm ifAbsent:ns
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   226
    ].
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   227
    ^ nil
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   228
! !
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   229
962
3821ab69b939 category change
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   230
!ClassChange methodsFor:'printing & storing'!
101
9a1c22e807e0 more changeSet stuff
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   231
9a1c22e807e0 more changeSet stuff
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   232
printOn:aStream
801
b84b61eaa2f6 comment
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   233
    "append a user printed representation of the receiver to aStream.
b84b61eaa2f6 comment
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   234
     The format is suitable for a human - not meant to be read back."
b84b61eaa2f6 comment
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   235
911
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 859
diff changeset
   236
    source isNil ifTrue:[
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 859
diff changeset
   237
        aStream nextPutAll:'an empty change'.
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 859
diff changeset
   238
        ^ self
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 859
diff changeset
   239
    ].
1469
7ddc832d7612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
   240
    aStream nextPutAll:(self class name , ' - ' , source string firstLine , '...').
101
9a1c22e807e0 more changeSet stuff
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   241
! !
9a1c22e807e0 more changeSet stuff
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   242
932
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   243
!ClassChange methodsFor:'queries'!
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   244
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   245
cutNameSpaceOf:aString
1304
737056524bd2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   246
    |dotIndex colonIndex|
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   247
1197
bc742b87f66d more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
   248
    aString notNil ifTrue:[
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   249
        dotIndex := aString indexOf:$..
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   250
        dotIndex ~~ 0 ifTrue:[
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   251
            ^ aString copyFrom:dotIndex+1
1197
bc742b87f66d more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1196
diff changeset
   252
        ].
1304
737056524bd2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   253
        colonIndex := aString indexOf:$:.
737056524bd2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   254
        colonIndex ~~ 0 ifTrue:[
737056524bd2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   255
            ^ aString copyFrom:colonIndex+2
737056524bd2 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 1303
diff changeset
   256
        ].
1196
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   257
    ].
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   258
    ^ aString
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   259
!
928f537ddeac more for vw-XML fileIn
Claus Gittinger <cg@exept.de>
parents: 1162
diff changeset
   260
932
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   261
isClassChange
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   262
    ^ true
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   263
!
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   264
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   265
nameSpaceForVWNamespace:ns class:className ifAbsent:default
1303
36df29ea195d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
   266
    "map the namespace for a given class"
36df29ea195d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
   267
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   268
    ns = 'Core' ifTrue:[^ 'Smalltalk'].
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   269
    ns = 'Kernel' ifTrue:[^ 'Smalltalk'].
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   270
    ns = 'Graphics' ifTrue:[^ 'Smalltalk'].
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   271
    ns = 'OS' ifTrue:[^ 'Smalltalk'].
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   272
    ns = 'Smalltalk' ifTrue:[^ 'Smalltalk'].
1303
36df29ea195d *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1300
diff changeset
   273
    ns = 'UI' ifTrue:[^ 'Smalltalk'].
1300
3847c8f8a4f5 handle NS.Classname (vw files)
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
   274
    ^ default value
932
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   275
! !
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   276
634
eb5a3f4f4539 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   277
!ClassChange class methodsFor:'documentation'!
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   278
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   279
version
1469
7ddc832d7612 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1305
diff changeset
   280
    ^ '$Header: /cvs/stx/stx/libbasic3/ClassChange.st,v 1.40 2006-03-06 08:56:50 cg Exp $'
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   281
! !