ClassPrimitiveChange.st
author Claus Gittinger <cg@exept.de>
Tue, 28 Jun 2011 23:00:07 +0200
changeset 2370 e87f7109ecfb
parent 2164 48b78f1a821d
child 3011 1997ff6e7e55
child 3501 2ec70319140a
permissions -rw-r--r--
refactored common code
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     1
"
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     2
 COPYRIGHT (c) 1999 by eXept Software AG
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     3
              All Rights Reserved
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     4
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     5
 This software is furnished under a license and may be used
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     6
 only in accordance with the terms of that license and with the
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     8
 be provided or otherwise made available to, or used by, any
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
     9
 other person.  No title to or ownership of the software is
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    10
 hereby transferred.
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    11
"
957
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
    12
"{ Package: 'stx:libbasic3' }"
54dade11e57f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 798
diff changeset
    13
782
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
ClassChange subclass:#ClassPrimitiveChange
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
	instanceVariableNames:''
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'System-Changes'
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    21
!ClassPrimitiveChange class methodsFor:'documentation'!
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    22
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    23
copyright
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    24
"
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    25
 COPYRIGHT (c) 1999 by eXept Software AG
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    26
              All Rights Reserved
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    27
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    28
 This software is furnished under a license and may be used
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    29
 only in accordance with the terms of that license and with the
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    31
 be provided or otherwise made available to, or used by, any
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    32
 other person.  No title to or ownership of the software is
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    33
 hereby transferred.
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    34
"
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    35
2164
48b78f1a821d comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 1470
diff changeset
    36
!
48b78f1a821d comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 1470
diff changeset
    37
48b78f1a821d comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 1470
diff changeset
    38
documentation
48b78f1a821d comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 1470
diff changeset
    39
"
48b78f1a821d comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 1470
diff changeset
    40
    Abstract superclass for all primitive code changes
48b78f1a821d comment/format in:6 methods
Claus Gittinger <cg@exept.de>
parents: 1470
diff changeset
    41
"
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    42
! !
782
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
!ClassPrimitiveChange methodsFor:'accessing'!
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
class:aClass source:newSource
1470
9d217f808e0f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 1286
diff changeset
    47
    self assert:(newSource isString).
1286
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    48
621aac0264a7 catch non-string source args
Claus Gittinger <cg@exept.de>
parents: 957
diff changeset
    49
    className := aClass name.
782
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
    source := newSource
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    "Created: 3.12.1995 / 14:02:40 / cg"
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
    "Modified: 3.12.1995 / 14:06:33 / cg"
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
! !
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
2370
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    56
!ClassPrimitiveChange methodsFor:'applying'!
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    57
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    58
apply
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    59
    "apply the change"
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    60
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    61
    |class|
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    62
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    63
    class := self changeClass.
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    64
    class isNil ifTrue:[
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    65
        self error:('Cannot apply change for missing class: ' , className) mayProceed:true.
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    66
        ^ self
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    67
    ].
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    68
    class autoload.         "Most changes cannot be applied to unloaded classes"
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    69
    Class nameSpaceQuerySignal answer:self nameSpace do:[
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    70
        self privateApply
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    71
    ].
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    72
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    73
    "Created: / 28-06-2011 / 22:58:53 / cg"
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    74
!
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    75
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    76
privateApply
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    77
    self subclassResponsibility
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    78
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    79
    "Created: / 28-06-2011 / 22:58:59 / cg"
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    80
! !
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
    81
798
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    82
!ClassPrimitiveChange methodsFor:'comparing'!
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    83
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    84
sameAs:changeB
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    85
    "return true, if the given change represents the same change as the receiver."
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    86
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    87
    (self isForSameAs:changeB) ifFalse:[^ false].
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    88
    ^ self sameSourceAs:changeB
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    89
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    90
! !
999fff0aa0d0 checkin from browser
Claus Gittinger <cg@exept.de>
parents: 782
diff changeset
    91
782
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
!ClassPrimitiveChange methodsFor:'queries'!
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
isPrimitiveChange
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    ^ true
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
! !
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
!ClassPrimitiveChange class methodsFor:'documentation'!
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
version
2370
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   101
    ^ '$Header: /cvs/stx/stx/libbasic3/ClassPrimitiveChange.st,v 1.7 2011-06-28 21:00:07 cg Exp $'
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   102
!
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   103
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   104
version_CVS
e87f7109ecfb refactored common code
Claus Gittinger <cg@exept.de>
parents: 2164
diff changeset
   105
    ^ '$Header: /cvs/stx/stx/libbasic3/ClassPrimitiveChange.st,v 1.7 2011-06-28 21:00:07 cg Exp $'
782
fc228e99f1cf initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   106
! !