ClassChange.st
author Claus Gittinger <cg@exept.de>
Thu, 08 Nov 2001 14:43:49 +0100
changeset 1096 4a949a840bb3
parent 1046 450ef3136cc3
child 1162 4af27057a3ce
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
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    16
	instanceVariableNames:'className'
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
235
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    41
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    42
    [author:]
3ebfdc6edab9 documentation
Claus Gittinger <cg@exept.de>
parents: 101
diff changeset
    43
        Claus Gittinger
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    44
"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    45
! !
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    46
634
eb5a3f4f4539 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
    47
!ClassChange class methodsFor:'instance creation'!
85
c354e2f81394 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 68
diff changeset
    48
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    49
class:aClass
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    50
    ^ self new class:aClass
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    51
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    52
    "Created: 3.12.1995 / 14:01:32 / cg"
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    53
!
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
class:aClass source:source
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    56
    ^ self new class:aClass source:source
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    57
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    58
    "Created: 3.12.1995 / 14:01:32 / cg"
9
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    59
! !
f5b6ab00bdf6 *** empty log message ***
claus
parents: 3
diff changeset
    60
0
470788421600 Initial revision
claus
parents:
diff changeset
    61
!ClassChange methodsFor:'accessing'!
470788421600 Initial revision
claus
parents:
diff changeset
    62
850
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    63
changeClass
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    64
    "the class of the change (nil if not present)"
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    65
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    66
    className isNil ifTrue:[^ nil].
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    67
    ^ Smalltalk classNamed:className
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    68
!
5efe4b98c509 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 801
diff changeset
    69
1040
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
    70
changeClass:aClass
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
    71
    "set the class of the change"
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
    72
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
    73
    className := aClass name.
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
    74
!
552c3a8b2b5c *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 962
diff changeset
    75
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    76
class:aClass
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    77
    "set the class of the change"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    78
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    79
    className := aClass name.
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    80
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    81
    "Created: 3.12.1995 / 14:01:45 / cg"
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    82
    "Modified: 15.7.1996 / 09:28:26 / cg"
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    83
!
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
    84
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    85
class:aClass source:newSource
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    86
    "set both class and source of the change"
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    87
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    88
    className := aClass name.
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    89
    source := newSource.
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    90
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    91
    "Created: 3.12.1995 / 14:01:45 / cg"
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    92
    "Modified: 15.7.1996 / 09:28:26 / cg"
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    93
!
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
    94
0
470788421600 Initial revision
claus
parents:
diff changeset
    95
className 
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    96
    "return the className of the change"
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    97
0
470788421600 Initial revision
claus
parents:
diff changeset
    98
    ^  className
378
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
    99
f106015c98a6 commentary
Claus Gittinger <cg@exept.de>
parents: 235
diff changeset
   100
    "Modified: 15.7.1996 / 09:28:35 / cg"
654
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   101
!
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   102
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   103
className:aString 
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   104
    "set the className of the change"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   105
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   106
    className := aString
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   107
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   108
    "Modified: / 15.7.1996 / 09:28:35 / cg"
edeb63d98088 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 634
diff changeset
   109
    "Created: / 16.2.1998 / 13:05:36 / cg"
0
470788421600 Initial revision
claus
parents:
diff changeset
   110
! !
470788421600 Initial revision
claus
parents:
diff changeset
   111
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   112
!ClassChange methodsFor:'applying'!
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   113
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   114
apply
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   115
    "apply the change"
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   116
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   117
    Class nameSpaceQuerySignal answer:(self nameSpace) do:[
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   118
        Parser evaluate:(self source)
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   119
    ].
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   120
!
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   121
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   122
nameSpace
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   123
    |nsName nameSpace|
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   124
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   125
    (nsName := self nameSpaceName) notNil ifTrue:[
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   126
        ^ NameSpace name:nsName.
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   127
    ].
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   128
    ^ Smalltalk
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   129
!
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   130
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   131
nameSpaceName
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   132
    (className includes:$:) ifTrue:[
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   133
        "/ in a namespace
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   134
        ^ className upTo:$:.
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   135
    ].
1046
450ef3136cc3 care for the nameSpace in a class-definition
Claus Gittinger <cg@exept.de>
parents: 1043
diff changeset
   136
    ^ nil
859
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   137
! !
5d50d068c63b keep track of the nameSpace
Claus Gittinger <cg@exept.de>
parents: 850
diff changeset
   138
962
3821ab69b939 category change
Claus Gittinger <cg@exept.de>
parents: 932
diff changeset
   139
!ClassChange methodsFor:'printing & storing'!
101
9a1c22e807e0 more changeSet stuff
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   140
9a1c22e807e0 more changeSet stuff
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   141
printOn:aStream
801
b84b61eaa2f6 comment
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   142
    "append a user printed representation of the receiver to aStream.
b84b61eaa2f6 comment
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   143
     The format is suitable for a human - not meant to be read back."
b84b61eaa2f6 comment
Claus Gittinger <cg@exept.de>
parents: 654
diff changeset
   144
911
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 859
diff changeset
   145
    source isNil ifTrue:[
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 859
diff changeset
   146
        aStream nextPutAll:'an empty change'.
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 859
diff changeset
   147
        ^ self
cecf421ee767 VW5i compatibility
Claus Gittinger <cg@exept.de>
parents: 859
diff changeset
   148
    ].
1043
ce8626431253 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1041
diff changeset
   149
    aStream nextPutAll:(self class name , ' - ' , source string asCollectionOfLines first , '...').
101
9a1c22e807e0 more changeSet stuff
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   150
! !
9a1c22e807e0 more changeSet stuff
Claus Gittinger <cg@exept.de>
parents: 100
diff changeset
   151
932
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   152
!ClassChange methodsFor:'queries'!
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   153
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   154
isClassChange
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   155
    ^ true
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   156
! !
8028d375f842 #isClassChange query
Claus Gittinger <cg@exept.de>
parents: 918
diff changeset
   157
634
eb5a3f4f4539 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 378
diff changeset
   158
!ClassChange class methodsFor:'documentation'!
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   159
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   160
version
1096
4a949a840bb3 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1046
diff changeset
   161
    ^ '$Header: /cvs/stx/stx/libbasic3/ClassChange.st,v 1.28 2001-11-08 13:43:36 cg Exp $'
100
d09e51d14901 project changeSet fixes
Claus Gittinger <cg@exept.de>
parents: 85
diff changeset
   162
! !